//PURPOSE: for select form elements to work without a go button; selected URL appears in main window
//ADDED BY: Shawna Schnorr
function goTo(form)
	{
	var index = form.urlSelect.selectedIndex;
	var jump = form.urlSelect.options[index].value;
	document.location.href = jump;
	}
//PURPOSE: for select form elements to work without a go button; selected URL appears in popup window. (used for ViewPrintAds)
//ADDED BY: Shawna Schnorr
function goToPopup(form)
	{
	var index = form.urlSelect.selectedIndex;
	var jump = form.urlSelect.options[index].value;
	//document.location.href = jump;
        if (jump.indexOf("http://") == 0)  
		{window.open(jump,'ad_window','toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=yes,height=500,width=765').focus;}
	return(0);
	}


// PURPOSE: user registration
//ADDED BY: Shawna Schnorr (from threshhold component, which we no longer need to use)
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(cname) {
 var arg=cname+"="; 
 var alen=arg.length;
 var clen=document.cookie.length;i
 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 false;
}
function SaveCookie(cname,cvalue,cdays,cpath) {
 ex = new Date; ex.setTime(ex.getTime() + (cdays*86400000));
 if (cpath == null) { cpath = "/" }
 else { cpath = "; path=" + cpath }
 sitedom=location.hostname.replace(/24hour\./,"").replace(/www\./,"");
 document.cookie=cname + '=' + cvalue + '; expires=' + ex.toGMTString() + cpath + "; domain="+sitedom;
}
