/* le tre funzioni chiudiDiv(), nascondiDiv(), richiama(n) PER AVVISO NELLE PAG DELL'OF 2006/2007 */
function chiudiDiv() {
	var divPadre = document.getElementById("padre");
	if (divPadre.style.display == "") {
	  divPadre.style.display = "none";
	} else {
	  divPadre.style.display = "";
	}
}
function nascondiDiv() {
	var divFiglio = document.getElementById("figlio");
	var imgFiglio = document.getElementById("ac");
	if (divFiglio.style.display == "") {
	  divFiglio.style.display = "none";
	  imgFiglio.src = "/unicattolica_rm/images/chiudi.gif";
	} else {
	  divFiglio.style.display = "";
	  imgFiglio.src = "/unicattolica_rm/images/apri.gif";
	}
}
function richiama(n) {
	var miodiv;
	var code;
	var msg;
	// se n 1000000 oppure 2000000
	// il div non viene richiamato
	// nb: se occorre richiamare il div
	// richiamre l'id della pagina dove deve comparire
	if (n == 1000000 || n == 2000000) {
		//alert("chiamo funzione collegata alla pagina " + n);
		msg = "";
		msg = "&nbsp;<br>";
		msg += "<b>Il Servizio Didattica resterà chiuso<br>";
		msg += "dal 14 al 18 agosto 2006</b>";
//		msg += "<br><br>&nbsp;";
		miodiv = document.getElementById("richiama_" + n);
		miodiv.style.position = "absolute";
		miodiv.style.top = screen.height / 4;
		miodiv.style.left = screen.width / 3;
		//div esterno apri, chiudi
		code = "";
		code += "<div id=\"padre\"><img id=\"ac\" src=\"/unicattolica_rm/images/apri.gif\" width=\"250\" height=\"15\" border=\"0\" usemap=\"#Map\">";
		code += "<div id=\"figlio\" style=\"width:250px; height:50px; background-image:url(/unicattolica_rm/images/sfondoAvviso.gif); text-align:center;\">" + msg + "</div>";
		//div esterno apri, chiudi
		code += "</div>"
		code += "<map name=\"Map\">";
		code += "<area shape=\"rect\" coords=\"236,3,247,12\" onclick=\"chiudiDiv();\">";
		code += "<area shape=\"rect\" coords=\"216,3,231,12\" onclick=\"nascondiDiv();\">";
		code += "</map>";
		miodiv.innerHTML = code;
	} else {
		return;
	}
}

function scriviCookie(name, value, path, domain) {
  var cookie = name + "=" + escape(value) +
		((path) ? "; path=" + path : "") + 
		((domain) ? "; domain=" + domain : "") + 
		"; expires=Fri, 1 Jan 2010 00:00:00 UTC";
  document.cookie =  cookie;
}

function leggiCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) {
			return unescape(c.substring(nameEQ.length,c.length));
		}
	}
	return null;
}

function cancellaCookie(name, path, domain) { 
	if (leggiCookie(name)) { 
		document.cookie = name + "=" + 
		((path) ? "; path=" + path : "") + 
		((domain) ? "; domain=" + domain : "") + 
		"; expires=Thu, 01-Jan-70 00:00:01 GMT"; 
	} 
}

// inizio
//da migliorare/togliere 21/07/2005
function setCookie (n) {
	var cookieFinto;
	cookieFinto = n;
}

function setCookie1 (n) {
	var cookieFinto1;
	cookieFinto1 = n;
}
// fine 
function nascondiNovitaSede(n) {
	if (document.getElementById("NovitaSede") != null) {
		if (n == 0) {
		  document.getElementById("NovitaSede").style.display = "none";
		}
	}
}
function mostraNovitaSede(n) {
	if (document.getElementById("NovitaSede") != null) {
		if (n == 1) {
		  document.getElementById("NovitaSede").style.display = "";
		}
	}
}
function ApriFinestra(url,ref,wdt,hgt,top,lft,tool) { 
	var hb = (screen.width - wdt) / 2;
	var vb = (screen.height - hgt) / 2;
	window.open(url,ref,"toolbar=" + tool + ",location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=" + wdt + ",height=" + hgt + ",top=" + vb + ",left=" + hb); 
} 
function selection(url_path,name,w,h) {
	agent = navigator.userAgent;
	if (agent.toUpperCase().indexOf("MOZILLA/3.01 (MAC") > -1) 		location = url_path;
	else {
		max =window.open(url_path,name,'width=' + w +' ,height=' + h +' ,top=100,left=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		max.focus()
	}
}
function showLayer(layerName) {
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"'); 	
} 	
function hideLayer(layerName) {
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"'); 	
} 
function hideLayers() {
	hideLayer('layer2');
}
function apriISI() {
	var url = "http://websvi.rm.unicatt.it/pls/urp/documenti_pack.Pubblicazioni_ISI?ui=10800072&leggi_cat=16&leggi_sotto_cat=0&leggi_arg=0";
	window.open(url,'Pubblicazioni_ISI','scrollbars=yes,resizable=no,width=700,height=600');
}