set_cookie('CTLads');

function showRightHTML(id)
{
	if((cookie = getCookie("CTLads")) > "")
	{
			//cookie is set
			document.write('<DIV CLASS="rq_bg"><IMG SRC="/gifs/rq-top.gif" WIDTH="258" HEIGHT="6"><BR> <IMG HEIGHT="7" SRC="/gifs/zero.gif" WIDTH="1"><BR> <DIV CLASS="rq_txt"><IMG SRC="/gifs/want-p.gif" WIDTH="155" HEIGHT="16" ALT="Want to Purchase?"><BR><P>Let the suppliers contact you.</P><A HREF="/business-enquiry.html"><IMG SRC="/gifs/post-ur.gif" WIDTH="233" HEIGHT="43" ALT="Post your purchase /Post your purchase /" BORDER="0"></A><BR><P CLASS="r">&#149; Receive quotes from pre-verified suppliers<BR> &nbsp; only.</P><IMG SRC="/gifs/rq-about.gif" WIDTH="169" HEIGHT="15" ALT="About IndiaMART.com"><BR><P>India\'s largest B2B marketplace since 1996 that assists buyers and sellers trade with each other at a reliable, common platform. <BR><BR> Search from over 500,000 suppliers and 200,000 products.</P></DIV><IMG SRC="/gifs/rq-bottom.gif" WIDTH="258" HEIGHT="11"></DIV><IMG HEIGHT="30" SRC="/gifs/zero.gif" WIDTH="1"><BR>');
	}
	else
	{
		document.write('<center> <iframe id="TOP1RIGHT" src="http://www.media4trade.com/mediaserver?action=show&location=TOP1RIGHT&size=160x300&mcat='+id+'&iframe=1" marginwidth="0" marginheight="0" target="_top" frameborder="0" height="320" scrolling="no" width="160"></iframe> </center>');

	}
}

function showFeatureProductsHTML()
{
	if((cookie = getCookie("CTLads")) > "")
	{
		//cookie is set
		document.write('<div class="source_bg2"> <div class="bg_heading1"> <p>Free Sourcing Help Desk</p></div> <div class="headings">Sourcing Products from India?</div> <div class="headings1">Tell suppliers exactly what you need </div> <div class="post"><span>Click here to:</span> <div class="setmargin" onclick="location.href=\'http://catalogs.indiamart.com/business-enquiry.html\'">Post your purchase / sourcing requirements here</div> <div class="receive_new">Receive quotes only from genuine and pre-verified suppliers</div></div> </div><div class="clear"><img src="/gifs/zero.gif" height="27" width="1"><br></div>');
	}
	else
	{
		document.write('<IFRAME id="TOPCENTER" SRC="/cat_iframe.html" BORDER="0" BORDERCOLOR="0" FRAMEBORDER="0" FRAMESPACING="0" HEIGHT="220" WIDTH="100%" SCROLLING="NO" MARGINWIDTH="0" MARGINHEIGHT="0"></IFRAME><DIV CLASS="clear"><IMG SRC="/gifs/zero.gif" HEIGHT="27" WIDTH="1"><BR></DIV>');
	}
}


function getCookie(Name)
{
	var search = Name + "="
	if (document.cookie.length > 0)
	{ // if there are any cookies
		offset = document.cookie.indexOf(search)
		if (offset != -1)
		{ // if cookie exists
			offset += search.length
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset)
			// set index of end of cookie value
			if (end == -1) end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}

	return "";
}

function set_cookie(_name)
{
//alert('set');
	if((cookie = getCookie("CTLads")) > "")
	{
		//do nothing
	}
	else
	{
		var ref = document.referrer;
		var self_ref = window.location.href;
		//alert(ref);

		if((/aclk\?sa|iclk\?sa/.test(ref)) || (/gclid/.test(self_ref)))
		{
			_value='1';

			expires = new Date();
			expires.setTime (expires.getTime() + 5 * 1000);
			document.cookie = _name + "=" + escape(_value)+ ";";
		}
	}
}


