
/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts.
This may be used freely as long as this msg is intact!
********************************************************************************
Browsercheck:*/
ie=document.all?1:0
n=document.layers?1:0

/********************************************************************************
If you want to change the appearens on the text, background-colors, size or
anything do that in the style tag above.

This menu might not be as easy to adapt to your own site, but please
play around with it before you mail me for help 
****************************************************************************/

/***************************************************************************
Variables to set.
****************************************************************************/
//How many menus do you have? (remember to copy and add divs in the body if you add menus)
var numberOfMenus=4
//The width on the menus (set the width in the stylesheet as well)
var mwidth=101
//Pixels between the menus
var pxBetween=18
//The first menus left position
var fromLeft=280
//The top position of the menus
var fromTop=70
//The bgColor of the bottom mouseover div
var bgColor='#CECFCE'
//The bgColor to change to
var bgColorChangeTo='#6380BC'
//The position the mouseover line div will stop at when going up!
var imageHeight=15
/***************************************************************************
You shouldn't have to change anything below this
****************************************************************************/
//Object constructor
function makeNewsMenu(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'					
	this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')	
	this.scrollHeight=n?this.css.document.height:eval('document.all.'+obj+'.offsetHeight')
	this.moveIt=b_moveIt;this.bgChange=b_bgChange;
	this.slideUp=b_slideUp; this.slideDown=b_slideDown;
	this.clipTo=b_clipTo;
    this.obj = obj + "Object"; 	eval(this.obj + "=this")		
    
 }
//Objects methods
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}
function b_bgChange(color){if(ie) this.css.backgroundColor=color; else this.css.bgColor=color}
function b_clipTo(t,r,b,l){
	if(n){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l
	}else this.css.clip="rect("+t+","+r+","+b+","+l+")";
}
function b_slideUp(ystop,moveby,speed,fn,wh){
	if(!this.slideactive){
		if(this.y>ystop){
			this.moveIt(this.x,this.y-10); eval(wh)
			setTimeout(this.obj+".slideUp("+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed)
		}else{
			this.slideactive=false; this.moveIt(0,ystop); eval(fn)
		}
	}
}
function b_slideDown(ystop,moveby,speed,fn,wh){
	if(!this.slideactive){
		if(this.y<ystop){
			this.moveIt(this.x,this.y+10); eval(wh)
			setTimeout(this.obj+".slideDown("+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed)
		}else{
			this.slideactive=false; this.moveIt(0,ystop); eval(fn)
		}
	}
}
//Initiating the page, making cross-browser objects
function newsMenuInit(){
	oTopMenu=new Array()
	for(i=0;i<=numberOfMenus;i++){
		oTopMenu[i]=new Array()
		oTopMenu[i][0]=new makeNewsMenu('divTopMenu'+i)
		oTopMenu[i][1]=new makeNewsMenu('divTopMenuBottom'+i,'divTopMenu'+i)
		oTopMenu[i][2]=new makeNewsMenu('divTopMenuText'+i,'divTopMenu'+i)
		oTopMenu[i][1].moveIt(0,imageHeight)
		oTopMenu[i][0].clipTo(0,mwidth,imageHeight+3,0)
		oTopMenu[i][0].moveIt(i*mwidth+0+(i*pxBetween),0)
		//oTopMenu[i][0].moveIt(i*mwidth+fromLeft+(i*pxBetween),fromTop)
		oTopMenu[i][0].css.visibility="visible"
	}
}
//Moves the menu
function topMenu(num){
	if(oTopMenu[num][1].y==imageHeight) oTopMenu[num][1].slideDown(oTopMenu[num][2].scrollHeight+20,10,40,'oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)','oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)')
	else if(oTopMenu[num][1].y==oTopMenu[num][2].scrollHeight+20) oTopMenu[num][1].slideUp(imageHeight,10,40,'oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)','oTopMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)')
}
//Changes background onmouseover
function menuOver(num){oTopMenu[num][1].bgChange(bgColorChangeTo)}
function menuOut(num){oTopMenu[num][1].bgChange(bgColor)}

//Set these variables:

//The pixel value of where you want the layer to start (from the top)
lstart=220

//Set this to false if you just want it to go one time
loop=true 

//Set the speed, lower value gives more speed
speed=100

//Set this to how many pixels you want it to go for each step, this also changes the speed.    
pr_step=5
	
/**********************************************************************
You don't have to change anything below this
**********************************************************************/

//Object constructor
function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
    this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
	this.scrollHeight=n?this.css.document.height:eval(obj+'.offsetHeight')
	this.up=goUp
    this.obj = obj + "Object"
    eval(this.obj + "=this")
   return this
}
//Makes the layer slide up
function goUp(speed){
	if(parseInt(this.css.top)>-this.scrollHeight){
		this.css.top=parseInt(this.css.top)-pr_step
		setTimeout(this.obj+".up("+speed+")",speed)
	}else if(loop) {
		this.css.top=lstart
		eval(this.obj+".up("+speed+")")
	  }
}
/*
//Calls the object constructor,makes the slide object and starts the sliding.
	function slideInit(){
		oSlide=makeObj('divNews','divCont')
		oSlide.css.top=lstart
		oSlide.up(speed)
		
	}
*/

//Start the sliding on page load.
//onload=slideInit;

//Calls the init function onload
//onload=newsMenuInit;



//********************************************************************************************
//		Script Utility Varie ---->				 by Walter Rossi
//********************************************************************************************

//Funzione che rende visibili i "Div"
function Mostra(param){
Nascondi();
param.style.display = 'block';
}

//Funzione che rende visibili i "Div" x le foto
function Mostra2(param){
Nascondi2();
param.style.display = 'block';
}

//Funzione che rende non visibili i "Div"
function Nascondi(){
document.getElementById('ChiPage').style.display = 'none';
document.getElementById('HomePage').style.display = 'none';
document.getElementById('SedePage').style.display = 'none';
document.getElementById('SedeVisitPage').style.display = 'none';
document.getElementById('CDPage').style.display = 'none';
document.getElementById('RespPage').style.display = 'none';
document.getElementById('C1Page').style.display = 'none';
document.getElementById('C2Page').style.display = 'none';
document.getElementById('C3Page').style.display = 'none';
document.getElementById('C30Page').style.display = 'none';
document.getElementById('CStoPage').style.display = 'none';
document.getElementById('CorpoPage').style.display = 'none';
document.getElementById('GiPage').style.display = 'none';
document.getElementById('StrCorsiPage').style.display = 'none';
document.getElementById('StrCorsiPage2').style.display = 'none';
document.getElementById('MilitiPage').style.display = 'none';
document.getElementById('GrPage').style.display = 'none';
document.getElementById('GrIniPage').style.display = 'none';
document.getElementById('StatutoPage').style.display = 'none';
document.getElementById('RegoPage').style.display = 'none';
document.getElementById('VolonPage').style.display = 'none';
document.getElementById('PriSocPage').style.display = 'none';
document.getElementById('AnpasPage').style.display = 'none';
document.getElementById('ContPage').style.display = 'none';
document.getElementById('InaPage').style.display = 'none';
}


//Funzione che rende non visibili i "Div" x le foto
function Nascondi2(){
document.getElementById('SalaR').style.display = 'none';
document.getElementById('SalaRi').style.display = 'none';
document.getElementById('Ufficio').style.display = 'none';
document.getElementById('StanzaM').style.display = 'none';
document.getElementById('238').style.display = 'none';
document.getElementById('Fornovo9').style.display = 'none';
document.getElementById('C2Duc').style.display = 'none';
document.getElementById('C1Wol').style.display = 'none';
document.getElementById('Walter').style.display = 'none';
document.getElementById('Dario').style.display = 'none';
document.getElementById('Andrea').style.display = 'none';
document.getElementById('Grana').style.display = 'none';
document.getElementById('Pitto').style.display = 'none';
}


//Funzione che carica i file .pdf
function pdf() {

var url = "regolamento.pdf"
var titolo = "Assistenza Pubblica di Calestano - Regolamento Corpo Militi"
var attributi = "toolbar=no,location=no,status=no,menubar=no,width=800,height=600"

window.open(url, "" , attributi);

}


//Funzione che carica i file .pdf
function pdf2() {

var url = "libretto.pdf"
var titolo = "Assistenza Pubblica di Calestano - Dispensa Base"
var attributi = "toolbar=no,location=no,status=no,menubar=no,width=800,height=600"

window.open(url, "" , attributi);

}

//Funzione che carica i file .pdf
function pdf3() {

var url = "statuto.pdf"
var titolo = "Assistenza Pubblica di Calestano - Statuto Associativo"
var attributi = "toolbar=no,location=no,status=no,menubar=no,width=800,height=600"

window.open(url, "" , attributi);

}


//Funzione apre URL esterni
function openlink(Url){

var url = "top_open.shtml?" + Url
var attributi = "toolbar=yes,location=yes,status=yes,menubar=yes,width=800,height=500"

window.open(url, "" , attributi);
}

//Funzione apre URL interni
function openlink2(Url){

var url = Url
var attributi = "toolbar=yes,location=yes,status=yes,menubar=yes,width=880,height=500"

window.open(url, "" , attributi);
}


//Funzione ToolTip
function floatingDetail(or, ver){

document.all["dettaglio"].style.top=ver-34;
document.all["dettaglio"].style.left=or-200;
document.all["dettaglio"].style.visibility="visible";

}

//Funzione ToolTip
function floatingDetail2(or, ver){

document.all["dettaglio2"].style.top=ver-59;
document.all["dettaglio2"].style.left=or-195;
document.all["dettaglio2"].style.visibility="visible";

}

//Funzione ToolTip
function floatingDetail3(or, ver){

document.all["dettaglio3"].style.top=ver-70;
document.all["dettaglio3"].style.left=or-205;
document.all["dettaglio3"].style.visibility="visible";

}

//Funzione ToolTip
function floatingDetail4(or, ver){

document.all["dettaglio4"].style.top=ver-83;
document.all["dettaglio4"].style.left=or-337;
document.all["dettaglio4"].style.visibility="visible";

}

//Funzione ToolTip
function floatingDetail5(or, ver){

document.all["dettaglio5"].style.top=ver-32;
document.all["dettaglio5"].style.left=or-290;
document.all["dettaglio5"].style.visibility="visible";

}
 
//Funzione ToolTip Inaugurazione C3
function floatingDetailIna(p, or, ver){
var det = document.all["dettaglio_"+p]
	
	det.style.top = ver + 182;
	det.style.left = or + 345;
	det.style.visibility = "visible";
}

//********************************************************************************************
