
function tr_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 tr_getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) 
			break;   
	}  
	return null;
}

function tr_getCookieVal(offset) 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function tr_SetCookie (name, value, expires, path, domain) 
{  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires)) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain));
}

function DoCookies()
{
	var RetSessionStr;
	var RetUserStr;
	var value;
	RetUserStr = tr_GetCookie('RuW');
	RetSessionStr = tr_GetCookie('RsW');
	if (RetUserStr == null)
	{
		curdate = new Date();
		curtime = curdate.getTime();
		value = (curtime*1000) + Math.round(Math.random()*1000);
		tr_SetCookie("RuW", value, "Mon, 31-Dec-2001 23:59:59 GMT", "/", ".rediff.com");
	}
	if (RetSessionStr == null)
	{
		curdate = new Date();
		curtime = curdate.getTime();
		value = (curtime*1000) + Math.round(Math.random()*1000);
		tr_SetCookie("RsW", value, "", "/", ".rediff.com");
	}
	return;
}

function dochk() 
{
	if(document.serv.service[0].checked) 
  	{
    		document.serv.action="http://www.rediffmail.com/cgi-bin/login.cgi";
	    	return true;
  	}
  	if(document.serv.service[1].checked) 
  	{
    		n_win1 = window.open("radiopop.htm","ThisWindow","toolbar=no,directories=no,menubar=no,scrollbars=no,height=185,width=270");
	    	return false;
  	}
}

function dochk1() 
{
  	lsignname = new Array ("aquarius","pisces","aries","taurus","gemini","cancer","leo","virgo","libra","scorpio","sagittarius","capricorn");
  	signname = new Array ("Aquarius","Pisces","Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn");
  	selSign = document.astro.sign.selectedIndex;
  	if(document.astro.duration[0].checked) 
  	{
    		signPage="http://astrology.rediff.com/astrology/sections/daily/daily.asp?sign="+signname[selSign];
    		var wind = window.open(signPage ,"RediffDaily","toolbars=no,directory=no,scrolling=no,scrollbars=yes,maximize=null,width=340,height=275");
    		wind.focus();
    		return false;
  	}
  	if(document.astro.duration[1].checked) 
  	{
		linkname=signname[selSign].toLowerCase();
		top.location.href = "http://astrology.rediff.com/astrology/sections/weekly/weekly.asp?sign="+linkname;
		return false;
  	}
  	if(document.astro.duration[2].checked) 
  	{
		window.open("http://astrology.rediff.com/astrology/bday.cgi","Rediff","toolbars=no,directory=no,scrolling=no,scrollbars=yes,maximize=null,width=440,height=370");
		return false;
  	}
}

function SetCookie (name, value, expdt)
{
	this.document.cookie = name + "=" + value + "; expires="+expdt.toGMTString();
}

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 tempvar = this.document.cookie;
	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 popupmenu(choice)
{
	var winOpts='toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,width=200,height=300';
	confirmWin=window.open(choice,'theconfirmWin',winOpts);
	window.open(choice,'theconfirmWin',winOpts);
}

function popupmenu1(choice)
{
	var winOpts='toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,width=250,height=500';
	confirmWin=window.open(choice,'theconfirmWin',winOpts);
	window.open(choice,'theconfirmWin',winOpts);
}

function OpenWin(url)
{
	window.open(url,"win1","toolbar=no,directories=no,resize=no,menubar=no,location=no,scrollbars=yes,width=175,height=350,maximize=null,top=70,left=80");
}
function gc(c){location.href='http://citypages.rediff.com/citypages/cp_events.php?city='+c;}

function popupmenu2(choice)
{
	var winOpts='toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,width=615,height=400';
	confirmWin=window.open(choice,'theconfirmWin',winOpts);
	window.open(choice,'theconfirmWin',winOpts);
}

function future()
{
        window.open("http://astrology.rediff.com/astrology/cookie.cgi","products","toolbars=no,directory=no,scrolling=no,scrollbars=no,maximize=null,width=310,height=150");
}

function play(tt)
{
	url="http://radio.rediff.com/cgi-bin/cradio/desong1?Song_Id="+tt+"&media=WM";
	window.open(url,"Rediff","width=233,height=190,resizable=yes");
}

function dosignup()
{
  
   location.href="http://www.rediffmail.com/cgi-bin/register.cgi?FormName=user_details";
  
}

function PasswdRemindWin()
{
	window.open("http://www.rediffmail.com/cgi-bin/passwd_remind.cgi?FormName=provide_login","win1","toolbar=no,directories=no,resize=yes,menubar=no,location=no,scrollbars=yes,width=430,height=280,maximize=null,top=70,left=80");
}

function gotest()
{
	version=parseFloat(navigator.appVersion);
	if(navigator.appName.indexOf("Netscape") != -1 && version <= 4.05)
	{
		AppWnd=window.open("/shopping/browserupgrade.htm","win1","toolbar=no,directories=no, resize=no,menubar=no,location=no,scrollbars=yes,width=500,height=350,maximize=null");
	}
}

function popupmenu(choice)
{
	var winOpts='toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,width=615,height=400';
	confirmWin=window.open(choice,'theconfirmWin',winOpts);
	window.open(choice,'theconfirmWin',winOpts);
}

function popupmenu2(choice,wt,ht)
{
	var winOpts="toolbars=no,maximize=no,resize=no,width="+wt+",height="+ht+",location=no,directories=no";
	confirmWin=window.open(choice,'theconfirmWin',winOpts);
}

