//# $Id: glusr-header.js 13574 2009-02-17 13:32:59Z gunjan $
//# $HeadURL: http://qmail1/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="/cgi/glusr-check.mp?login=true&modid=ETO&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='+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-check.mp?logoff=true&modid=ETO&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;
}
