
function searchResult(val1,val2,val3,val4)
{
   
 xmlhttpPost(val1,val2,val3,val4);
    return true;
  }
   function xmlhttpPost(val1,val2,val3,val4) 
{    


if ((typeof val1 !='undefined') || (typeof val2 !='undefined') || (typeof val3 !='undefined') || (typeof val4 !='undefined'))
{
          var page_pri=val1;
var pg=val2;
var city2=val4;  
}
else
{    
var page_pri="";
var city2=""; 

}

    document.getElementById("searchmain").innerHTML = "<FONT SIZE='2' COLOR='red'>Sending Request...<img src='manage/images/ajax-loader.gif' border='0'></font>";
             var url ="search.php?city2=" +city2+ "&page_pri="+page_pri;
//	 var posData = "?cat=" + cat + "&state=" + state + "&price=" + price  + "&price2=" + price2 +  "&page_pri=" + page_pri +   "&pg=" + pg + "&listing=" + listing + "&city=" + city + "&order=" + order + "&city2=" + city2;
   //alert(url);
    if (window.XMLHttpRequest) 
    { 
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) 
        {
            http_request.overrideMimeType('text/xml');
        }
    } 
    else if (window.ActiveXObject) 
    { // IE
        try 
        {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } 
        catch (e) 
        {
            try 
            {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    http_request.onreadystatechange = function() { getsearch(http_request); };
	http_request.open('GET', url , true);
//    http_request.open('GET', url + posData, true);
    http_request.send(null);
}
function getsearch(http_request){
    
   if (http_request.readyState == 4) {
        if (http_request.status == 200)
        {
            resText = http_request.responseText;
           //alert(resText);
            document.getElementById("searchmain").innerHTML = resText;
                      
        } else {
            document.getElementById("searchmain").innerHTML = "<FONT SIZE='4' COLOR='red'>Query not submitted!</FONT>";
            document.getElementById("searchmain").innerHTML = "<FONT SIZE='4' COLOR='red'>Query not submitted!</FONT>";
        }
    }
        }



