$(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);
		 

			$.each(jsondata.Data, function(index,item){
			//alert(item.NailPath);
				$("img#"  + item.Vid).attr("src",item.NailPath);
				}
			)

			
		if (jsondata.Finished == "finished")
			{	
				clearTimer();
			}
	
		 }
	  }
	  
	xmlhttp.open("GET","Video/addThumnail?now="+new Date().getTime(),true);
	xmlhttp.send();
	t=setTimeout("loadXMLDoc()",1000);
}

function clearTimer()
{
	clearTimeout(t);
	}