function JavaTrim(stringa){
		
		var appo = new Array();
		var strOut="";
		var strIn="";
		appo=stringa.split(' ');
		for (i=0;i<appo.length;i++){
			if(appo[i]!=""){
				strOut=strOut+appo[i]+" ";
			}
		}
		if (strOut.length>0){
			strOut=strOut.substr(0,strOut.length-1);
		}
		return strOut
	}

function change(id, newClass) {

	identity=document.getElementById(id);

	identity.className=newClass;

}

function VisualizzaSchedaAttivita(){
	
	if (document.getElementById("cmbAttivita").value != '-1'){
		document.getElementById("hid_TxtAttivita").value = document.getElementById("cmbAttivita").value
		document.getElementById("hid_idFunzione").value = "0";
		//document.getElementById("Form1").target = "iframe1"
		document.getElementById("Form1").target = "_top";
		document.getElementById("Form1").method = "get";
		document.getElementById("Form1").action = "/SchedeAttivita/SchedaAttivita.asp"
		document.getElementById("Form1").submit()
		//document.getElementById("iframe1").focus()
	}
}

function Cerca(){
	
	if(JavaTrim(document.getElementById("txtCerca").value) != ''){
		
		document.getElementById("hid_TxtCerca").value = document.getElementById("txtCerca").value
		document.getElementById("Form1").target = "_self";
		document.getElementById("Form1").method = "get";
		document.getElementById("Form1").action = "/Cerca/Cerca.asp" 
		document.getElementById("Form1").submit()

	}
}

function chg_language(){
	if(document.getElementById("slLanguage").value!=0){
		document.getElementById("Form1").target = "_self"
		document.getElementById("Form1").action = "/chg_language.asp" // 
		document.getElementById("Form1").submit()
	}
}	

function getCurrentTime() {
	
		var d = new Date();
		var h = d.getHours();
		var m = d.getMinutes();

		var str = '';

		if (h < 10) {
			str += '0' + h + '.';
		}
		else {
			str += h + '.';
		}

		if (m < 10) {
			str += '0' + m;
		}
		else {
			str += m;
		}

		document.getElementById("tdTime").innerHTML = '&nbsp;' + str;
	
		var timeout = window.setTimeout("getCurrentTime()", 10000);
	}	

function goBack(){
	//self.history.back();
	history.back();
}



function apri(url)
{
	window.location.href = "http://" + url 
}

function callPage(idFunz, strHREF, idPalc){
	// Carico la pagina collegata
	parent.caricaPalchetto(idFunz,strHREF, idPalc);
}
