browser_type = navigator.appName;
function getCookieVal(offset) 
   {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
   }
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) 
   {
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (argc > 2) ? argv[2] : null;
   document.cookie = name + "=" + escape (value) +
        ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
        "; path=/";
   }
function DeleteCookie () 
   {
   var exp = new Date();
   exp.setTime (exp.getTime() - 1000000000);  // This cookie is history (changed -1 to make it previous time)
   var cval = GetCookie ('TimeZone');
   document.cookie ='TimeZone' + "=" + cval + "; expires=" + exp.toGMTString() + "; path=/"  ;
   }
// Clears text box after setting cookie
function SetTheCookie()
   {
DeleteCookie();
zoneSelected=document.Home.zones;
zoneVal=zoneSelected.options[zoneSelected.selectedIndex].value;
   if(GetCookie('TimeZone')==null)  
      {
	var expdate = new Date (); 
	expdate.setTime(expdate.getTime() + (10 * 365 * 24 * 60 * 60 * 1000)); 
	SetCookie('TimeZone', zoneVal, expdate);  
	} 
	document.Home.TimeZone.value=GetCookie('TimeZone');
	date=document.Home.date.value;
	window.location.href='/CreateProgram.nsf/ScheduleLookup?ReadForm&date='+date+'&zone='+zoneVal;
	
}
function GetTheCookie()
{
	if(GetCookie('TimeZone')==null)
	{
window.location.href='/CreateProgram.nsf/ScheduleLookup?ReadForm&zone='
	}
	else
	{
		
	window.location.href='/CreateProgram.nsf/ScheduleLookup?ReadForm&zone='+GetCookie('TimeZone');
	}
}
function DeleteStateCookie () 
   {
   var exp = new Date();
   exp.setTime (exp.getTime() - 1000000000);  // This cookie is history (changed -1 to make it previous time)
   var cval = GetCookie ('State');
   document.cookie ='State' + "=" + cval + "; expires=" + exp.toGMTString() + "; path=/"  ;
   }
function SetStateCookie1()
{
DeleteStateCookie();
stateSelected=document.State.select;
stateVal=stateSelected.options[stateSelected.selectedIndex].value;
   if(GetCookie('State')==null)  
      {
	var expdate = new Date (); 
	expdate.setTime(expdate.getTime() + (10 * 365 * 24 * 60 * 60 * 1000)); 
	SetCookie('State', stateVal, expdate);  
	} 
	document.State.StationState.value=GetCookie('State');
	date=document.State.date.value;
	window.location.href='/CreateProgram.nsf/ScheduleLookup?ReadForm&date='+date+'&state='+stateVal;
	
}
function SetStateCookie()
{
	DeleteStateCookie();
	stateSelected=document.State.select;
	stateVal=stateSelected.options[stateSelected.selectedIndex].value;
   if(GetCookie('State')==null)  
      {
	var expdate = new Date (); 
	expdate.setTime(expdate.getTime() + (10 * 365 * 24 * 60 * 60 * 1000)); 
	SetCookie('State', stateVal, expdate);  
	} 
	document.State.StationState.value=GetCookie('State');
	date=document.State.date.value;
	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
		  {
		  // Internet Explorer
		  try
		    {
		    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		    }
		  catch (e)
			    {
			    try
			      {
			      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			      }
			    catch (e)
			      {
				window.location.href='/CreateProgram.nsf/ScheduleLookup?ReadForm&date='+date+'&state='+stateVal;
			      }
	   } 
}
	xmlHttp.onreadystatechange=function()
	{
	    if(xmlHttp.readyState==4)
	      {
		document.getElementById("stationlookup").innerHTML=xmlHttp.responseText;
	      }
	}
	xmlHttp.open("GET","/CreateProgram.nsf/StationsLookup?readform&State="+stateVal,true);
	xmlHttp.send(null);
}
function GetStateCookie()
{
	if(GetCookie('State')==null)
	{
		window.location.href='/CreateProgram.nsf/ScheduleLookup?ReadForm&zone=&state'
	}
	else
	{
		window.location.href='/CreateProgramTest.nsf/ScheduleLookup?ReadForm&state='+GetCookie('State');
	}
}
