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;
}
var ajaxObj = getHTTPObject(); 

function prof_list(profdes,username,usertype){
	var city = '%';
	var name = document.frmprofe.txtname.value;
	var district = document.frmprofe.district.value;
	if(document.getElementById("selectcity")!=null)
	{
		city = document.frmprofe.selectcity.value;
	}
	
	url = "prof_list_detail.php?profdes="+profdes+"&name="+name+"&district="+district+"&city="+city+"&username="+username+"&usertype="+usertype+"&sid="+Math.random();
	ajaxObj.open("GET", url, true); 
	ajaxObj.onreadystatechange = displaytext; 
	ajaxObj.send(null);
}

function displaytext() 
{ 
	document.getElementById("proflist").innerHTML = "Loading...";
	if (ajaxObj.readyState == 4) {
	  if(ajaxObj.status==200) {
		var results=ajaxObj.responseText;
		document.getElementById("proflist").innerHTML = results;
		window.location = '#prof_list';
	  } 
	}
}

function paginate(pages,thispage,clickedlink,username,usertype)
{	
	var profdes = document.frmprofe.profession.value;
	var name = document.frmprofe.txtname.value;
	var district = document.frmprofe.district.value;
	var city = document.frmprofe.selectcity.value;
	
	url ='prof_list_detail.php?thispage='+thispage+"&pages="+pages+"&"+clickedlink+'=true'+"&profdes="+profdes+"&name="+name+"&district="+district+"&city="+city+"&username="+username+"&usertype="+usertype+'&sid='+Math.random(); 
	ajaxObj.open("GET", url, true);
	ajaxObj.onreadystatechange = displaytext;
	ajaxObj.send(null);
}

