// JavaScript Document
//----------------------------- Testo scorrevole tool bar ----------------------------------//
	var scrtxt="Gesų Cristo č morto e risorto "+ 
             "per questo Dio Gli ha dato il nome che č al di sopra di ogni altro nome";
     var lentxt=scrtxt.length;
     var width=100;
     var pos=1-width;

     function scroll() {
      pos++;
      var scroller="";
      if (pos==lentxt) {
         pos=1-width;
      }
      if (pos<0) {
        for (var i=1; i<=Math.abs(pos); i++) {
            scroller=scroller+" ";
         }
        scroller=scroller+scrtxt.substring(0,width-i+1);
      } else {
         scroller=scroller+scrtxt.substring(pos,width+pos);
        }
       window.status = scroller;
       setTimeout("scroll()", 150);
    }

//--------------------------- testo scorrevole nella pagina ----------------------//
 	var id,pause=0,position=0;
	function scorrevole(){
		var i,k,msg="                Parrocchia Santa Maria Nuova, Piazza della Chiesa, 1 - 67050 Collelongo(AQ) - Diocesi Dei Marsi - Avezzano        ";
		k=(150/msg.length)+1;
		for(i=0;i<=k;i++) msg+=" "+msg;
		document.form2.scorrevole.value=msg.substring(position,position+150);
		if(position++==150) position=0;
		id=setTimeout("scorrevole()",150); 
	}
	
//------------------------------------- link dinamici ------------------------------------//
	
	var bufferImage = new Array();
	function Buffer(filename) {
    	var i = bufferImage.length;
    	bufferImage[i] = new Image();
    	bufferImage[i].src = filename;
	}
	
	function showImage(filename) {
		var bHtmlMode = false;
 		var str_iFrameDoc = (document.all)?
			"document.frames(\"Body\").document\;": "document.getElementById(\"Body\").contentDocument\;";
		iFrameDoc=eval(str_iFrameDoc);
		filename="Immagini/" + filename + ".jpg"
    	iFrameDoc.images[Image_Name].src = filename;
	}
	Image_Name = "SHOWPAD";
	Buffer("Immagini/0.jpg");
	Buffer("Immagini/5.jpg");
	Buffer("Immagini/6.jpg");
	Buffer("Immagini/10.jpg");
	Buffer("Immagini/18.jpg");
	Buffer("Immagini/21.jpg");	
//------------------------------------ Menu --------------------------------------------------------
	function inizializza(){ 
       if (document.all) { 
	    documento="document.all"; 
         parA="[\""; 
         parB="\"]"; 
         visibilita=".style.visibility"; 
         nascosto="\"hidden\""; 
         visibile="\"visible\""; 
       } 
       else if (document.layers){ //NN4 
         documento="document.layers"; 
         parA="[\""; 
         parB="\"]"; 
         visibilita=".visibility"; 
         nascosto="\"hide\""; 
         visibile="\"show\""; 
       } 
       else if (document.getElementById) { // Opera e NN6 
          documento="document.getElementById"; 
         parA="(\""; 
         parB="\")"; 
         visibilita=".style.visibility"; 
         nascosto="\"hidden\""; 
         visibile="\"visible\""; 
       } 
    } 

	 function nascondi() {    
      if (document.all) {
         document.all["mostraMenu"].style.visibility="hidden";
       }
       else if (document.layers){ //NN4
          document.layers["mostraMenu"].visibility="hide";
       }
       else if (document.getElementById) { //NN6 ed Opera
		  document.getElementById("mostraMenu").style.visibility="hidden";
       }
     } 

	 function mostra() { 
      	if (document.all) {
      		document.all["mostraMenu"].style.visibility="visible";
    	}
    	else if (document.layers){
	       document.layers["mostraMenu"].visibility="show";
    	}
	    else if (document.getElementById) {
    	   document.getElementById("mostraMenu").style.visibility="visible";
    	}
     } 

	 inizializza(); 
	 
	 function autohidden(eName){
		 if (eName=="Parrocchia"){
			 var paese ="Paese";
			 if(document.getElementById(paese).style.display == "block" || document.getElementById(paese).style.display == ""){
				 document.getElementById(paese).style.display = 'none';
			 }
			 var percorso_file=document.getElementById("Body").src;
			 var perc_body=percorso_file.indexOf("Body");
			 percorso_file=percorso_file.substr(perc_body);
			 if(percorso_file == "Body2.html"){
				document.getElementById("Body").src="Body.html";
				}
		 }
		 if (eName=="Paese"){
			 var parrocchia ="Parrocchia";
		   	 if(document.getElementById(parrocchia).style.display == "block" || document.getElementById(parrocchia).style.display == ""){
				 document.getElementById(parrocchia).style.display = 'none';
			 }
			 var percorso_file=document.getElementById("Body").src;
			 var perc_body=percorso_file.indexOf("Body");
			 percorso_file=percorso_file.substr(perc_body);
			 if(percorso_file == "Body.html"){
				document.getElementById("Body").src="Body2.html";
				}
		 }
		 if (document.getElementById(eName).style.display == "none" || 
			  document.getElementById(eName).style.display == ""){
			 document.getElementById(eName).style.display = 'block';
		 }
	    else{
	        document.getElementById(eName).style.display = 'none';
		}
	}


function external() {
 if (document.getElementsByTagName) {
  var i, a;
  a = document.getElementsByTagName('a');
  for (i in a) {
   if (a[i].getAttribute('href') && 
       a[i].getAttribute('rel') == 'external') a[i].target = '_blank';
  }
 }
}
window.onload = external;

//------------------ main -----------------------------------
function funzioni()
	{
		scorrevole();
		scroll();
	}	