function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		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 getcasteindex(casteid) {		
		
		var strURL="lib/getcaste.php?casteid="+casteid;
		//strURL=strURL+Math.random()
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4)
				{
					// only if "OK"
					
					if (req.status == 200) 
					{	
					
					//alert('hai hello');
					//alert(req.responseText);					
						document.getElementById('castediv').innerHTML=req.responseText;						
					}
					//else
//					{
//						
//					document.getElementById('castediv').innerHTML='<select  name="caste" id="caste" disabled="disabled">
//	  <option value="0">Loading..</option>
//        </select>';			
//					}
					
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	
	function getcastefran(casteid) {		
		
		var strURL="../../lib/getcaste.php?casteid="+casteid;
		//strURL=strURL+Math.random()
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4)
				{
					// only if "OK"
					
					if (req.status == 200) 
					{	
					
					//alert('hai hello');
					//alert(req.responseText);					
						document.getElementById('castediv').innerHTML=req.responseText;						
					}
					//else
//					{
//						
//					document.getElementById('castediv').innerHTML='<select  name="caste" id="caste" disabled="disabled">
//	  <option value="0">Loading..</option>
//        </select>';			
//					}				
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	function getcaste(casteid) {		
		
		var strURL="../lib/getcaste.php?casteid="+casteid;
		//strURL=strURL+Math.random()
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) 
					{	
					
					//alert('hai hello');
					//alert(req.responseText);					
						document.getElementById('castediv').innerHTML=req.responseText;						
					}
					
					
					
					
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	function getcaste1(casteid) {		
		
		var strURL="../../lib/getcaste.php?casteid="+casteid;
		//strURL=strURL+Math.random()
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) 
					{	
					
					//alert('hai hello');
					//alert(req.responseText);					
						document.getElementById('castediv').innerHTML=req.responseText;						
					}
				 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}

	function children(child) {	

		
		var strURL="../lib/children.php?child="+child;
		//strURL=strURL+Math.random()
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) 
					{	
					
					//alert('hai hello');
					//alert(req.responseText);					
						document.getElementById('childdiv').innerHTML=req.responseText;						
					}
					
					
					
					
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	function getState(countryId) {		
		
		var strURL="../lib/findState.php?country="+countryId;
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					
					
					if (req.status == 200) 
					{	
					
					
					 //alert(req.responseText);					
						document.getElementById('statediv').innerHTML=req.responseText;						
					}
					
					
					
					
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	function getStatehoro(countryId) {		
		
		var strURL="../lib/findStatehoro.php?country="+countryId;
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					
					
					if (req.status == 200) 
					{	
					
					
					 //alert(req.responseText);					
						document.getElementById('statediv').innerHTML=req.responseText;						
					}
					
					
					
					
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	
	function getplacehoro(place) {	
	alert("ggg");
	alert(place);
		
		var strURL="../lib/getplacehoro.php?place="+place;
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					
					
					if (req.status == 200) 
					{	
					
					
					 //alert(req.responseText);					
						document.getElementById('detid').innerHTML=req.responseText;						
					}
					
					
					
					
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	
	
	function getState1(countryId) {		
		
		var strURL="../../lib/findState1.php?country="+countryId;
		//alert(strURL);
		//
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					
					
					if (req.status == 200) 
					{	
					
					
					 //alert(req.responseText);					
						document.getElementById('statediv').innerHTML=req.responseText;						
					}
					 else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	function getCity(stateId) {		
		var strURL="../lib/findCity.php?state="+stateId;
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					//alert(req.responseText);					
						document.getElementById('citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}
	function getCityhoro(stateId) {		
		var strURL="../lib/findCityhoro.php?state="+stateId;
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					//alert(req.responseText);					
						document.getElementById('citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}
	function getCity1(stateId) {		
		var strURL="../../lib/findCity1.php?state="+stateId;
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					//alert(req.responseText);					
						document.getElementById('citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}
	function getCity2(stateId) {		
		var strURL="../../lib/place_list.php?state="+stateId;
		//alert(strURL);
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					//alert(req.responseText);					
						document.getElementById('citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}