var myhost = window.location.hostname;
var loginscript = "http://"+myhost+"/ibhacks/login.pl";
var imgserve = "http://www.surfbollywood.com/imgserve.pl";
var ie=document.all;
var dom=document.getElementById;
var ns4=document.layers;

// set cookies
function setCookie(NameOfCookie, value, expiredays) 
{
  	var ExpireDate = new Date (); 
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 12 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + 
	((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

// get cookies
function getCookie(NameOfCookie)
{ if (document.cookie.length > 0) 
	{  begin = document.cookie.indexOf(NameOfCookie+"="); 
	   if (begin != -1) // Note: != means "is not equal to"
		{ begin += NameOfCookie.length+1; 
		   end = document.cookie.indexOf(";", begin);
		   if (end == -1) end = document.cookie.length;
		   return unescape(document.cookie.substring(begin, end)); 
		} 
 	}
 return ""; 
}

function refreshwindow () {
  var myloc = window.location.href;
  redirectdelay(myloc,1000);
  rerun;
}

function redirectdelay (l1,t) {
  var p = "redirect(\'"+l1+"\')";
  window.setTimeout(p,t);
  return;
}

function redirect (u) {
  window.location = u;
  return;
}
