window.defaultStatus=" ::  Parrocchia di Castello sopra Lecco - Santi Martiri Gervaso e Protaso  ::  ";

function menuspegni(livello){menutempo=setTimeout("menuspegni2("+livello+")",3000);}
function menuspegni2(livello){if(!eval('menustatus'+livello)){MM_showHideLayers('menu'+livello,'','hide');}}
function menuaccendi(livello){
	clearTimeout(menutempo);
	for(var i=1;i<6;i++){
		if(i!=livello) MM_showHideLayers('menu'+i,'','hide');
		else MM_showHideLayers('menu'+i,'','show');
	}
}
var menutempo;
var menustatus1=false;
var menustatus2=false;
var menustatus3=false;
var menustatus4=false;
var menustatus5=false;
MM_preloadImages('../abc-lib/images/menu/home.hover.jpg','../abc-lib/images/menu/agenda.hover.jpg','../abc-lib/menu/images/attivita.hover.jpg','../abc-lib/menu/images/gruppi.hover.jpg','../abc-lib/menu/images/parrocchia.hover.jpg','../abc-lib/images/menu/parrocchia.hover.jpg','../abc-lib/images/menu/multimedia.hover.jpg');


var win = null; 
function NewWindow(mypage,myname,w,h,scroll){ 
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
settings = 
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no' 
win = window.open(mypage,myname,settings) 
} 


var enablepersist="on"

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
selectedItem=cid+"|"+document.getElementById(cid).style.display
}
}

function revivecontent(){
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
contractcontent(selectedComponents[0])
document.getElementById(selectedComponents[0]).style.display=selectedComponents[1]
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
if (typeof selectedItem!="undefined")
document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
getElementbyClass("switchcontent")
if (enablepersist=="on" && getselectedItem()!="")
revivecontent()
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

function museo(str) {
        searchWin = window.open(str,'museo','scrollbars=no,resizable=no,width=450,height=300,status=no,location=no,toolbar=no');
//        searchWin.refer = self;

}

function benedizioni(str) {
        searchWin = window.open(str,'benedizioni','scrollbars=yes,resizable=no,width=760,height=505,status=yes,location=no,toolbar=no');
//        searchWin.refer = self;

}

	function openMessaging() {
		nomefinestra = 'MessagingWindow';
		larghezza = screen.availWidth;
		//  alert('larghezza='+larghezza);
		altezza = screen.availHeight;
		//  alert('altezza='+altezza);
		sinistra = 0;
		if (larghezza >= 800) {
		delta = (larghezza - 800)/2;
		//	alert(delta);
		sinistra = delta + 120;
		}
		opzioni = 'scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=780,height=440,left='+sinistra+',top=50'
		nw=window.open('',nomefinestra,opzioni);
		nw.focus();
	}

	function chiericard(theform,idcode,passa) {
		if ((idcode == null) || (idcode.length == 0)) {
		alert('Attenzione! Non \u00E8 stata inserita la ID-CODE');
		return;
		}
		if ((passa == null) || (passa.length == 0)){
		alert('Attenzione! Non \u00E8 stata  inserita la password');
		return;
		}
		openMessaging();
		theform.idcode.value = idcode;
		theform.passa.value = passa;
		theform.submit();
	}


function fullWin(url) {
	var H=screen.availHeight-60;
	var W=screen.availWidth-10;
	window.open(url+'','','left=0,top=0,width='+W+',height='+H+',resizable=1,scrollbars=1,status=1');
}

// Initialize DHTML Toggle DIV
function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}
