var xmlHttp
var xmlHttp2

function display_image(imgid)
{
 	
	if(imgid.length==0)
	 { 
			 document.getElementById("divdisplayimg").innerHTML="";
			 document.getElementById("divdisplayimg").style.border="0px";
			 return
	 }
			 
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
	 {
		alert ("Browser does not support HTTP Request")
		 return
	 } 

	/*var t1 = "**am**";
	var t2 = "**pm**";
	var doctor_name = doctor_name.replace(/&/g, t1);
	doctor_name = doctor_name.replace("?","**pm**");
	*/
	
	var url="../display-image.php"
	passdata="img_id="+imgid
	//alert(passdata);
	xmlHttp.onreadystatechange=stateChangedimg
	xmlHttp.open("POST",url,true)
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", passdata.length);
	xmlHttp.send(passdata)
	
} 

function stateChangedimg() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("divdisplayimg").style.display="block";
		document.getElementById("fullimgsection").style.display = 'none';
		document.getElementById("divdisplayimg").innerHTML=xmlHttp.responseText;
		document.getElementById("divdisplayimg").style.border="0px solid #A5ACB2";
		
	 } 
}


function display_all_image()
{
	 document.getElementById("fullimgsection").style.display = '';
	 document.getElementById("divdisplayimg").style.display='none';
	 //document.getElementById("divdisplayimg").innerHTML = '';
}
function display_doctor_profile(url,text)
{
 	document.frmdrprofile.hiddenvalue.value = text
	document.frmdrprofile.submit();
	//var url = url+'?text='+text
	//alert(url)
	//window.location = url
	//alert(window.location);
} 

/*function stateChanged2() 
{ 
	if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
	 { 
		// document.getElementById("divdisplaycurimg").innerHTML='';
		// document.getElementById("divdisplayimg").innerHTML=xmlHttp2.responseText;
		 //document.getElementById("divdisplayimg").style.border="0px solid #A5ACB2";
	 } 
}*/



function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
