// JavaScript Document

var xmlhttp;

function countryFun(country)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
 
  
var url="include/selectCountry.php";
url=url+"?country="+country;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChangedCountry;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function subNwsltr(email)
{
    xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	  
	  
	var url="include/nwsLtrSub.php";
	url=url+"?email="+email;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateShowNwsLtr;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}


function cityFun(city)
{

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
 
var url="include/selectCity.php";
url=url+"?city="+city;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChangedCity;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

//////3333333333333333

function showStoreInfo(id)
{

	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	var url="include/showStoreInfo.php";
	url=url+"?storeId="+id;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateInfoVal;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function stateShowNwsLtr()
{
if (xmlhttp.readyState==4)
  {
   document.getElementById("txtNwsLtr").value= xmlhttp.responseText;
  }
else
{
   
   document.getElementById("txtNwsLtr").value= 'please wait'; 
}
}


function stateInfoVal()
{
if (xmlhttp.readyState==4)
  {
   document.getElementById("storeStoreImgInfo").innerHTML= xmlhttp.responseText;
  }
else
{

	 
   document.getElementById("storeStoreImgInfo").innerHTML= '<table align="center" style="padding-top:15px;"><tr><td>Please wait<br/><br/><br/><img src="images/loading.gif" /></td></tr></table>';
    
   
}
}


function stateChangedCountry()
{
if (xmlhttp.readyState==4)
  {
   document.getElementById("showCityDiv").innerHTML= xmlhttp.responseText;
  }
else
{
   
   document.getElementById("showContentList").innerHTML= ''; 
}
}


function stateChangedCity()
{
if (xmlhttp.readyState==4)
  {
	//setTimeout("alert('')", 15000); 
   document.getElementById("showContentList").innerHTML= xmlhttp.responseText;
  }
else
{
  document.getElementById("showContentList").innerHTML= 'please wait'; 
  
  
}  

}


function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
