function commonsearch(str1)
{
http.open("POST", "searchaction.php", true);
http.onreadystatechange = commonsearchHttpRes;
var params = "str1=" + encodeURI(str1)+
"&str2=" + encodeURI(document.getElementById("search").value);
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");
  http.send(params);
	}


function commonsearch1(str1)
{
http.open("POST", "searchaction.php", true);
http.onreadystatechange = commonsearchHttpRes1;
var params = "str1=" + encodeURI(str1);
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");
  http.send(params);
	}





function commonsearchHttpRes( ) {
  if (http.readyState == 4 && http.status == 200) { 
    res = http.responseText;  // These following lines get the response and update the page
window.location.href='searchaction.php';
}
}

function commonsearchHttpRes1( ) {
if (http.readyState == 4 && http.status == 200) { 
res = http.responseText;  // These following lines get the response and update the page
document.getElementById("page_contents").innerHTML=res;

}
else
{
document.getElementById('page_contents').innerHTML = "<div align='center'><img src='loder.gif'></div>";
}
}

function getXHTTP( ) {
  var xhttp;
   try {   // The following "try" blocks get the XMLHTTP object for various browsers…
      xhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e2) {
 		 // This block handles Mozilla/Firefox browsers...
	    try {
	      xhttp = new XMLHttpRequest();
	    } catch (e3) {
	      xhttp = false;
	    }
      }
    }
  return xhttp; // Return the XMLHTTP object
}

var http = getXHTTP(); // This executes when the page first loads.
var rowid;
