//# $Id: glusr-header.js 1294 2006-01-11 04:37:28Z amar $
//# $HeadURL: http://qmail2:8081/svn/im-sw/indiamart-trade/trunk/main/glusr-header.js $

var value = "";
value = readCookie('v4iil');

var url = document.URL;
var redirect = "";

if(url.match('/cgi/'))
{
	redirect = '/';
}
else
{
	if(url.match('signout.html'))
	{
		redirect = '/';
	}
	else
	{
		redirect = escape(url);
	}
}

if(value == null || value == "")
{
	document.write('<A HREF="http://www.indiamart.com/" target="_top">IndiaMART Home</A>&nbsp;&nbsp;-&nbsp;&nbsp; <A HREF="http://dir.indiamart.com/cgi/glusr.mp?login=true&modid=DIR&redirect='+redirect+'" target="_top">Sign In</A> &nbsp;&nbsp;-&nbsp;&nbsp; <A HREF="http://my.indiamart.com/cgi/glusr-reg1.mp?action=newreg1&modid=MY&redirect=/" target="_top">Join Free</A> &nbsp;&nbsp;-&nbsp;&nbsp; <A HREF="http://my.indiamart.com/" target="_top">My Profile</A>&nbsp;&nbsp;-&nbsp;&nbsp; <A HREF="http://www.indiamart.com/help/" target="_top">Help</A>&nbsp;&nbsp;');
}
else
{
	document.write('<A HREF="http://www.indiamart.com/" target="_top">IndiaMART Home</A>&nbsp;&nbsp;-&nbsp;&nbsp; <A HREF="/cgi/glusr.mp?logoff=true&modid=DIR&redirect=/signout.html?redirect=/" target="_top">Sign Out</A> &nbsp;&nbsp;-&nbsp;&nbsp; <A HREF="http://my.indiamart.com/" target="_top">My  Profile</A>&nbsp;&nbsp;-&nbsp;&nbsp; <A HREF="http://www.indiamart.com/help/" target="_top">Help</A>&nbsp;&nbsp;');
}

function readCookie(name)
{
	var ca = document.cookie.split(';');
	var nameEQ = name + "=";
	for(var i=0; i < ca.length; i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
	}
	return null;
}






function openchildts_search(thisurl){
if ( CanAnimate ){

        var windowHeight;
        var windowWidth;
        var windowTop;
        var windowLeft;
        windowHeight=(screen.height*(80/100))*0.85;
        windowWidth=screen.width*(57/100);
        windowTop=(screen.height*(20/100))*0.8;
        windowLeft=screen.width*(40.2/100);

        msgWindow=window.open( '' ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,top='+windowTop+',left='+windowLeft+',width='+windowWidth+',height='+windowHeight);
        msgWindow.focus();
        msgWindow.location.href = thisurl;
}
else {
        msgWindow=window.open( thisurl,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=510,height=420');
}

}