
function rollover()
{
  if(!document.getElementById || !document.createTextNode){return;}
  var n=document.getElementById('nav');
  if(!n){return;}
  var lis=n.getElementsByTagName('li');
  for (var i=0;i<lis.length;i++)
  {
    lis[i].onmouseover=function()
    {
      this.className=this.className?'cur':'over';
    }
    lis[i].onmouseout=function()
    {
       this.className=this.className=='cur'?'cur':'';
    }
  }
}
window.onload=rollover;

function fillthescreen(){
		winH = windowHeight(); //This returns the screen heigth
		//winH = window.screen.height;
		//document.write(winH);
		heightNeeded=winH-135; //We need to substract the footer height
		heightNeeded2=winH-635;
		if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight
			document.getElementById('col2').style.height=heightNeeded+'px';
			document.getElementById('swirls').style.height=heightNeeded2+'px';//So, we use height (and explroer bug)
		}
		document.getElementById('col2').style.minHeight=heightNeeded+'px';
		document.getElementById('swirls').style.minHeight=heightNeeded2+'px';//For every other browser, we use minHeight
		
		if(winH > 1200){
		document.getElementById('return').style.visibility='visible';
		document.getElementById('swirls').style.background ='url(assets/imgs/swirls_bg.gif)';
		}
	}
 
	function windowHeight(){
		var alto= 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			alto= window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			alto= document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			alto= document.body.clientHeight;
		}
		alto = document.body.offsetHeight;
		return alto;
	}
	
	/*** Text zooming ***/
function ZoomOut()
{
	if (curZoom > 70) curZoom -= 10;
	do_Zoom();
	return false;
}

function ZoomIn()
{
	if (curZoom < 250) curZoom += 10;
	do_Zoom();
	return false;
}

function ZoomDefault()
{
	curZoom = 100;
	do_Zoom();
	return false;
}

function ZoomTo(z)
{
	curZoom = z;
	do_Zoom();
	return false;
}

function do_Zoom()
{
	document.getElementsByTagName("body")[0].style.fontSize = curZoom + '%';
	document.getElementById("z1").firstChild.className = "";
	document.getElementById("z2").firstChild.className = "";
	document.getElementById("z3").firstChild.className = "";
	document.getElementById("z4").firstChild.className = "";
	
	if (curZoom == 80) document.getElementById("z1").firstChild.className = "on";
	if (curZoom == 100) document.getElementById("z2").firstChild.className = "on";
	if (curZoom == 125) document.getElementById("z3").firstChild.className = "on";
	if (curZoom == 145) document.getElementById("z4").firstChild.className = "on";
	
	SetCookie("currentZoom",curZoom,false);
}

function GetCookie(sName)
{
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++)
	{
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0])
			return unescape(aCrumb[1]);
	}
	return null;
}

function SetCookie(sName, sValue, isSession)
{
	if (!isSession)
	{
		date = new Date(2010,12,31);
		document.cookie = sName + "=" + escape(sValue) + "; path=/; expires=" + date.toGMTString();
	}
	else
	{
		document.cookie = sName + "=" + escape(sValue) + "; path=/;";
	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
} 
