// JScript File

function ChangeFont(size) {
	//deleteCookie('FontSize');
	// alert('ChangeFont: ' + size);
	switch (size) {
		case 'Small Text':
			//document.cookie = "FontSize=10; style='Small Text'";
			createCookie("FontSize", 10, 365);
			createCookie("style", "Small Text", 365);
			
			document.body.style.fontSize='10px';
			// document.theForm.input.style.fontsize='8px';

			if(document.getElementById("threeColumnC")!= null)
			document.getElementById("threeColumnC").style.height = "470px";

 

			break;
		case 'Medium Text':
			//document.cookie = "FontSize=12; style='Medium Text'";
			createCookie("FontSize", 12, 365);
			createCookie("style", "Medium Text", 365);
			
			document.body.style.fontSize='12px';
			//document.body.style.fontFamily='Verdana,Sans-serif';

			if(document.getElementById("threeColumnC")!= null)
			document.getElementById("threeColumnC").style.height = "550px";
			break;

		case 'Large Text':
		case 'Larger Text':
			//document.cookie = "FontSize=14; style='Large Text'";
			createCookie("FontSize", 14, 365);
			createCookie("style", "Larger Text", 365);
			document.body.style.fontSize='14px';

			if(document.getElementById("threeColumnC")!= null)
			document.getElementById("threeColumnC").style.height = "550px";
			break;

		default:
			//document.cookie = "FontSize=10; style='Small Text'";
			
			createCookie("FontSize", 10, 365);
			createCookie("style", "Small Text", 365);
			
			document.body.style.fontSize='10px';
			//document.input.style.fontsize='8px';

			if(document.getElementById("threeColumnC")!= null)
			document.getElementById("threeColumnC").style.height= "550px";
	}
}

function checkCookie() {
//	fontsize = getCookie('FontSize');
//	// alert(fontsize);
//	if (fontsize!=null && fontsize!="") {
//		//alert('checkCookie: '+fontsize);
//		switch (fontsize) {
//			case '10':
//				fontsize = 'Small Text';
//				break;
//			case '12':
//				fontsize = 'Medium Text';
//				break;
//			case '14':
//				fontsize = 'Larger Text';
//				break;
//			default:
//				fontsize = 'Small Text';
//				// document.input.style.fontsize='11px';
//		}
//	}
//	else {
//		fontsize = 'Small Text';
//	}
	fontsize = readCookie('style');
	ChangeFont(fontsize);
}

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 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 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=/; domain=.azblue.com";
}

//function deleteCookie( c_name ) {
//document.cookie = c_name + "=" +

//";expires= Thu, 01-Jan-2009 00:00:01 GMT";
//}