window.onload = function() {
 // udskriver top 
 var top = '';
 top = top + '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="774" height="162" align="middle">';
 top = top + '<param name="allowScriptAccess" value="sameDomain" />';
 top = top + '<param name="allowFullScreen" value="false" />';
 top = top + '<param name="movie" value="/Files/System/englebarn_dk/grafik/top.swf" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="transparent" />	<embed src="/Files/System/englebarn_dk/grafik/top.swf" quality="high" bgcolor="#ffffff" width="774" height="162" name="top" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
 top = top + '</object>';
 
 
 // firefox tjek og udskriver derefter
 /*
	if(navigator.appName =="Netscape") {
  document.getElementById('top').innerHTML = '<img src="/Files/System/englebarn_dk/grafik/top.jpg" alt="" border="0" usemap="#top" />';
 } else {
  if(hent_cookie('topflash') == 'vist') {
   document.getElementById('top').innerHTML = '<img src="/Files/System/englebarn_dk/grafik/top.jpg" alt="" border="0" usemap="#top" />';
  } else {
   saet_cookie('topflash','vist');
	 document.getElementById('top').innerHTML = top;
  }
 }
	*/
	if(hent_cookie('topflash') == 'vist') {
  document.getElementById('top').innerHTML = '<img src="/Files/System/englebarn_dk/grafik/top.jpg" alt="" border="0" usemap="#top" />';
 } else {
  saet_cookie('topflash','vist');
	 document.getElementById('top').innerHTML = top;
 }

   
 // udskriver nyhedsbrev
 var nyhedsbrev = '';
 nyhedsbrev = nyhedsbrev + '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="102" height="314" align="middle">';
 nyhedsbrev = nyhedsbrev + '<param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="/Files/System/englebarn_dk/grafik/nyhedsbrev.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#bdd853" />';
 nyhedsbrev = nyhedsbrev + '<embed src="/Files/System/englebarn_dk/grafik/nyhedsbrev.swf" quality="high" bgcolor="#bdd853" width="102" height="314" name="nyhedsbrev" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
 nyhedsbrev = nyhedsbrev + '</object>';
 document.getElementById('nyhedsbrev').innerHTML = nyhedsbrev;
}

function hent_cookie(name){
 var cname = name + "=";               
 var dc = document.cookie;             
 if (dc.length > 0) {              
  begin = dc.indexOf(cname);       
  if (begin != -1) {           
   begin += cname.length;       
  end = dc.indexOf(";", begin);
  if (end == -1) end = dc.length;
   return unescape(dc.substring(begin, end));
  } 
 }
 return null;
}

function saet_cookie(name, value, expires, path, domain, secure) 
{
 document.cookie = name + "=" + escape(value) + 
 ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
 ((path == null) ? "" : "; path=" + path) +
 ((domain == null) ? "" : "; domain=" + domain) +
 ((secure == null) ? "" : "; secure");
}

function slet_cookie (name,path,domain) {
 if (hent_cookie(name)) {
 document.cookie = name + "=" +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  "; expires=Thu, 01-Jan-70 00:00:01 GMT";
 }
}
