$(function(){ 
	//alert('start')
	var t
	t=setTimeout("loadXMLDoc()",1000);
	}) 


function OnHide(name){
	alert(name)
	var divCtl = document.getElementById(name);
	divCtl.style.display="none";
		}
function loadXMLDoc()
{	
	var xmlhttp;
	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)
	     {
		 var jsondata = $.parseJSON(xmlhttp.responseText);
		 
		 for (x in jsondata.Data)
			{
				//alert(jsondata[x].id);
				$("#"+jsondata.Data[x].id+" img").attr("src",jsondata.Data[x].value);
			}
			
		if (jsondata.Finished)
			{	
				clearTimer();
				$('.operaterefresh li[rel=addFlag]').removeClass('refreshing');	
			}
		 
		 
		 //if (jsondata == "Complete")
			//{
		 	//clearTimer();
			//}
		 //else
			//{   
		    //alert(jsondata.id)
			//$("#"+jsondata.id+" img").attr("src",jsondata.value);
			//for (x in jsondata)
				//{
					//alert(jsondata[x].id);
					//$("#"+jsondata[x].id+" img").attr("src",jsondata[x].value);
				//}
			//}
			
			
			
		 }
	  }
	  
	xmlhttp.open("GET","Photo/json?now="+new Date().getTime(),true);
	xmlhttp.send();
	t=setTimeout("loadXMLDoc()",1000);
}

function clearTimer()
{
	clearTimeout(t);
	}