// JavaScript Document


var http = getHTTPObject();
//Start Ziaul 27.10.2007////////////////
var CATID="1";
function handleHttpAgeLow() {	
		if (http.readyState == 4) {
			  if(http.status==200) {
			  	var results=http.responseText;
				//alert(results);
				if(results.length != 0){
					document.all.syear1.innerHTML=results;
					OpenAgeHigh(CATID);
				}
				
			  }
  			}
		}

      function OpenAgeLow(cat_id) { 
  
			//alert(cat_id);
			var url = "ajaxagelow.php?cat=" + cat_id; // The server-side script		
		//  window.open( "ajaxlookfor.php?cat=" + cat_id, cat_id, 'toolbar=no, resizable=no, status=yes, width=600, height=605');
			
			http.open("GET", url, true);
			http.onreadystatechange = handleHttpAgeLow;
			http.send(null); 
        }
		
		
     function handleHttpAgeHigh() {	
		if (http.readyState == 4) {
			  if(http.status==200) {
			  	var results=http.responseText;
			//	alert(results);
				if(results.length != 0){
					document.all.syear2.innerHTML=results;
					
				}
				
			  }
  			}
		}

      function OpenAgeHigh(cat_id) { 
  
			
			var url = "ajaxagehigh.php?cat=" + cat_id; // The server-side script		
		//  window.open( "ajaxlookfor.php?cat=" + cat_id, cat_id, 'toolbar=no, resizable=no, status=yes, width=600, height=605');
			
			http.open("GET", url, true);
			http.onreadystatechange = handleHttpAgeHigh;
			http.send(null); 
        }
		

////End Ziaul///////////////////////////
function handleHttpResponse() {	
		if (http.readyState == 4) {
			  if(http.status==200) {
			  	var results=http.responseText;
			//	alert(results);
				if(results.length != 0){
					document.getElementById('lookfor').innerHTML = results;
					OpenAgeLow(CATID);
				}
				
			  }
  			}
		}


  function OpenLookFor(cat_id) { 
  
			CATID=cat_id;
			var url = "ajaxlookfor.php?cat=" + cat_id; // The server-side script		
		//  window.open( "ajaxlookfor.php?cat=" + cat_id, cat_id, 'toolbar=no, resizable=no, status=yes, width=600, height=605');
			
			http.open("GET", url, true);
			http.onreadystatechange = handleHttpResponse;
			http.send(null); 
        }
		
		
function handleHttpAnser() {	
		if (http.readyState == 4) {
			  if(http.status==200) {
			  	var results=http.responseText;
				//alert(results);
				if(results.length != 0){
					//document.getElementById('soci').display = "block" ;
					document.getElementById('soci').innerHTML = results;
				}
				
			  }
  			}
		}



function getHTTPObject() {
  var xmlhttp;
 
  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    
}
  return xmlhttp;

  
}


function SearchOpen(id)
 {
	
	var cit = document.getElementById("city").value ;
	var occ = document.getElementById("occupation").value ;
	if((document.getElementById("ph").checked ||cit == "ahmedabad" ) && occ == 13)
	 { 
	 var url = "ajaxAdvance.php?case=1&occ=" + occ ;
	// window.open( url, id, 'toolbar=no, resizable=no, status=yes, width=600, height=605');
	        http.open("GET", url, true);
			http.onreadystatechange = handleHttpAnser ;
			http.send(null); 
	 //alert("OK OK ") ; 
	 }

 }
		
