
var timeout = 0.25;


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}



function setCookie(name, value)

{
  var hours = timeout;
  var expire = "";

  if(hours != null)

  {

    expire = new Date((new Date()).getTime() + hours * 3600000);

    expire = "; expires=" + expire.toGMTString();

  }

  document.cookie = name + "=" + escape(value) + expire + " path=/";

}

function checkCookie()
{
myFontSize=getCookie('myFontSize');

//alert(myFontSize);

if (myFontSize!=null && myFontSize!="")
  {
   return myFontSize;
  }
}

// Resize Text
function fontDisplay() {
	size = checkCookie();
	if (size != "") {
		setCookie("myFontSize", size);
	
		switch(size)
		{
			case "0":
			  document.write('<link rel="stylesheet" type="text/css" href="/maintenance/css/brown/typography-small.css"/>');
			  break;
			case "2":
			  document.write('<link rel="stylesheet" type="text/css" href="/maintenance/css/brown/typography-large.css"/>');
			  break;
		}
	}
}

// Set Text Size
function fontSet(size) {
	switch(size)
	{
		case 0:
		  setCookie("myFontSize", "0");
		  window.location.reload();
		  break;
		case 1:
		  setCookie("myFontSize", "1");
		  window.location.reload();
		  break;
		case 2:
		  setCookie("myFontSize", "2");
		  window.location.reload();
		  break;
		default:
		  setCookie("myFontSize", "1");
		  window.location.reload();
	}
}
