function openw(theURL,winName,features) { 
  finestra = window.open(theURL,winName,features);
  finestra.focus();
}

function scriviCookie(nome, valore, durata, misura, percorso, dominio, sicurezza){
	if(arguments.length < 4)return;

	var tempo = (misura == "giorni") ? durata * 24 * 60 : durata;

	var termine = new Date();
	termine.setTime(termine.getTime() +  (tempo * 60 * 1000));

	document.cookie = nome + "!" + escape(valore) + "; expires=" + termine.toGMTString() +
	((percorso == null) ? "" : ("; path=" + percorso)) +
	((dominio == null) ? "" : ("; domain=" + dominio)) +
	((sicurezza == true) ? "; secure" : "");
}
