function page_user_report(pno,name,country,state,district,doctor,search_cat,startdate,enddate)//age_from,age_to,sex,disease_category
{
    //alert("Rajasekar");
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="xml_user_report_search_list.php";
url=url+"?pno="+pno+"&name="+name+"&countryid="+country+"&stateid="+state+"&districtid="+district+"&doctor="+doctor+"&search_cat="+search_cat+"&startdate="+startdate+"&enddate="+enddate;
//alert(url);
xmlhttp.onreadystatechange=stateChangedpage_user_port_page;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChangedpage_user_port_page()
{
if (xmlhttp.readyState==4)
  {
 //   history.go(0);
//alert(xmlhttp.responseText);
document.getElementById("search_list").innerHTML=xmlhttp.responseText;
  }
}






function user_report_search()
{
    //alert("Rajasekar");
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

var vname=document.getElementById("user_fname").value;

//alert("name="+vname);//


//alert(age_from+" "+age_to);
if(document.getElementById("doctor1").checked==true)
{
var doctor=document.getElementById("doctor1").value;
}
else if(document.getElementById("doctor2").checked==true)
{
var doctor=document.getElementById("doctor2").value;
}
else
{
var doctor=document.getElementById("doctor3").value;
}
//alert(doctor);
stateid=document.getElementById("DSStates").value;
districtid=document.getElementById("DSDistricts").value;

countryid=document.getElementById("DSCountry").value;
if(countryid!=1)
{

    stateid=0;
    districtid=0;
}
else if(countryid==1)
{
    if(stateid==0)
    {
        districtid=0;
    }
}

startdate=document.getElementById("startdate").value;
enddate=document.getElementById("enddate").value;
if(startdate=="")
{
    startdate=0;
}
if(enddate=="")
{
    enddate=0;
}

if(document.getElementById("search_cat0").checked==true)
{
    var search_cat=document.getElementById("search_cat0").value;
    //alert("00");
}
else if(document.getElementById("search_cat1").checked==true)
{
    var search_cat=document.getElementById("search_cat1").value;
    //alert("01");
}
else if(document.getElementById("search_cat2").checked==true)
{
    var search_cat=document.getElementById("search_cat2").value;
    //alert("02");
}
else if(document.getElementById("search_cat3").checked==true)
{
    var search_cat=document.getElementById("search_cat3").value;
    //alert("03");
}

//alert("Rajasekar="+search_cat);

//alert(stateid+"-"+districtid);
//alert(sex);
var url="xml_user_report_search_list.php";
url=url+"?name="+vname+"&countryid="+countryid+"&stateid="+stateid+"&districtid="+districtid+"&doctor="+doctor+"&startdate="+startdate+"&enddate="+enddate+"&search_cat="+search_cat;
//url=url+"?name="+vname+"&stateid="+stateid+"&districtid="+districtid+"&doctor="+doctor+"&startdate="+startdate+"&enddate="+enddate+"&search_cat="+search_cat;


//alert(url);
xmlhttp.onreadystatechange=stateChangedsearch_user_report;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChangedsearch_user_report()
{
if (xmlhttp.readyState==4)
  {
   // alert(xmlhttp.responseText);
    document.getElementById("search_list").innerHTML=xmlhttp.responseText;
  }
}


function user_report_show(uid,divid,type,name)//USERID,DIVID,REPORT TYPE
{
    //alert(name);
    document.getElementById("user_report"+divid).className="user_report_showdiv";
    
    user_report_detail_divid=divid;
    xmlhttp=GetXmlHttpObject();
    if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
    
    var url="xml_user_report_details.php";
    url=url+"?uid="+uid+"&type="+type+"&divid="+divid+"&name="+name;
    //alert(url);
    xmlhttp.onreadystatechange=user_report_detail;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
    
}
function user_report_detail()
{
if (xmlhttp.readyState==4)
  {
   // alert(xmlhttp.responseText);
  // alert(user_report_detail_divid);
    document.getElementById("user_report_div"+user_report_detail_divid).innerHTML=xmlhttp.responseText;
  }
}
function closeuserreport(divid)
{
    document.getElementById("user_report"+divid).className="user_report_hiddendiv";
}
