// JavaScript Document

function setActiveStyleSheet(type,title) 
	{
	var i, a, main;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) 
		{
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) 
			{
			if(a.getAttribute("title").substr(0,type.length) == type) {a.disabled = true;}
			if(a.getAttribute("title") == type + '-' + title) {a.disabled = false;}
		}
	}
	var cookieCrumbled = setCookie(type, title);
	return true;
}
function getCookie( cookieID ) 
	{
	var cookieCrumb = document.cookie.split( "; " );
	for( var i = 0; i < cookieCrumb.length; i++ ) 
		{
		var thisCookie = cookieCrumb[i].split( "=" );
		if( thisCookie[0] == escape( cookieID ) ) { return thisCookie[1] ? unescape( thisCookie[1] ) : ''; 
		}
	}
	return;
}
function setCookie( cookieID, cookieStr, domain, path, life, isSecure ) 
{
	if( !cookieID ) { return false; }
	if( life == "delete" ) { life = -10; }
	document.cookie = escape( cookieID ) + "=" + escape( cookieStr ) + ( life ? ";expires=" + ( new Date( ( new Date() ).getTime() + ( 1000 * life ) ) ).toGMTString() : "" ) + ( path ? ";path=" + path : "") + ( domain ? ";domain=" + domain : "") + ( isSecure ? ";secure" : "");
	if( life < 0 ) { if( typeof( getCookie( cookieID ) ) == "string" ) { return false; } return true; }
	if( typeof( getCookie( cookieID ) ) == "string" ) { return true; } 
	return false;
}
startList = function() 
{
	if (document.all&&document.getElementById) 
		{
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) 
			{
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") 
				{
				node.onmouseover=function() 
					{this.className+=" over";}
				node.onmouseout=function() 
					{this.className=this.className.replace(" over", "");}
   				}
  			}
 		}
	var type = 'contrast';
	var title = getCookie(type);
	var res = setActiveStyleSheet(type,title);
	var typef = 'font';
	var titlef = getCookie(typef);
	var resf = setActiveStyleSheet(typef,titlef);
	return true;
}
window.onload=startList;