	Event.observe(window,'load',aggiornaWebCam);
		
	 function aggiornaWebCam(){ 			
		setStartImg();
	 
		var ora = new Date().getHours();

		var allWebcam = document.getElementsByClassName('webcam');
					
		if (allWebcam){											
			var myPe = new PeriodicalExecuter(function(pe) {
				for (var i=0; i < allWebcam.length ; i++  ) {
					if ( (parseInt(ora)>=12) && (parseInt(ora)<14) ){					
						$(allWebcam[i]).update($(allWebcam[i]).innerHTML);
					}else{
						id = $(allWebcam[i]).id.split('_')[1];
						$('webcamImg_' + id).src = eval("altImg_" + id);
					}										
				}			
			}, 30.0);	
							
		}	
	}
	
	
	function setStartImg(){
	
		var ora = new Date().getHours();
		var allWebcam = document.getElementsByClassName('webcam');	
		if (allWebcam){
			for (var i=0; i < allWebcam.length ; i++  ) {
				if ( !((parseInt(ora)>=12) && (parseInt(ora)<14))){					
					var id = $(allWebcam[i]).id.split('_')[1];
					$('webcamImg_' + id).src = eval("altImg_" + id);
				}						
				 $(allWebcam[i]).show();				
			}			
		}
	}

		

