// JavaScript Document
//for showing State Name 

function MM_jumpMenu(targ,selObj,restore){ 
  show_state(selObj.options[selObj.selectedIndex].value);
  if (restore) selObj.selectedIndex=0;
}

//for showing City Name 
function MM_jumpMenu_state(targ,selObj,restore){ 
  var list = document.frm.country
  var chosen_country = list.options[list.selectedIndex].value
  show_city(selObj.options[selObj.selectedIndex].value,chosen_country);
  if (restore) selObj.selectedIndex=0;
}
//for showing City Name on profile section
function MM_jumpMenu_state_profile(targ,selObj,restore,chosen_country){
  show_city(selObj.options[selObj.selectedIndex].value,chosen_country);
  if (restore) selObj.selectedIndex=0;
}
var xmlHttp;
var str;
var site_path="http://softwaredep.com/project/090305/"; 
//for showing State Name 
function show_state(value)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
	var url=""+site_path+"country_state.php?country=" + value;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChanged1() 
{ 
    active_city="state_id"
	if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading")
	{ 
		//document.getElementById(active_city).innerHTML="Loading...."
		document.getElementById('hideimage').style.display = "block";
	} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	    document.getElementById('hideimage').style.display = "none";
		document.getElementById(active_city).innerHTML=xmlHttp.responseText
	} 

}

//for showing City Name 
function show_city(value,country)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
	var url=""+site_path+"country_city.php?state=" + value + "&country=" + country;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged2
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged2() 
{ 
    active_city="city_id"
	if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading")
	{ 
		//document.getElementById(active_city).innerHTML="Loading...."
		document.getElementById('hideimage').style.display = "block";
	} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	    document.getElementById('hideimage').style.display = "none";
		document.getElementById(active_city).innerHTML=xmlHttp.responseText
	} 

}

function MM_jumpMenu1(targ,selObj,restore){ 
  show_state1(selObj.options[selObj.selectedIndex].value);
  if (restore) selObj.selectedIndex=0;
}

//for showing City Name 
function MM_jumpMenu_state1(targ,selObj,restore){ 
  var list = document.frm.country1
  var chosen_country = list.options[list.selectedIndex].value
  var list1=show_city1(selObj.options[selObj.selectedIndex].value,chosen_country);
  
  if (restore) selObj.selectedIndex=0;
}
//for showing City Name on profile section
function MM_jumpMenu_state_profile1(targ,selObj,restore,chosen_country){
  show_city1(selObj.options[selObj.selectedIndex].value,chosen_country);
  if (restore) selObj.selectedIndex=0;
}
var xmlHttp;
var str;
var site_path="http://softwaredep.com/project/090305/"; 
//for showing State Name 
function show_state1(value)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
	var url=""+site_path+"country_state.php?country1=" + value;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged4
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChanged4() 
{ 
    active_city="state_id1"
	if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading")
	{ 
		//document.getElementById(active_city).innerHTML="Loading...."
		document.getElementById('hideimage').style.display = "block";
	} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	    document.getElementById('hideimage').style.display = "none";
		document.getElementById(active_city).innerHTML=xmlHttp.responseText
	} 

}

//for showing City Name 
function show_city1(value,country)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
	var url=""+site_path+"country_city.php?state1=" + value + "&country1=" + country;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged3
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged3() 
{ 
    active_city="city_id1"
	if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading")
	{ 
		//document.getElementById(active_city).innerHTML="Loading...."
		document.getElementById('hideimage').style.display = "block";
	} 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	    document.getElementById('hideimage').style.display = "none";
		document.getElementById(active_city).innerHTML=xmlHttp.responseText
	} 

}

//////////////////////////////////////////////////////////////////////////////////////// 

function GetXmlHttpObject(handler)
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}