var ie = document.all ? true:false;
var mac = window.navigator.platform.toLowerCase().search("mac")!=-1 ? true:false;

/*************************************************************************************************
*************************FUNZIONI DI COMPATIBILITA' TRA BROWSER***********************************
**************************************************************************************************/

function DocumentAll(obj) {
	if (obj.lastIndexOf(".")>0) {
		perc = obj.substr(0,obj.lastIndexOf("."));
		ob = obj.substr(obj.lastIndexOf(".")+1);
		if (ie) {
			var RetObj = eval(perc + ".document.all('"+ob+"')");
			return RetObj;
		} else {
			var RetObj = eval(perc +".document.getElementById('"+ob+"')");
			return RetObj;
		}
	}
	else {
	if (ie) {
	 var RetObj	=document.all(obj);
	 return RetObj}
	else {
		var RetObj	= document.getElementById(obj);
		return RetObj;
	}
	}
}
function DocumentAllN(obj) {
	if (obj.lastIndexOf(".")>0) {
		perc = obj.substr(0,obj.lastIndexOf("."));
		ob = obj.substr(obj.lastIndexOf(".")+1);
		if (ie) {
			var RetObj = eval(perc + ".document.all('"+ob+"')");
			return RetObj;
		} else {
			var RetObj = eval(perc +".document.getElementsByName('"+ob+"')");
			return RetObj[0];
		}
	}
	else {
	if (ie) {
	 var RetObj	=document.all(obj);
	 return RetObj}
	else {
		var RetObj	= document.getElementsByName(obj);
		return RetObj[0];
	}
	}
}

function ElList(obj) {
	if (obj.lastIndexOf(".")>0) {
		perc = obj.substr(0,obj.lastIndexOf("."));
		ob = obj.substr(obj.lastIndexOf(".")+1);
		if (ie) {
			var RetObj = eval(perc + ".document.all('"+ob+"')");
			return RetObj;
		} else {
			var RetObj = eval(perc +".document.getElementsByName('"+ob+"')");
			return RetObj;
		}
	}
	else {
	if (ie) {
	 var RetObj	=document.all(obj);
	 return RetObj}
	else {
		var RetObj	= document.getElementsByName(obj);
		return RetObj;
	}
	}
}
/*****************************************************************************************
******************************************************************************************/
function cambiaImmagine(oggetto, nuovaImmagine){
	oggetto.src = nuovaImmagine
}
function apriSistema(indirizzo){
	window.open(indirizzo,"sistema","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=424");
	//window.open("sistemacontrollo.html","sistema","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=424");
}
