/* Font Size Change Script */

var curFontSize = 1; 	
var fontModifier = .1; 	

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function FixCookieDate(date) {
	var base = new Date(0);
	var skew = base.getTime();
	if (skew > 0) 
		date.setTime (date.getTime() - skew);
}

function GetCookie(name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i=0;
	while (i < clen) {	
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
		}
	return null;
}

function SetCookie(name,value,expires,path,domain,secure) {
	document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}


function fontSize(act) {
    if (document.getElementById) {
    		 mainCon = document.getElementById("mainContent");
    		 footNav = document.getElementById("footer");     		  
    		 secNav = document.getElementById("secondaryNav");         
         secCon = document.getElementById("secconText");	 
         secConList = document.getElementById("highlight3List");        
				 secConList2 = document.getElementById("secconStyle3");			 
				 //mainConList = document.getElementById("frameContent");
				 
        if (act == 1) {
            curFontSize += fontModifier;
            curFontSize = Math.min(curFontSize, 1.3);
        } else if (act == 0) {
            curFontSize -= fontModifier;
            curFontSize = Math.max(curFontSize, 1);
        }
         
        mainCon.style.fontSize = curFontSize + "em";
        footNav.style.fontSize = curFontSize + "em";
        secNav.style.fontSize = curFontSize + "em";        
        secCon.style.fontSize = curFontSize + "em";               
        secConList.style.fontSize = curFontSize + "em";  
        secConList2.style.fontSize = curFontSize + "em";
        //mainConList.style.fontSize = curFontSize + "em";
	  }
	
		// set cookie with font size
		var expdate = new Date();
		FixCookieDate (expdate);
		expdate.setTime (expdate.getTime() + (672*60*60*1000)); // 4 weeks
		SetCookie("userfontc",curFontSize,expdate);		
		return(false);
}

//if(secConList != null) {
//   for (v = 0; v < mainConList.getElementsByTagName("highlight3List").length; v++) {
//	       secConList2.getElementsByTagName("highlight3List")[v].style.fontSize = curFontSize + "em";
//   }
//}			