// .....................Lightbox main coding...................

function getPageScroll(){
	var yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}
function getPageSize(){
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function getXMLHTTP()
{	var xmlhttp=true; try { xmlhttp=new XMLHttpRequest(); }
	catch(e) { try { xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); }
	catch(e) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; }
	} } return xmlhttp; }

function browser_support() {
	xmlHttp=getXMLHTTP(); if (xmlHttp==null) { alert("Your browser does not support AJAX!"); return; } }

function getXmlHttpRequestObject() {
   if (window.XMLHttpRequest) { return new XMLHttpRequest();
   } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); //IE
   } else {  alert("Your browser doesn't support the XmlHttpRequest object."); }
   } var receiveReq = getXmlHttpRequestObject();
/*----------------State and city load Function----------------*/
function getLocation(str,country,state,txt,page,action,preload){
   if(action == 'city') {
	 strTrim = str.replace(/^(\s*)/g,""); 
	 if(strTrim!="") { document.getElementById(preload).style.display ='block'; }
   	  var stateId = document.getElementById(state).value; var countryId = document.getElementById(country).value;
   	  var strURL="templates/findCity.template.php?country="+countryId+"&state="+stateId+"&q="+str+"&page="+page; }
	 else if(action == 'state') {
	  var strURL="templates/findState.template.php?country="+country+"&page="+page;  }
      var req = getXMLHTTP(); if (req) { 
	  req.onreadystatechange = function() { if (req.readyState == 4) {				
	    if(req.status == 200) { 
		  if(action == 'city') {
		    document.getElementById(txt).innerHTML=req.responseText;
			if(document.getElementById(txt).innerHTML!="") { document.getElementById(preload).style.display ='none'; }
			} else if(action == 'state') {
			document.getElementById(txt).innerHTML=req.responseText; }
			} else { alert("There was a problem while using XMLHTTP:\n" + req.statusText);  } }  }			
   req.open("GET", strURL, true); req.send(null);  } }
/*------------------Availability Checking Function---------------*/
function showlogin(str,ctrl,field,table,spanId,page)
{
 browser_support();
var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
	}
	else
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
	}



 if((page=='admin') || (page=='adminlist')){str=document.getElementById(str).value;var url="../available.php";} else{spanId=spanId;var url=urlValue+"available.php";} 
  if(ctrl == 'login'){ url=url+"?vlogin="+str+"&field="+field+"&table="+table+"&spanId="+spanId+"&page="+page; url=url+"&sid="+Math.random();}
  else if(ctrl=='email'){ url=url+"?vemail="+str+"&field="+field+"&table="+table+"&spanId="+spanId+"&page="+page; url=url+"&sid="+Math.random(); }
  else if(ctrl=='username') { str=document.getElementById(str).value; url=url+"?vUser="+str+"&field="+field+"&table="+table+"&spanId="+spanId+"&page="+page; url=url+"&sid="+Math.random();  }
  else if(ctrl=='memberType') { url=url+"?vtype="+str+"&field="+field+"&table="+table+"&page="+page; url=url+"&sid="+Math.random(); }
  else if(ctrl=='ademail') { url=url+"?vademail="+str+"&field="+field+"&table="+table+"&page="+page; url=url+"&sid="+Math.random();  }
  if(page=='adminlist'){
	  xmlHttp.onreadystatechange=userChanged1;} else {xmlHttp.onreadystatechange=userChanged;} xmlHttp.open("GET",url,true); xmlHttp.send(null); }
function userChanged(){ 
  if(xmlHttp.readyState==4) { var msg=xmlHttp.responseText;
   msg = msg.split('#',6);
	  if(msg[5] != "admin") {
		  if(msg[0] == "*Available") {
		   document.getElementById(msg[2]).style.color="green";
		   document.getElementById(msg[2]).style.display='block';
		   document.getElementById(msg[2]).innerHTML=msg[3]+" "+'<b>'+msg[1]+'</b>'+" "+"  Available";
		   document.getElementById(msg[4]).value = msg[0]; }
		  else {
		   document.getElementById(msg[2]).style.color="#ff0000";
		   document.getElementById(msg[2]).style.display='block';
		   document.getElementById(msg[2]).innerHTML=msg[3] +" "+'<b>'+msg[1]+'</b>'+" "+"  Not Available"; 
		   } 
	  } else {		  
		  if(msg[0] != "*Available") {
			  	var eiderr = "* Email ID "+msg[1]+" is not available";
				alert(eiderr);document.getElementById('useremail').value = "";document.getElementById('useremail').focus(); }
	  }
    }
} 
function userChanged1(){ 
  if(xmlHttp.readyState==4) {

	if(document.getElementById('suggest1').value=="")
	{
		alert('Business/User Email is empty');
		return false;
		exit();
	}

	  var msg=xmlHttp.responseText; msg = msg.split('#',6); 
		if(msg[5] == "adminlist"){
			  if(msg[0] != "*Available") {
				alert("EmailId already exist."); 
				document.getElementById(msg[4]).value = "exist";
				return false; 
				}
				else
			{
		document.getElementById('EmailValue').value=document.getElementById('suggest1').value;
		document.listForm.submit();
		return true;
			}
	} } 
}

function sample()
{
document.frmPost.action="addListing.php?Refid="+document.getElementById('suggest1').value;
return true;
}
function load()
{
return false;
}
function sendPage(){
	document.send.action='test.php';
}

function sendVerifycode(url,phone,verifyid) {

	browser_support();
	document.getElementById('preloadSms').style.display='';
	var val = new Array();
	var url = url+"?phone="+phone+"&verifyid="+verifyid+"&sid="+Math.random(); 
	document.getElementById('CodeVerify').value='';
	xmlHttp.onreadystatechange = sendvcode;
	xmlHttp.open("GET",url,true); 	xmlHttp.send(null); }

function sendvcode() { 
 if (xmlHttp.readyState==4) {	
   	   document.getElementById('preloadSms').style.display='none';
	var msg=xmlHttp.responseText; msg = msg.split('#',3); 
	var Value=msg[0].substring(0,5);
   document.getElementById('CodeVerify').value=Value;
   document.getElementById(msg[1]).innerHTML='Verification Code has<br/> been sent to your mobile';
	   
	} 
}


var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 2
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
		closeDiv('SENDSMS');
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}

function sendvalue(ValueControl,id,url)
{
	//alert('hi');
    browser_support();
    txtctrl=new Array();
	for(i=0;i<ValueControl.split("|").length;i++) {
	txtctrl[i]=document.getElementById(ValueControl.split("|")[i].toString()).value;} 

var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");

if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
	if(url=='signup.php')
		{
	var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
		}
		else
		{
	var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
		}
	}
	else
{
if(url=='signup.php')
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
	}
	else
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";
	}
}

	url=urlValue+url+"?username="+txtctrl[0]+"&userpassword="+txtctrl[1]+"&useremail="+txtctrl[2]+"&usercontactnumber="+txtctrl[3]+"&rType="+id;
//alert(url);
	if((id=='I') || (id == 'C')){
		xmlHttp.onreadystatechange=signup;
	}else{
		if(id=='get'){
			xmlHttp.onreadystatechange=searchcouponic;	
		}else{
			xmlHttp.onreadystatechange=searchcouponicView;	}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}

function SendSMS(url,phone,name,phone1,title,copname,coupAdd,desc,closeid,dtype,percent)
{
	browser_support();
	 document.getElementById('preloadSms1').style.display='';
	var val = new Array();
	var url = url+"?phone="+phone+"&name="+name+"&sid="+Math.random()+"&phone1="+phone1+"&title="+encodeURIComponent(title)+"&copname="+copname+"&coupAdd="+coupAdd+"&closeid="+closeid+"&dtype="+dtype+"&percent="+percent;
	document.getElementById('CodeVerify').value='';
	xmlHttp.onreadystatechange = sendSMSvcode;
	xmlHttp.open("GET",url,true); 
	xmlHttp.send(null); 
}
function sendSMSvcode() { 
   if (xmlHttp.readyState==4) {	
   		var msg = xmlHttp.responseText; 
    	document.getElementById('preloadSms1').style.display='none';
		a = msg.split("#",2);
		document.getElementById('SENDSMS').innerHTML=a[0];
		InitializeTimer();
     //	alert(a[0]);
		//closeDiv(a[1]);
	  // document.getElementById('CodeVerify').value=xmlHttp.responseText;
	  // document.getElementById('verifyButton').innerHTML='Verification Code has<br/> been sent to your mobile';
	} 
}

function SendMAIL(url,mailid,name,coupDesc,title,copname,coupAdd,closeid,bname,imgname,mobno,coupontype,discount)
{	 
	browser_support();
	document.getElementById('preloadMail').style.display='';
	var val = new Array();
	var url=url+"?mailid="+mailid+"&name="+name+"&coupDesc="+coupDesc+"&title="+encodeURIComponent(title)+"&copname="+copname+"&coupAdd="+coupAdd+"&closeid="+closeid+"&bname="+bname+"&imgname="+imgname+"&mobno="+mobno+"&coupontype="+coupontype+"&discount="+discount+"&sid="+Math.random();
	xmlHttp.onreadystatechange = sendMAILcode;
	xmlHttp.open("GET",url,true); 	xmlHttp.send(null);
}
function sendMAILcode() { 
   if (xmlHttp.readyState==4) {	
   		var msg = xmlHttp.responseText;
		document.getElementById('preloadMail').style.display='none';
		a = msg.split("#",3);
		document.getElementById('SENDSMS').innerHTML=a[1];
		InitializeTimer();
     	//alert(a[1]);
		//closeDiv(a[2]);
	} 
}

function SendMobile(url,phone,businessName,mobAddress,mobArea,mobCity,mobState,mobCountry,mobContact,mobKeyword,mobCoupID,mobName)
{
	browser_support();
	var url = url+"?phone="+phone+"&businessName="+businessName+"&mobAddress="+mobAddress+"&mobArea="+mobArea+"&mobCity="+mobCity+"&mobState="+mobState+"&mobCountry="+mobCountry+"&mobContact="+mobContact+"&mobKeyword="+mobKeyword+"&mobCoupID="+mobCoupID+"&mobName="+mobName+"&sid="+Math.random();
	xmlHttp.onreadystatechange = mobileSend;
	xmlHttp.open("GET",url,true); 	xmlHttp.send(null); 
}
function mobileSend() { 
   if (xmlHttp.readyState==4) {	
	window.location="coupon.php";
	} 
}

/*----Refresh the Verification code-----*/   
function pageeRef(url) {
	browser_support();
	var val = new Array();
	var url = url+"?sid="+Math.random();
	xmlHttp.onreadystatechange = refPage;
	xmlHttp.open("GET",url,true); 	xmlHttp.send(null); }

function refPage() { 
   if (xmlHttp.readyState==4) {	
   		img = document.getElementById('imgCaptcha'); 
   		img.src = 'create_image.php?' + Math.random(); } }

/*--------Function for captcha code checking--------*/
function makeRequest(url, param) {
   if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
   receiveReq.open("POST", url, true);
   receiveReq.onreadystatechange = updatePage; 
   receiveReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   receiveReq.setRequestHeader("Content-length", param.length);
   receiveReq.setRequestHeader("Connection", "close");
   receiveReq.send(param);  } }

function updatePage() {
   if (receiveReq.readyState == 4) {
	document.getElementById('verifyErr').style.display='block';  
   document.getElementById('verifyErr').innerHTML = receiveReq.responseText;
} }

function getParam(txtControl) {

var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
	}
	else
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";
	}

   var url = urlValue+'captcha.php';
   var postStr = document.getElementById(txtControl).name + "=" + encodeURIComponent( document.getElementById(txtControl).value );
    makeRequest(url, postStr); 
	}

/*function sendvalue300(ValueControl,id,url)
{
    browser_support();
    txtctrl=new Array();
	for(i=0;i<ValueControl.split("|").length;i++) {
	txtctrl[i]=document.getElementById(ValueControl.split("|")[i].toString()).value;} 
	url=url+"?username="+txtctrl[0]+"&userpassword="+txtctrl[1]+"&useremail="+txtctrl[2]+"&usercontactnumber="+txtctrl[3]+"&rType="+id;
	if(id=='I' || id == 'C'){
		xmlHttp.onreadystatechange=signup;
	}else{
		if(id=='get'){
			xmlHttp.onreadystatechange=searchcouponic;	
		}else{
			xmlHttp.onreadystatechange=searchcouponicView;	}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}
*/



function signup(){
	if(xmlHttp.readyState==4){ 
		var ans = xmlHttp.responseText;
		if(ans == 'business_insert.php'){
			//window.location.reload( true );
			//window.location.href="business_insert.php";
var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";		
var pageArgument=pathArray[3];
	}
	else
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";		
var pageArgument=pathArray[4];
	}

			window.location.href=urlValue+"index.php?id=business";
			//head_load(ans,'');
		} else {
		searchCouponVal('couponsList.php',document.getElementById('cattype').value,'Coupon',document.getElementById('getCityVal').innerHTML,document.getElementById('myInput1').value,document.getElementById('myInput2').value);}
}}

function searchcouponic()
{
	if(xmlHttp.readyState==4){ 
		var cou = xmlHttp.responseText;
		document.getElementById('intext').innerHTML=cou;
		searchCouponVal('couponsList.php',document.getElementById('cattype').value,'Coupon',document.getElementById('getCityVal').innerHTML,document.getElementById('myInput1').value,document.getElementById('myInput2').value);
	}
}

function searchcouponicView()
{
	if(xmlHttp.readyState==4){ 
		var cou = xmlHttp.responseText;
		document.getElementById('Viewtext').innerHTML=cou;
}}

function view_coupon(url,ctype,innercatid,maindisid){
	browser_support();
	var val = new Array();
	var url=url+"?ctype="+ctype+"&innercatid="+innercatid+"&maindisid="+maindisid+"&sid="+Math.random();
	if(ctype == 'Cash Back Coupons'){
	xmlHttp.onreadystatechange = view_cashdisplay;
	}else if(ctype == 'Free Coupons'){
	xmlHttp.onreadystatechange = view_freedisplay;
	}else if(ctype == 'Discount Coupons'){
	xmlHttp.onreadystatechange = view_disdisplay;
	}else if(ctype == 'Offer Coupons'){
	xmlHttp.onreadystatechange = view_offerdisplay;
	}
	xmlHttp.open("GET",url,true); 	xmlHttp.send(null); 
}
function view_cashdisplay() { 
   if (xmlHttp.readyState==4) {	
	   document.getElementById('view_cashdiv').innerHTML="";
   		var msg = xmlHttp.responseText;
		document.getElementById('view_cash').style.display='block';
		document.getElementById('view_cashdiv').style.display='block';
		document.getElementById('view_cashdiv').innerHTML='';		
		
		document.getElementById('view_dis').style.display='none';
		document.getElementById('view_disdiv').style.display='none';	
		document.getElementById('view_disdiv').innerHTML='';
		
		document.getElementById('view_off').style.display='none';
		document.getElementById('view_offdiv').style.display='none';
		document.getElementById('view_offdiv').innerHTML='';
			
		document.getElementById('view_free').style.display='none';
		document.getElementById('view_freediv').style.display='none';
		document.getElementById('view_freediv').innerHTML='';

		
		document.getElementById('view_cashdiv').innerHTML=msg;
	} 
}

function view_freedisplay() { 
   if (xmlHttp.readyState==4) {	
document.getElementById('view_freediv').innerHTML="";
   		var msg = xmlHttp.responseText;
		document.getElementById('view_free').style.display='block';
		document.getElementById('view_freediv').style.display='block';
		document.getElementById('view_freediv').innerHTML='';
		
		document.getElementById('view_dis').style.display='none';
		document.getElementById('view_disdiv').style.display='none';
		document.getElementById('view_disdiv').innerHTML='';
		
		document.getElementById('view_off').style.display='none';
		document.getElementById('view_offdiv').style.display='none';
		document.getElementById('view_offdiv').innerHTML='';
		

		
		document.getElementById('view_cash').style.display='none';
		document.getElementById('view_cashdiv').style.display='none';	
		document.getElementById('view_cashdiv').innerHTML='';	

		document.getElementById('view_freediv').innerHTML=msg;
	} 
}

function view_disdisplay() { 
   if (xmlHttp.readyState==4) {	
		document.getElementById('view_disdiv').innerHTML="";
   		var msg = xmlHttp.responseText;
		document.getElementById('view_dis').style.display='block';
		document.getElementById('view_disdiv').style.display='block';
		document.getElementById('view_disdiv').innerHTML='';		
		
		document.getElementById('view_off').style.display='none';
		document.getElementById('view_offdiv').style.display='none';
		document.getElementById('view_offdiv').innerHTML='';
		
		document.getElementById('view_free').style.display='none';
		document.getElementById('view_freediv').style.display='none';
		document.getElementById('view_freediv').innerHTML='';
		
		document.getElementById('view_cash').style.display='none';
		document.getElementById('view_cashdiv').style.display='none';
		document.getElementById('view_cashdiv').innerHTML='';			
		
		document.getElementById('view_disdiv').innerHTML=msg;
	} 
}

function view_offerdisplay() { 
   if (xmlHttp.readyState==4) {	
		document.getElementById('view_offdiv').innerHTML="";
   		var msg = xmlHttp.responseText;
		document.getElementById('view_off').style.display='block';
		document.getElementById('view_offdiv').style.display='block';
		document.getElementById('view_offdiv').innerHTML='';		
		
		document.getElementById('view_dis').style.display='none';
		document.getElementById('view_disdiv').style.display='none';
		document.getElementById('view_disdiv').innerHTML='';			
		
		document.getElementById('view_free').style.display='none';
		document.getElementById('view_freediv').style.display='none';
		document.getElementById('view_freediv').innerHTML='';
		
		document.getElementById('view_cash').style.display='none';
		document.getElementById('view_cashdiv').style.display='none';	
		document.getElementById('view_cashdiv').innerHTML='';
		document.getElementById('view_offdiv').innerHTML=msg;
	} 
}

function signin_vld(uname,pwd,uerrid,perrid){
	var msg=window.location;
	var d = msg.toString();
	var value=d.substring(0,100);
	var pathArray = value.split("/");
	if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
		var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
		var urlValue1=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
	}
	else
	{
		var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
		var urlValue1=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";
	}

	if(document.getElementById(uname).value=="")
	{document.getElementById(uname).focus(); return false;}
	var struid=document.getElementById(uerrid).innerHTML;
	if(struid!=""){
	if(document.getElementById(uerrid).style.color=='rgb(255, 0, 0)'){document.getElementById(uname).focus();return false;}}
 	if(document.getElementById(pwd).value=="")
	{document.getElementById(pwd).focus(); return false;}
	var strpid=document.getElementById(perrid).innerHTML;
	if(strpid!=""){
	if(document.getElementById(perrid).style.color=='rgb(255, 0, 0)'){ document.getElementById(pwd).focus();return false;} }
	loginChk(urlValue+'signin.php',document.getElementById('txtusername').value,document.getElementById('txtuserpassword').value,document.getElementById('txtfoldername').value,document.getElementById('loginpg').value);
	return true;
}

function loginChk(url,uname,password,folname,pgname){
	browser_support();
	url=url+"?username="+uname+"&userpassword="+password+"&foldername="+folname+"&pgname="+pgname;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=userchk;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function userchk(){
	if (xmlHttp.readyState==4)
	{
		var ans = xmlHttp.responseText;
		//alert(ans);

		var msg=window.location;
		var d = msg.toString();
		var value=d.substring(0,100);
		var pathArray = value.split("/");
		
		if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
		{
			var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
			var urlValueFull=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
			var pageValue=pathArray[3];
		}
		else
		{
			var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
			var urlValueFull=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";
			var pageValue=pathArray[4];
		}

		

			var splitvalues = ans.split("#");
		//	alert(ans);


		if(ans == 'false'){
			head_load('signin.php','Email Id/Password is incorrect');
			document.getElementById('newuser_postdiscount').style.display='';
			document.getElementById('signIN').style.display='none';
			document.getElementById('signForget').style.display='none';
		}/* else if(ans == 'Business'){
			window.location.href = urlValueFull+'post_BusinessList.php?id='+ans;
		} else if(ans == 'coupons'){
			window.location.href = urlValueFull+'post_coupon.php?id='+ans;
		} else if(ans == 'offer'){
			window.location.href = urlValueFull+'post_head_offer.php?id='+ans;
		}*/else{
			//window.location.href = urlValueFull+'index.html';
			window.location.href = urlValue+'post_page.php?pvalue='+pageValue+'&pgname='+splitvalues[1];		
		}
	}
}

function loadFullUrl()
{
var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
		var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
		var urlValue1=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";

	}
	else
	{
		var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
		var urlValue1=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";
	}
		document.getElementById('fullURL').value=urlValue;
		document.getElementById('PageURL').value=urlValue1;
}

function head_load(url,id) {

	browser_support();	
	document.getElementById('preload').style.display='';
	var msg=window.location;
	var d = msg.toString();
	var value=d.substring(0,100);
	var pathArray = value.split("/");
	
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
		var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
		var urlFullValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
	}	else	{
		var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
		var urlFullValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";
	}
	
	
	if((url=='postDiscount.php')||(url=='discountDetails.php')||(url=='post_BusinessList.php'))	{
		url=urlFullValue+url+"?id="+id+"&UrlPageValue="+urlValue+"&urlfullValue="+urlFullValue;
	}else{
		url=urlValue+url+"?id="+id+"&UrlPageValue="+urlValue+"&urlfullValue="+urlFullValue;
	}
	
		url=url+"&sid="+Math.random();
		//alert(url);
		xmlHttp.onreadystatechange=load_content;
		xmlHttp.open("GET",url,true); xmlHttp.send(null); }

function load_content(){
	if(xmlHttp.readyState==4) {
	 document.getElementById('content').innerHTML = xmlHttp.responseText;
     document.getElementById('preload').style.display='none';
	 }
}

// lightbox

function showtabs(url,divid,fname)
{
	browser_support();
	var arrayPageSize = getPageSize();
	document.getElementById('fade').style.height=arrayPageSize[1] + 'px';
	url=url+"?divid="+divid+"&fname="+fname;
	url=url+"&sid="+Math.random();

	if(divid=='I')	{
		xmlHttp.onreadystatechange=LoadBusinessTable;	
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	else if(divid=='C')	{
		xmlHttp.onreadystatechange=LoadBusinessTablePart2;	
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}

function LoadBusinessTable()
{
	if (xmlHttp.readyState==4)
	{
		var a= xmlHttp.responseText;
		var sp=a.split('####',20);
		document.getElementById("jobs").innerHTML = sp[0]+sp[2]+sp[3]+sp[5]+sp[6]+sp[8]+sp[10]+sp[12]+sp[14]+sp[15]+sp[17]+sp[18];	
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignjobs');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
			objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 386 - objLoadingImage.offsetHeight) / 2) + 'px');
		}
		document.getElementById("jobs").style.display='block';
		document.getElementById("fade").style.display='block';
	}
}

function LoadBusinessTablePart2()
{
document.getElementById("jobs").style.display='none';
if (xmlHttp.readyState==4)
{
var a1= xmlHttp.responseText;
var spp=a1.split('####',20);
document.getElementById("jobs").innerHTML = spp[0]+spp[1]+spp[3]+spp[4]+spp[6]+spp[7]+spp[8]+spp[9]+spp[10]+spp[11]+spp[13]+spp[15]+spp[16]+spp[18]; 
var objOverlay = document.getElementById('fade');
var objLoadingImage = document.getElementById('alignjobs');
var arrayPageSize = getPageSize();
var arrayPageScroll = getPageScroll();
if (objLoadingImage) 
{
objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 386 - objLoadingImage.offsetHeight) / 2) + 'px');
}
	document.getElementById("jobs").style.display='block';
	document.getElementById("jobs").style.display='block';
}
}

function LoadTabContent(url,divid)
{	
	browser_support();
	url=url+"?divid="+divid;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=LoadTabValue;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function LoadTabValue() 
{ 
	if (xmlHttp.readyState==4)	{
		var a= xmlHttp.responseText;
		sp = a.split("###",3);
		document.getElementById(sp[0]).innerHTML=sp[1];
	}
}
function printContent(url,divid,fname)
{	
	browser_support();
	url=url+"?divid="+divid+"&fname="+fname;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=printValue;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function printValue() 
{ 
	if (xmlHttp.readyState==4)	{		var a= xmlHttp.responseText;	}
}

//front page tabs
function changeTab(id,id1,id2)
{	
var ul = document.getElementById("maintab");
var liNodes = ul.getElementsByTagName("li");
for( var i = 0; i < liNodes.length; i++ )
{
	if(id==i){
	document.getElementById(id1).style.display='none';
	DISStylenone(id2);
	liNodes.item(i).id='current'; 
	}	else	{
		liNodes.item(i).id='';
	}
}
}

function insert_offer(ValueControl,url)
{
    browser_support();
    txtctrl=new Array();
	for(i=0;i<ValueControl.split("|").length;i++) {
	txtctrl[i]=document.getElementById(ValueControl.split("|")[i].toString()).value;}
	url=url+"?keyword="+txtctrl[0]+"&description="+txtctrl[1]+"&offer_image="+txtctrl[2];
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=offerres;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function offerres(){if(xmlHttp.readyState==4){ 
window.location.href = "offer.php";}}

function insert_wanted(ValueControl,url)
{
    browser_support();
    txtctrl=new Array();
	for(i=0;i<ValueControl.split("|").length;i++) {
	txtctrl[i]=document.getElementById(ValueControl.split("|")[i].toString()).value;}
	url=url+"?keyword="+txtctrl[0]+"&description="+txtctrl[1];
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=wantedres;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function wantedres(){if(xmlHttp.readyState==4){ }}

function downAddress(val,url)
{
	browser_support();
	var rand   = Math.random(9999);
    txtctrl=new Array();
	for(i=0;i<val.split("|").length;i++) {txtctrl[i]=document.getElementById(val.split("|")[i].toString()).value;}
	var url = url+"?v1="+txtctrl[0]+"&v2="+txtctrl[1]+"&v3="+txtctrl[2]+"&v4="+txtctrl[3]+"&v5="+txtctrl[4]+"&v6="+txtctrl[5]+"&v7="+txtctrl[6]+"&v8="+txtctrl[7]+"&v9="+txtctrl[8]+"&v10="+txtctrl[9]+"&v11="+txtctrl[10]+"&v12="+txtctrl[11]+"&v13="+txtctrl[12];
	xmlHttp.onreadystatechange=downAddressResult;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function downAddressResult()
{	
	if (xmlHttp.readyState==4)
	{
		showtabs('success.php','','');
	}
}

function Displayvalue(url,id) {
	browser_support(); 
	url=url+"?usertypes="+id;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=displayVal;
	xmlHttp.open("GET",url,true); xmlHttp.send(null); }
	
function displayVal(){ if(xmlHttp.readyState==4) {
	window.location.href="business_profile.php";
	DISStylenone('divBusiness|divcpmlogo|divcmpvideo|divcomplex');
	} }
	
function DisplayState(url,id,id1,page) {
	browser_support();
	id=document.getElementById(id).value;
	url=url+"?id="+id+"&page="+page;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=displayStat;
	xmlHttp.open("GET",url,true); xmlHttp.send(null); }
	
function displayStat(){ if(xmlHttp.readyState==4) {
	document.getElementById('divcity').innerHTML=xmlHttp.responseText; 	} }

//from general.js
function validate_downLoad(txtval,divval)
{
	var k=0;
	var j=0;
	var ValueControl=txtval; var ValueDivs=divval; 
	for(var i=0;i<ValueControl.split("|").length;i++) {
	var txtctrl=document.getElementById(ValueControl.split("|")[i].toString());
	if(((txtctrl.type=="text") && (txtctrl.value==""))||((txtctrl.type=="password") && (txtctrl.value==""))||((txtctrl.type=="textarea") && (txtctrl.value==""))){
	txtctrl.focus();
	return false;}
	if(document.getElementById(ValueDivs.split("|")[i].toString()).innerHTML!='&nbsp;'){
	if(((document.getElementById(ValueDivs.split("|")[i].toString()).innerHTML)!="")){ k++;	}
	else{j++;} 	}
	}
	if((k==0))
	{
	downAddress('pidBusiness|txtname|txtstd|txtphone|txtemail|txtfname|txtfstd|txtfphone|txtfemail','getBusiness.php');
	}
}

/*function InsertPage(url,id,identity,coupTitle,coupname,coupContact,coupAdd,desc,mobno,count,dtype,percent) {  
	browser_support();
	for(var i=0;i<count;i++){
		var str = "showMobile_"+i;
		if(id != str){
			closeDiv(str);
		}
	}
	var coupTitle=document.getElementById(coupTitle).innerHTML;
	var coupname=document.getElementById(coupname).innerHTML;
	var coupContact=document.getElementById(coupContact).innerHTML;
	var coupAdd=document.getElementById(coupAdd).innerHTML;
	var desc=document.getElementById(desc).innerHTML;
	var mobno=document.getElementById(mobno).value;
	url=url+"?usertypes="+id+"&coupTitle="+coupTitle+"&coupname="+coupname+"&coupContact="+coupContact+"&coupAdd="+coupAdd+"&desc="+desc+"&mobno="+mobno+"&coupontype="+dtype+"&discount="+percent+"&identity"+identity;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=insert_Page;
	xmlHttp.open("GET",url,true); xmlHttp.send(null); 
	}*/
	
function InsertPage(val,url,id,bname,address,count,phone,page) { 

browser_support();

if(page!='view')
{	for(i=0;i<count;i++){
		var str = "showMobile"+i;
		if(id != str) {
	closeDiv(str);
		}
	}
	var bname=document.getElementById(bname).value;
	}
	if(page=='view')
	{
	var bname=document.getElementById(bname).value;	
	}

	var address=document.getElementById(address).innerHTML;
	url=url+"?usertypes="+id+"&bname="+encodeURIComponent(bname)+"&address="+address+"&phone="+phone+"&val="+val;
	//alert(url);
	url=url+"&sid="+Math.random();
 	xmlHttp.onreadystatechange=insert_Page;
	xmlHttp.open("GET",url,true); xmlHttp.send(null); 
	}
	
function insert_Page(){ if(xmlHttp.readyState==4) { 
	var response = xmlHttp.responseText;
	var res = response.split("#",2);
	var value=trim(res[0]);
	document.getElementById(value).style.display='block';
	document.getElementById(value).innerHTML=res[1]} } 


function view_page(url,id,identity,coupTitle,coupname,coupContact,coupAdd,desc,mobno,count,bname,imgName,discount,identy) {  
	browser_support(); 
	var coupTitle=document.getElementById(coupTitle).innerHTML;
	var coupname=document.getElementById(coupname).innerHTML;
	var coupContact=document.getElementById(coupContact).innerHTML;
	var coupAdd=document.getElementById(coupAdd).innerHTML;
	var desc=document.getElementById(desc).innerHTML;
	var mobno=document.getElementById(mobno).value;
	var imgName=document.getElementById(imgName).value;
	url=url+"?usertypes="+id+"&coupTitle="+encodeURIComponent(coupTitle)+"&coupname="+coupname+"&coupContact="+coupContact+"&coupAdd="+coupAdd+"&desc="+desc+"&mobno="+mobno+"&bname="+bname+"&imgName="+imgName+"&coupontype="+count+"&discount="+discount+"&identity="+identy;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=resview_Page;
	xmlHttp.open("GET",url,true); xmlHttp.send(null); 
	}
	
function resview_Page(){ if(xmlHttp.readyState==4) { 
	var response = xmlHttp.responseText; 
	var res = response.split("#",2);
	document.getElementById(res[0]).style.display='block'; document.getElementById(res[0]).innerHTML=res[1];
	var number=res[0].split('_',2);
	for(var j=1;j<=5;j++){
		if(number[1]!=j){
			document.getElementById("showMobile_"+j).style.display='none';}
	}
	} 
} 

/*function PrintPage(url,id,identity,coupTitle,coupname,coupContact,coupAdd,desc,mobno,count,bname,imgName,coupontype,discount,page) {  
	browser_support();	
	//alert(count);
	for(var i=0;i<count;i++){
		var str = "showMobile_"+i;
		//alert(str);
		if(id != str) {
			closeDiv(str);
		}
	}
	if(page == 'print'){closeDiv(id); }
				
	epage = "search";
	var coupTitle=document.getElementById(coupTitle).innerHTML;
	var coupname=document.getElementById(coupname).innerHTML;
	var coupContact=document.getElementById(coupContact).innerHTML;
	var coupAdd=document.getElementById(coupAdd).innerHTML;
	var desc=document.getElementById(desc).innerHTML;
	var mobno=document.getElementById(mobno).value;
	var bname=document.getElementById(bname).innerHTML;
	var imgName=document.getElementById(imgName).value;
	url=url+"?usertypes="+id+"&coupTitle="+coupTitle+"&coupname="+coupname+"&coupContact="+coupContact+"&coupAdd="+coupAdd+"&desc="+desc+"&mobno="+mobno+"&bname="+bname+"&imgName="+imgName+"&coupontype="+coupontype+"&discount="+discount+"&epage="+epage+"&identity="+identity;
	url=url+"&sid="+Math.random();// alert(url);
	if(page == 'print'){
		xmlHttp.onreadystatechange=pPage;
	} else if(page == 'email'){
		xmlHttp.onreadystatechange=insert_Page;
	}
	xmlHttp.open("GET",url,true); xmlHttp.send(null); 
	}
	
function pPage(){ 
	if(xmlHttp.readyState==4) { 
		var response = xmlHttp.responseText;
		my_window = window.open ("getPrint.php","mywindow","location=1,status=1,scrollbars=1,width=550,height=300,resizable=0"); 
		my_window.document.write(response);
	} 
} */

/*function view_more(url,id,identity,coupTitle,coupname,coupContact,coupAdd,desc,mobno,count,bname,imgName,coupontype,discount,page) {  
	browser_support();	
	for(var i=0;i<count;i++){
		var str = "showMobile_"+i;
		if(id != str) {
			closeDiv(str);
		}
	}
	epage = "search";
	document.getElementById('preload').style.display='';	
	var coupTitle=document.getElementById(coupTitle).innerHTML;
	var coupname=document.getElementById(coupname).innerHTML;
	var coupContact=document.getElementById(coupContact).innerHTML;
	var coupAdd=document.getElementById(coupAdd).innerHTML;
	var desc=document.getElementById(desc).innerHTML;
	var mobno=document.getElementById(mobno).value;
	var bname=document.getElementById(bname).innerHTML;
	var imgName=document.getElementById(imgName).value;
	url=url+"?usertypes="+id+"&coupTitle="+coupTitle+"&coupname="+coupname+"&coupContact="+coupContact+"&coupAdd="+coupAdd+"&desc="+desc+"&mobno="+mobno+"&bname="+bname+"&imgName="+imgName+"&coupontype="+coupontype+"&discount="+discount+"&epage="+epage;
	url=url+"&sid="+Math.random(); alert(url);
		xmlHttp.onreadystatechange=viewmore;
	xmlHttp.open("GET",url,true); xmlHttp.send(null); 
	}
	
function viewmore(){ 
	if(xmlHttp.readyState==4) { 
		var response = xmlHttp.responseText;
		alert(response);
		 document.getElementById('content').innerHTML = xmlHttp.responseText;
	     document.getElementById('preload').style.display='none';		
	} 
} 
*/

function closeDiv(id)
{
	document.getElementById(id).innerHTML="";
	document.getElementById(id).style.display='none';
}

function post_discount(profileid,businessid){

var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
var urlValue1=pathArray[0]+"//"+pathArray[2]+"/";
	}
	else
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/"+pathArray[4]+"/";
var urlValue1=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
	}

	if(profileid != '' && businessid != ''){
		head_load('discountDetails.php','');
	} else if(profileid != '' && businessid == ''){
		head_load('business_insert.php','');
	} else if(profileid == '' && businessid == ''){
		document.getElementById('signIN').style.display='none';
		document.getElementById('signForget').style.display='none';		
		head_load('postDiscount.php','');
	}
}


function ale(id,id2)
{ 
	arvalue=id; 
	if(arvalue=='Chennai')	{
	document.getElementById(id2).disabled=false;
	} else if(arvalue!='Chennai') {
	document.getElementById(id2).disabled=true;
	document.getElementById(id2).value="";
	}
}

function LoadArea(url,id1)
{ 
	id1=document.getElementById(id1).value; 
	url=url+"?city="+id1;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=Areaa;
	xmlHttp.open("GET",url,true); xmlHttp.send(null); 
		
}

function Areaa()
{
	if(xmlHttp.readyState==4) {
	 var res = xmlHttp.responseText;
	 document.getElementById('divarea').innerHTML=res;
	
	 }
	
}

//for admin area auto load
function show_typemail(url,id) {
    browser_support();	
	url=url+"?utype="+id;
	url=url+"&sid="+Math.random();
	if(id=='Chennai'){
	xmlHttp.onreadystatechange=res_typearea;
	}else{
	xmlHttp.onreadystatechange=res_typemail;}
	xmlHttp.open("GET",url,true); xmlHttp.send(null); }

function res_typearea(){
	if(xmlHttp.readyState==4) {
	 var res = xmlHttp.responseText;
	 get_area(res);
	 }
}
function res_typemail(){
	if(xmlHttp.readyState==4) {
	 var res = xmlHttp.responseText;
	 get_email(res);
	 }
}

////For business innercategory search
//search_create('F','searchname','pick_list.php','go','searchstate','searchcity');
function search_create(search_create,url,val)
{  	
				browser_support();
				var url=url;
				url=url+"?search_create="+search_create+"&val="+val;
				url=url+"&sid="+Math.random(9999);
				xmlHttp.onreadystatechange=search_Result;
				xmlHttp.open("GET",url,true);
				xmlHttp.send(null);
}
function search_Result()
{
	//alert(xmlHttp.responseText);
	//document.getElementById('resultInner').style.display='block';
	//document.getElementById('resultInner').innerHTML=xmlHttp.responseText;
	//alert(document.getElementById('resultInner').innerHTML);

/*				if (xmlHttp.readyState==4)
				{	
				var title = xmlHttp.responseText;
				var arr=title;
				for(i=0;i<arr.split("split").length;i++){
				number=arr.split("split")[i];
				//alert(number);
				if(i==1){document.getElementById('paginate_response').innerHTML=number;}}
				}
*/}


// lightbox

function showstat(url,divid,fname,urll)
{
	browser_support();
	var arrayPageSize = getPageSize();
	document.getElementById('fade').style.height=arrayPageSize[1] + 'px';

var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
	}
	else
{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
}
	url=url+"?divid="+divid+"&fname="+fname+"&UrlPageValue="+urlValue;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=userstat;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function userstat() 
{ 
	if (xmlHttp.readyState==4)
	{	
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("stat").innerHTML ="<center><img src='images/loading-icon.gif'></center>";	
		}
		else
		{
		document.getElementById("stat").innerHTML = xmlHttp.responseText;	
		}
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignstat');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 250 - objLoadingImage.offsetHeight) / 2) + 'px');
		}


/*color coding starts here*/

var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
	var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
	}
	else
		{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
		}
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
	var UrlPath=pathArray[3];
	}
	else
		{
	var UrlPath=pathArray[4];
		}

if(UrlPath=='coupons')
		{
			
document.getElementById("DivBorderColor").style.backgroundColor='#e9fff4';
document.getElementById("DivBorderColor").style.border='1px solid #58b588';

		}
		else
if(UrlPath=='offer')
		{
document.getElementById("DivBorderColor").style.backgroundColor='#fdf6f9';
document.getElementById("DivBorderColor").style.border='1px solid #9f0e50';

		}
else
      if(UrlPath=='Business')
		{

document.getElementById("DivBorderColor").style.backgroundColor='#EBF5FB';
document.getElementById("DivBorderColor").style.border='1px solid #3495C5';
		}

	document.getElementById("stat").style.display='';

	document.getElementById("fade").style.display='block';
	
	}
}

<!--For load city-->

function LoadCity(url)
{
	browser_support();
	var val = new Array();
	var url = url+"?id=1&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange = returnCity2000;
	xmlHttp.open("GET",url,true); 	xmlHttp.send(null); 
}
function returnCity2000() { 
//alert(xmlHttp.readyState);
   if (xmlHttp.readyState==4) {	
var cityValue=xmlHttp.responseText;

	   document.getElementById('cities').innerHTML=xmlHttp.responseText;
	   document.getElementById('cities').style.display='block';
	   //alert(document.getElementById('cities').innerHTML);
	   if((document.getElementById('cities').innerHTML)=="")
	   {
		   document.getElementById('preload').style.display='block';
	   }
	   else
	   {
document.getElementById('preload').style.display='none';
	   }

	} 
}

function getfoldername(txt)
{
pathArray = window.location.pathname.split( '/' );
newPathname = "";
for ( i = 0; i<pathArray.length; i++ ) {
newPathname += "/";
newPathname += pathArray[i];
}
//alert(pathArray[2]);
document.getElementById(txt).value=pathArray[2];
}
<!--For business page show all category-->

function LoadCategoryDiv()
{//alert("haidd");
var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");

if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
	}
	else
{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
}
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
	var PathName=pathArray[4];
	}
	else
	{
	var PathName=pathArray[5];
	}

if(PathName=='List')
	{
document.getElementById('showlist').style.display='block'; 
document.getElementById('divid').style.display='none';
	}
	else
	{
document.getElementById('showlist').style.display='none'; 
	}
}

//for company

function LoadCompanyDiv()
{
	//alert("hai");
var msg=window.location;
var d = msg.toString();
var value=d.substring(0,100);
var pathArray = value.split("/");

if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/";
	}
	else
{
var urlValue=pathArray[0]+"//"+pathArray[2]+"/"+pathArray[3]+"/";
}
if((pathArray[2]=='www.quick2get.com')||(pathArray[2]=='quick2get.com'))
	{
	var PathName=pathArray[4];
	}
	else
	{
	var PathName=pathArray[5];
	}

if(PathName=='List')
	{
document.getElementById('show_list').style.display='block'; 
//document.getElementById('divid').style.display='none';
	}
	else
	{
document.getElementById('show_list').style.display='none'; 
	}
}



function searchcouponic()
{
	if(xmlHttp.readyState==4){ 
		var cou = xmlHttp.responseText;
		document.getElementById('intext').innerHTML=cou;
		searchVal();
	}
}
function searchVal(){
	var frm = document.searfrm;	
	frm.submit();
	return true;
}

function searchcouponicView()
{
	if(xmlHttp.readyState==4){ 
		var cou = xmlHttp.responseText;
		document.getElementById('Viewtext').innerHTML=cou;
}}

function sample()
{
document.frmPost.action="addListing.php?Refid="+document.getElementById('suggest1').value;
return true;
}
function load()
{
return false;
}
function sendPage(){
	document.send.action='test.php';
}
