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);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); }
return null; }
function CheckDataSearch(Form){
Form.ss.value = Form.ss.value.replace(/'/g, '');
Form.ss.value = Form.ss.value.replace(/[^a-zA-Z0-9 ]/g, ' ');
Form.ss.value = Form.ss.value.replace(/^\s+/g, '').replace(/\s+$/g, '');
while(Form.ss.value.indexOf('  ')>0){
Form.ss.value = Form.ss.value.replace('  ',' '); }
var temp=Form.ss.value.replace(/\s/g, '');
	if (temp.length < 3) {
	alert("Enter at least three characters for search.");
	Form.ss.focus(); return false; }
	else {
	var str = Form.ss.value.replace(/\s/g, '+');
	if(Form.searchfor.value == "comp"){
	str ='ss='+escape(str);
	str = "http://dir.indiamart.com/cgi/compcatsearch.mp?"+str;
	str = myReplace(str,"\\\\?\\\\&","?");
	window.location = str; return false; }
	else if(Form.searchfor.value == "product"){
	str ='ss='+escape(str);
	str = "http://catalogs.indiamart.com/cgi/catprdsearch.mp?"+str;
	str = myReplace(str,"\\\\?\\\\&","?");
	window.location = str; return false; }
	else if(Form.searchfor.value == "offer"){
	str ='search='+escape(str); str = "/search.mp?"+str;
	str = myReplace(str,"\\\\?\\\\&","?"); window.location = str;
	return false; }
	else if(Form.searchfor.value == "tenders"){
	str ='ss='+escape(str);
	str = "http://tenders.indiamart.com/search.cgi?"+str;
	str = myReplace(str,"\\\\?\\\\&","?");
	window.location = str;
	return false; } 
	} 
}
function myReplace(str, a, b) { var re = new RegExp(a, "g"); var ret = str.replace(re,b); return ret; }
function trim(sString){ sString = sString.replace(/^\s+/g, '').replace(/\s+$/g, ''); return sString; }
function openchildts(thisurl) { browserName = navigator.appName; browserVer = parseInt(navigator.appVersion);
condition = !(( (browserName.indexOf("Explorer") >=0 ) && (browserVer < 4) ) ||  ((browserName.indexOf("Netscape") >=0 ) && (browserVer < 2) ) ) ;
if (condition == true  )
CanAnimate = true;
else
CanAnimate = false;
if ( CanAnimate ) {
var windowHeight; var windowWidth; var windowTop; var windowLeft;
windowHeight=(screen.height*(80/100))*0.85; windowWidth=(screen.width*(57/100)-200);
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'); } }