function getPostargue2(usei){
var poststr = "pid=" + encodeURI(usei);
return poststr;
}

function getPostargue2l(usei,usei1){
var poststr = "sid=" + encodeURI(usei) + "&scity=" + encodeURI(usei1);
return poststr;
}



function handleresi(){
var myajax=ajaxpack.ajaxobj;
var myfiletype=ajaxpack.filetype;
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
if (myfiletype=="txt"){
document.getElementById('listOption').innerHTML=myajax.responseText;
}
else
alert(myajax.responseXML);
}
}
}

function handleresil(){
var myajax=ajaxpack.ajaxobj;
var myfiletype=ajaxpack.filetype;
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
if (myfiletype=="txt"){
document.getElementById('listOptionl').innerHTML=myajax.responseText;
}
else
alert(myajax.responseXML);
}
}
}





function getPostargue21(t1,t2,f1,f2,ts){
var poststr = "t1=" + encodeURI(t1) + "&f1=" + encodeURI(f1)+ "&t2=" + encodeURI(t2)+ "&f2=" + encodeURI(f2)+ "&ts=" + encodeURI(ts);
return poststr;
}


function disedit(edit){
var poststr=getPostargue2(edit);
ajaxpack.postAjaxRequest("list.php", poststr, handleresi, "txt");
}

function diseditl(edit,edit1){
var poststr=getPostargue2l(edit,editl);
ajaxpack.postAjaxRequest("listl.php", poststr, handleresil, "txt");
}


function calal(t1,t2,f1,f2,ts){
var poststr=getPostargue21(t1,t2,f1,f2,ts);
ajaxpack.postAjaxRequest("time.php", poststr, handleresi, "txt");
}
function cln(t1){
var poststr=getcl(t1);
ajaxpack.postAjaxRequest("clinic.php", poststr, handlecl, "txt");
}
function getcl(t1){
var poststr = "t1=" + encodeURI(t1);
return poststr;
}

function handlecl(){
var myajax=ajaxpack.ajaxobj;
var myfiletype=ajaxpack.filetype;

if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
if (myfiletype=="txt"){
var data=myajax.responseText.split("~");
document.form1.clinic_name.value=data[0];
document.form1.clinic_name.readOnly=true;
document.form1.clinic_add.value =data[1];
document.form1.clinic_add.readOnly=true;
document.form1.zipcode.value    =data[2];
document.form1.zipcode.readOnly=true;
document.form1.locality.style.display="none";
document.getElementById('loc').innerHTML="<input type=text size=27 name='locality1' value='"+ data[3] +"'>";
document.form1.locality1.readOnly=true;
document.form1.locality23.value=data[4];
}
else
alert(myajax.responseXML);
}
}
}

function handlresidence(){
var myajax=ajaxpack.ajaxobj;
var myfiletype=ajaxpack.filetype;

if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
if (myfiletype=="txt"){
var data=myajax.responseText.split("~");
document.form1.clinic_name.value="Residence";
document.form1.clinic_name.readOnly=true;
document.form1.clinic_add.value =data[0];
document.form1.clinic_add.readOnly=true;
document.form1.zipcode.value    =data[1];
document.form1.zipcode.readOnly=true;
document.form1.clinic_ph.value    =data[2];
document.form1.clinic_ph.readOnly=true;
document.form1.clinic_ph2.value    =data[3];
document.form1.clinic_ph2.readOnly=true;
document.form1.clinic_name1.disabled=true;
document.form1.locality.style.display="none";
document.getElementById('loc').innerHTML="<input type=text size=27 name='locality1' value='"+ data[4] +"'>";
document.form1.locality1.readOnly=true;
document.form1.locality23.value=data[5];
}
else
alert(myajax.responseXML);
}
}
}

function emailid(t1){
var poststr=getemail(t1);
ajaxpack.postAjaxRequest("emailid.php", poststr, handlemail, "txt");
}
function getemail(t1){
var poststr = "t1=" + encodeURI(t1);
return poststr;
}

function handlemail(){
var myajax=ajaxpack.ajaxobj;
var myfiletype=ajaxpack.filetype;

if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
if (myfiletype=="txt"){
var data=myajax.responseText.split("-");
if(data != "")
{
window.open("passwordmatch.php",'Pass word match','height=100','width=100','left=100');
}
}
else
alert(myajax.responseXML);
}
}
}


