function preloadImage(url)
{
	var i = new Image();
	i.src = url;
	return i;
}
if (document.images)
{ // Preload images
	var screenup = preloadImage("../images/screenbtn_up.gif");
	var screendn = preloadImage("../images/screenbtn_dn.gif");
	var contactup = preloadImage("../images/lrnbtn_up.gif");
	var contactdn = preloadImage("../images/lrnbtn_dn.gif");
}
	// On input "myimage" this function sets the src of the image with
	// this name to the value of myimageon.src
function mouseOn(imgName)
{
	if (document.images)
	document[imgName].src = eval(imgName + "dn.src");
}
// On input "myimage" this function sets the src of the image with
// this name to the value of myimageoff.src
function mouseOff(imgName)
{
	if (document.images)
	document[imgName].src = eval(imgName + "up.src");
}

function disp(mod){
	if(mod != 'undefinedxx'){
		mod = mod.substring(0,mod.length-2);
		var elem, btn;
		var check = false;
		var d=document;
		var modArray = new Array('core','main','proj','purc','asset');
		for(var cnt=0;cnt<modArray.length; cnt++){
			elem=d.getElementById(modArray[cnt]);
			elem.style.display='none';
			btn=d.getElementById(modArray[cnt]+'up');
			btn.style.marginLeft='30px';
			btn.style.lineHeight='16px';
			btn.style.color='#000050';
			btn.style.width='187px';
			btn.style.background='#FFFFFF url(../images/sideNav_bg_off.gif) top left no-repeat';
			if(mod==modArray[cnt])
				check = true;
		}
		if(!check){
			mod='core';
		}
		elem=d.getElementById(mod);
		elem.style.display='block';
		btn=d.getElementById(mod+'up');
		btn.style.marginLeft='10px';
		btn.style.lineHeight='16px';
		btn.style.color='#0099FF';
		btn.style.width='208px';
		btn.style.background='#FFFFFF url(../images/sideNav_bg.gif) top left no-repeat';
	}
	return false;
}


window.onload = function()
{
	/*var modArray1 = new Array('core','main','proj','purc','asset');
	for(var cnt=0;cnt<modArray1.length; cnt++){
		btn=d.getElementById(modArray1[cnt]+'up');
		btn.style.marginLeft='30px';
		btn.style.color='#000050';
		btn.style.lineHeight='16px';
		btn.style.width='187px';
		btn.style.background='#FFFFFF url(../images/sideNav_bg_off.gif) top left no-repeat';
	}
	var mod1 = document.getElementById('coreup');
	mod1.style.marginLeft='10px';
	mod1.style.lineHeight='16px';
	mod1.style.color='#0099FF';
	mod1.style.width='208px';
	mod1.style.background='#FFFFFF url(../images/sideNav_bg.gif) top left no-repeat';*/
	
	var d=document;
	var mod, modup, moddn;
	var modArray = new Array('core','main','proj','purc','asset');
	for(var cnt=0;cnt<modArray.length; cnt++){
		mod=modArray[cnt];
		modup=d.getElementById(mod+'up');
		modup.onclick=function(){return disp(this.id);};		
	}
	for(var num=1;num<=21; num++){
		var divId=d.getElementById('div'+num);
		divId.title = 'Click to expand';
		divId.onmouseover = function()
		{
			this.style.backgroundColor='#FFFFEE';
			this.style.color='#000000';
			this.style.border='1px solid #CCCCCC';
			this.style.cursor='pointer';
		};
		divId.onmouseout = function()
		{
			this.style.backgroundColor='#FFF';
			this.style.border='1px solid #FFFFFF';
		};
		divId.onclick = function()
		{
			if(noClick) return;
			noClick = true;
			var snum=this.id;
			snum=snum.substring(3);
			var slide=d.getElementById('slide'+snum);
			var more=d.getElementById('div'+snum+'more');
			this.title = '';
			if(slide.style.display == 'none'){
				Effect.SlideDown(slide,{ duration: 0.5 });
				more.innerHTML = '<img src="../images/icons/less.gif" id="arrow" border="0" />';
				more.title = 'minimize';
			}else{
				Effect.SlideUp(slide,{ duration: 0.5 });
				more.innerHTML = '<img src="../images/icons/more.gif" id="arrow" border="0" />';
				more.title = 'maximize';
			}
			var clickTimer = setTimeout ('enableClick();',500);
		};
	}
	

	var p = document.getElementById('body');
	var size = readCookie("fontsize");
	p.style.fontSize = document.cookie.substring("fontsize=",";");
	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	p.style.fontSize = size;
	
	mod = querySt('mod');
	if(mod == undefined){
		mod='core';
	}
	disp(mod);
}