// JavaScript Document
// 

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}




// ajax

function getpractitionerdetails(str)
 {
 if (str=="")
   {
   document.getElementById("txtHint").innerHTML="";
   return;
   } 
if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
   xmlhttp=new XMLHttpRequest();
   }
 else
   {// code for IE6, IE5
   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
 xmlhttp.onreadystatechange=function()
   {
   if (xmlhttp.readyState==4 && xmlhttp.status==200)
     {
	
     results=xmlhttp.responseText;	
	 SplitResult = results.split("~");
	
     document.getElementById("pname").innerHTML=SplitResult[0];
	 document.getElementById("ptelephone").innerHTML="Telephone : " +SplitResult[1];
	 document.getElementById("ptext").innerHTML=SplitResult[2];
	 document.getElementById("pdesc").innerHTML="<b>" + SplitResult[5] + "</b>";
	 
     document.apmt.practioner.value= SplitResult[0];
	 document.apmt.practioneremail.value= SplitResult[3];
	 document.apmt.practionerkey.value= SplitResult[4];
	 
}
   }
 xmlhttp.open("GET","/getpractitioner.php?q="+str,true);
 xmlhttp.send();
 }
 
 
 
 function send_ap_request()
 {
	
$outstr="apname=" + document.apmt.apname.value +"&apcontactno=" + document.apmt.apcontactno.value +"&apnotes=" +document.apmt.apnotes.value+ "&practioneremail="+ document.apmt.practioneremail.value;
	
	
 xmlhttp.open("POST","/sendrequest2.php",true);
 xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
 xmlhttp.send($outstr);
 
 MM_showHideLayers('doctor','','hide')
 
 alert ( "Thank you for contacting Us. A Practitioners will call you soon");
 }
 
 
 
function newmember()
 {
	if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
   xmlhttp=new XMLHttpRequest();
   }
 else
   {// code for IE6, IE5
   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }	
	
	$outstr="name=" + document.member.nmname.value +"&email=" + document.member.nmemail.value +"&tel=" +document.member.nmtel.value+ "&area="+ document.member.nmarea.value+ "&profbody="+ document.member.nmprofbody.value;	

		
 xmlhttp.open("POST","/newmember.php",true);
 xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
 xmlhttp.send($outstr);
 

 document.member.nmname.value="";
 document.member.nmemail.value="";
 document.member.nmtel.value="";
 document.member.nmarea.value="";
 document.member.nmprofbody.value="";
 
 alert ( "Thank you for contacting Us. We will call you soon");
 }
 
 
 


function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}




function appointment(practitioner)
{
doctorkey=practitioner;	
MM_showHideLayers('doctor','','show')
getpractitionerdetails(doctorkey);
}


function appointmentclose()
{

MM_showHideLayers('doctor','','hide')
}
