// JavaScript Document
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 chkavil12(str)
{
	//alert('ok');

if(str.lenght==0)
{
alert("please enter");
return;
}
var strURL="validateUser.php?q="+str;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					
 
  //alert(prid);
  

						document.getElementById('tt').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
		function myfuns()
		{
				//alert('ok');

			var prPo1=document.getElementById('proPurpose1');
 			 var prPo2=document.getElementById('proPurpose2');
               var strURL;
			if(prPo1.checked==true)
				{
					//alert ('Buy');
					strURL="buyBudget.php";
				}
			if(prPo2.checked==true)
				{
					//alert ('Rent');
					strURL="rentBudget.php";
				}
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					
 
  //alert(prid);
  

						document.getElementById('budget').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
					}		
			}
function city12(str)
{
	//alert('ok');
if(str.lenght==0)
{
alert("please enter");
return;
}
var strURL="city.php?q="+str;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					
 
  //alert(prid);
  

						document.getElementById('city1').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}

function gosize(str) {		
		//alert(str);
	
		var strURL="avil12.php?q="+str;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
					
		//alert(req.responseText);
		 var mystr45=req.responseText;
  //var myArr= new array;
  myArr12=mystr45.split(",");
  var prid=myArr12[0];
   var sqa12=myArr12[1];
 
  
  
 

var tts231=prid+",tts2314";
var sqz="sz12"+prid;


//alert(sqa12);
//alert('pop');
document.getElementById(tts231).innerHTML = "<input name='"+sqz+"' id='"+sqz+"' type='hidden' value='"+sqa12+"' />";
//document.getElementById('title1').value=mname;

		
		
		
					
						//document.getElementById('pack12').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
