// JavaScript Document
	function get_cookie ( cookie_name )
	{
	  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
	
	  if ( results )
	    return ( unescape ( results[2] ) );
	  else
	    return null;
	}

	function makearray(n) 
	{
		this.length = n;
    	for(var i = 1; i <= n; i++)
        	this[i] = 0;
    	return this;
	}
	hexa = new makearray(16);
	for(var i = 0; i < 10; i++)
	    hexa[i] = i;
	hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
	hexa[13]="d"; hexa[14]="e"; hexa[15]="f";
	function hex(i) 
	{
	    if (i < 0)
	        return "00";
	    else if (i > 255)
	        return "ff";
	    else
	        return "" + hexa[Math.floor(i/16)] + hexa[i%16];
	}
	
	function setbgColor(r, g, b) 
	{
	    var hr = hex(r); var hg = hex(g); var hb = hex(b);
	    //document.getElementById('doc-body').style.backgroundColor = "#"+hr+""+hg+""+hb;
	    document.bgColor = "#"+hr+""+hg+""+hb;
	}
	
	function fade(sr, sg, sb, er, eg, eb, step) 
	{
	    for(var i = 0; i <= step; i++) {
	       setbgColor(
	        Math.floor(sr * ((step-i)/step) + er * (i/step)),
	        Math.floor(sg * ((step-i)/step) + eg * (i/step)),
	        Math.floor(sb * ((step-i)/step) + eb * (i/step)));
	    }
	}

	function runintro()
	{		
		if(get_cookie('nointro')=='yes')
		{
			closeintro();
		}
		else
		{
			document.cookie = "nointro=yes";
			introfadein();		
			document.getElementById('page-content').style.display="none";
			document.getElementById('page-intro').style.display="block";
			setContent();			
			setTimeout('introfadeout()', 90000);
		}
	}
	function introfadein()
	{
		fade(0,0,0,255,255,255,125);
		fade(255,255,255,0,0,0,125);
	}
	
	function introfadeout()
	{
		fade(0,0,0,255,255,255,125);
		fade(255,255,255,0,0,0,125);		
		closeintro();		
	}
	
	function closeintro()
	{
		document.getElementById('page-content').style.display="block";
		document.getElementById('page-intro').style.display="none";		
	}	

	function getWindowHeight() {
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
		}
		return windowHeight;
	}
	function setContent() {
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				var contentElement = document.getElementById('page-intro');
				var contentHeight = contentElement.offsetHeight;
				if (windowHeight - contentHeight > 0) {
					contentElement.style.position = 'relative';
					contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
				}
				else {
					contentElement.style.position = 'static';
				}
			}
		}
	}
	window.onresize = function() {
		setContent();
	}