function apriFinestra(url, myname, w, h, prop, res) {
 	var winl = (screen.width - w) / 2;
 	var wint = (screen.height - h) / 2;
 	winprops = "scrollbars="+prop+",height="+h+",width="+w+",top="+wint+",left="+winl+",resizable="+res+",status=yes";
	var win;
 	win = window.open(url, myname, winprops);
 if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//per la visualizzaione dei livelli di scadenziario
function getObj(nome)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(nome);
	this.style = document.getElementById(nome).style;
  }
  else if (document.all)
  {
	this.obj = document.all[nome];
	this.style = document.all[nome].style;
  }
}

function vis(val,nomelivello)
{
	var f = new getObj(nomelivello);
	f.style.visibility = val;
}


//questa server per evidenziare le righe di tabella
function ov(i, incl){
	if(document.getElementById(i).className=="BGrowselected"){
  	document.getElementById(i).className=incl;
  }else{
  	document.getElementById(i).className="BGrowselected";
 	}
}

//funzioni da utilizzare con ajax in contratti e assistenze
//carcamento di un Select
//caricamento dati in un div
function riempiSelect(inValRef,nomecampo,nomediv,URLPG){//4 argomento per un secondo parametro del form indispensabile per la query
	//alert('url passato '+URLPG);
	if(inValRef!=""){
		document.getElementById(nomecampo).options.length = 0;
		var strUrl2='';
		if(arguments[4]!=''){//strcliente
			strUrl2="&campoRef2="+arguments[4];
		}
		tempURL=URLPG+inValRef+strUrl2;
		caricaDatiCampoSelect(tempURL,nomediv,nomecampo);
		
	}else{
		eval("document.insert_fl."+nomecampo+".options.length=0");
	}
}
function caricaDatiInDiv(inValRef,nomediv,URLPG){
	tempURL=URLPG+inValRef;
	if(inValRef!=""){
		caricaPagina(tempURL,nomediv);
	}
}
//per presettare nontrasf (non conteggiare le ore trasferta in base alla selezione di eseguito
function preselectTrasferta(inValEseguito,inCampo,inForm){
	var F=eval("document."+inForm+"."+inCampo);
	if(inValEseguito=='lab'){
		F.checked=true;
	}else{
		F.checked=false;
	}
}