// JavaScript Document<script type="text/javascript">

// we need some function
function getWeekNr()
{
 var today = new Date();
 Year = takeYear(today);
 Month = today.getMonth();
 Day = today.getDate();
 now = Date.UTC(Year,Month,Day+1,0,0,0);
 var Firstday = new Date();
 Firstday.setYear(Year);
 Firstday.setMonth(0);
 Firstday.setDate(1);
 then = Date.UTC(Year,0,1,0,0,0);
 var Compensation = Firstday.getDay();
 if (Compensation > 3) Compensation -= 4;
 else Compensation += 3;
 NumberOfWeek =  Math.round((((now-then)/86400000)+Compensation)/7);
 return NumberOfWeek;
}
function takeYear(theDate)
{
 x = theDate.getYear();
 var y = x % 100;
 y += (y < 38) ? 2000 : 1900;
 return y;
}
currentWeek=getWeekNr()+1;
// JS must match OE for the year 2009: we add 1
// **********************************************************
//the actual script
/* function callme() {
if (getWeekNr() ==6) {
 //alert(getWeekNr()+" do this");
  document.write("callme: 6 ");
} else {
 alert(getWeekNr()+" do something else");
}
}*/
// use the following for a scheduled pool
// do not use the following in the home page randomiser
function writeXLSWF(){
	// writes the scheduled banner in the Corporate home page banner
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="760" height="109" id="homepage_banner" align="middle" >');
document.write('<param name="movie" value=\"'+swfurl+'\" >');
document.write('<param name="quality" value="high" >');
document.write('<param name="wmode" value="transparent" >');
document.write('<embed src=\"'+swfurl+'\" quality="high" width="760" height="109" name="homepage_banner" align="middle" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" >');
document.write('</object>');
}
//alert(getWeekNr()+" script loaded");
function writeLSWF(){
	// writes the scheduled banner in the Corporate home page footer banner
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="500" height="100" id="homepage_banner" align="middle" >');
document.write('<param name="movie" value=\"'+swfurl+'\" >');
document.write('<param name="quality" value="high" >');
document.write('<param name="wmode" value="transparent" >');
document.write('<embed src=\"'+swfurl+'\" quality="high" width="500" height="100" name="homepage_banner" align="middle" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" >');
document.write('</object>');
}

function writeLRECSWF(swfurl){
	// writes the scheduled banner in a 500x300 LREC
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="500" height="300" id="homepage_banner" align="middle" >');
document.write('<param name="movie" value=\"'+swfurl+'\" >');
document.write('<param name="quality" value="high" >');
document.write('<param name="wmode" value="transparent" >');
document.write('<embed src=\"'+swfurl+'\" quality="high" width="500" height="300" name="homepage_banner" align="middle" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" >');
document.write('</object>');
}
//
