$(function() {

	$(".button").click(function() {
		
		// Nescondo il DIV della skimap
		$("#skimap").hide();
		
		var image1 = $('<img />').attr('src', 'images/indicator.gif').css("padding-top", "170px");
		
		// Insert preloaded image into the DOM tree
		$('#img_webcam').html(image1);
		
		var timestamp = new Date().getTime();
		
		var immagine = 'images/' + $(this).attr("res");    
			$('<img />')
		    .attr('src', immagine+'?'+timestamp)
		    .height(425).width(985)
	    	.load(function(){
	        	$('#img_webcam').html( $(this));
	        	$("#btn_next").show();
	    		$("#btn_prev").show();
	        });

		// Faccio vedere il div con le immagini
		$("#img_webcam").show();
	    
	  });
	  
	  
	$("#punti_video").click(function() {
	
		// Visulaizzo il DIV della skimap
		$("#skimap").show();
		
		
		var immagine = 'images/white.gif';    
		$('<img />')
			.attr('src', immagine)
			.height(200).width(300)
			.load(function(){
				$('#img_webcam').html( $(this) );
			});
		
		// Nascondo vedere il div con le immagini
		$("#img_webcam").hide();
		$("#btn_next").hide();
	    $("#btn_prev").hide();
	 
	  });
	  
	  
});
