	var videoPageLink = "http://www.youcabaret.it/videoShare/view/showVideo.action?videoId=";
	var videoMiniLink = "http://www.youcabaret.it/video/jpegVideo/"

		
	function loadVideo (request)
	{       
		$('#destination').find('div').remove ();       
		return addVideo(request);
	}

	function addVideo (request)
	{       
	  $.get(request+"?date="+(new Date()).getMilliseconds(), function (data)
	    {           
	      $(data).find ('video').each (function (i)
	      {

	        var location = $("#videoPreviewTemplate").clone();
	        location.find(".previewImage").find("img").attr('src',videoMiniLink+$(this).find ('preview').text());
	        
	        location.find(".previewImage").find("a").attr('href',videoPageLink+$(this).find ('id').text());
	        location.find(".videoTitolo").find("a").text($(this).find ('title').text());
	        location.find(".videoTitolo").find("a").attr('href',videoPageLink+$(this).find ('id').text());
	        location.find(".descrizione").text($(this).find ('description').text());
	        location.find(".visto").text($(this).find ('view').text());
	        location.find(".vistoOggi").text($(this).find ('viewToday').text());
	        location.find(".durata").text($(this).find ('lenght').text());
	        location.find(".view").eq("2").find("a").text($(this).find ('owner').text());
	        location.find(".view").eq("2").attr('id','anchor_'+$(this).find ('id').text());
	        // Jquery all'interno di una funzione cambia lo scope di this
	        var owner = $(this).find ('owner').text();
	        var ownerId = $(this).find ('ownerId').text();
	        var id = $(this).find ('id').text();
	        location.find(".view").eq("2").find("a").click (function(){showPopup(owner,ownerId,"anchor_"+id);return false;})
	        location.find(".ranking").text($(this).find ('ranking').text());
	        location.find(".data").text($(this).find ('insertDate').text());
	        
	        location.appendTo("#destination");
	      }
	      );
	      $("#pageNumber").text($(data).find ('page').text());
	    }
	  );
	  return false;
	}