// JavaScript Document
var xmlHttp;

function Confirmation(){
	if(confirm("Are You Sure, You Want to Delete?"))
		return true;
	else
		return false;
}

function Stop_Action_Message(Message)
{
	alert(Message);
	return false;
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function LocationPull(City_Id)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="./AjaxClass/Location_Combo.php";
	url=url+"?q="+City_Id;
	url=url+"&rand="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("Location").innerHTML=xmlHttp.responseText;
	}
}

//------------------------------------------Packages Function------------------------------------------------
function EmailValidation(Business_Email)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="./EmailAccountValidation.php";
	url=url+"?Business_Email="+document.getElementById(Business_Email).value;
	url=url+"&rand="+Math.random();
	xmlHttp.onreadystatechange=stateChanged_EmailValidation;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged_EmailValidation()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if (xmlHttp.responseText > 0) {
			document.getElementById("Business_Email_Tr").style.display = "";
			document.getElementById("Business_Email_Td").innerHTML = "Business Email All Ready Exist!";
			document.getElementById("Business_Email").value = "";
		}
		else
		{
			document.getElementById("Business_Email_Tr").style.display = "none";
		}
	}
}


