// head foot js start
var page_flag = '';
var gl_ofr_id = 0;
var x=0;function init(text)
{try
{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(text);}
catch(e)
{try
{parser=new DOMParser();xmlDoc=parser.parseFromString(text,"text/xml");}
catch(e)
{alert(e.message);return;}}
return xmlDoc;}
function ajaxFunction()
{var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
return xmlHttp;}
function setcredit()
{var attempt=Number(x)+1;var xmlHttp=ajaxFunction();if(xmlHttp)
{xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{if(xmlHttp.responseText)
{temp=xmlHttp.responseText.split('##');if(temp[2]==1&&attempt==1)
{Header();}
else
{document.getElementById('welcomeuser').innerHTML=' to <strong>HelloTrade!</strong>';document.getElementById('nhavbcrd').style.display="none";}}}}
var params="";var str='/cgi-bin/ht-setcredit.mp';xmlHttp.open("POST",str,true);xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlHttp.setRequestHeader("Content-length",params.length);xmlHttp.setRequestHeader("Connection","close");xmlHttp.send(params);}}
function Header()
{
	var value="";
	value=readCookie('v4iil');
	var url=document.URL;
	var redirect="";
	if(url.match('/cgi-bin/'))
	{
		var dd=document.referrer;redirect=dd;
		if(dd.match('/cgi-bin/'))
		{
			redirect='http://www.hellotrade.com';
		}
	}
	else
	{
		if(url.match('signout.html'))
		{
			redirect='/';
		}
		else
		{
			redirect=escape(url);
		}
	}
	if(value==null||value=="")
	{
		if(document.getElementById('signinornot'))
		{
		document.getElementById('signinornot').innerHTML='<span id="signinornot"><a href="http://my.hellotrade.com/cgi-bin/ht-joinfree.mp?action=joinfree&modid=HELLOTD&redirect='+redirect+'" rel="nofollow">Join Free</a>  |  <a HREF="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?login=true&modid=HELLOTD&redirect='+redirect+'" rel="nofollow" target="_top">Login</a></span>';
		}
		
		
	}
	else
	{
		if(document.getElementById('signinornot'))
		{
		document.getElementById('signinornot').innerHTML='<span id="signinornot"><A href="http://my.hellotrade.com/" target="_top">My Hellotrade</a>  |  <a href="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?logoff=true&modid=HELLOTD&redirect='+redirect+'" target="_top">Logout</a></span>';
		}
		
	}
var user=getUserName();
var id = '';
	if(user!='')
	{
		var ofr_id = 0;
		document.getElementById('welcomeuser').innerHTML='<strong>'+user+'</strong>';
		document.getElementById('addbal').innerHTML = '<div class="adbtn bls" style="background-position:-117px -5px;"><a href="javascript:showBuyCreditMsg(\'\','+ofr_id+');" rel="nofollow">Add Balance</a></div>';
		for(var i=0;i<40;i++)
		{
			id = 'showbtn'+i;
			if(document.getElementById('showbtn'+i))
			{
				
				document.getElementById('showbtn'+i).innerHTML = '<div class="bnw bls" style="background-position: -2px -87px; cursor: pointer;" onClick="javascript:displaylead('+i+',1);"><b class="log" style="font-size: 17px; color: rgb(204, 0, 0);">Buy Now</b></div>';
			}
		}
		
	}
	else
	{
		
		document.getElementById('welcomeuser').innerHTML=' to <strong>HelloTrade!</strong>';
		document.getElementById('addbal').innerHTML = '';
		for(var i=0;i<40;i++)
		{
			id = 'showbtn'+i;
			if(document.getElementById(id))
			{	
				var ofr_id = jsonObj.buyers[i].ofr_id;
				var credits = jsonObj.buyers[i].credits;
				document.getElementById(id).innerHTML = '<div class="btns bls" style="background-position:-2px -36px; cursor: pointer;" onClick="javascript:loginwin('+i+','+ofr_id+','+credits+',\'btn\');"><b class="log">Login to</b><br><b class="log" style="font-size: 13px; color: rgb(204, 0, 0);">Contact Buyer</b></div>';
			}
		}
		
		
	}
var crtavl=getAvlCredit();
	if(crtavl!=-1)
	{
		crtavl=Math.floor(crtavl/5);document.getElementById('nhavbcrd').innerHTML='Available Balance : <strong>'+crtavl+' US$</strong>';
	}
	else if(value)
	{
		if(crtavl==-1)
		{
			setcredit();
		}
	}
	else
	{
		document.getElementById('nhavbcrd').style.display="none";
	}
}
function getUserName()
{var value="";var value=readCookie('htusr');if(value==null||value=="")
{value='';}
else
{value=unescape(value);}
return value;}
function getAvlCredit()
{var value="";value=readCookie('htavlcrdt');if(value==null||value=="")
{value=-1;}
else
{value=unescape(value);}
return value;}
function Footer()
{
	var value="";value=readCookie('v4iil');
	var url=document.URL;var redirect="";
	if(url.match('/cgi-bin/'))
	{
		var dd=document.referrer;redirect=dd;
		if(dd.match('/cgi-bin/'))
		{
			redirect='http://www.hellotrade.com';
		}
	}
	else
	{
		if(url.match('signout.html'))
		{
			redirect='/';
		}
		else
		{
			redirect=escape(url);
		}
	}
	if(value==null||value=="")
	{
		if(document.getElementById('signinornot1'))
		{
		document.getElementById('signinornot1').innerHTML='<span id="signinornot1"><a href="http://my.hellotrade.com/cgi-bin/ht-joinfree.mp?action=joinfree&modid=HELLOTD" rel="nofollow">Join Free</a> | <a HREF="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?login=true&modid=HELLOTD&redirect='+redirect+'" target="_top" rel="nofollow">Login</a></span>';
		}
		
	}
	else
	{
		if(document.getElementById('signinornot1'))
		{
		document.getElementById('signinornot1').innerHTML='<span id="signinornot1"><a href="http://my.hellotrade.com/" target="_top">My Hellotrade</a> | <a href="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?logoff=true&modid=HELLOTD&redirect='+redirect+'" target="_top">Logout</a></span>';
		}
		
	}
}
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;
}

// buyers js start

var xmlHttp;
var navindex;
var offerID=0;
var Values=new Array();
var jsonObj;
var total_sell_count;
var jsondata;


function initpage(jsonObj,total_buy_count)
{
	jsonObj = jsonObj;
	var total_buy_count = total_buy_count;
}


function displaylead(id, showmsg)
{
	if(document.getElementById("country-hide"))
	{	
		document.getElementById("country-hide").style.display="none";
	}
	if(showmsg != 1)
	{
		showmsg = 0;
	}
		navindex = id;
		var ofr_title 	= jsonObj.buyers[id].ofr_title;
		var ofr_desc 	=  jsonObj.buyers[id].ofr_desc;
		var ofr_qty 	=   jsonObj.buyers[id].ofr_qty;
		var s_ip		= 	jsonObj.buyers[id].s_ip;
		var s_ip_country= jsonObj.buyers[id].s_ip_country;
		var gl_country 	= jsonObj.buyers[id].gl_country;
		var glusr_comp 	= jsonObj.buyers[id].glusr_comp;
		var sendername 	= jsonObj.buyers[id].sendername;
		var address 	= jsonObj.buyers[id].address;
		var ofr_s_city 	= jsonObj.buyers[id].ofr_s_city;
		var s_phone 	= jsonObj.buyers[id].s_phone;
		var s_fax 		= jsonObj.buyers[id].s_fax;
		var credits 	= jsonObj.buyers[id].credits;
		var glusr_comp	= jsonObj.buyers[id].glusr_comp;
		var ofr_id 		= jsonObj.buyers[id].ofr_id;
		var email 		= jsonObj.buyers[id].email;
		var website		= jsonObj.buyers[id].website;
		var ofr_image	= jsonObj.buyers[id].image;

		offer_title ='<h2>'+ofr_title+'</h2>';

		offer='<span style="font-size:14px;">'+ofr_desc+'</span>';

		if(ofr_image)
		{
			ofr_image = '<img src='+ofr_image+' align="left" border="0" vspace="4" hspace="5" alt="">';
		}
		else
		{
			ofr_image = '';
		}
		
		if (ofr_qty)
		{
			ofr_qty ='<tr><td width="46%" class="cont"><b>Preferred Quantity</b></td><td width="5%" align="center"><strong> :</strong></td><td width="49%">'+ofr_qty+'</td></tr>';
		}
		else
		{
			ofr_qty = '';
		}

		if (s_ip)
		{
			var ip = s_ip;
		}
		else
		{
			ip = '';
		}

		if (s_ip_country)
		{
			var ip_country = s_ip_country; 
		}
		else
		{
			ip_country = '';
		}

		if (gl_country)
		{
			var country = gl_country;
		}
		else
		{
			country = '';
		}
	
		if (glusr_comp)
		{
			var company ='<tr><td width="9%" class="cont"><b>Company</b></td><td width="4%" class="cont">: </td><td width="56%" class="cont">'+glusr_comp+'</td><td width="31%" rowspan="8" valign="top" class="cont"><div class="information" align="left">All Contact Informations masked with "xxxx" will be visible to you once you Purchase this Buy Lead</div></td></tr>';
		}
		else
		{
			company = '';
		}

		if (sendername)
		{
			var sendername ='<tr><td class="cont"><b>Contact</b></td><td class="cont">: </td><td class="cont">'+sendername+'</td></tr>';
		}
		else
		{
			sendername = '';
		}

		if (address)
		{
			var address ='<tr><td class="cont"><b>Address</b></td><td class="cont">: </td><td class="cont">'+address+'</td></tr>';
		}
		else	
		{
			address = '';
		}
		
		if (ofr_s_city)
		{
			var city ='<tr><td class="cont"><b>City</b></td><td class="cont">:</td><td class="cont">'+ofr_s_city+'</td></tr>';
		}
		else
		{
			city = '';
		}

		if (s_phone)
		{
			var s_phone ='<tr><td class="cont"><b>Phone</b></td><td class="cont">: </td><td class="cont">'+s_phone+'</td></tr>';
		}
		else
		{
			s_phone ='';
		}

		if (s_fax)
		{
			var s_fax ='<tr><td class="cont"><b>Fax</b></td><td class="cont">: </td><td class="cont">'+s_fax+'</td></tr>';
		}
		else
		{
			s_fax ='';
		}

		if (credits)
		{
			var credit = credits;
		}
		else
		{
			credit = '';
		}

		if (ofr_id)
		{
			var ofr_id = ofr_id;
		}	
		else
		{
			ofr_id = '';
		}

		if (email)
		{
			var email ='<tr><td class="cont"><b>Email</b></td><td class="cont">: </td><td class="cont">'+email+'</td></tr>';
		}
		else
		{
			email ='';
		}

		if (website)
		{
			var website ='<tr><td class="cont"><b>Website</b></td><td class="cont">: </td><td class="cont">'+website+'</td></tr>';
		}
		else
		{
			website ='';
		}
	var ip_cntr = '';
	if(ip)		
	{
		ip_cntr = ip;
	}
	if(ip_country)
	{
		ip_cntr = ip_cntr+' ('+ip_country+')';
	}
	if(ip_cntr)
	{
		ip_cntr ='<tr><td width="46%" class="cont"><b>Sender\'s IP/Country</b></td><td width="5%" align="center"><strong>:</strong></td><td width="49%">'+ip_cntr+'</td></tr><tr><td width="46%" class="cont"><br></td><td width="5%" align="center"></td><td width="49%">&nbsp;</td></tr>';
	}
	var pre_count = id - 1;
	var first_n_pre = '';
	if(pre_count > -1)
	{
		
		first_n_pre = '<td width="3%" align="left"><a rel="nofollow" onClick="javascript:displaylead(0);" style="cursor:pointer;"><img src="/gifs/first.gif" alt="First Lead" border="0"></a></td><td width="18%" align="left"><a rel="nofollow" onClick="javascript:displaylead(0);" style="cursor:pointer">First Lead</a></td><td width="3%" align="left"><a rel="nofollow" onClick="javascript:displaylead('+pre_count+');" style="cursor:pointer;"><img src="/gifs/previous.gif" alt="Previous" border="0"></a></td><td width="26%" align="left"><a rel="nofollow" onClick="javascript:displaylead('+pre_count+');" style="cursor:pointer">Previous</a></td>';
	}
	else
	{
		first_n_pre = '<td width="3%" align="left"><img src="/gifs/first.gif" alt="First Lead" border="0"></td><td width="18%" align="left">First Lead</td><td width="3%" align="left"><img src="/gifs/previous.gif" alt="Previous" border="0"></td><td width="26%" align="left">Previous</td>';
	}
	var nxt_count = id +1;
	var last_count = total_buy_count - 1;
	var tot_count = total_buy_count;
	var nxt_n_last = '';
	if(nxt_count < total_buy_count)
	{
		nxt_n_last = '<td width="26%" align="right"><a rel="nofollow" style="cursor:pointer;" onClick="javascript:displaylead('+nxt_count+');">Next</a></td><td width="3%" align="right"><a rel="nofollow" onClick="javascript:displaylead('+nxt_count+');" style="cursor:pointer;"><img src="/gifs/next.gif" alt="Next" border="0"></a></td><td width="18%" align="right"><a rel="nofollow" onClick="javascript:displaylead('+last_count+');" style="cursor:pointer;">Last Lead</a></td><td width="3%" align="right"><a rel="nofollow" onClick="javascript:displaylead('+last_count+');" style="cursor:pointer;"><img src="/gifs/lastpage.gif" alt="Last Lead" border="0"></a></td>';
	}
	else
	{
		nxt_n_last = '<td width="26%" align="right">Next</td><td width="3%" align="right"><img src="/gifs/next.gif" alt="Next" border="0"></td><td width="18%" align="right">Last Lead</td><td width="3%" align="right"><img src="/gifs/lastpage.gif" alt="Last Lead" border="0"></td>';
	}		
	display1='<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="30"><h1>Requirement</h1></td></tr><tr><td align="justify">'+ofr_image+offer_title+offer+'<br/><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>&nbsp;</td><td align="center">&nbsp;</td><td>&nbsp;</td></tr>'+ofr_qty+' '+ip_cntr+'</table></td></tr><tr><td height="30"><h1>Buyer\'s Contact Information</h1></td></tr><tr><td><table cellpadding="3" cellspacing="0" border="0" width="100%">'+company+' '+sendername+' '+address+' '+city+' <tr><td class="cont"><b>Country</b></td><td class="cont">:</td><td class="cont">'+country+'</td></tr>'+s_phone+' '+s_fax+' '+email+' '+website+'<tr><td colspan="4">&nbsp;</td></tr></table></td></tr></table>';
	
	document.getElementById("content").innerHTML = display1;
			
	display1='<table width="100%" border="0" cellspacing="0" cellpadding="0" id="requirement"><tr><td valign="top"><!--lead deatils:start--><div id="scrollcontent"><table width="95%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">'+display1+'</td></tr></table></div></td><td width="27.5%" valign="top" style="background-color:#EEEEEE;"><input type="hidden" value="'+ofr_id+'" id="ofr_id"><table width="55%" border="0" align="center" cellpadding="4" cellspacing="0"> <tr> <td align="center" style="font-size:15px;" id="avbc1"> </td> </tr> </table> <span id="price"></span></td></tr><tr><td height="30" colspan="2" align="center" valign="middle" id="morelead"><table cellpadding="4" cellspacing="0" border="0" width="100%"><tr>'+first_n_pre+' '+nxt_n_last+'</tr></table></td></tr></table>';
			
	document.getElementById("showinner").innerHTML = display1;
	
	showLayerNew();
	page_flag = 'First Screen';
	gl_ofr_id = ofr_id;
	
	check_loginstatus(id,ofr_id,credit,0,showmsg,tot_count,'pop_win');
}

function display_resp_unmask(jsondata,id)
{
		var display1='';
		navindex = id;

		var ofr_title = jsondata.finaldata[1].offer.buyers[0].ofr_title;	
		var ofr_desc = jsondata.finaldata[1].offer.buyers[0].ofr_desc;
		var ofr_qty = jsondata.finaldata[1].offer.buyers[0].ofr_qty;
		var s_ip = jsondata.finaldata[1].offer.buyers[0].s_ip;
		var s_ip_country = jsondata.finaldata[1].offer.buyers[0].s_ip_country;
		var gl_country 	= jsondata.finaldata[1].offer.buyers[0].gl_country;
		var glusr_comp 	= jsondata.finaldata[1].offer.buyers[0].glusr_comp;
		var sendername 	= jsondata.finaldata[1].offer.buyers[0].sendername;
		var address 	= jsondata.finaldata[1].offer.buyers[0].address;
		var ofr_s_city 	= jsondata.finaldata[1].offer.buyers[0].ofr_s_city;
		var s_phone 	= jsondata.finaldata[1].offer.buyers[0].s_phone;
		var s_fax 		= jsondata.finaldata[1].offer.buyers[0].s_fax;
		var credits = jsondata.finaldata[1].offer.buyers[0].availcredit;
		var glusr_comp	= jsondata.finaldata[1].offer.buyers[0].glusr_comp;
		var ofr_id 		= jsondata.finaldata[1].offer.buyers[0].ofr_id;
		var glusr_id 	= jsondata.finaldata[1].offer.buyers[0].glusr_id;
		var email 		= jsondata.finaldata[1].offer.buyers[0].email;
		var website		= jsondata.finaldata[1].offer.buyers[0].website;
		var ofr_image	= jsondata.finaldata[1].offer.buyers[0].image;

		offer_title ='<h2>'+ofr_title+'</h2>';

		offer='<span style="font-size:14px;">'+ofr_desc+'</span>';

		if(ofr_image)
		{
			ofr_image = '<img src='+ofr_image+' align="left" border="0" vspace="4" hspace="5" alt="">';
		}
		else
		{
			ofr_image = '';
		}

		
		if (ofr_qty)
		{
			ofr_qty ='<tr><td width="46%" class="cont"><b>Preferred Quantity</b></td><td width="5%" align="center"><strong> :</strong></td><td width="49%">'+ofr_qty+'</td></tr>';
		}
		else
		{
			ofr_qty = '';
		}

		if (s_ip)
		{
			var ip = s_ip;
		}
		else
		{
			ip = '';
		}

		if (s_ip_country)
		{
			var ip_country = s_ip_country; 
		}
		else
		{
			ip_country = '';
		}

		if (gl_country)
		{
			var country = gl_country; 
		}
		else
		{
			country = '';
		}
		
		if (glusr_comp)
		{
			var company ='<tr><td width="9%" class="cont"><b>Company</b></td><td width="4%" class="cont">: </td><td width="56%" class="cont">'+glusr_comp+'</td><td width="31%" rowspan="8" valign="top" class="cont"></td></tr>';
		}
		else
		{
			company = '';
		}

		if (sendername)
		{
			var sendername ='<tr><td class="cont"><b>Contact</b></td><td class="cont">: </td><td class="cont">'+sendername+'</td></tr>';
		}
		else
		{
			sendername = '';
		}

		if (address)
		{
			var address ='<tr><td class="cont"><b>Address</b></td><td class="cont">: </td><td class="cont">'+address+'</td></tr>';
		}
		else	
		{
			address = '';
		}
		
		if (ofr_s_city)
		{
			var city ='<tr><td class="cont"><b>City</b></td><td class="cont">:</td><td class="cont">'+ofr_s_city+'</td></tr>';
		}
		else
		{
			city = '';
		}

		if (s_phone)
		{
			
			var phdisplay1 = s_phone.replace(/[^0-9]/g, '');
// 			var s_phone ='<tr><td class="cont"><b>Phone</b></td><td class="cont">: </td><td class="cont">'+s_phone+'<input type ="hidden" id="phn1" value='+phdisplay1+'>&nbsp;&nbsp;<a href="javascript:showLayerNewfcall(\'phone\',\''+glusr_id+'\',\'phn1\');" rel="nofollow"><img src="/gifs/callfree-s.gif" alt="" border="0"></a></td></tr>';

			var s_phone ='<tr><td class="cont"><b>Phone</b></td><td class="cont">: </td><td class="cont">'+s_phone+'<input type ="hidden" id="phn1" value='+phdisplay1+'></td></tr>';
		}
		else
		{
			s_phone ='';
		}

		if (s_fax)
		{
			var s_fax ='<tr><td class="cont"><b>Fax</b></td><td class="cont">: </td><td class="cont">'+s_fax+'</td></tr>';
		}
		else
		{
			s_fax ='';
		}

		if (credits)
		{
			var credit = credits;
			var dollar = Math.floor(credit / 5);
		}
		else
		{
			credit = '';
			dollar = '';
		}

		if (ofr_id)
		{
			ofr_id = ofr_id;
		}	
		else
		{
			ofr_id = '';
		}

		if (email)
		{
			var email ='<tr><td class="cont"><b>Email</b></td><td class="cont">: </td><td class="cont">'+email+'</td></tr>';
		}
		else
		{
			email ='';
		}

		if (website)
		{
			var website ='<tr><td class="cont"><b>Website</b></td><td class="cont">: </td><td class="cont">'+website+'</td></tr>';
		}
		else
		{
			website ='';
		}

	var ip_cntr = '';
	if(ip)		
	{
		ip_cntr = ip;
	}
	if(ip_country)
	{
		ip_cntr = ip_cntr+' ('+ip_country+')';
	}
	if(ip_cntr)
	{
		ip_cntr ='<tr><td width="46%" class="cont"><b>Sender\'s IP/Country</b></td><td width="5%" align="center"><strong>:</strong></td><td width="49%">'+ip_cntr+'</td></tr><tr><td width="46%" class="cont"><br></td><td width="5%" align="center"></td><td width="49%">&nbsp;</td></tr>';
	}
	var pre_count = navindex - 1;
	var first_n_pre = '';
	if(pre_count > -1)
	{
		first_n_pre = '<td width="3%" align="left"><a rel="nofollow" onClick="javascript:displaylead(0);" style="cursor:pointer;"><img src="/gifs/first.gif" alt="First Lead"  border="0"></a></td><td width="18%" align="left"><a rel="nofollow" onClick="javascript:displaylead(0);" style="cursor:pointer;">First Lead</a></td><td width="3%" align="left"><a rel="nofollow" onClick="javascript:displaylead('+pre_count+');" style="cursor:pointer;"><img src="/gifs/previous.gif" alt="Previous" border="0"></a></td><td width="26%" align="left"><a rel="nofollow" onClick="javascript:displaylead('+pre_count+');" style="cursor:pointer;">Previous</a></td>';
	}
	else
	{
		first_n_pre = '<td width="3%" align="left"><img src="/gifs/first.gif" alt="First Lead" border="0"></td><td width="18%" align="left">First Lead</td><td width="3%" align="left"><img src="/gifs/previous.gif" alt="Previous" border="0"></td><td width="26%" align="left">Previous</td>';
	}
	var nxt_count = navindex + 1;
	var nxt_n_last = '';
	
	var last_count= total_buy_count - 1;
	if(nxt_count < total_buy_count)
	{
		nxt_n_last = '<td width="26%" align="right"><a onClick="javascript:displaylead('+nxt_count+');" rel="nofollow" style="cursor:pointer;">Next</a></td><td width="3%" align="right"><a rel="nofollow" onClick="javascript:displaylead('+nxt_count+');" style="cursor:pointer;"><img src="/gifs/next.gif" alt="Next" border="0"></a></td><td width="18%" align="right"><a rel="nofollow" onClick="javascript:displaylead('+last_count+');" style="cursor:pointer;">Last Lead</a></td><td width="3%" align="right"><a rel="nofollow" onClick="javascript:displaylead('+last_count+');" style="cursor:pointer;"><img src="/gifs/lastpage.gif" alt="Last Lead" border="0"></a></td>';
	}
	else
	{
		nxt_n_last = '<td width="26%" align="right">Next</td><td width="3%" align="right"><img src="/gifs/next.gif" alt="Next" border="0"></td><td width="18%" align="right">Last Lead</td><td width="3%" align="right"><img src="/gifs/lastpage.gif" alt="Last Lead" border="0"></td>';
	}		
	display1='<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="30"><h1>Requirement</h1></td></tr><tr><td align="justify">'+ofr_image+offer_title+offer+'<br/><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>&nbsp;</td><td align="center">&nbsp;</td><td>&nbsp;</td></tr>'+ofr_qty+' '+ip_cntr+'</table></td></tr><tr><td height="30"><h1>Buyer\'s Contact Information</h1></td></tr><tr><td><table cellpadding="3" cellspacing="0" border="0" width="100%">'+company+' '+sendername+' '+address+' '+city+' <tr><td class="cont"><b>Country</b></td><td class="cont">:</td><td class="cont">'+country+'</td></tr>'+s_phone+' '+s_fax+' '+email+' '+website+'<tr><td colspan="4">&nbsp;</td></tr></table></td></tr></table>';
			
	document.getElementById("content").innerHTML = display1;
	
	display1='<table width="100%" border="0" cellspacing="0" cellpadding="0" id="requirement"><tr><td valign="top"><!--lead deatils:start--><div id="scrollcontent"><table width="95%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">'+display1+'</td></tr></table></div><!--lead details:ends--></td><td width="27.5%" valign="top" style="background-color:#EEEEEE;"><input type="hidden" value="'+ofr_id+'" id="ofr_id"><!--price & Buy :start--><table width="55%" border="0" align="center" cellpadding="4" cellspacing="0"> <tr> <td align="center" style="font-size:15px;" id="avbc1"><div id="avbc">Available Balance &nbsp;:&nbsp;'+dollar+' US$</div><div align="right"><a href="javascript:showBuyCreditMsg(\'\','+ofr_id+');" class="buycredits" rel="nofollow">Add Balance</a></div></td> </tr> </table><span id="price"></span><!--price & Buy :ends--></td></tr><tr><td height="30" colspan="2" align="center" valign="middle" id="morelead"><table cellpadding="4" cellspacing="0" border="0" width="100%"><tr>'+first_n_pre+' '+nxt_n_last+'</tr></table></td></tr></table>';
	return display1;
}


function check_loginstatus(id,ofr_id,credit,loadpurchase,showmsg, tot_count,from)
{
	var value = "";
	value = readCookie('v4iil');
	var url = document.URL;
	var redirect = "";
	var dollar = Math.floor(credit / 5);

	if(value == null || value == "")
	{
		xmlHttp=GetXmlHttpObject();
		if(xmlHttp)
		{
			var params="modid=HELLOTD&offer="+ofr_id;
			var str ='/cgi-bin/hello-eto-buy-reject.mp';
			xmlHttp.open("POST",str,true);
			xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xmlHttp.setRequestHeader("Content-length", params.length);
			xmlHttp.setRequestHeader("Connection", "close");
			xmlHttp.send(params);
		}

		var nxt_count = id + 1;
		document.getElementById("price").innerHTML = ' <table width="55%" border="0" align="center" cellpadding="4" cellspacing="0"> <tr> <td align="center" style="font-size:15px;"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td style="font-size:13px; text-align:center;padding-top:85px;"><nobr>Introduction Fee</nobr> </td> </tr> <tr> <td class="cost">'+dollar+' US$</td> </tr> <tr> <td style="font-size:13px; text-align:center;"></td> </tr> </table> </td> </tr> <tr align="center"> <td> <div align="left" class="buynow"> <a rel="nofollow" onClick="javascript:loginwin('+id+','+ofr_id+','+credit+');" style="cursor:pointer;">Contact Now </a> </div> </td> </tr> <tr align="center"> <td> <div align="left" class="noin"></div> </td> </tr> </table>';
	}
	else
	{
		
			showUsrData(ofr_id,credit,loadpurchase,showmsg,id,tot_count,from);
		
	}
}

function loginwin(id,ofr_id,credit,from) 
{
	var xmlHttp=GetXmlHttpObject();
	page_flag = page_flag + ',Login form';
	gl_ofr_id = ofr_id;
	if(document.getElementById("country-hide"))
	{
		document.getElementById("country-hide").style.display="none";
	}
	if(xmlHttp)
	{
		xmlHttp.onreadystatechange=function()
		{

			if(xmlHttp.readyState==4)
			{
				hideLayershowloadpage();
				if(xmlHttp.responseText)
				{
					var temp = xmlHttp.responseText;

					document.getElementById("showlogin").innerHTML = temp;	
					captchaCode();
				}
				else
				{
					document.getElementById("showlogin").innerHTML = "Sorry some error accured";
				}
			}
		}
		
			var params="id="+id+"&ofr_id="+ofr_id+"&credit="+credit+"&from="+from;
			var str = '/cgi-bin/ht-buyer-login.cgi';
			xmlHttp.open("POST",str,true);
			xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xmlHttp.setRequestHeader("Content-length", params.length);
			xmlHttp.setRequestHeader("Connection", "close");
			xmlHttp.send(params);
	}

	showLayerNewlogin();
	
}


function goLogin(id,from)
{
	if(document.SubmitMemberLoginForm.email.value == '')
	{
		alert("Kindly enter your Email.");
		document.SubmitMemberLoginForm.email.focus();
		return false;
	}
	
	if(document.SubmitMemberLoginForm.usr_pass.value == '')
	{
		alert("Kindly enter your Password.");
		document.SubmitMemberLoginForm.usr_pass.focus();
		return false;
	}

	var email=document.SubmitMemberLoginForm.email.value;
	var pass=document.SubmitMemberLoginForm.usr_pass.value;

	var xmlHttp=GetXmlHttpObject();
	showLayershowloadpage();	
	
	if(xmlHttp)
	{
		xmlHttp.onreadystatechange=function()
		{
			document.getElementById("notLogin").innerHTML='';

			if(xmlHttp.readyState==4)
			{
				hideLayershowloadpage();
				if(xmlHttp.responseText)
				{
					var temp = xmlHttp.responseText;
					if(temp == 1)
					{
						hideLayerNewlogin();

						var co_ofrid= document.currentoffer.co_ofrid.value;
						var co_credit= document.currentoffer.co_credit.value;
						
						check_loginstatus(id,co_ofrid,co_credit,1,1,0,from);
												
					}
					else
					{
						document.getElementById('notLogin').innerHTML="<h2>Email or Password is incorrect.</h2>";
					}
				}
				else
				{
					document.getElementById("notLogin").innerHTML='<h2>Some Error with the request.<br>Please try again.</h2>';
				}
			}
		}

		var params="email="+email+"&usr_pass="+pass;
		var str = '/cgi-bin/ht-check-login.mp';
		xmlHttp.open("POST",str,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(params);
 
	}
return false;	
}


function freeUsrLogin(id)
{
document.getElementById('notLogin').innerHTML='';if(document.ModReg.first_name.value=="")
{alert("Kindly enter your First Name.");document.ModReg.first_name.focus();return false;}
if(document.ModReg.email.value=="")
{alert("Kindly enter your E-mail ID.");document.ModReg.email.focus();return false;}
else if(document.ModReg.email.value.length!=0)
{var e_check=document.ModReg.email.value;if(document.ModReg.email.value.indexOf(" ")!=-1){alert("Kindly enter correct E-Mail ID without any spaces in it.");document.ModReg.email.focus();return false;}
if(document.ModReg.email.value.indexOf("@")==-1){alert("Invalid E-Mail ID! Kindly enter correct E-Mail ID.");document.ModReg.email.focus();return false;}
if(document.ModReg.email.value.indexOf(",")!=-1){alert("Invalid E-Mail ID! Kindly enter correct E-Mail ID.");document.ModReg.email.focus();return false;}
if(document.ModReg.email.value.indexOf("'")!=-1){alert("Invalid E-Mail ID! Kindly enter correct E-Mail ID.");document.ModReg.email.focus();return false;}
if(document.ModReg.email.value.indexOf(")")!=-1){alert("Invalid E-Mail ID! Kindly enter correct E-Mail ID.");document.ModReg.email.focus();return false;}
if(document.ModReg.email.value.indexOf("(")!=-1){alert("Invalid E-Mail ID! Kindly enter correct E-Mail ID.");document.ModReg.email.focus();return false;}
validarr=document.ModReg.email.value.split("@");if(validarr[0].length==0){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}
if(validarr[0].length!=0){if(validarr[0].indexOf(".")!=-1){validemail=validarr[0].split(".");if(validemail[0].length<2){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}
if(validemail[1].length<2){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}}}
if(validarr[1].indexOf("@")>=0){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}
if(validarr[1].length==0){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}
if(validarr[1].length!=0){if(validarr[1].indexOf(".")==-1){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}
validemail=validarr[1].split(".");if(validemail[0].length<2){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}
if(validemail[1].length<2){alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");document.ModReg.email.focus();return false;}}}
if(document.ModReg.country.selectedIndex==0)
{
alert("Kindly select your country name.");
document.ModReg.country.focus();return false;
}

if(document.ModReg.ph_country.value=="")
{
	alert("Kindly enter country code for Telephone Number.");
	document.ModReg.ph_country.focus();
	return false;
}
else if(document.ModReg.ph_no.value==""  && document.ModReg.mobile.value=="")
{
	alert("Kindly enter your Telephone Number or Mobile Number");
	document.ModReg.ph_no.focus();return false;
}
if(document.ModReg.captcha_text.value.length==0){alert("Kindly enter the code as appearing in the Image.");document.ModReg.captcha_text.focus();return false;}
if(!document.ModReg.terms.checked){alert("You must agree to the Terms of Use for your registration.");document.ModReg.terms.focus();return false;}
if(document.ModReg.first_name.value.length>20)
{alert("First Name should not exceed 20 characters.");document.ModReg.first_name.focus();return false;}
if(document.ModReg.last_name.value.length>20)
{alert("Last Name should not exceed 20 characters.");document.ModReg.last_name.focus();return false;}
if(document.ModReg.email.value.length>100)
{alert("Email should not exceed 100 characters.");document.ModReg.email.focus();return false;}

if(document.ModReg.comp_name.value.length>60)
{alert("Company Name should not exceed 60 characters.");document.ModReg.comp_name.focus();return false;}

if(document.ModReg.website.value.length>40)
{alert("Website Name should not exceed 40 characters.");document.ModReg.website.focus();return false;}

if(document.ModReg.ph_country.value.length>6)
{alert("Telephone (Country Code) should not exceed 6 characters.");document.ModReg.ph_country.focus();return false;}
if(document.ModReg.ph_area.value!='')
{if(isNaN(document.ModReg.ph_area.value))
{alert("Telephone (Area Code) should be an integer value.");document.ModReg.ph_area.focus();return false;}}
if(document.ModReg.ph_area.value.length>6)
{alert("Telephone (Area Code) should not exceed 6 characters.");document.ModReg.ph_area.focus();return false;}

if(document.ModReg.ph_no.value.length>35)
{alert("Telephone (Number) should not exceed 35 characters.");document.ModReg.ph_no.focus();
return false;
}

if(document.ModReg.mobile.value!='')
{if(isNaN(document.ModReg.mobile.value))
{alert("Mobile should be an integer value.");document.ModReg.mobile.focus();return false;}}
var comp_name=document.ModReg.comp_name.value;var website=document.ModReg.website.value;var mobile=document.ModReg.mobile.value;var salute=document.ModReg.salute.options[document.ModReg.salute.selectedIndex].value;var first_name=document.ModReg.first_name.value;var last_name='';if(document.ModReg.last_name.value)
{last_name=document.ModReg.last_name.value;}
var email=document.ModReg.email.value;var country_name=document.ModReg.country.options[document.ModReg.country.selectedIndex].text;var country=document.ModReg.country_iso.value;var ph_country=document.ModReg.ph_country.value;var ph_area='';if(document.ModReg.ph_area.value)
{ph_area=document.ModReg.ph_area.value;}
var ph_no=document.ModReg.ph_no.value;var captcha_text=document.ModReg.captcha_text.value;var captcha_ref=document.ModReg.captcha_ref.value;var xmlHttp=GetXmlHttpObject();showLayershowloadpage();
if(xmlHttp)
{
	xmlHttp.onreadystatechange=function()
	{
		document.getElementById("notLogin").innerHTML='';
		if(xmlHttp.readyState==4)
		{
			hideLayershowloadpage();
			if(xmlHttp.responseText)
			{
				var temp=xmlHttp.responseText;
				if(temp==1)
				{
					hideLayerNewlogin();
					var co_ofrid=document.currentoffer.co_ofrid.value;
					var co_credit=document.currentoffer.co_credit.value;
					
					check_loginstatus(id,co_ofrid,co_credit,1,0,0,'free_user');
				}
				else if(temp==3)
				{
					captchaCode();
					document.getElementById('notLogin').innerHTML="<h2>Captcha Incorrect.</h2>";
				}
				else
				{
					document.getElementById('notLogin').innerHTML="<h2>You are already registered with us. Please use above form to login.</h2>";
					document.SubmitMemberLoginForm.email.value=email;
					document.SubmitMemberLoginForm.usr_pass.focus();
					captchaCode();
				}
			}
			else
			{
				document.getElementById("notLogin").innerHTML='<h2>Some error with the request <br> please try again.</h2>';
			}
		}
	}
var params="salute="+salute+"&first_name="+first_name+"&last_name="+last_name+"&email="+email+"&country_name="+country_name+"&country="+country+"&ph_country="+ph_country+"&ph_area="+ph_area+"&ph_no="+ph_no+"&captcha_text="+captcha_text+"&captcha_ref="+captcha_ref+"&comp_name="+comp_name+"&website="+website+"&mobile="+mobile;
var str='/cgi-bin/ht-new-usr-login.cgi';
xmlHttp.open("POST",str,true);xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlHttp.setRequestHeader("Content-length",params.length);xmlHttp.setRequestHeader("Connection","close");xmlHttp.send(params);
}
return false;
}

function showUsrData(ofr_id,credit,loadpurchase,showmsg,id,tot_count,from)
{ 	showLayershowloadpage();

	xmlHttp=GetXmlHttpObject();
	if(xmlHttp)
	{
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4)
			{				
				jsondata = eval('(' +xmlHttp.responseText+ ')');

				userDataInHtml(jsondata,ofr_id,credit,loadpurchase,showmsg,id,tot_count,from);

			}
		}

		var params="modid=HELLOTD&action=userdata&offer="+ofr_id;
		var str ='/cgi-bin/hello-eto-buy-reject.mp';

		xmlHttp.open("POST",str,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(params);
	}
}


function userDataInHtml(jsondata,ofr_id,credit,loadpurchase,showmsg,id,tot_count,from)
{
	var usrid = jsondata.finaldata[0].credit.buyers[0].usrid;
	var prePurchase = jsondata.finaldata[0].credit.buyers[0].prePurchase;
	var custAvCredit = jsondata.finaldata[0].credit.buyers[0].custAvCredit;

	var dollar = Math.floor(credit / 5);
		
	if (usrid)
	{
		usrid = usrid; 
	}
	else
	{	
		usrid = '';
	}

	if (prePurchase)
	{
		prePurchase = prePurchase;
	}
	else
	{
		prePurchase = '';
	}
	
	if (custAvCredit)
	{
		custAvCredit = custAvCredit;
		custAvDollar = Math.floor(custAvCredit / 5);
	}
	else
	{
		custAvCredit = '';
		custAvDollar = '';
	}

	setHeaderLink();
	setFooterLink();
	
	if(from == 'btn' && from != '')
	{
			
		hideLayershowloadpage();
	}
	else
	{
		
		hideLayershowloadpage();
	if(prePurchase == 0)
	{
		var nxt_count = id + 1;
		if(document.getElementById("price"))
		{
		document.getElementById("price").innerHTML = '<table width="55%" border="0" align="center" cellpadding="4" cellspacing="0"> <tr> <td align="center" style="font-size:15px;"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td>&nbsp; </td> </tr> <tr> <td style="font-size:16px; text-align:center;">Introduction Fee</td> </tr> <tr> <td class="cost">'+dollar+' US$</td> </tr> <tr> <td style="font-size:13px; text-align:center;"></td> </tr> </table> </td> </tr> <tr align="center"> <td> <div align="left" class="buynow"> <a href="javascript:goForPurchase(\'buy\','+ofr_id+','+custAvCredit+','+credit+','+id+');" rel="nofollow">Contact Now </a> </div> </td> </tr> <tr align="center"> <td> <div align="left" class="noin"></div> </td> </tr> </table>';
		}
		var custAvCredit = parseInt(custAvCredit);
		if(loadpurchase)
		{
			goForPurchase('buy',ofr_id,custAvCredit,credit,id);
		}
	}	
	else
	{
		var display=display_resp_unmask(jsondata,id);

		document.getElementById("showinner").innerHTML = display;
		
		document.getElementById("price").innerHTML = '<table width="55%" border="0" align="center" cellpadding="4" cellspacing="0"> <tr> <td align="center" style="font-size:15px;"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td>&nbsp; </td> </tr> <tr> <td style="font-size:16px; text-align:center;">Introduction Fee </td> </tr> <tr> <td class="cost">'+dollar+' US$</td> </tr> <tr> <td style="font-size:13px; text-align:center;"></td> </tr> </table> </td> </tr> <tr align="center"> <td> <div align="left" class="conbuy"><a href="javascript:contact_buyer('+ofr_id+');" rel="nofollow">Contact Buyer </a> </div> </td> </tr> <tr align="center"> <td> <div align="left" class="maillead"><a href="javascript:sendOfferToMyMail('+ofr_id+');" rel="nofollow">Send Me a Copy</a> </div> </td> </tr> </table>';
	
		if(showmsg == 1)
		{
			document.getElementById("showthanks").innerHTML='<div id="fade"></div><div class="alert"><div>&nbsp;</div><div>You have already purchased this lead.<div>&nbsp;</div><div align="right"><input type="button" name="okbutton" value="OK" class="frmbutf" onclick="javascript:hideLayerNewthanks(); return false;" style="height:20px; font-size:12px;"></div></div></div>';
			showLayerNewthanks();
		}
	}	
	
	var crtavl = getAvlCredit();
	if(crtavl != 0)
	{
		var crtavl = Math.floor(crtavl / 5);
		document.getElementById('nhavbcrd').innerHTML = 'Available Balance :<strong>'+crtavl+' US$</strong>';
	}
	if(document.getElementById("avbc1"))
	{
		document.getElementById("avbc1").innerHTML = '<div id="avbc">Available Balance &nbsp;:&nbsp;'+custAvDollar+' US$</div><div align="right"><a href="javascript:showBuyCreditMsg(\'\','+ofr_id+');" class="buycredits" rel="nofollow">Add Balance</a></div>';
	}
	}
}

function contact_buyer(offer)
{
	document.getElementById('contactb').innerHTML='<div align="left" id="logn"><br/><h2 style="font-size:150%; font-weight:normal;">Contact Buyer</h2></div><div>&nbsp;</div><form id="sendquery" name="contactbuyer" method="post" action="" style="margin: 0; padding: 0;"><table width="70%" border="0" align="center" cellpadding="2" cellspacing="0"><tr><td width="8%"><strong style="font-size:14px;">Subject</strong</td><td width="1%">:</td><td width="91%"><input name="subject" type="text" id="subject" tabindex="1" value="" maxlength="60" style="height:22px; width:98%;"></td></tr><tr><td><strong style="font-size:14px;">Message</strong></td><td>:</td><td><textarea name="query" cols="25" rows="10" class="inputnew1" id="query" tabindex="2"></textarea></td></tr><tr><td colspan="3" align="right"><input name="Submit3" value="Send" class="frmbutf" style="width: 90px; height: 22px; font-size: 14px;" type="button" onclick="contactBuy('+offer+'); return false;">&nbsp;<input name="Cancel" value="Cancel" class="frmbutf" style="width: 90px; height: 22px; font-size: 14px;" type="button" onclick="hideLayerNewcontb(); return false;"></td></tr></table></form>';
	
	showLayerNewcontb();
	document.getElementById('contactb').style.display = "block";
}

function contactBuy(offer)
{
	if(document.contactbuyer.subject.value == '')
	{
		alert("Kindly enter Subject.");
		document.contactbuyer.subject.focus();
		return false;
	}
	
	if(document.contactbuyer.query.value == '')
	{
		alert("Kindly enter your message.");
		document.contactbuyer.query.focus();
		return false;
	}
	hideLayerNewcontb();
	
	showLayershowloadpage();

	xmlHttp=GetXmlHttpObject();
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			hideLayershowloadpage();
			var xmltext =xmlHttp.responseText;
			var xmlDoc=init(xmltext);
			var message=showMessage(xmlDoc); 

			document.getElementById("showthanks").innerHTML='<div id="fade"></div><div class="alert"><div>&nbsp;</div><div>'+message+'<div>&nbsp;</div><div align="right"><input type="button" name="okbutton" value="OK" class="frmbutf" onclick="javascript:hideLayerNewthanks(); return false;" style="height:20px; font-size:12px;"></div></div></div>';
			hideLayershowloadpage();
			showLayerNewthanks();			
		}
	}

	var subj = document.contactbuyer.subject.value;
	var msg = document.contactbuyer.query.value;
	var params="mseg="+msg+"&subj="+subj+"&offer="+offer;
	var str ='/cgi-bin/contact-buyer.cgi';
	xmlHttp.open("POST",str,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(params);
}

function goForPurchase(obj,offerid,balance,credit,id)
{
	var alerttabs = 'alerttabs';

	var dollar = Math.floor(credit / 5);

	var bal_dollar = Math.floor(balance / 5);
		 
	var custAfterPurchase = Math.round((bal_dollar - dollar)* 100.0) / 100.0;

	if(obj == 'buy')
	{
			var xmlHttp=GetXmlHttpObject();
			if(xmlHttp)
			{
				var params="modid=HELLOTD&action=sendmailtosales&offer="+offerid;
				var str ='/cgi-bin/hello-eto-buy-reject.mp';
				xmlHttp.open("POST",str,true);
				xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				xmlHttp.setRequestHeader("Content-length", params.length);
				xmlHttp.setRequestHeader("Connection", "close");
				xmlHttp.send(params);
			}

		if(balance < credit)
		{
			creditval = Math.floor(credit / 5) ;
			page_flag = page_flag + ',insufficient balance screen';
			gl_ofr_id = offerid;
			document.getElementById('showbuycr').innerHTML='<div id="fade"></div><div class="alert"><form id="buycredit" name="creditbuy" method="post" action="/cgi-bin/purchase-credit.cgi" style="margin:0px; padding:0px;"> <table id="windowconf" align="center" border="0" cellpadding="4" cellspacing="0" width="100%"> <tr> <td colspan="3"> <strong>You don\'t have sufficient balance<br></strong></td></tr><tr><td width="50%">Available Balance</td> <td width="1%">:</td><td width="30%" style="font-size: 18px;">'+bal_dollar+' US$</td></tr><tr><td>Cost of this Lead</td><td>:</td><td rowspan="2" style="color: rgb(204, 0, 0); font-size: 18px;"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>'+dollar+' US$</td> </tr> <tr> <td><div style="padding-left:5%;"><a href="javascript:document.creditbuy.submit();" class="buycredits">Contact this Buyer Now!</a></div></td> </tr> </table><input type="hidden" name="offerd" value="'+offerid+'"><input type="hidden" name="page" value="'+page_flag+'"></td></tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr><td colspan="3" align="center">&nbsp;</td></tr></table><table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" id="buycrd"> <tr> <td colspan="4"><h2 style="font-size:18px;">Add Balance</h2></td> </tr> <tr> <td width="3%"> <input name="plan" type="radio" value="1"> </td> <td width="40%" align="left"><strong>200</strong> US$ </td> <td width="57%" align="right"></td> </tr> <tr> <td><input name="plan" value="2" type="radio"> </td> <td align="left" align><strong>500</strong> US$ </td> <td align="right"></td> </tr> <tr> <td colspan="3" align="right"> <br> <input type="button" name="BuyNow" value="Buy Credits" class="frmbutf" onclick="javascript:creditBuy(this.form);return false;"> <input type="button" name="Cancel" value="Cancel" class="frmbutf" onclick="javascript:hideLayershowbuycr();return false;"> <input type="hidden" name="modid" value="HELLOTD"> <input type="hidden" name="action" value="creditpur"></td> </tr> </table> </form> </div>';
			showLayershowbuycr();
			
		}
		else
		{	
			document.getElementById('showconf').innerHTML='<div id="fade"></div><div class="alert"><form id="credit" name="form1" method="post" action=""><table width="100%" border="0" align="center" cellpadding="5" cellspacing="5" id="windowconf"><tr><td width="50%">Available Balance</td><td width="1%">:</td><td>'+bal_dollar+' US$</td></tr><tr><td>Cost of this Lead</td><td>:</td><td style="color:#CC0000;">'+dollar+' US$</td></tr><tr><td>Balance Dollars</td><td>:</td><td>'+custAfterPurchase+' US$</td></tr><tr><td colspan="3" align="center">&nbsp;</td></tr><tr><td colspan="3" align="right"><input type="button" name="Submit" value="Confirm" class="frmbutf" onclick="javascript:purchaseLead('+offerid+','+id+');return false;"> <input type="button" name="Cancel" value="Cancel" class="frmbutf" onclick="javascript:hideLayerNewconf();return false;"></td></tr></table></form></div>';
			showLayerNewconf();
		}
	}
	else if(obj == 'reject')
	{
	}
}
function showBuyCreditMsg(msg,offerid)
{
	document.getElementById('showbuycr').innerHTML='<div id="fade"></div><div class="alert">'+msg+'<form id="buycredit" name="creditbuy" method="post" action="/cgi-bin/purchase-credit.cgi" style="margin:0px; padding:0px;"> <table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" id="buycrd"> <tr> <td colspan="4"><h2 style="font-size:18px;">Add Balance</h2></td> </tr> <tr> <td width="3%"> <input name="plan" type="radio" value="1"> </td> <td width="40%" align="left"><strong>200</strong> US$ </td> <td width="57%" align="right"></td> </tr> <tr> <td><input name="plan" value="2" type="radio"> </td> <td align="left"><strong>500</strong> US$  </td> <td align="right"></td> </tr> <tr> <td colspan="3" align="right"> <br> <input type="button" name="BuyNow" value="Buy Credits" class="frmbutf" onclick="javascript:creditBuy(this.form);return false;"> <input type="button" name="Cancel" value="Cancel" class="frmbutf" onclick="javascript:hideLayershowbuycr();return false;"> <input type="hidden" name="modid" value="HELLOTD"> <input type="hidden" name="action" value="creditpur"><input type="hidden" name="offerd" value="'+offerid+'"></td> </tr> </table> </form> </div>';
	showLayershowbuycr();
}

function purchaseLead(offer_id,id)
{
	showLayershowloadpage();
	xmlHttp=GetXmlHttpObject();
	
	if(xmlHttp)
	{
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4)
			{
				jsondata = eval('(' +xmlHttp.responseText+ ')');

				var display=display_resp_unmask(jsondata,id);

				document.getElementById("showinner").innerHTML = display;
				
				var crtavl = getAvlCredit();
				if(crtavl != 0)
				{
					var crtavl = Math.floor(crtavl / 5);

					document.getElementById('nhavbcrd').innerHTML = 'Available Balance : <strong>'+crtavl+' US$</strong>';
				}
				
				document.getElementById("price").innerHTML = ' <table width="55%" border="0" align="center" cellpadding="4" cellspacing="0"> <tr align="center"> <td> <br><br><div align="left" class="conbuy"><a href="javascript:contact_buyer('+offer_id+');" rel="nofollow">Contact Buyer</a> </div> </td> </tr> <tr align="center"> <td> <div align="left" class="maillead"><a href="javascript:sendOfferToMyMail('+offer_id+');" rel="nofollow">Send Me a Copy</a> </div> </td> </tr></table>';

				hideLayershowloadpage();
				hideLayerNewconf();
				showLayerNew();
			}
		}

		var params="modid=HELLOTD&offer="+offer_id+"&action=purchase";
		var str = '/cgi-bin/hello-eto-buy-reject.mp';
		xmlHttp.open("POST",str,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(params);
	}
}

function creditBuy(cform)
{
	hideLayerNewconf();
	var k=0;for(var i=0;i<2;i++)
	{
		if(cform.plan[i].checked)
		{k=1;}
	}
	if(k==1)
	{cform.submit();}
	else
	{alert('Please select a option');return false;}
}
function setHeaderLink()
{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.getElementById('signinornot').innerHTML='<span id="signinornot"><a href="http://my.hellotrade.com/cgi-bin/ht-joinfree.mp?action=joinfree&modid=HELLOTD&redirect='+redirect+'">Join Free</a>  |  <a HREF="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?login=true&modid=HELLOTD&redirect='+redirect+'" target="_top">Login</a></span>';
	document.getElementById('addbal').innerHTML = '';
	for(var i=0;i<40;i++)
		{
			id = 'showbtn'+i;
			if(document.getElementById(id))
			{	
				var ofr_id = jsonObj.buyers[i].ofr_id;
				var credits = jsonObj.buyers[i].credits;
				document.getElementById(id).innerHTML = '<div class="btns bls" style="background-position: -2px -36px; cursor: pointer;" onClick="javascript:loginwin('+i+','+ofr_id+','+credits+',\'btn\');"><b class="log">Login to</b><br><b class="log" style="font-size: 13px; color: rgb(204, 0, 0);">Contact Buyer</b></div>';
			}
		}
}
else
{
	document.getElementById('signinornot').innerHTML='<span id="signinornot"><A href="http://my.hellotrade.com/" target="_top">My Hellotrade</a>  |  <a href="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?logoff=true&modid=HELLOTD&redirect='+redirect+'" target="_top">Logout</a></span>';
	document.getElementById('addbal').innerHTML = '<div class="adbtn bls" style="background-position:-117px -5px;"><a href="javascript:showBuyCreditMsg(\'\','+ofr_id+');" rel="nofollow">Add Balance</a></div>';
	for(var i=0;i<40;i++)
	{
		id = 'showbtn'+i;
		if(document.getElementById('showbtn'+i))
		{
			
			document.getElementById('showbtn'+i).innerHTML = '<div class="bnw bls" style="background-position: -2px -87px; cursor: pointer;" onClick="javascript:displaylead('+i+',1);"><b class="log" style="font-size: 17px; color: rgb(204, 0, 0);">Buy Now</b></div>';
		}
	}
}
var user=getUserName();if(user!='')
{
document.getElementById('welcomeuser').innerHTML='<strong>'+user+'</strong>';
}
else
{
document.getElementById('welcomeuser').innerHTML=' to <strong>HelloTrade!</strong>';
}
var crtavl=getAvlCredit();if(crtavl!=0)
{
var crtavl=Math.floor(crtavl/5);document.getElementById('nhavbcrd').innerHTML='Available Balance : <strong>'+crtavl+' US$</strong>';
}
else
{document.getElementById('nhavbcrd').style.display="none";}}
function setFooterLink()
{
	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=="")
	{
		if(document.getElementById('signinornot1'))
		{
			document.getElementById('signinornot1').innerHTML='<span id="signinornot1"><a href="http://my.hellotrade.com/cgi-bin/ht-joinfree.mp?action=joinfree&modid=HELLOTD">Join Free</a> | <a HREF="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?login=true&modid=HELLOTD&redirect='+redirect+'" target="_top">Login</a></span>';
		}
	}
	else
	{
		if(document.getElementById('signinornot1'))
		{
			document.getElementById('signinornot1').innerHTML='<span id="signinornot1"><a href="http://my.hellotrade.com/" target="_top">My Hellotrade</a> | <a href="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?logoff=true&modid=HELLOTD&redirect='+redirect+'" target="_top">Logout</a></span>';
		}
		
	}
}


function sendOfferToMyMail(offer)
{
	var xmlHttp=GetXmlHttpObject();
	showLayershowloadpage();
	
	if(xmlHttp)
	{
		xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4)
			{
				var xmltext =xmlHttp.responseText;
				var xmlDoc=init(xmltext);
				var message=showMessage(xmlDoc); 

 				document.getElementById("showthanks").innerHTML='<div id="fade"></div><div class="alert"><div>&nbsp;</div><div>'+message+'<div>&nbsp;</div><div align="right"><input type="button" name="okbutton" value="OK" class="frmbutf" onclick="javascript:hideLayerNewthanks(); return false;" style="height:20px; font-size:12px;"></div></div></div>';
				hideLayershowloadpage();
				showLayerNewthanks();
			}
		}
		var params="modid=HELLOTD&offer="+offer+"&action=sendmaillead";
		var str = '/cgi-bin/hello-eto-buy-reject.mp';
		xmlHttp.open("POST",str,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(params);
	}
}

function showMessage(xmlDoc)
{var x=xmlDoc.getElementsByTagName("msg_status");var z=x[0].childNodes;var y=x[0].childNodes[0].nodeName;if(y=='message')
{var total=x[0].getElementsByTagName(y);var t_cnt=total.length;if(t_cnt>1)
{message=x[0].getElementsByTagName(y)[0].childNodes[0].nodeValue;}
else
{message=x[0].getElementsByTagName(y)[0].childNodes[0].nodeValue;}}
return message;
}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{
alert("Your browser does not support AJAX!");return false;}}}
return xmlHttp;
}
expires = new Date();
expires.setTime (expires.getTime() + 24 * 60 * 60 * 150 * 1000);
function setCookie(name,value)
{if(value.length>0)
{
document.cookie = name + "=" + escape(value)+ ";"+"expires=" + expires.toGMTString() + ";" + "path=/;" ;}
}
function getBrowserHeight()
{var x=0;var y=0;var bd_ht=document.body.scrollHeight;var bd_wd=document.body.offsetHeight
if(bd_ht>bd_wd)
{x=document.body.scrollWidth;y=document.body.scrollHeight;}
else
{x=document.body.offsetWidth;y=document.body.offsetHeight;}
return{width:parseInt(x),height:parseInt(y)};}
function getPageScroll()
{var yScroll;if(self.pageYOffset)
{yScroll=self.pageYOffset;}
else if(document.documentElement&&document.documentElement.scrollTop)
{yScroll=document.documentElement.scrollTop;}
else if(document.body)
{yScroll=document.body.scrollTop;}
return{scrollheight:parseInt(yScroll)};}
function setLayerPosition()
{
var ScrollHeight=getPageScroll();var show=document.getElementById("show");var bws=getBrowserHeight();show.style.left=10;show=null;
}
function setLayerPosition1()
{var ScrollHeight=getPageScroll();var show=document.getElementById("showbuycr");var bws=getBrowserHeight();show.style.left=20;show.style.top=parseInt(ScrollHeight.scrollheight+150);show=null;}
function setLayerPosition2()
{
var ScrollHeight=getPageScroll();var show=document.getElementById("showlogin");var bws=getBrowserHeight();show.style.left=20;show.style.top=parseInt(ScrollHeight.scrollheight+150);show=null;
}
function showLayerNew()
{document.getElementById("show").style.display="block";}
function hideLayerNew()
{
	
	document.getElementById("show").style.display="none";
	if(document.getElementById("country-hide"))
	{
		document.getElementById("country-hide").style.display="block";
	}
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp)
	{
		
		var params="modid=HELLOTD&offer="+gl_ofr_id+"&track=leadtrack&page="+page_flag;
		var str ='/cgi-bin/hello-eto-buy-reject.mp';
		xmlHttp.open("POST",str,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(params);
	}
}
function showLayerNewlogin()
{setLayerPosition2();document.getElementById("showlogin").style.display="block";}
function hideLayerNewlogin()
{document.getElementById("showlogin").style.display="none";
if(document.getElementById("country-hide"))
{
	document.getElementById("country-hide").style.display="block";
}
}
function showLayerNewconf()
{setLayerPosition1();document.getElementById("showconf").style.display="block";}
function hideLayerNewconf()
{document.getElementById("showconf").style.display="none";}
function hideLayerAll()
{document.getElementById("show").style.display="none";document.getElementById("showlogin").style.display="none";document.getElementById("showconf").style.display="none";document.getElementById("showcontb").style.display="none";document.getElementById("showthanks").style.display="none";document.getElementById("showbuycr").style.display="none";}
function showLayerNewcontb()
{setLayerPosition();document.getElementById("showcontb").style.display="block";}
function hideLayerNewcontb()
{document.getElementById("showcontb").style.display="none";}
function showLayerNewthanks()
{setLayerPosition1();document.getElementById("showthanks").style.display="block";}
function hideLayerNewthanks()
{document.getElementById("showthanks").style.display="none";}
function showLayershowbuycr()
{setLayerPosition1();document.getElementById("showbuycr").style.display="block";}
function hideLayershowbuycr()
{document.getElementById("showbuycr").style.display="none";}
function showLayershowloadpage()
{setLayerPosition();document.getElementById("showloadpage").style.display="block";}
function hideLayershowloadpage()
{document.getElementById("showloadpage").style.display="none";}
function showLayerNewtnc()
{setLayerPosition1();document.getElementById("showtnc").style.display="block";}
function hideLayerNewtnc()
{document.getElementById("showtnc").style.display="none";}

function captchaCode()
{
	var d=new Date();
	var epoch_time=(d.getTime()-d.getMilliseconds())/1000;
	var randomnumber=Math.floor(Math.random()*9999);
	var randomnumber1=Math.floor(Math.random()*9999);
	var ran_num=randomnumber+"."+epoch_time+"."+randomnumber1;
	var url="http://www.hellotrade.com/cgi/get_captcha.cgi?cref="+ran_num;
	document.ModReg.captcha_ref.value=ran_num;
	document.getElementById('captchaID').innerHTML='<img src="'+url+'" WIDTH="100" HEIGHT="25">';
}

function buy_search(kw,frm)
{
	error=0;
	if(kw.length<3)
	{
		error_message="Please enter characters for search";
		error=1;
	}
	if(kw=="Enter Product / Company Name")
	{
		error_message="Please enter correct string for search";
		error=2;
	}
	if(error==1)
	{
		alert(error_message);
		frm.ss.focus();
		return false;
	}
	if(error==2)
	{
		alert(error_message);
		frm.ss.focus();
		return false;
	}
	else
	{
		var from = 'SRCH PAGE TOP SEARCHBOX';
		if(frm.name=='BuyLeadSearchFormFoot') from = 'SRCH PAGE BOTTOM SEARCHBOX';
		_gaq.push(['_trackEvent', 'SearchBox',from, kw]);
		return true;
	}
}
function set_country(name,iso,hostt)
{var host=window.location.hostname;var mystr="http://"+host+"/business/"+hostt+"/buyers/";var str=document.URL;if(iso.length>0)
{document.cookie=name+"="+escape(iso)+";path=/;";}
if(hostt)
{window.location.href=mystr;}
else
{window.location.href=str;}}
function eraseCookie(name,iso)
{document.cookie=name+"="+escape(iso)+";path=/;";}
function showLayerNewfcall(type1,glusr_id,phn)
{document.callme.type_of_call.value=type1;get_data(document.callme);setLayerPosition();document.getElementById("r_glusr_id").value=glusr_id;document.getElementById("des_no_phone").value=document.getElementById(phn).value;document.getElementById("showcallfree").style.display="block";}
function get_data(form1)
{cookie=getCookie("newImeshIDvisitor");if((cookie=getCookie("newImeshIDvisitor"))>"")
{Values=cookie.split("|");if(Values.length>=7)
{if(typeof(Values[0])!="undefined")
{if(document.callme.S_first_name.value.length==0)
{document.callme.S_first_name.value=Values[0];}
else if(document.callme.S_first_name.value=="First Name")
{document.callme.S_first_name.value=Values[0];}}
else
{document.callme.S_first_name.value=Values[0];}
if(typeof(Values[1])!="undefined")
{if(document.callme.S_last_name.value.length==0)
{document.callme.S_last_name.value=Values[1];}
else if(document.callme.S_last_name.value=="Last Name")
{document.callme.S_last_name.value=Values[1];}}
else
{document.callme.S_last_name.value='';}
if(typeof(Values[2])!="undefined")
{if(document.callme.S_email.value.length==0)
document.callme.S_email.value=Values[2];}
else
{document.callme.S_email.value='';}
if(typeof(Values[3])!="undefined")
{if(document.callme.S_country.selectedIndex==0)document.callme.S_country.options[Values[3]].selected=true;}
else
{document.callme.S_country.options[0].selected=true;}
if(typeof(Values[4])!="undefined")
{if(document.callme.S_ccode.value.length==0)
document.callme.S_ccode.value=Values[4];}
else
{document.callme.S_ccode.value='';}
if(typeof(Values[5])!="undefined")
{if(document.callme.S_acode.value.length==0)
document.callme.S_acode.value=Values[5];}
else
{document.callme.S_acode.value='';}
if(typeof(Values[6])!="undefined")
{if(document.callme.S_phone.value.length==0)
document.callme.S_phone.value=Values[6];}
else
{document.callme.S_phone.value='';}}}}
function getCookie(Name)
{var search=Name+"="
if(document.cookie.length>0)
{offset=document.cookie.indexOf(search)
if(offset!=-1)
{offset+=search.length
end=document.cookie.indexOf(";",offset)
if(end==-1)end=document.cookie.length
return unescape(document.cookie.substring(offset,end))}}
return"";}
function hideLayerNew_tring()
{document.getElementById("showcallfree").style.display="none";document.getElementById("callingprog").style.display="none";document.getElementById("callingfrm").style.display="block";document.getElementById("show_error_msg").style.display="none";}
function validateform(thisform)
{thisform=document.callme;if(thisform.S_first_name.value=="")
{alert('Please enter your name')
thisform.S_first_name.focus();return false;}
else if(thisform.S_first_name.value=="First Name")
{alert('Please enter your name')
thisform.S_first_name.focus();return false;}
if(thisform.S_email.value=="")
{alert('Please insert the valid E-mail Id.')
thisform.S_email.focus();return false;}
else
{apos=thisform.S_email.value.indexOf("\@");dotpos=thisform.S_email.value.lastIndexOf(".");lastpos=thisform.S_email.value.length-1;if(apos<1||dotpos-apos<2||lastpos-dotpos>3||lastpos-dotpos<2)
{alert('Invalid E-mail Id.');return false;}}
if(thisform.S_country[thisform.S_country.selectedIndex].value=='')
{alert('Please select country.');thisform.S_country.focus();return false;}
if(thisform.S_ccode.value.length==0)
{alert('Please insert country code.');thisform.S_ccode.focus();return false;}
if(thisform.S_phone.value.length==0)
{alert('Please insert your phone/mobile number.');thisform.S_phone.focus();return false;}
newIILCookie=thisform.S_first_name.value;newIILCookie+="|"+thisform.S_last_name.value;newIILCookie+="|"+thisform.S_email.value;newIILCookie+="|"+thisform.S_country.selectedIndex;newIILCookie+="|"+thisform.S_ccode.value;newIILCookie+="|"+thisform.S_acode.value;newIILCookie+="|"+thisform.S_phone.value;newIILCookie+="|";setCookie("newImeshIDvisitor",newIILCookie);makeCall(thisform);}


function makeCall(thisForm)
{
	thisForm = document.callme;
	email = thisForm.S_email.value;
	salute = thisForm.S_salute[thisForm.S_salute.selectedIndex].value;
	first_name = thisForm.S_first_name.value;
	last_name = thisForm.S_last_name.value;
	countryname = thisForm.S_country[thisForm.S_country.selectedIndex].text;
	country_iso = thisForm.S_country_iso.value;
	ph_country = thisForm.S_ccode.value;
	ph_acode = thisForm.S_acode.value;
	ph_no = thisForm.S_phone.value;
	des_no_phone = thisForm.des_no_phone.value;
	des_no_mobile = thisForm.des_no_mobile.value;
	r_glusr_id = thisForm.r_glusr_id.value;
	type_of_call = thisForm.type_of_call.value;
	s_ip_address = thisForm.s_ip_address.value;
	
	if(type_of_call == 'phone')
	{
		des_no = des_no_phone;
	}
	else if(type_of_call == 'mobile')
	{
		des_no = des_no_mobile;
	}
	document.getElementById("callingfrm").style.display = "block";
	var xmlHttp=ajaxFunction();
	if(xmlHttp)
	{
		xmlHttp.onreadystatechange=function()
		{
			document.getElementById("callingfrm").style.display = "none";
			if(xmlHttp.readyState==4)
			{
				temp = xmlHttp.responseText;
				if(temp == 1)
				{
					document.getElementById("callingprog").style.display = "block";
					document.getElementById("callingfrm").style.display = "none";
				}
				else if(temp == 2)
				{
					document.getElementById("show_error_msg1").innerHTML = '';
					document.getElementById("callingprog").style.display = "none";
					document.getElementById("callingfrm").style.display = "none";
					document.getElementById("show_error_msg1").innerHTML = "Your account has been blocked";
					document.getElementById("show_error_msg").style.display = "block";
				}
				else
				{
					document.getElementById("show_error_msg1").innerHTML = '';
					document.getElementById("callingprog").style.display = "none";
					document.getElementById("callingfrm").style.display = "none";
					document.getElementById("show_error_msg1").innerHTML = "Unable to instantiate your call right now. Please try after some time.";
					document.getElementById("show_error_msg").style.display = "block";
				}
			}
		}
		
		var params = 'S_salute='+salute+'&S_first_name='+first_name+'&S_last_name='+last_name+'&S_country_iso='+country_iso+'&S_ccode='+ph_country+'&S_acode='+ph_acode+'&S_phone='+ph_no+'&des_no='+des_no+'&S_email='+email+'&R_glusr_id='+r_glusr_id+'&R_phone='+des_no+'&S_ip_address='+s_ip_address;

		var str = '/c2c/click2call.php';

		xmlHttp.open("POST",str,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(params);

	}
}

var data=new Array();data[0]="---Select Your Country---";data[1]="Afghanistan##AF##93";data[2]="Albania##AL##355";data[3]="Algeria##DZ##213";data[4]="American Samoa##AS##1-684";data[5]="Andorra##AD##376";data[6]="Angola##AO##244";data[7]="Anguilla##AI##1-264";data[8]="Antarctica##AQ##672";data[9]="Antigua And Barbuda##AG##1-268";data[10]="Argentina##AR##54";data[11]="Armenia##AM##374";data[12]="Aruba##AW##297";data[13]="Australia##AU##61";data[14]="Austria##AT##43";data[15]="Azerbaijan##AZ##994";data[16]="Bahamas##BS##1-242";data[17]="Bahrain##BH##973";data[18]="Bangladesh##BD##880";data[19]="Barbados##BB##1-246";data[20]="Belarus##BY##375";data[21]="Belgium##BE##32";data[22]="Belize##BZ##501";data[23]="Benin##BJ##229";data[24]="Bermuda##BM##1-441";data[25]="Bhutan##BT##975";data[26]="Bolivia##BO##591";data[27]="Bosnia And Herzegovina##BA##387";data[28]="Botswana##BW##267";data[29]="Bouvet Island##BV##";data[30]="Brazil##BR##55";data[31]="British Indian Ocean Territory##IO##246";data[32]="Brunei##BN##673";data[33]="Bulgaria##BG##359";data[34]="Burkina Faso##BF##226";data[35]="Burundi##BI##257";data[36]="Cambodia##KH##855";data[37]="Cameroon##CM##237";data[38]="Canada##CA##1";data[39]="Cape Verde##CV##238";data[40]="Cayman Islands##KY##1-453";data[41]="Central African Republic##CF##236";data[42]="Chad##TD##235";data[43]="Chile##CL##56";data[44]="China##CN##86";data[45]="China (Hong Kong S.A.R.)##HK##852";data[46]="China (Macau S.A.R.)##MO##853";data[47]="Christmas Islands##CX##61";data[48]="Cocos Islands##CC##672";data[49]="Colombia##CO##57";data[50]="Comoros##KM##269";data[51]="Congo##CG##242";data[52]="Cook Islands##CK##682";data[53]="Costa Rica##CR##506";data[54]="Cote D Ivoire##CI##225";data[55]="Croatia##HR##385";data[56]="Cuba##CU##53";data[57]="Cyprus##CY##357";data[58]="Czech Republic##CZ##420";data[59]="Democractic Republic Of Congo##CD##243";data[60]="Denmark##DK##45";data[61]="Djibouti##DJ##253";data[62]="Dominica##DM##1-767";data[63]="Dominican Republic##DO##1-809";data[64]="East Timor##TL##670";data[65]="Ecuador##EC##593";data[66]="Egypt##EG##20";data[67]="El Salvador##SV##503";data[68]="Equatorial Guinea##GQ##240";data[69]="Eritrea##ER##291";data[70]="Estonia##EE##372";data[71]="Ethiopia##ET##251";data[72]="Faeroe Islands##FO##298";data[73]="Falkland Islands##FK##500";data[74]="Fiji Islands##FJ##679";data[75]="Finland##FI##358";data[76]="France##FR##33";data[77]="French Guiana##GF##594";data[78]="French Polynesia##PF##689";data[79]="French Southern Territories##TF##262";data[80]="Gabon##GA##241";data[81]="Georgia##GE##995";data[82]="Germany##DE##49";data[83]="Ghana##GH##233";data[84]="Gibraltar##GI##350";data[85]="Greece##GR##30";data[86]="Greenland##GL##299";data[87]="Grenada##GD##1-473";data[88]="Guadeloupe##GP##590";data[89]="Guam##GU##1-671";data[90]="Guatemala##GT##502";data[91]="Guinea##GN##224";data[92]="Guinea-Bissau##GW##245";data[93]="Guyana##GY##592";data[94]="Haiti##HT##509";data[95]="Heard And Mcdonald Islands##HM##672";data[96]="Holy See##VA##379";data[97]="Honduras##HN##504";data[98]="Hungary##HU##36";data[99]="Iceland##IS##354";data[100]="India##IN##91";data[101]="Indonesia##ID##62";data[102]="Iran##IR##98";data[103]="Iraq##IQ##964";data[104]="Ireland##IE##353";data[105]="Israel##IL##972";data[106]="Italy##IT##39";data[107]="Jamaica##JM##1-876";data[108]="Japan##JP##81";data[109]="Jordan##JO##962";data[110]="Kazakhstan##KZ##7";data[111]="Kenya##KE##254";data[112]="Kiribati##KI##686";data[113]="Korea##KR##82";data[114]="Korea, North##KP##850";data[115]="Kuwait##KW##965";data[116]="Kyrgyzstan##KG##996";data[117]="Lao People's Democratic Republic##LA##856";data[118]="Latvia##LV##371";data[119]="Lebanon##LB##961";data[120]="Lesotho##LS##266";data[121]="Liberia##LR##231";data[122]="Libya##LY##218";data[123]="Liechtenstein##LI##423";data[124]="Lithuania##LT##370";data[125]="Luxembourg##LU##352";data[126]="Macedonia##MK##389";data[127]="Madagascar##MG##261";data[128]="Malawi##MW##265";data[129]="Malaysia##MY##60";data[130]="Maldives##MV##960";data[131]="Mali##ML##223";data[132]="Malta##MT##356";data[133]="Marshall Islands##MH##692";data[134]="Martinique##MQ##596";data[135]="Mauritania##MR##222";data[136]="Mauritius##MU##230";data[137]="Mayotte##YT##269";data[138]="Mexico##MX##52";data[139]="Micronesia##FM##691";data[140]="Moldova##MD##373";data[141]="Monaco##MC##377";data[142]="Mongolia##MN##976";data[143]="Montenegro##ME##382";data[144]="Montserrat##MS##1-664";data[145]="Morocco##MA##212";data[146]="Mozambique##MZ##258";data[147]="Myanmar##MM##95";data[148]="Namibia##NA##264";data[149]="Nauru##NR##674";data[150]="Nepal##NP##977";data[151]="Netherlands Antilles##AN##599";data[152]="New Caledonia##NC##687";data[153]="New Zealand##NZ##64";data[154]="Nicaragua##NI##505";data[155]="Niger##NE##227";data[156]="Nigeria##NG##234";data[157]="Niue##NU##683";data[158]="Norfolk Island##NF##672";data[159]="Northern Mariana Islands##MP##1-670";data[160]="Norway##NO##47";data[161]="Oman##OM##968";data[162]="Pakistan##PK##92";data[163]="Palau##PW##680";data[164]="Panama##PA##507";data[165]="Papua New Guinea##PG##675";data[166]="Paraguay##PY##595";data[167]="Peru##PE##51";data[168]="Philippines##PH##63";data[169]="Pitcairn Island##PN##872";data[170]="Poland##PL##48";data[171]="Portugal##PT##351";data[172]="Puerto Rico##PR##1";data[173]="Qatar##QA##974";data[174]="Reunion##RE##262";data[175]="Romania##RO##40";data[176]="Russia##RU##7";data[177]="Rwanda##RW##250";data[178]="Saint Helena##SH##290";data[179]="Saint Kitts And Nevis##KN##1-869";data[180]="Saint Lucia##LC##1-758";data[181]="Saint Pierre And Miquelon##PM##508";data[182]="Saint Vincent And The Grenadin##VC##1-784";data[183]="Samoa##WS##685";data[184]="San Marino##SM##378";data[185]="Sao Tome And Principe##ST##239";data[186]="Saudi Arabia##SA##966";data[187]="Senegal##SN##221";data[188]="Serbia##RS##381";data[189]="Serbia And Montenegro##CS##381";data[190]="Seychelles##SC##248";data[191]="Sierra Leone##SL##232";data[192]="Singapore##SG##65";data[193]="Slovakia##SK##421";data[194]="Slovenia##SI##386";data[195]="Solomon Islands##SB##677";data[196]="Somalia##SO##252";data[197]="South Africa##ZA##27";data[198]="South Georgia##GS##995";data[199]="Spain##ES##34";data[200]="Sri Lanka##LK##94";data[201]="Sudan##SD##249";data[202]="Suriname##SR##597";data[203]="Svalbard And Jan Mayen Islands##SJ##47";data[204]="Swaziland##SZ##268";data[205]="Sweden##SE##46";data[206]="Switzerland##CH##41";data[207]="Syria##SY##963";data[208]="Taiwan##TW##886";data[209]="Tajikistan##TJ##992";data[210]="Tanzania##TZ##255";data[211]="Thailand##TH##66";data[212]="The Gambia##GM##220";data[213]="The Netherlands##NL##31";data[214]="Togo##TG##228";data[215]="Tokelau##TK##690";data[216]="Tonga##TO##676";data[217]="Trinidad And Tobago##TT##1-868";data[218]="Tunisia##TN##216";data[219]="Turkey##TR##90";data[220]="Turkmenistan##TM##993";data[221]="Turks And Caicos Islands##TC##1-649";data[222]="Tuvalu##TV##688";data[223]="Uganda##UG##256";data[224]="Ukraine##UA##380";data[225]="United Arab Emirates##AE##971";data[226]="United Kingdom##UK##44";data[227]="United States Minor Outlying I##UM##1";data[228]="United States Of America##US##1";data[229]="Uruguay##UY##598";data[230]="Uzbekistan##UZ##998";data[231]="Vanuatu##VU##678";data[232]="Venezuela##VE##58";data[233]="Vietnam##VN##84";data[234]="Virgin Islands (British)##VG##1-284";data[235]="Virgin Islands (Us)##VI##1-340";data[236]="Wallis And Futuna Islands##WF##681";data[237]="Western Sahara##EH##212";data[238]="Yemen##YE##967";data[239]="Yugoslavia##YU##38";data[240]="Zambia##ZM##260";data[241]="Zimbabwe##ZW##263";function addOptionCall(text,value)
{val=document.callme.S_country_iso.value;var opt=document.createElement("option");opt.text=text;opt.value=value;if(val==value)
{opt.selected=true;}
document.callme.S_country.options.add(opt);}
function populateCall()
{for(var i=0;i<data.length;i++)
{var data1=data[i];var my_array=data1.split("##");if(my_array[1])
{addOptionCall(my_array[0],my_array[1]);}
else
{addOptionCall(my_array[0],'');}}}
function check_count_change_call(form1)
{var val=form1.S_country[form1.S_country.selectedIndex].value;if(val!=form1.S_country_iso.value)
{if(data[form1.S_country.selectedIndex]!='')
{var data1=data[form1.S_country.selectedIndex];var my_array=data1.split("##");if(my_array[2])
{my_arr=my_array[2].split("-");if(my_arr[1])
{form1.S_ccode.value=my_arr[0];form1.S_acode.value=my_arr[1];}
else
{form1.S_ccode.value=my_array[2];}}
else
{form1.S_ccode.value='';}}}
form1.S_country_iso.value=val;}
function check_count_change(form1)
{
var val=form1.country[form1.country.selectedIndex].value;
if(val!=form1.country_iso.value)
{
	if(data[form1.country.selectedIndex]!='')
	{
		var data1=data[form1.country.selectedIndex];
		var my_array=data1.split("##");
		if(my_array[2])
		{
			my_arr=my_array[2].split("-");
			if(my_arr[1])
			{
				form1.ph_country.value=my_arr[0];
				form1.ph_country.value=my_arr[1];
				form1.mob_country.value=my_arr[0];
				form1.mob_country.value=my_arr[1];
			}
			else
			{
				form1.ph_country.value=my_array[2];
				form1.mob_country.value=my_array[2];
			}
		}
		else
		{
			form1.ph_country.value='';
			form1.mob_country.value='';
		}
	}
}
form1.country_iso.value=val;
}
function hideshw(cnt)
{
	if(document.getElementById('dispS'+cnt))
	{
		if(document.getElementById('dispS'+cnt).style.display == 'block')
		document.getElementById('dispS'+cnt).style.display = 'none';
		else
		document.getElementById('dispS'+cnt).style.display = 'block';
	}
	if(document.getElementById('disp'+cnt))
	{	
		if(document.getElementById('disp'+cnt).style.display == 'block')
		document.getElementById('disp'+cnt).style.display = 'none';
		else
		document.getElementById('disp'+cnt).style.display = 'block';
	}
}
function check_advanced_search(flag) { var str=''; if(flag == 1) { form1 = document.quick_find; } 
else { form1 = document.quick_find1; } form1.ss.value = form1.ss.value.replace(/^\s+/g, '').replace(/\s+$/g, ''); while(form1.ss.value.indexOf('  ')>0) { form1.ss.value = form1.ss.value.replace('  ',' ');	} form1.ss.value = form1.ss.value.replace(/[^a-zA-Z0-9+ ]/g, ' '); var temp=form1.ss.value.replace(/\s/g, ''); if (form1.ss.value.length < 3) { alert("Enter at least three characters for search."); form1.ss.focus(); return false; } else { var a = form1.ss.value.replace(/\+/g, ' '); a = a.replace(/\s+/g, '+'); str +='ss='+a; str = "http://www.hellotrade.com/cgi-bin/buyer-search-test.cgi?"+str; str = myReplace(str,"\\\\?\\\\&","?"); window.location = str; return false; } }

var Imgs=[];
function ImgLoad(cls) 
{ 
var as=zxcByClassName(cls); for (var z0=0;z0<as.length;z0++) { if (as[z0].getAttribute('rel')&&as[z0].getElementsByTagName('IMG')[0]) { oop=new Fade(as[z0].getElementsByTagName('IMG')[0],as[z0].getAttribute('rel')); Imgs.push(oop); } } CkTop();
}
function Fade(img,src){ this.img=img; this.src=src; this.opc=0; }
Fade.prototype.fade=function(){ if (this.opc==0) this.img.src=this.src; var oop=this; }
function CkTop(){ for (var z0=0;z0<Imgs.length;z0++){ if (zxcPos(Imgs[z0].img)[1]<zxcWWHS()[1]+zxcWWHS()[3]&&Imgs[z0].opc==0){ Imgs[z0].fade(); Imgs.splice(z0,1); z0--; } } }
function zxcWWHS(){ if (window.innerHeight) return [window.innerWidth-10,window.innerHeight-10,window.pageXOffset,window.pageYOffset]; else if (document.documentElement.clientHeight) return [document.documentElement.clientWidth-10,document.documentElement.clientHeight-10,document.documentElement.scrollLeft,document.documentElement.scrollTop]; return [document.body.clientWidth,document.body.clientHeight,document.body.scrollLeft,document.body.scrollTop]; }
function zxcPos(obj){ var rtn=[0,0]; while(obj){ rtn[0]+=obj.offsetLeft; rtn[1]+=obj.offsetTop; obj=obj.offsetParent; } return rtn; }
function zxcByClassName(nme,el,tag) { if (typeof(el)=='string') el=document.getElementById(el); el=el||document; ary=[]; if(nme != 'undefined') { for (var tag=tag||'*',reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName(tag),z0=0; z0<els.length;z0++) { if(reg.test(els[z0].className)) ary.push(els[z0]); } } return ary; }
window.onscroll=CkTop;
window.onload=function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  };

// CODE ADDED BY MONIKA
// ==========================================================
function loadframe()
{
	var a=Get_Cookie('srch_str');	
	var parts='';
	var coniso=''; 
	var pd='';
	var lc='';
	var lt='';
	var ihtml='';
	var ihtml1='';
	var ihtml2='';
	var ihtml3='';
	var cnt=0;
	var td_cnt=0;
	document.getElementById("country_iso").value='';
	document.getElementById("hposting_date").value='';
	document.getElementById("hlead_cost").value='';
	document.getElementById("hlead_type").value='';
     	if(a && a !='')
	{
		parts=a.split("|");
		coniso=parts[0].split("-");
		pd=parts[1];
		lc=parts[2];
		lt=parts[3];
		if (coniso && coniso!= '')
		{
			document.getElementById("country_iso").value=parts[0];
			for(var j=0;j<coniso.length-1;j++)
			{
				for(var i=0;i<con_arr.length;i++)
				{
					var ciso=con_arr[i].split('##')[0];
					var cname=con_arr[i].split('##')[1];
					if(ciso == coniso[j])
					{
						con_arr.splice(con_arr.indexOf_ie(con_arr[i]), 1);
						break;
					}
				}
				ihtml=ihtml+"<span class=\"ftx\" id='"+ciso+"'>"+cname+"<b id=\""+ciso+"#\" class=\"x\" onclick=\"my_search('"+ciso+"','D','country_iso')\">X</b></span>";
			}
			document.getElementById('myfilter').style.display="block";
			document.getElementById('sel_option').innerHTML=ihtml;
			document.getElementById('bob1').style.display="block";
			document.getElementById('bob1s').innerHTML='-';
		}
		if(pd)
		{
			var p=((pd =="PHA")?'Past Hour':(pd=="24H")?'Last Day':(pd=="W")?'Last Week':'Older');
			document.getElementById("hposting_date").value=parts[1];
			document.getElementById(pd+"-").innerHTML='';
			document.getElementById(pd+"^").innerHTML=p;
			document.getElementById(pd+"^").style.color="rgb(255, 0, 0)";
			ihtml=ihtml+"<span class=\"ftx\" id='"+pd+"'>"+p+"<b id=\""+pd+"#\" class=\"x\" onclick=\"my_search('"+pd+"','D','hposting_date')\">X</b></span>";
			document.getElementById('myfilter').style.display="block";
			document.getElementById('sel_option').innerHTML=ihtml;
			document.getElementById('bob2').style.display="block";
			document.getElementById('bob2s').innerHTML='-';
		}
		if(lc)
		{

			var l=((lc=="0-3")?'Less Than $3':(lc=="3-5")?'$3-$5':(lc=="5-10")?'$5-$10':'>$10');
			document.getElementById("hlead_cost").value=parts[2];
			document.getElementById(lc+"-").innerHTML='';
			document.getElementById(lc+"^").innerHTML=l;
			document.getElementById(lc+"^").style.color="rgb(255, 0, 0)";
			ihtml=ihtml+"<span class=\"ftx\" id='"+lc+"'>"+l+"<b id=\""+lc+"#\" class=\"x\" onclick=\"my_search('"+lc+"','D','hlead_cost')\">X</b></span>";
			document.getElementById('myfilter').style.display="block";
			document.getElementById('sel_option').innerHTML=ihtml;
			document.getElementById('bob3').style.display="block";
			document.getElementById('bob3s').innerHTML='-';
		}
		if(lt)
		{
			var ltt=((lt=="All")?'All':(lt=="V")?'Verified':'Verified & Updated');
			document.getElementById("hlead_type").value=parts[3];
			document.getElementById(lt+"-").innerHTML=''; 
			document.getElementById(lt+"^").innerHTML=ltt;
			document.getElementById(lt+"^").style.color="rgb(255, 0, 0)";
			ihtml=ihtml+"<span class=\"ftx\" id='"+lt+"'>"+ltt+"<b id=\""+lt+"#\" class=\"x\" onclick=\"my_search('"+lt+"','D','hlead_type')\">X</b></span>";
			document.getElementById('myfilter').style.display="block";
			document.getElementById('sel_option').innerHTML=ihtml;
			document.getElementById('bob4').style.display="block";
			document.getElementById('bob4s').innerHTML='-';
		}
	}
	for(var i=0;i<(con_arr.length-coniso.length);i++)
	{
		cnt=cnt+1;
		var ciso=con_arr[i].split('##')[0];
		var cname=con_arr[i].split('##')[1];
		
		if(cnt < 6)
		{
		
			ihtml1=ihtml1+"<div id='"+ciso+"' class=\"c1\"><div id=\""+ciso+"-\" style=\"float:right;display:none; \"><img id=\""+ciso+"#\" src=\"/images/load_img3.gif\"/></div><input id=\""+ciso+"_i\" type=\"checkbox\" onclick=\"my_search('"+ciso+"','A','country_iso','"+cname+"');\" \><label for=\""+ciso+"_i\" >&nbsp;"+cname+"</label></div>";
		}
		else
		{
			td_cnt=td_cnt+1;
			ihtml2=ihtml2+"<td width=\"17%\" align=\"left\"><nobr><div id=\""+ciso+"-\" style=\"float:right;display:none; \"><img id=\""+ciso+"#\" src=\"/images/load_img3.gif\"/></div>"+"<input type=\"checkbox\" onclick=\"my_search('"+ciso+"','A','country_iso','"+cname+"');\" \>"+cname+"</nobr></td>";
			if(td_cnt%4 == 0 || cnt == con_arr.length-coniso.length)
			{
				ihtml3=ihtml3+"<tr>"+ihtml2+"</tr>";
				ihtml2='';
			}
		}
	}
	document.getElementById("loadcountry").innerHTML=ihtml1;
	document.getElementById("fr-country-id").innerHTML='<table cellpadding="0" cellspacing="2px" width="100%" border="0">'+ihtml3+'</table>';
	eraseCookie('srch_str','');
}
function Get_Cookie( check_name ) 
{
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false;
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		a_temp_cookie = a_all_cookies[i].split( '=' );
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}
function my_search(val,option,hdn,srch_val)
{
	if(option=='A')
	{
		if(hdn=='country_iso')
		{
			document.getElementById(hdn).value+=val+"-";
		}
		else
		{
			document.getElementById(hdn).value=val;
		}
		document.getElementById(val+"-").style.display='block';
		var Srchflt=((hdn=="country_iso")?'By Country':(hdn=="hposting_date")?'By Date':(hdn=="hlead_cost")?'Lead Cost':'Lead Type');
		_gaq.push(['_trackEvent', 'Buyer_Filter', Srchflt,srch_val]);
	}
	else
	{
		if(hdn=='country_iso')
		{
			var new_iso=(document.getElementById(hdn).value).replace(val+"-","");
			document.getElementById(hdn).value=new_iso;
		}
		else
		{
			document.getElementById(hdn).value="";
		}
	}
	set_cookie('srch_str');
}
function showObject(id) 
{
	document.getElementById(id).style.display='block';
}
var hideflag = false;
function hideObject(id,flag)
{
	if(flag){
		if (hideflag == false && document.getElementById(id).style.display == "block")
		{
			document.getElementById(id).style.display='none';
		}
	}
	else{
		document.getElementById(id).style.display='none';
	}
}
function set_cookie(name,hostt)
{
	var host=window.location.hostname;
	var mystr="http://"+host+"/business/"+hostt+"/buyers/";var str=document.URL;
	var main_value=[];	
	main_value=document.getElementById("country_iso").value+"|"+document.getElementById("hposting_date").value+"|"+document.getElementById("hlead_cost").value+"|"+document.getElementById("hlead_type").value;
	if(main_value.length>0)
	{
		document.cookie=name+"="+main_value+";path=/;";
	}
	if(hostt)
	{
		window.location.href=mystr;
	}
	else
	{
		window.location.href=str;
	}
}

function showhide(div_id)
{
	var val=document.getElementById(div_id+'s').innerHTML;
	document.getElementById(div_id).style.display = (val=='+')?"block":"none";
	document.getElementById(div_id+'s').innerHTML=(val=='+')?"- ":"+";
}
Array.prototype.indexOf_ie = function(obj, start) {
     for (var i = (start || 0), j = this.length; i < j; i++) {
         if (this[i] === obj) { return i; }
     }
     return -1;
}
function EventTrack(Lead_cnt)
{
	_gaq.push(['_trackEvent', 'Buy_Lead',Lead_cnt]);
}
