var ipcall=0;
function findloc()
{
	loc=location.href;
	loc=loc.toLowerCase();
	loc=loc.substring(0,(loc.indexOf('.com/')))
	dm=loc.substring(loc.indexOf('.'),loc.length)
	dm=dm+".com"
	return dm
}
function setCookie(c_name,value) {document.cookie = c_name + "=" + escape(value)+";DOMAIN="+findloc()+";PATH=/";}

function hp_phone()
{
	ipcall++;	
	var ban_country=GetCookie("USERCNTRY");
	var t;	
	if(ban_country!=null)
	{
		if(ban_country == 98)
		{ // banner for india			
			if (document.getElementById('tollnum')) { document.getElementById('tollnum').innerHTML="1800-300-35483 (ELITE)<span style='padding-left:5px; font-size:16px; font-weight:bold;'>6AM to 11PM IST</span>"; }
			if (document.getElementById('toptollnum')) { document.getElementById('toptollnum').innerHTML="1800-300-35483 (ELITE)<br/><span style='padding-left:125px;'>6AM to 11PM IST</span>"; }
		}
		else if ((ban_country == 220) || (ban_country == 17) || (ban_country == 55) || (ban_country == 63) || (ban_country == 100) || (ban_country == 101) || (ban_country == 103) || (ban_country == 108) || (ban_country == 114) || (ban_country == 118) || (ban_country == 161) || (ban_country == 173) || (ban_country == 185) || (ban_country == 204) || (ban_country == 214))
		{	// banner for uae
			if (document.getElementById('tollnum')) { document.getElementById('tollnum').innerHTML="971557200444"; }
			if (document.getElementById('toptollnum')) { document.getElementById('toptollnum').innerHTML="971557200444"; }
		}
		else if (ban_country == 221)
		{	// banner for uk
			if (document.getElementById('tollnum')) { document.getElementById('tollnum').innerHTML="8081683096"; }
			if (document.getElementById('toptollnum')) { document.getElementById('toptollnum').innerHTML="8081683096"; }
		}
		else if ((ban_country==2)||(ban_country==5 )||(ban_country==14)||(ban_country==20)||(ban_country==21)||(ban_country==27)||(ban_country==34)||(ban_country==53)||(ban_country==56)||(ban_country==57)||(ban_country==67)|| (ban_country==72)||(ban_country==73)||(ban_country==80)||(ban_country==83)||(ban_country==96) || (ban_country==97)||(ban_country==102)||(ban_country==104)||(ban_country==117)||(ban_country==122)||(ban_country==124)||(ban_country==125)||(ban_country==132)||(ban_country==140)||(ban_country==141)||(ban_country==150)|| (ban_country==170)||(ban_country==171)||(ban_country==175)||(ban_country==176)||(ban_country==183) || (ban_country==190)||(ban_country==191)||(ban_country==194)||(ban_country==202)||(ban_country==203)||(ban_country==214)||(ban_country==219))
		{	// banner for euro
			if (document.getElementById('tollnum')) { document.getElementById('tollnum').innerHTML="8081683096"; }
			if (document.getElementById('toptollnum')) { document.getElementById('toptollnum').innerHTML="8081683096"; }
		}
		else
		{ // for other countries
			if (document.getElementById('tollnum')) { document.getElementById('tollnum').innerHTML="8668076684"; }
			if (document.getElementById('toptollnum')) { document.getElementById('toptollnum').innerHTML="8668076684"; }
		}
		clearInterval(t);
	}
	else{
		if(ipcall<=5){ 
			t=setTimeout("hp_phone()",1000); 
		}else{			
			clearTimeout(t);
			if (document.getElementById('tollnum')) { document.getElementById('tollnum').innerHTML="1800-300-35483 (ELITE)"; }
		}
	}	
}


function GetCookie(name) {
var cname = name + "=";
var dc = document.cookie;
	if (dc.length > 0)
	{ 
		begin = parseInt(dc.indexOf(cname));
		if (begin >= 0)
		{
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
			return unescape(dc.substring(begin, end));
		}
	}
return null;
}
