/* ------------------------ */

function select_country(Id){
      xmlhttp = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         xmlhttp = new XMLHttpRequest();
         if (xmlhttp.overrideMimeType) {
            xmlhttp.overrideMimeType('text/xml');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
	var url="xml/city_xml.inc.php?Id="+Id;
	xmlhttp.open("POST", url, true);
	xmlhttp.onreadystatechange = function () {
	     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {	 
       		xmlDoc=xmlhttp.responseXML;
			//alert(xmlhttp.responseText)
	   		var sonuc = xmlDoc.documentElement;			
	     	var kayit_kontrol=sonuc.childNodes[0].childNodes[0].firstChild.nodeValue;
			document.getElementById('CityID').options.length=0;
				document.getElementById('CityID').options[0]=new Option ('Select City','');			
				if(kayit_kontrol>0)
				{
				var gkod2=sonuc.childNodes[0].childNodes[1];
				for (i=0;i<gkod2.childNodes.length;i++){
				document.getElementById('CityID').options[0].selected=new Option ('Select City','');
			 	document.getElementById('CityID').options[i+1]=new Option(gkod2.childNodes[i].firstChild.nodeValue,gkod2.childNodes[i].getAttribute("id"));					
				}				
			}				
		 }
	}
	xmlhttp.send(null);

}

/* ------------------------ */


function select_city(Id){
      xmlhttp = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         xmlhttp = new XMLHttpRequest();
         if (xmlhttp.overrideMimeType) {
            xmlhttp.overrideMimeType('text/xml');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
	var url="xml/town_xml.inc.php?Id="+Id;
	xmlhttp.open("POST", url, true);
	xmlhttp.onreadystatechange = function () {
	     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {	 
       		xmlDoc=xmlhttp.responseXML;
			//alert(xmlhttp.responseText)
	   		var sonuc = xmlDoc.documentElement;			
	     	var kayit_kontrol=sonuc.childNodes[0].childNodes[0].firstChild.nodeValue;
			document.getElementById('TownID').options.length=0;
				document.getElementById('TownID').options[0]=new Option ('Select Town','');			
				if(kayit_kontrol>0)
				{
				var gkod2=sonuc.childNodes[0].childNodes[1];
				for (i=0;i<gkod2.childNodes.length;i++){
				document.getElementById('TownID').options[0].selected=new Option ('Select Town','');
			 	document.getElementById('TownID').options[i+1]=new Option(gkod2.childNodes[i].firstChild.nodeValue,gkod2.childNodes[i].getAttribute("id"));					
				}				
			}				
		 }
	}
	xmlhttp.send(null);

}