function show_searchtip_form(e,component,companyid,lang)
{
		hideall_div();
	var companyurl="/display_forms.php?component="+component+"&companyid="+companyid+"&lang1="+lang+"&rand="+Math.random();
	
	var posi=new Array();
		posi=trackClick(e);
		
		tracexy22(posi,"div_searchtip",lang);
		
	http22 = new getHTTPObject();
	var return_str;
	if (http22) 
	{
		http22.open("GET", companyurl, true);
		http22.send(null);
		http22.onreadystatechange = disp_searchtip;
		/*if(http22.readyState == 1)
		{
			return_str=http22.responseText;
  		}*/
	}
}
function disp_searchtip(e)
{
	if(http22.readyState == 4)
	{
		var return_str=http22.responseText;
     	document.getElementById("div_searchtip").innerHTML=return_str;
		//drag_div("drag_fav");
	}
}
function show_fav_form(e,component,companyid,directoryid,lang)
{
		hideall_div();
	var companyurl="/display_forms.php?component="+component+"&companyid="+companyid+"&lang1="+lang+"&rand="+Math.random();
	
	var posi=new Array();
		posi=trackClick(e);
		
		tracexy22(posi,"div_fav",lang);
		
	http22 = new getHTTPObject();
	var return_str;
	if (http22) 
	{
		http22.open("GET", companyurl, true);
		http22.send(null);
		http22.onreadystatechange = disp_fav;
		/*if(http22.readyState == 1)
		{
			return_str=http22.responseText;
  		}*/
	}
}
function disp_fav(e)
{
	if(http22.readyState == 4)
	{
		var return_str=http22.responseText;
     	document.getElementById("div_fav").innerHTML=return_str;
		//drag_div("drag_fav");
	}
}
function tracexy22(posi,divname,lang)
{

var scrwidth=screen.width;
if(scrwidth==800)
{
var emptySpace=scrwidth-984;
var tabStart=emptySpace/2;
var popupPos=tabStart+250+8;
}
else
{
var emptySpace=scrwidth-984;
var tabStart=emptySpace/2;
var popupPos=tabStart+195+8;
}
if(lang=="ar")
{
		document.getElementById(divname).style.display="block";
		document.getElementById(divname).style.right=popupPos+"px";
		//document.getElementById(divname).style.right="25%";
		document.getElementById(divname).style.top="225x";
}
else
{
		document.getElementById(divname).style.display="block";
		document.getElementById(divname).style.left=popupPos+"px";
		//document.getElementById(divname).style.left="25%";
		document.getElementById(divname).style.top="225px";
}
}














function trackClick(e) {
	var posi = new Array();
	var posx = 0;
	var posy = 0;
	//if (arguments.length == 0) e = event;
	/*if(navigator.appName.indexOf("Internet Explorer") != -1)
	{
		e=event;
	}
	else
	{
		e=window.event;
	}*/
	if (document.layers)
	{
		posi[0]=e.pageX;
		posi[1]=e.pageY;
	}
	else
	{
		if(navigator.appName=="Microsoft Internet Explorer")
		{
			/*posi[0]=e.screenX+document.body.scrollLeft;
			posi[1]=e.screenX+document.body.scrollTop;*/
			//posi[0]= e.clientX + document.body.scrollLeft
			//+ document.documentElement.scrollLeft;
			posi[0]=170+document.body.scrollLeft;
			posi[1]=e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
		}
		else
		{
			posi[0]=180+document.body.scrollLeft;
			posi[1]=e.layerY+document.body.scrollTop;
		}
	}
	//alert(posi[0]);
	return posi;
}

function hide_div_by_id(divid)
{
	document.getElementById(divid).style.display="none";	
}
function hide_sms_div(div_name)
{
	//alert("test");
	document.getElementById("div_brands").style.display="none";
	document.getElementById("div_searchtip").style.display="none";
	document.getElementById("div_branches").style.display="none";
	document.getElementById("div_profile").style.display="none";
	document.getElementById("div_photo").style.display="none";
	document.getElementById("div_video").style.display="none";
	document.getElementById("div_ad").style.display="none";
	document.getElementById("div_card").style.display="none";
	document.getElementById("div_map").style.display="none";
	document.getElementById("div_sms").style.display="none";
	<!--document.getElementById("success").style.visibility="hidden";-->
	//document.getElementById("emailsuccess").style.visibility="hidden";-->
	document.getElementById("div_email").style.display="none";
	document.getElementById("div_emailfriend").style.display="none";
	document.getElementById("div_fav").style.display="none";
	if(div_name=="div_more_categories")
	{
	document.getElementById("div_more_categories").style.display="none";
	}
	document.getElementById("div_category_index").style.display="none";
}

function hideall_div()
{
	document.getElementById("div_fav").style.display="none";
	document.getElementById("div_brands").style.display="none";
	document.getElementById("div_branches").style.display="none";
	document.getElementById("div_profile").style.display="none";
	document.getElementById("div_photo").style.display="none";
	document.getElementById("div_video").style.display="none";
	document.getElementById("div_ad").style.display="none";
	document.getElementById("div_card").style.display="none";
	document.getElementById("div_map").style.display="none";
	document.getElementById("div_sms").style.display="none";
	<!--document.getElementById("success").style.visibility="hidden";-->
	//document.getElementById("emailsuccess").style.visibility="hidden";-->
	document.getElementById("div_email").style.display="none";
	document.getElementById("div_emailfriend").style.display="none";
}


function handlersendsmsHttpResponse()
{
	if(http.readyState == 4)
	{
		var return_str=http.responseText;
     	document.getElementById("div_brands").innerHTML=return_str;
	}
}


function currconv(e,component,companyid,directoryid,lang,servicecode,msgformail,categoryid)
{
	hideall_div();

var loading_form='<div class="banktop3" id="cuconvert" style="width:551px; display:table;"><div class="bkibdr1" style="width:549px; background:url(images/currency-converter-bg.gif) repeat-x;"><div class="popttle" style="background:none;"><div class="ttletxt">Currency Converter</div><div class="ttleicon"><a style="cursor:hand;" onclick=document.getElementById("cuconvert").style.display="none";><img src="images/popup-close-button.gif" width="19" height="17" border="0" /></a></div></div><div class="popupbg" style="width:536px;";><iframe src="currency-converter.php" width="538" height="245" scrolling="auto" frameborder="0" style="border:0; padding:0; margin:0;"></iframe></div></div></div>';



document.getElementById("div_card").innerHTML=loading_form;
	//var companyurl="/display_forms.php?component="+component+"&companyid="+companyid+"&directoryid="+directoryid+"&lang1="+lang+"&service_code="+servicecode+"&category_id="+categoryid+"&rand="+Math.random();
	var posi=new Array();
		posi=trackClick(e);
		
		tracexy22(posi,"div_card",lang);
	
}

function disp_card()
{
	if(http15.readyState == 4)
	{
		var return_str=http15.responseText;
     	document.getElementById("div_card").innerHTML=return_str;
		//drag_div("drag_card");
	}
}














function show_enquiry_result(e,component,companyid,directoryid,lang,servicecode,msgformail,categoryid)
{
	hideall_div();
//	document.getElementById("pan123").style.display="none";
//	var loading_form='<table width="400" border="0"  cellpadding="0" cellspacing="0"  style="border:1px solid #584300; margin-right:8px;" class="main1">';


var loading_form='<div class="banktop3" id="bankenqry"><div class="bkibdr1"><div class="popttle"><div class="bkicn1"><img src="images/bank-enquiry-icon.gif" width="17" height="17" /></div><div class="bkicntxt1">Enquiry</div><div class="ttleicon"><a style="cursor:hand;" onclick=document.getElementById("bankenqry").style.display="none";><img src="images/popup-close-button.gif" width="19" height="17" border="0" /></a></div></div><div class="epbdrbtm"></div><div class="bksnbr"><div class="bkcld"><div class="bksclft"><b>Sections</b></div><div class="bkscrgt"><b>Numbers</b></div></div><div class="bkcll"><div class="bksclft">Toll-free</div><div class="bkscrgt">12345678910</div></div><div class="bkcld"><div class="bksclft">Head Office</div><div class="bkscrgt">12345678910</div></div><div class="bkcll"><div class="bksclft">Loans</div><div class="bkscrgt">12345678910</div></div><div class="bkcld"><div class="bksclft">Cards</div><div class="bkscrgt">12345678910</div></div><div class="bkcll"><div class="bksclft">Investments</div><div class="bkscrgt">12345678910</div></div></div><div class="space10"></div></div></div>';


document.getElementById("div_card").innerHTML=loading_form;
	//var companyurl="/display_forms.php?component="+component+"&companyid="+companyid+"&directoryid="+directoryid+"&lang1="+lang+"&service_code="+servicecode+"&category_id="+categoryid+"&rand="+Math.random();
	var posi=new Array();
		posi=trackClick(e);
		
		tracexy22(posi,"div_card",lang);

}

function disp_enquiry()
{
	if(http30.readyState == 4)
	{
		var return_str=http30.responseText;
     	document.getElementById("div_card").innerHTML=return_str;
		//drag_div("drag_card");
	}
}
































function show_sms_form(e,component,companyid,lang,servicecode)
{
	hideall_div();
		var companyurl="/display_forms.php?component="+component+"&companyid="+companyid+"&lang1="+lang+"&service_code="+servicecode+"&rand="+Math.random();
		var posi=new Array();
		posi=trackClick(e);
		
		tracexy22(posi,"div_sms",lang);
	
}
function disp_sms()
{
	if(http10.readyState == 4)
	{
		var return_str=http10.responseText;
     	document.getElementById("div_sms").innerHTML=return_str;
		//drag_div("drag_sms");
	}
}
function validatemobile(frm,mobilepop,validmobilepop,validdigitmobilepop,validdigitstartpop,msgpaid,msgformail)
{
	if(frm.mobile_no.value=="")
	{
		//alert("Please enter your mobile number.");
		alert(mobilepop);
		frm.mobile_no.focus();
		return false;
	}
	if(isNaN(frm.mobile_no.value))
	{
		//alert("Please enter a valid mobile number.");
		alert(validmobilepop);
		frm.mobile_no.focus();
		return false;
	}
	if (frm.mobile_no.value.length < 10 )
	{
		//alert ("Please enter 10 digit Mobile number.");
		alert(validdigitmobilepop);
		frm.mobile_no.focus();
		return false;	
	}
	if (frm.mobile_no.value.length > 10 )
	{
		//alert ("Please enter a valid mobile number.");
		alert(validmobilepop);
		frm.mobile_no.focus();
		return false;	
	}
	if((frm.mobile_no.value).substr(0,1)!="9")
	{
		//alert ("Mobile number starts with '9' only.");
		alert(validdigitstartpop);
		frm.mobile_no.focus();
		return false;
	}
	if(frm.mess.value =="")
	{
		//alert ("Please Enter Message.");
		alert(msgpaid);
		frm.mess.focus();
		return false;
	}
	send_sms(frm.mobile_no.value,frm.component.value,frm.comp_id.value,msgformail);
	return false;
}

function send_sms(mobile_num,component,companyid,msgformail)
{
	var loading_form='<img src="/includes/english/images/loading.gif" height="32" width="32" /><br /><font class="mediumtxt">'+msgformail+'</font>';
	
	document.getElementById("smssuccess").innerHTML=loading_form;
	//hideall_div();
		
		var companyurl="/mailing.php?component="+component+"&companyid="+companyid+"&mobile_no="+mobile_num;
	http11 = new getHTTPObject();
	var return_str;
	if (http11) 
	{
		http11.open("GET", companyurl, true);
		http11.send(null);
		http11.onreadystatechange = displaySuccess;
		/*if(http11.readyState == 1)
		{
			return_str=http11.responseText;
  		}*/
	}
}
function displaySuccess()
{
	if(http11.readyState == 4)
	{
		var return_str=http11.responseText;
     	document.getElementById("smssuccess").innerHTML=return_str;
	}
}

function show_email_form(e,component,companyid,lang,servicecode,categoryid,directoryid)
{
	hideall_div();
	var companyurl="/display_forms.php?component="+component+"&companyid="+companyid+"&lang1="+lang+"&service_code="+servicecode+"&category_id="+categoryid+"&directory_id="+directoryid+"&rand="+Math.random();
	var posi=new Array();
		posi=trackClick(e);
		
		tracexy22(posi,"div_email",lang);
	http6 = new getHTTPObject();
	var return_str;
	if (http6) 
	{
		http6.open("GET", companyurl, true);
		http6.send(null);
		http6.onreadystatechange = disp_email;
		/*if(http6.readyState == 1)
		{
			return_str=http6.responseText;
  		}*/
	}
}
function disp_email()
{
	if(http6.readyState == 4)
	{
		var return_str=http6.responseText;
     	document.getElementById("div_email").innerHTML=return_str;
		//drag_div("drag_email");
	}
}


function validateemail(frm,fullnamepaid,emailpaid,validemailpaid,subjectpaid,msgpaid,msgformail)
	{
	/*if(frm.fullname.value=="")
	{
		//alert("Please enter Full Name.");
		alert(fullnamepaid);
		frm.fullname.focus();
		return false;
	}*/
	if(frm.address.value=="")
	{
		//alert("Please enter E-mail Address.");
		alert(emailpaid);
		frm.address.focus();
		return false;
	}
	var youraddress=cemail(frm.address.value);
	if(youraddress==false)
	{
		//alert("Please enter valid E-mail Address");
		alert(validemailpaid);
		frm.address.focus();
		return false;
	}
	/*if(frm.subject.value=="")
	{
		//alert("Please enter Subject.");
		alert(subjectpaid);
		frm.subject.focus();
		return false;
	}*/
	if(frm.mess.value == "")
	{
		//alert("Please enter Message.");
		alert(msgpaid);
		frm.mess.focus();
		return false;
	}
	send_email(frm.emailid.value,frm.company_name.value,frm.fullname.value,frm.address.value,frm.subject.value,frm.component.value,frm.companyid.value,frm.mess.value,msgformail);
	}
function send_email(emailid,companyname,fullname,address,subject,component,companyid,mess,msgformail)
{
	var loading_form='<img src="/includes/english/images/loading.gif" height="32" width="32" /><br /><font style="font-family:tahoma; color:#eca800; font-size:12px; font-weight:bold;">'+msgformail+'</font>';
	
	document.getElementById("emailsuccess").innerHTML=loading_form;
	
	//hideall_div();
		var companyurl="/mailing.php?component="+component+"&emailid="+emailid+"&companyid="+companyid+"&fullname="+fullname+"&address="+address+"&subject="+subject+"&companyname="+companyname+"&mess="+mess;
		//alert(companyurl);

	http12 = new getHTTPObject();
	var return_str;
	if (http12) 
	{
		http12.open("GET", companyurl, true);
		http12.send(null);
		http12.onreadystatechange = displaySuccess1;
		/*if(http12.readyState == 1)
		{
			return_str=http12.responseText;
  		}*/
	}
	return false;
}
function displaySuccess1()
{

	if(http12.readyState == 4)
	{
		var return_str=http12.responseText;
		document.getElementById("test").style.display="none";
    	document.getElementById("emailsuccess").innerHTML=return_str;
	}
}

/* e-mail to friend */

function show_emailtofriend_form(e,component,companyid,lang)
{
	hideall_div();
//	var companyurl="/display_forms.php?component="+component+"&companyid="+companyid+"&lang1="+lang+"&rand="+Math.random();
	var posi=new Array();
		posi=trackClick(e);
		
		tracexy22(posi,"div_emailfriend",lang);
	http20 = new getHTTPObject();
	var return_str;
	if (http20) 
	{
		http20.open("GET", companyurl, true);
		http20.send(null);
		http20.onreadystatechange = disp_email6;
		/*if(http20.readyState == 1)
		{
			return_str=http20.responseText;
  		}*/
	}
}
function disp_email6()
{
	if(http20.readyState == 4)
	{
		var return_str=http20.responseText;
     	document.getElementById("div_emailfriend").innerHTML=return_str;
		//drag_div("drag_emailfrnd");
	}
}

function cemail(val)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(val))
{
return (true)
}
return false;
}

function validateemailfriend(frm,yournamepop,youremailpop,friendnamepop,friendemailpop,validemailpaid,subjectpaid,msgpaid,msgformail)
	{
		//alert(msgformail);
	if(frm.existid.value == "") 
	{
		/*if(frm.yourname.value=="")
		{
			//alert("Please enter Your Name.");
			alert(yournamepop);
			frm.yourname.focus();
			return false;
		}*/
		if(frm.youremail.value=="")
		{
			//alert("Please enter Your E-mail Address.");
			alert(youremailpop);
			frm.youremail.focus();
			return false;
		}
		var youremailid=cemail(frm.youremail.value);
		if(youremailid==false)
		{
		//alert("Please enter valid E-mail Address");
		alert(validemailpaid);
		frm.youremail.focus();
		return false;
		}
	}
	/*if(frm.friendname.value=="")
	{
		//alert("Please enter Friend Name.");
		alert(friendnamepop);
		frm.friendname.focus();
		return false;
	}*/
	if(frm.friendemail.value=="")
	{
		//alert("Please enter Friend E-mail Address.");
		alert(friendemailpop);
		frm.friendemail.focus();
		return false;
	}
	var friendemailid=cemail(frm.friendemail.value);
	if(friendemailid==false)
	{
	//alert("Please enter valid E-mail ID");
	alert(validemailpaid);
	frm.friendemail.focus();
	return false;
	}
	if(frm.subject.value=="")
	{
		//alert("Please enter Subject.");
		alert(subjectpaid);
		frm.subject.focus();
		return false;
	}
	/*if(frm.mess.value == "")
	{
		//alert("Please enter Message.");
		alert(msgpaid);
		frm.mess.focus();
		return false;
	}*/
	//send_email(frm.emailid.value,frm.company_name.value,frm.fullname.value,frm.address.value,frm.subject.value,frm.component.value,frm.companyid.value,frm.mess.value);
	send_email1(frm.yourname.value,frm.youremail.value,frm.friendname.value,frm.friendemail.value,frm.subject.value,frm.mess.value,frm.component.value,frm.companyid.value,frm.company_name.value,msgformail);
	}
function send_email1(yourname,youremail,friendname,friendemail,subject,mess,component,companyid,company_name,msgformail)
{
	//alert(msgformail);
	var loading_form='<img src="/includes/english/images/loading.gif" height="32" width="32" /><br /><font style="font-family:tahoma; color:#eca800; font-size:12px; font-weight:bold;">'+msgformail+'</font>';
	
	document.getElementById("emailsuccess1").innerHTML=loading_form;
	
	//hideall_div();
		var companyurl="/mailing.php?component="+component+"&companyid="+companyid+"&yourname="+yourname+"&youremail="+youremail+"&friendname="+friendname+"&friendemail="+friendemail+"&subject="+subject+"&companyname="+company_name+"&mess="+mess;

	http21 = new getHTTPObject();
	var return_str;
	if (http21) 
	{
		
		http21.open("GET", companyurl, true);
		http21.send(null);
		http21.onreadystatechange = displaySuccess2;
		/*if(http21.readyState == 1)
		{
			return_str=http21.responseText;
  		}*/
	}
	return false;
}
function displaySuccess2()
{

	if(http21.readyState == 4)
	{
		var return_str=http21.responseText;
		document.getElementById("test").style.display="none";
    	document.getElementById("emailsuccess1").innerHTML=return_str;
	}
}

function getHTTPObject()
{
	var xmlhttp;
	try
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		try 
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	
		}
		catch (E)
		{
			xmlhttp = false;
		}
	
	}
	
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		try
		{
			xmlhttp = new XMLHttpRequest();
		}
		catch (e)
		{
			xmlhttp = false;
		}
	}
	
	return xmlhttp;
}
//preloader starts

function showBranches(k,j)
{
	//j++;
	
	for(l=0;l<j;l++)
	{
		//divid=eval("shop"+l);
		//if(l!=k)
		//{
			document.getElementById("brnch-"+l).style.display="none";
			document.getElementById("img_more"+l).style.display="block";
			document.getElementById("img_minus"+l).style.display="none";
		//}
	}
	//divid=eval("shop"+k);
	document.getElementById("brnch-"+k).style.display="block";
	document.getElementById("img_more"+k).style.display="none";
	document.getElementById("img_minus"+k).style.display="block";
}
function hideBranches(k)
{
	//alert(k);
	document.getElementById("brnch-"+k).style.display="none";
	document.getElementById("img_more"+k).style.display="block";
	document.getElementById("img_minus"+k).style.display="none";
}
function showPhotos(k,j)
{
	//j++;
	
		for(l=0;l<j;l++)
		{
			//divid=eval("shop"+l);
			//if(l!=k)
			//{
				document.getElementById("photo-"+l).style.display="none";
				document.getElementById("pht_more"+l).style.display="block";
				document.getElementById("pht_minus"+l).style.display="none";
			//}
		}
	
	//divid=eval("shop"+k);
	document.getElementById("photo-"+k).style.display="block";
	document.getElementById("pht_more"+k).style.display="none";
	document.getElementById("pht_minus"+k).style.display="block";
}
function hidePhotos(k)
{
	document.getElementById("photo-"+k).style.display="none";
	document.getElementById("pht_more"+k).style.display="block";
	document.getElementById("pht_minus"+k).style.display="none";
}
function showVideos(k,j)
{
	//j++;
	
		for(l=0;l<j;l++)
		{
			//divid=eval("shop"+l);
			//if(l!=k)
			//{
				document.getElementById("video-"+l).style.display="none";
				document.getElementById("img_vid_more"+l).style.display="block";
				document.getElementById("img_vid_minus"+l).style.display="none";
			//}
		}
	
	//divid=eval("shop"+k);
	document.getElementById("video-"+k).style.display="block";
	document.getElementById("img_vid_more"+k).style.display="none";
	document.getElementById("img_vid_minus"+k).style.display="block";
}
function hidevideos(k)
{
	document.getElementById("video-"+k).style.display="none";
	document.getElementById("img_vid_more"+k).style.display="block";
	document.getElementById("img_vid_minus"+k).style.display="none";
}
function showPrintedAds(k,j)
{
	//j++;

	
		for(l=0;l<j;l++)
		{
			
			//divid=eval("shop"+l);
			//if(l!=k)
			//{
				document.getElementById("printedad-"+l).style.display="none";
				document.getElementById("img_more"+l).style.display="block";
				document.getElementById("img_minus"+l).style.display="none";
			//}
			
		}
	
	//divid=eval("shop"+k);
	document.getElementById("printedad-"+k).style.display="block";
	document.getElementById("img_more"+k).style.display="none";
	document.getElementById("img_minus"+k).style.display="block";
	
}
function hidePrintedAds(k)
{
	document.getElementById("printedad-"+k).style.display="none";
	document.getElementById("img_more"+k).style.display="block";
	document.getElementById("img_minus"+k).style.display="none";
}