
function rand(number){return Math.ceil(Math.random()*number);}
function SetClickTracksCookie()
{var thisCookie=GetCookie("CLICKTRACKSCOOKIE");if(thisCookie==null)
{var myValue=new Date();var randNum=rand(100);myValue=myValue.toGMTString()+"_"+randNum;var expiryDate=new Date();var date2010="Fri, 31 Dec 2030 23:00:00 EST";var dt=Date.parse(date2010);expiryDate.setTime(dt);SetCookie("CLICKTRACKSCOOKIE",myValue,expiryDate,"/",window.location.hostname);}
var thisCookie=GetCookie("LANDINGURL");if(thisCookie==null)
{var myValue=location.href;var expiryDate=new Date();var date2010="Fri, 31 Dec 2030 23:00:00 EST";var dt=Date.parse(date2010);expiryDate.setTime(dt);SetCookie("LANDINGURL",myValue,expiryDate,"/",window.location.hostname);}
var myValue=document.referrer;var thisCookie=GetCookie("REFERER");if(thisCookie==null)
{var expiryDate=new Date();var date2010="Fri, 31 Dec 2030 23:00:00 EST";var dt=Date.parse(date2010);expiryDate.setTime(dt);SetCookie("REFERER",myValue,expiryDate,"/",window.location.hostname);}}
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;var path=(argc>3)?argv[3]:null;var domain=(argc>4)?argv[4]:null;var secure=(argc>5)?argv[5]:false;document.cookie=name+"="+escape(value)+
((expires==null)?"":("; expires="+expires.toGMTString()))+
((path==null)?"":("; path="+path))+
((domain==null)?"":("; domain="+domain))+
((secure==true)?"; secure":"");}
function DeleteCookie(name){var exp=new Date();exp.setTime(exp.getTime()-1);var cval=GetCookie(name);document.cookie=name+"="+cval+"; expires="+exp.toGMTString();}
SetClickTracksCookie();function clearfield()
{document.forms.search.PC.value='';}
function validate()
{var zip=document.forms.search.PC.value;var subject=document.forms.search.sub.value;var flag_zip=false;var flag_sub=false;document.getElementById('error1').innerHTML='';document.getElementById('error2').innerHTML='';if(zip!=null&&(zip.length)==5&&((zip.indexOf(0)==0)||(parseInt(zip)==zip)))
{flag_zip=true;}
if(subject!='none')
{flag_sub=true;}
if(!(flag_zip))
clearfield();if(!(flag_sub))
document.getElementById('error2').innerHTML='Subject Required';if(!(flag_sub))
{return(false);}
else
document.forms.search.submit();}