var xmlHttp;
function uploadphoto(id)
{	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
		
	var url="photo_hospital.php?id="+id+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
	//alert(str);
}
		
function stateChanged() 
{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				var div_id = "hospital_photo";
				document.getElementById(div_id).innerHTML="<img src='images/loading.gif'>";
				document.getElementById(div_id).innerHTML=xmlHttp.responseText
			} 
}


function uploadphoto2(id,MID)
{	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
		
	var url="photo_hospital2.php?id="+id+"&MID="+MID+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged222
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
	//alert(str);
}
		
function stateChanged222() 
{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				var div_id = "hospital_photo";
				document.getElementById(div_id).innerHTML="<img src='images/loading.gif'>";
				document.getElementById(div_id).innerHTML=xmlHttp.responseText
			} 
}


function GetXmlHttpObject()
{ 
			var objXMLHttp=null
			if (window.XMLHttpRequest)
			{
				objXMLHttp=new XMLHttpRequest()
			}
			else if (window.ActiveXObject)
			{
				objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
			}
			return objXMLHttp
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	

function showdetail(lid)
{	

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 	
		
	var url="showdetail.php?linkid="+lid+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged1() 
{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				var div_id1 = "showdetail";
				document.getElementById(div_id1).innerHTML=xmlHttp.responseText
			} 
}

//======================
function yeararticle(year,linkid)
{	

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 	
		
	var url="yeararticle.php?linkid="+linkid+"&year="+year+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged2
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged2() 
{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{	
				var div_id1 = "yeararticle";
				document.getElementById(div_id1).innerHTML=xmlHttp.responseText
			} 
}