var redirect="/redir.php?";

function popW(url,l,t,w,h,hidden)
{
  if (navigator.appName=="Netscape") {oWin=window.open("","_blank","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1");}
  else{if (navigator.appName=="Microsoft Internet Explorer"){oWin=window.open("","","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1");}}
  if (oWin!=null)
	{
	if (hidden)
	{
		oWin.blur();
		self.focus();
		oWin.resizeTo(w,h);oWin.moveTo(l,t);oWin.location=url;
	}
	else
	{
		oWin.blur();
		oWin.resizeTo(w,h);oWin.moveTo(l,t);oWin.location=url;
		oWin.focus();
	}
	}
}


function GoTo(URL)
		{window.location=redirect + URL;}

function popup(URL)
{
	popW(redirect + URL, 10,20,800,700,0);
}

function popunder(URL)
{
	popW(URL, 20,20,850,700,1);
}

function pophidden(URL)
{
	popW(URL, 2000,2000,1,1,1);
}

function pophex(URL)
{
    popup(fromhex(URL));
}

function fromhex(str) {
	var url='';
	len = str.length / 2;
	for (i=0; i<len; i++) {url += unescape('%' + str.substr(i*2,2))}
	return url;
}

function createRequest(){
	try {
		request = new XMLHttpRequest();
	} catch (trymicrosoft) {
		try {
			request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (othermicrosoft) {
			try {
				request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (failed) {
				request = false;
			}  
		}
	}
}

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 null
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate)
}