<!--
	function CheckFormSearch() {
		re = /\s+$|^\s+/g;
		
		// Elimino gli spazi vuoti inseriti nelle text della form
		document.getElementById('frmCerca').cerca.value = document.getElementById('frmCerca').cerca.value.replace(re, '');
		
		// Controllo che non siano stati lasciati campi vuoti nella form
		if (document.getElementById('frmCerca').cerca.value.length < 3) {
			window.alert('E\' necessario inserire almeno tre caratteri');
			document.getElementById('frmCerca').cerca.focus();
			return false;
		}
		document.getElementById('frmCerca').cerca.focus();
	}
	function TargetBlank() { 	// attributo 'target="_blank"' per il tag 'a' in XHTML (è una toppa per ingannare il validatore...)
		for (var i=0; i<document.links.length; i++)
			if (document.links[i].className=="blank") {
				document.links[i].target="_blank";
		} 
	}
	function rollover(nome, img) {
		document.images[nome].src = "" + img
	}
	
	function FormatDate(DateToFormat,FormatAs) {
		if (DateToFormat == "") { return""; }
		if (!FormatAs) { FormatAs="dd/mm/yyyy"; }
		
		var strReturnDate;
		FormatAs = FormatAs.toLowerCase();
		DateToFormat = DateToFormat.toLowerCase();
		var arrDate
		var arrMonths = new Array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
		var strMONTH;
		var Separator;
		
		while (DateToFormat.indexOf("st") > -1) {
			DateToFormat = DateToFormat.replace("st","");
		}
		while (DateToFormat.indexOf("nd") > -1) {
			DateToFormat = DateToFormat.replace("nd","");
		}
		while (DateToFormat.indexOf("rd") > -1) {
			DateToFormat = DateToFormat.replace("rd","");
		}
		while (DateToFormat.indexOf("th") > -1) {
			DateToFormat = DateToFormat.replace("th","");
		}
		if (DateToFormat.indexOf(".") > -1) {
			Separator = ".";
		}
		if (DateToFormat.indexOf("-") > -1) {
			Separator = "-";
		}
		
		if (DateToFormat.indexOf("/") > -1) {
			Separator = "/";
		}
		if (DateToFormat.indexOf(" ") > -1) {
			Separator = " ";
		}
		
		arrDate = DateToFormat.split(Separator);
		DateToFormat = "";
			for (var iSD = 0;iSD < arrDate.length;iSD++) {
				if (arrDate[iSD] != "") {
					DateToFormat += arrDate[iSD] + Separator;
				}
			}
		DateToFormat = DateToFormat.substring(0,DateToFormat.length-1);
		arrDate = DateToFormat.split(Separator);
		
		if(arrDate.length < 3){
			return "";
		}
		
		var DAY = arrDate[0];
		var MONTH = arrDate[1];
		var YEAR = arrDate[2];
		
		if (parseFloat(arrDate[1]) > 12) {
			DAY = arrDate[1];
			MONTH = arrDate[0];
		}
		if (parseFloat(DAY) && DAY.toString().length == 4) {
			YEAR = arrDate[0];
			DAY = arrDate[2];
			MONTH = arrDate[1];
		}
		
		for (var iSD = 0;iSD < arrMonths.length;iSD++) {
			var ShortMonth = arrMonths[iSD].substring(0,3).toLowerCase();
			var MonthPosition = DateToFormat.indexOf(ShortMonth);
				if (MonthPosition > -1) {
					MONTH = iSD + 1;
					if (MonthPosition == 0) {
						DAY = arrDate[1];
						YEAR = arrDate[2];
					}
					break;
				}
		}
		
		var strTemp = YEAR.toString();
		if (strTemp.length == 2) {
			if (parseFloat(YEAR) > 40) {
				YEAR = "19" + YEAR;
			} else {
				YEAR = "20" + YEAR;
			}
		}
		
		if (parseInt(MONTH)< 10 && MONTH.toString().length < 2) {
			MONTH = "0" + MONTH;
		}
		if(parseInt(DAY)< 10 && DAY.toString().length < 2) {
			DAY = "0" + DAY;
		}
		switch (FormatAs) {
			case "dd/mm/yyyy":
				return DAY + "/" + MONTH + "/" + YEAR;
			case "mm/dd/yyyy":
				return MONTH + "/" + DAY + "/" + YEAR;
			case "dd/mmm/yyyy":
				return DAY + " " + arrMonths[MONTH -1].substring(0,3) + " " + YEAR;
			case "mmm/dd/yyyy":
				return arrMonths[MONTH -1].substring(0,3) + " " + DAY + " " + YEAR;
			case "dd/mmmm/yyyy":
				return DAY + " " + arrMonths[MONTH -1] + " " + YEAR;	
			case "mmmm/dd/yyyy":
				return arrMonths[MONTH -1] + " " + DAY + " " + YEAR;
		}
		
		return DAY + "/" + strMONTH + "/" + YEAR;;
	}
	function _Date() {
		var oggi   = new Date();
		
		var giorno = oggi.getDate();
		var mese   = (oggi.getMonth() + 1);
		var anno   = oggi.getFullYear();
		
		return giorno + "/" + mese + "/" + anno;
	}
	function Time() {
		var oggi    = new Date();
		
		var ora     = oggi.getHours();
		var minuti  = oggi.getMinutes();
		var secondi = oggi.getSeconds();
		
		// return ora + ":" + minuti + ":" + secondi;
		return ora + ":" + minuti;
	}
	function ScriviData() {
		document.write(FormatDate(_Date(), 'dd/mmmm/yyyy') + ' &bull; ' + Time());
	}
	
	window.onload = TargetBlank;
//-->
