







/* ******************************************************************************** */
function intestazione(){
	     logo();
   		 search();
   		 menuorizzontale();
}
/* ******************************************************************************** */










/* ******************************************************************************** */
/* ****               PARTE IN ALTO : LOGO E TITOLO DEL SITO                    *** */ 
/* ******************************************************************************** */

function logo(){

document.write(''+
'    	<div id="logosection">'+
'	    </div>'+
'')
}


/* ******************************************************************************** */
/* ****               PARTE IN ALTO : FUNZIONE CERCA                            *** */ 
/* ******************************************************************************** */

var domainroot="www.istitutosgbosco.it"

var searchaction=[ 
"http://www.google.com/search",
"http://search.yahoo.com/search",
"http://search.msn.com/results.aspx"
]
var queryfieldname=["q","p","q"] 
function switchaction(cur, index){
cur.form.action=searchaction[index]
document.getElementById("hiddenquery").name=queryfieldname[index]
}
function jksitesearch(curobj){
for (i=0; i< document.jksearch.se.length; i++){ //loop through radio to see which is checked
if (document.jksearch.se[i].checked==true)
switchaction(document.jksearch.se[i], i)
}
document.getElementById("hiddenquery").value="site:"+domainroot+" "+curobj.qfront.value
}


function search(){
document.write(''+
'<div id="templatemo_menu">'+
'  		<div id="search">'+
'			<form name="jksearch" style="padding:0px;" action="http://www.google.com/search" method="get" onsubmit="jksitesearch(this)" target="_blank">'+
'				<input class="textfield" id="hiddenquery" type="hidden" name="q" />'+
'				<input class="textfield" name="qfront" type="text" style="border-style: groove;" value="Cerca nel sito..." />'+
'				<input class="send_btn" style="cursor: hand;"  value=" " type="submit" />'+
'				<input name="se" type="hidden"  />'+ 
'			</form>'+
'		</div>'+
'')  


}


/* ******************************************************************************** */
/* ****                       MENU ORIZZONTALE                                  *** */ 
/* ******************************************************************************** */


function menuorizzontale(){

var currentURL = window.location.href;
var length=currentURL.length;

var href1=""+path+"index.html";
var href2=""+path+"corsi/index.html";
var href3=""+path+"sedi/index.html";
var href4=""+path+"laboratori/index.html";
var href5=""+path+"personale/index.html";
var href6=""+path+"documenti/index.html";
var href7=""+path+"areariservata.html";

var testo1="";
var testo2="I Corsi";
var testo3="Le Sedi";
var testo4="I Laboratori";
var testo5="Il Personale";
var testo6="I Documenti";
var testo7="Area riservata";


if (currentURL==path)
	var class1="class=\"current\"";
	else
 	{
		if (currentURL==href1)
			var class1="class=\"current\"";
			else
		 	var class1="";
	}
if (currentURL==href2)
	var class2="class=\"current\"";
	else
 	var class2="";
if (currentURL==href3)
	var class3="class=\"current\"";
	else
 	var class3="";
if (currentURL==href4)
	var class4="class=\"current\"";
	else
 	var class4="";
if (currentURL==href5)
	var class5="class=\"current\"";
	else
 	var class5="";
if (currentURL==href6)
	var class6="class=\"current\"";
	else
 	var class6="";
if (currentURL==href7)
	var class7="class=\"current\"";
	else
 	var class7="";


 
document.write(''+
'			<div id="menu">'+
'           <ul>'+
'                <li><a href="'+href1+'" '+class1+'>Home</a></li>'+
'                <li><a href="'+href2+'" '+class2+' onmouseover="dropdownmenu(this, event, menu2, \'150px\')" onmouseout="delayhidemenu()">'+testo2+'</a></li>'+
'                <li><a href="'+href3+'" '+class3+' onmouseover="dropdownmenu(this, event, menu3, \'150px\')" onmouseout="delayhidemenu()">'+testo3+'</a></li>'+
'                <li><a href="'+href4+'" '+class4+' onmouseover="dropdownmenu(this, event, menu4, \'150px\')" onmouseout="delayhidemenu()">'+testo4+'</a></li>'+
'                <li><a href="'+href5+'" '+class5+' onmouseover="dropdownmenu(this, event, menu5, \'150px\')" onmouseout="delayhidemenu()">'+testo5+'</a></li>'+
'                <li><a href="'+href6+'" '+class6+' onmouseover="dropdownmenu(this, event, menu6, \'150px\')" onmouseout="delayhidemenu()">'+testo6+'</a></li>'+
'                <li><a href="'+href7+'" '+class7+' onmouseover="dropdownmenu(this, event, menu7, \'150px\')" onmouseout="delayhidemenu()">'+testo7+'</a></li>'+
'            </ul>'+
'            </div>'+
'            </div>'+
'')

//se vuoi che al click sulla voce principale non ci sia link scrivi <li><a href="'+href6+'" '+class6+' onclick="return clickreturnvalue()" onmouseover="dropdownmenu(this, event, menu6, \'150px\')" onmouseout="delayhidemenu()">'+testo6+'</a></li>'+

}

// HOME
var menu1=new Array()

// I CORSI
var menu2=new Array()
menu2[0]='<a href="'+path+'corsi/tecnici/index.html">ISTR. TECNICA (5 ANNI)</a>'
menu2[1]='<a href="'+path+'corsi/professionali/index.html">ISTR. PROF. (5 ANNI)</a>'
menu2[2]='<a href="'+path+'corsi/regionali/index.html">FORM. PROF. (3 ANNI)</a>'
menu2[6]='<a href="'+path+'corsi/serali/index.html">CORSI SERALI</a>'

// LE SEDI
var menu3=new Array()
menu3[0]='<a href="'+path+'sedi/viadana.html">VIADANA</a>'
menu3[1]='<a href="'+path+'sedi/gazoldo.html">GAZOLDO DEGLI IPP.</a>'

// I LABORATORI
var menu4=new Array()
menu4[0]='<a href="'+path+'laboratori/informatica.html">INFORMATICA</a>'
menu4[1]='<a href="'+path+'laboratori/chimica.html">CHIMICA</a>'
menu4[2]='<a href="'+path+'laboratori/fisica.html">FISICA</a>'
menu4[3]='<a href="'+path+'laboratori/meccanici.html">MECCANICI</a>'
menu4[4]='<a href="'+path+'laboratori/elettrici.html">ELETTRICI</a>'
menu4[5]='<a href="'+path+'laboratori/agrari.html">AGRARI</a>'
menu4[6]='<a href="'+path+'laboratori/ristorativi.html">SERVIZI RISTORATIVI</a>'
menu4[7]='<a href="'+path+'laboratori/servizisociali.html">SERVIZI SOCIALI</a>'

// IL PERSONALE
var menu5=new Array()
menu5[0]='<a href="'+path+'personale/dirigentescolastico.html">DIRIGENTE SCOLASTICO</a>'
menu5[1]='<a href="'+path+'personale/collegiodocenti.html">COLLEGIO DEI DOCENTI</a>'
menu5[2]='<a href="'+path+'personale/consiglioistituto.html">CONSIGLIO DI ISTITUTO</a>'
menu5[3]='<a href="'+path+'personale/giuntaesecutiva.html">GIUNTA ESECUTIVA</a>'
menu5[4]='<a href="'+path+'personale/ufficiamministrativi.html">UFFICI AMMINISTRATIVI</a>'
menu5[5]='<a href="'+path+'personale/organigramma.html">ORGANIGRAMMA</a>'

// I DOCUMENTI
var menu6=new Array()
menu6[0]='<a href="/documenti/pianooffertaformativa.html">PIANO DELL\'OFFERTA FORMATIVA</a>'
menu6[1]='<a href="/documenti/cartaserviziscolastici.html">CARTA DEI SERVIZI SCOLASTICI</a>'
menu6[2]='<a href="/documenti/pianoannualeattivita.html">PIANO ANNUALE DELLE ATTIVIT&Agrave;</a>'
menu6[3]='<a href="/documenti/regolamentoistituto.html">REGOLAMENTO DI ISTITUTO</a>'
menu6[4]='<a href="/documenti/pattoeducativo.html">PATTO EDUCATIVO DI CORRESPONSABILIT&Agrave;</a>'
menu6[5]='<a href="/documenti/programmaannuale.html">PROGRAMMA ANNUALE</a>'
menu6[6]='<a href="/documenti/contoconsuntivo.html">CONTO CONSUNTIVO</a>'
menu6[7]='<a href="/documenti/codicedisciplinare.html">CODICE DISCIPLINARE</a>'
menu6[8]='<a href="/documenti/contrattoistituto.html">CONTRATTO DI ISTITUTO</a>'
menu6[9]='<a href="/documenti/documentoprogrammaticosicurezza.html">DOCUMENTO PROGRAMMATICO SICUREZZA</a>'
menu6[10]='<a href="/documenti/documentovalutazionerischi.html">DOCUMENTO VALUTAZIONE DEI RISCHI</a>'

// AREA RISERVATA
var menu7=new Array()
menu7[0]='<a href="http://mail.istitutosgbosco.it" target="_blank">POSTA ELETTRONICA</a>'
menu7[1]='<a href="/wic" target="_blank">SITO INTRANET</a>'

		
var menuwidth='165px' //default menu width
var menubgcolor='#e0e0e0' //'lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?


/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu










