	function GetDay(nDay)
	{
	  var Days = new Array("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
	  return Days[nDay]
	}

	function GetMonth(nMonth)
	{
	  var Months = new Array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
	  return Months[nMonth] 	  	 
	}

	function Clock(index) {
	  var oggi = new Date();
	  var wday = GetDay(oggi.getDay());
	  var day = oggi.getDate();
	  var month = GetMonth(oggi.getMonth());
	  var year = oggi.getFullYear();
	  document.orologio.data.value = wday + " " + day + " " + month + " " + year;

	  var HH = oggi.getHours();
	  var MM = oggi.getMinutes();
	  var SS = oggi.getSeconds();
	  parseInt(MM) < 10 ? MM = "0" + MM : null;
	  parseInt(SS) < 10 ? SS = "0" + SS : null;
	  document.orologio.ora.value = HH + ":" + MM + ":" + SS;
		if ( (count % delay) == 0 ) {
			setNextImage(index);
			index = (index + 1) % preLoad.length;
		}
		count = count + 1;
	  eval ("window.setTimeout('Clock("+index+")', 1000)");
	}

//******** slideshow ********//

	document.write("<style type='text/css'>#foto1 {visibility:hidden;}</style>");
	document.write("<style type='text/css'>#foto2 {visibility:hidden;}</style>");

	/*var pic_dir = "";
	var Pic = new Array("carel.gif","carly.gif","danfoss.gif");
	var Pic = new Array("http://localhost/NuovaRAFI New/primo/images/100_0107.JPG","http://localhost/NuovaRAFI New/primo/images/Immagine%20175_edited.jpg","http://localhost/NuovaRAFI New/primo/images/certificato%20fiera.JPG","http://localhost/NuovaRAFI New/primo/images/SATREC-SENEGAL_edited.JPG");*/
	var preLoad = new Array();
	for (i = 0; i < Pic.length; i++){
		preLoad[i] = new Image();
		preLoad[i].src = pic_dir + Pic[i];
	}
	var imageId1 = 'foto1';  // immagine sotto
	var max_width = 150;
	var max_height = 150;

	function initImage() {
		image1 = document.getElementById(imageId1);
		image1.src = preLoad[0].src;
		setSize(imageId1, preLoad[0], max_width, max_height);
		image1.style.visibility = "visible";
		Clock(1);
	}

	function setSize(objId, image, width, height) {
		if (image.width >= image.height)	{
			document.getElementById(objId).width = width;
			document.getElementById(objId).height = (image.height * width) / image.width;
		} else {
			document.getElementById(objId).height = height;
			document.getElementById(objId).width = (image.width * height) / image.height;
		}
	}

	function setNextImage(i) {
//		alert("i="+i);
		setSize(imageId1, preLoad[i], max_width, max_height);
		document.getElementById(imageId1).src = preLoad[i].src;
	}
