var place1=Math.floor(Math.random()*700);
var place2=Math.floor(Math.random()*700);
var place3=Math.floor(Math.random()*700);
var place4=Math.floor(Math.random()*700);
var place5=Math.floor(Math.random()*700);
var place6=Math.floor(Math.random()*700);
var place7=Math.floor(Math.random()*700);
var place8=Math.floor(Math.random()*700);
var place9=Math.floor(Math.random()*700);
var place10=Math.floor(Math.random()*700);
var place11=Math.floor(Math.random()*700);
var place12=Math.floor(Math.random()*700);
var place13=Math.floor(Math.random()*700);
var place14=Math.floor(Math.random()*700);
var place15=Math.floor(Math.random()*700);
var place16=Math.floor(Math.random()*700);
var place17=Math.floor(Math.random()*700);
var place18=Math.floor(Math.random()*700);
var place19=Math.floor(Math.random()*700);
var place20=Math.floor(Math.random()*700);
var place21=Math.floor(Math.random()*700);
var place22=Math.floor(Math.random()*700);
var place23=Math.floor(Math.random()*700);
var place24=Math.floor(Math.random()*700);
var place25=Math.floor(Math.random()*700);
var place26=Math.floor(Math.random()*700);
var place27=Math.floor(Math.random()*700);
var place28=Math.floor(Math.random()*700);
var place29=Math.floor(Math.random()*700);
var place30=Math.floor(Math.random()*700);
var place31=Math.floor(Math.random()*700);
var place32=Math.floor(Math.random()*700);
var place33=Math.floor(Math.random()*700);
var place34=Math.floor(Math.random()*700);
var place35=Math.floor(Math.random()*700);
var place36=Math.floor(Math.random()*700);
var place37=Math.floor(Math.random()*700);
var place1y=Math.floor(Math.random()*500);
var place2y=Math.floor(Math.random()*500);
var place3y=Math.floor(Math.random()*500);
var place4y=Math.floor(Math.random()*500);
var place5y=Math.floor(Math.random()*500);
var place6y=Math.floor(Math.random()*500);
var place7y=Math.floor(Math.random()*500);
var place8y=Math.floor(Math.random()*500);
var place9y=Math.floor(Math.random()*500);
var place10y=Math.floor(Math.random()*500);
var place11y=Math.floor(Math.random()*500);
var place12y=Math.floor(Math.random()*500);
var place13y=Math.floor(Math.random()*500);
var place14y=Math.floor(Math.random()*500);
var place15y=Math.floor(Math.random()*500);
var place16y=Math.floor(Math.random()*500);
var place17y=Math.floor(Math.random()*500);
var place18y=Math.floor(Math.random()*500);
var place19y=Math.floor(Math.random()*500);
var place20y=Math.floor(Math.random()*500);
var place21y=Math.floor(Math.random()*500);
var place22y=Math.floor(Math.random()*500);
var place23y=Math.floor(Math.random()*500);
var place24y=Math.floor(Math.random()*500);
var place25y=Math.floor(Math.random()*500);
var place26y=Math.floor(Math.random()*500);
var place27y=Math.floor(Math.random()*500);
var place28y=Math.floor(Math.random()*500);
var place29y=Math.floor(Math.random()*500);
var place30y=Math.floor(Math.random()*500);
var place31y=Math.floor(Math.random()*500);
var place32y=Math.floor(Math.random()*500);
var place33y=Math.floor(Math.random()*500);
var place34y=Math.floor(Math.random()*500);
var place35y=Math.floor(Math.random()*500);
var place36y=Math.floor(Math.random()*500);
var place37y=Math.floor(Math.random()*500);
var menunavgfxpath = "gfx/nav-menu/";
var parts       = new Array("chromosoom","date","yesterday","twoday","threeday","show","show1","show2","show3","show4","show5","show6","show7","show8","show9","show10", "show11","show12","show13","show14", "show15","show16","show17","show18","show19","show20","show21","show22","show23","show24", "show25","show26","show27","show28","show29","show30","show31","show32","book1","book2","book3","book4","enjoy1","enjoy2","mailing");
var partsStatus = new Array(1,0,0,0,0,0,0,0,0,0,0);
var partsPosX   = new Array(150,150,300,353,395,place1,place2,place3,place4,place5,place6,place7,place8,place9,place10,place11,place12,place13,place14,place15,place16,place17,place18,place19,place20,place21,place22,place23,place24,place25,place26,place27,place28,place29,place30,place31,place32,place33,180,200,220,240,260,280, 150);
var partsPosY   = new Array(48,70,209,249,284,place1y,place2y,place3y,place4y,place5y,place6y,place7y,place8y,place9y,place10,place11y,place12y,place13y,place14y,place15y,place16y,place17y,place18y,place19y,place20y,place21y,place22y,place23y,place24y,place25y,place26y,place27y,place28y,place29y,place30y,place31y,place32y,place33y,180,200,220,240,260,280,620);

function getPartIndex(name) {
	var index;
	for (i=0;i<parts.length;i++) {
		if (parts[i] == name) {
			index = i;
			break;
		}
	}
	return index;
}

function bringLastPartToFront() {
	for (i=0;i<parts.length;i++) {
		if (partsStatus[i] == 1) {
   			bringPartToFront(parts[i]);
   			break;
  		}
 	}  
}


function bringPartToFront(name) {
	var partindex;
	var partwindow;
	var divdisable;
	
	for (i=0;i<parts.length;i++) {
		partwindow = document.getElementById('w_' + parts[i]);
		divdisable = document.getElementById('disable_' + parts[i]);
		if (partwindow != null)
			partwindow.style.zIndex = 100+i;
		if (divdisable != null)
			divdisable.style.display = '';
	}
	partindex = getPartIndex(name);
	
	partwindow = document.getElementById('w_' + name);
	divdisable = document.getElementById('disable_' + name);
	if (partwindow != null)
		partwindow.style.zIndex = 500;
	if (divdisable != null)
		divdisable.style.display = 'none';
  
}



function menuChoose(name) {
	var partindex;
	var partwindow;
	menuSwap(name,'hide');
	partindex = getPartIndex(name);
	partsStatus[partindex] = 1; //set status to opened 
	partwindow = document.getElementById('w_' + name); 
	partwindow.style.left = partsPosX[partindex] + 'px';
	partwindow.style.top  = partsPosY[partindex] + 'px'; 
	partwindow.style.display = '';
	
	bringPartToFront(name);
}

function menuClose(name) {
	var partindex;
	partindex = getPartIndex(name);
	partsStatus[partindex] = 0; //set status to opened 
	menuSwap(name,'out');
	document.getElementById('w_' + name).style.display = 'none'; 
	bringLastPartToFront();
}

function menuSwap(name,why) {
	var img;
	var partindex;
	img = document.getElementById('m_img_'+name);
	partindex = getPartIndex(name);
	if (partsStatus[partindex] == 1) 
		return -1; //part is opened, so do not swap
	
	if (img != null) {
		if (why == 'over') 
			img.src = menunavgfxpath + name + '-over.gif';
		if (why == 'out') 
			img.src = menunavgfxpath + name + '.gif';
		if (why == 'hide') 
			img.src = 'gfx/x.gif';
	}
}

function hideMenu() {
	div = document.getElementById('LayerMenu');
	if (div != null) {
		if (div.style.display == '')
			div.style.display = 'none'; 
		else
			div.style.display = ''; 
	}
}

function menuToggle() {
	var div = document.getElementById('divMenu');
	var img = document.getElementById('imgMenu');
	
	if (div != null && img != null) {
		if (div.style.display == '') { 	
			div.style.display = 'none';
			img.src = menunavgfxpath + 'window-plus.gif';
		} else { 
			div.style.display = ''; 
			img.src = menunavgfxpath + 'window-minus.gif';
		}
	}
	
	if (img != null) {
		if (img.src == '') 
			div.style = 'none';
		else 
			div.style = '';
	}
	
}

//returns the current date in YYYYMMDD format
function getCurrentDateString(){

	//make a new date object set at the current date
	var currentDate = new Date();
	
	//get the four position year and
	//make it a string
	var currentYear = currentDate.getFullYear() + "";
	
	//get the zero-indexed month and add 1
	//for the real month and make it a strintg
	var currentMonth = (currentDate.getMonth() + 1) + "";
	
	//add a zero at the beginning if only one
	//digit month
	if (currentMonth.length == 1) {
		currentMonth = "0" + currentMonth;
	}
	
	//get the current day of the month and
	//make it a string
	var currentDayOfMonth = currentDate.getDate() + "";
	
	//add a zero if necessary
	if (currentDayOfMonth.length == 1) {
		currentDayOfMonth = "0" + currentDayOfMonth;
	}
	
	return(currentYear + currentMonth + currentDayOfMonth);
}

//preload image based upon currentDate
var currentDateString = getCurrentDateString();
var dailyImageObject = new Image();
dailyImageObject.src = "gfx/nav-menu/" + currentDateString + ".gif";

//called when the page loads to
//set the actual HTML IMG element to have the same
//SRC as our cached Image object
function showDailyImage(){
	document.getElementById("dailyIMGElement").src = dailyImageObject.src;
}

//preload image based upon currentDate
var currentDateString = getCurrentDateString();
var date = new Image();
date.src = "gfx/every-day/" + currentDateString + ".jpg";

//called when the page loads to
//set the actual HTML IMG element to have the same
//SRC as our cached Image object
function showdate(){
	document.getElementById("dateElement").src = date.src;
}

<!-- yesterday -->
function getYesterday(){
	var yesterdayDate = new Date();
	yesterdayDate.setDate(yesterdayDate.getDate() - 7);
	
	var yesterdayYear = yesterdayDate.getFullYear() + "";
	var yesterdayMonth = (yesterdayDate.getMonth() + 1) + "";
	if (yesterdayMonth.length == 1)
		yesterdayMonth = "0" + yesterdayMonth;
	
	var yesterdayDayOfMonth = yesterdayDate.getDate() + "";
	if (yesterdayDayOfMonth.length == 1)
		yesterdayDayOfMonth = "0" + yesterdayDayOfMonth;
	
	return(yesterdayYear + yesterdayMonth + yesterdayDayOfMonth);
}

var yesterdayDateString = getYesterday();
var yesterdayImageObject = new Image();
yesterdayImageObject.src = "gfx/nav-menu/" + yesterdayDateString + ".gif";

function showyesterdayImage(){
	document.getElementById("yesterdayIMGElement").src = yesterdayImageObject.src;
}

var yesterdayDateString = getYesterday();
var yesterdate = new Image();
yesterdate.src = "gfx/every-day/" + yesterdayDateString + ".jpg";

function showyesterdaydate(){
	document.getElementById("yesterdayElement").src = yesterdate.src;
}
 

<!-- day before yesterday (two days ago) -->

function twodays(){
	var twodaysDate = new Date();
	twodaysDate.setDate(twodaysDate.getDate() - 14);
	
	var twodaysYear = twodaysDate.getFullYear() + "";
	var twodaysMonth = (twodaysDate.getMonth() + 1) + "";
	if (twodaysMonth.length == 1)
		twodaysMonth = "0" + twodaysMonth;
	
	var twodaysDayOfMonth = twodaysDate.getDate() + "";
	if (twodaysDayOfMonth.length == 1)
		twodaysDayOfMonth = "0" + twodaysDayOfMonth;

	return(twodaysYear + twodaysMonth + twodaysDayOfMonth);
}

var twodaysDateString = twodays();
var twodaysImageObject = new Image();
twodaysImageObject.src = "gfx/nav-menu/" + twodaysDateString + ".gif";

function showtwodaysImage(){
	document.getElementById("twodaysElement").src = twodaysImageObject.src;
}

var twodaysDateString = twodays();
var twodaysdate = new Image();
twodaysdate.src = "gfx/every-day/" + twodaysDateString + ".jpg";

function showtwodaysdate(){
	document.getElementById("twodaysdateElement").src = twodaysdate.src;
}


<!-- three days ago) -->

function threedays(){
	var threedaysDate = new Date();
	threedaysDate.setDate(threedaysDate.getDate() - 21);
	
	var threedaysYear = threedaysDate.getFullYear() + "";
	var threedaysMonth = (threedaysDate.getMonth() + 1) + "";
	if (threedaysMonth.length == 1)
		threedaysMonth = "0" + threedaysMonth;
	
	var threedaysDayOfMonth = threedaysDate.getDate() + "";
	if (threedaysDayOfMonth.length == 1)
		threedaysDayOfMonth = "0" + threedaysDayOfMonth;

	return(threedaysYear + threedaysMonth + threedaysDayOfMonth);
}

var threedaysDateString = threedays();
var threedaysImageObject = new Image();
threedaysImageObject.src = "gfx/nav-menu/" + threedaysDateString + ".gif";

function showthreedaysImage(){
	document.getElementById("threedaysElement").src = threedaysImageObject.src;
}

var threedaysDateString = threedays();
var threedaysdate = new Image();
threedaysdate.src = "gfx/every-day/" + threedaysDateString + ".jpg";

function showthreedaysdate(){
	document.getElementById("threedaysdateElement").src = threedaysdate.src;
}

function getBackgroundImage() {
	var numImages = 8;
	var imageNum = Math.round((Math.random() * (numImages-1))) + 1;
	return "gfx/background/bg_pattern" + imageNum + ".gif";
}

function getBackgroundColor() {
	var bgcolorlist = new Array("#000000", "#414141", "#6e6e6e", "#5a5a5a", "#828282", "#969696", "#a9a9a9", "#bebebe", "#d2d2d2", "#e6e6e6");
	return bgcolorlist[Math.floor(Math.random()*bgcolorlist.length)];
}

function setBackground()
{
	document.body.style.backgroundImage = "url('" + getBackgroundImage() + "')";
	document.bgColor = getBackgroundColor();
}


function clearDefault(el) {
  if (el.defaultValue==el.value) 
  	el.value = ""
}


function embedFlash(pathOfSwf, pathToAlternativeJpg, width , height)
{
	var MM_contentVersion = 6;
	var MM_FlashCanPlay = false;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		for (var i = 0; i < words.length; ++i)
		{
			if (isNaN(parseInt(words[i])))
				continue;
			var MM_PluginVersion = words[i]; 
		}
	
		MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
		
	} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	if ( MM_FlashCanPlay ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="script" WIDTH="' + width + '" HEIGHT="' + height + '" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="' + pathOfSwf + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
		document.write(' <EMBED src="' + pathOfSwf + '" quality=high bgcolor=#FFFFFF  ');
		document.write(' swLiveConnect=FALSE WIDTH="' + width + '" HEIGHT="' + height + '" NAME="script" ALIGN=""');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	} else{
		document.write('<IMG SRC="' + pathToAlternativeJpg + '" WIDTH="' + width + '" HEIGHT="' + height + '" usemap="#script" BORDER=0>');
	}	
	
}