
// font menù : Arial 9pt

{
	var id = new String;
	var color = new String;
	var pre = new String('homepage');
	
	var homepage_blu = new Image();
	homepage_blu.src = "images/menu/home_page/home_page01.gif";
	var homepage_azz = new Image();
	homepage_azz.src = "images/menu/home_page/home_page02.gif";
	
	var pvm_blu = new Image();
	pvm_blu.src = "images/menu/la_pallavolo_a_modena/pallavolo_a_modena01.gif"
	var pvm_azz = new Image();
	pvm_azz.src = "images/menu/la_pallavolo_a_modena/pallavolo_a_modena02.gif"
	
	var comitato_blu = new Image();
	comitato_blu.src = "images/menu/comitato/comitato01.gif"
	var comitato_azz = new Image();
	comitato_azz.src = "images/menu/comitato/comitato02.gif"
	
	var attivita_blu = new Image();
	attivita_blu.src = "images/menu/attivita/attivita01.gif"
	var attivita_azz = new Image();
	attivita_azz.src = "images/menu/attivita/attivita02.gif"	

	var modulistica_blu = new Image();
	modulistica_blu.src = "images/menu/modulistica/modulistica01.gif";
	var modulistica_azz = new Image();
	modulistica_azz.src = "images/menu/modulistica/modulistica02.gif";
	
	var regolamenti_blu = new Image();
	regolamenti_blu.src = "images/menu/regolamenti/regolamenti01.gif";
	var regolamenti_azz = new Image();
	regolamenti_azz.src = "images/menu/regolamenti/regolamenti02.gif";

	var collegamenti_blu = new Image();
	collegamenti_blu.src = "images/menu/collegamenti/collegamenti01.gif";
	var collegamenti_azz = new Image();
	collegamenti_azz.src = "images/menu/collegamenti/collegamenti02.gif";

	var bv_blu = new Image();
	bv_blu.src = "images/menu/beach_volley/beach_volley01.gif";
	var bv_azz = new Image();
	bv_azz.src = "images/menu/beach_volley/beach_volley02.gif";

	var manifestazioni_blu = new Image();
	manifestazioni_blu.src = "images/menu/manifestazioni/manifestazioni01.gif";
	var manifestazioni_azz = new Image();
	manifestazioni_azz.src = "images/menu/manifestazioni/manifestazioni02.gif";

	var campionati_blu = new Image();
	campionati_blu.src = "images/menu/campionati/campionati01.gif";
	var campionati_azz = new Image();
	campionati_azz.src = "images/menu/campionati/campionati02.gif";
	
	var statistiche_blu = new Image();
	statistiche_blu.src = "images/menu/abc123/statistiche01.gif";
	var statistiche_azz = new Image();
	statistiche_azz.src = "images/menu/abc123/statistiche02.gif";
   
   	var cercoffro_blu = new Image();
	cercoffro_blu.src = "images/menu/cercoffro/cercoffro01.gif";
	var cercoffro_azz = new Image();
	cercoffro_azz.src = "images/menu/cercoffro/cercoffro02.gif";

   	var mondiali_blu = new Image();
	mondiali_blu.src = "images/menu/mondiali/mondiali01.gif";
	var mondiali_azz = new Image();
	mondiali_azz.src = "images/menu/mondiali/mondiali02.gif";
	
   	var documenti_blu = new Image();
	documenti_blu.src = "images/menu/documenti/documenti01.gif";
	var documenti_azz = new Image();
	documenti_azz.src = "images/menu/documenti/documenti02.gif";


	function preferiti()
	{
		if (document.all)
			window.external.AddFavorite('http://www.fipav.mo.it','FIPAV Comitato Provinciale di Modena');
	}

	function MenuLoader(id)
	{
		ImgChange(id, 'azz'); 

		if (pre != id)
			BackImage(pre);
			SetOutImg(id);
			
		if (id == 'homepage')
			parent.frames[1].open('menu2_hp.html', 'menu2');
		if (id == 'pvm')
			parent.frames[1].open('menu2_pvm.html', 'menu2');
		if (id == 'comitato')
			parent.frames[1].open('menu2_cmt.html', 'menu2');
		if (id == 'attivita')
			parent.frames[1].open('menu2_atv.html', 'menu2');
		if (id == 'modulistica')
			parent.frames[1].open('menu2_mod.html', 'menu2');
		if (id == 'regolamenti')
			parent.frames[1].open('menu2_reg.html', 'menu2');
		if (id == 'collegamenti')
			parent.frames[1].open('menu2_col.html', 'menu2');
		if (id == 'bv')
			parent.frames[1].open('menu2_bv.html', 'menu2');
		if (id == 'manifestazioni')
			parent.frames[1].open('menu2_man.html', 'menu2');
		if (id == 'statistiche')
			parent.frames[1].open('menu2_sta.html', 'menu2');
		if (id == 'cercoffro')
			parent.frames[1].open('menu2_cer.html', 'menu2');			
		if (id == 'campionati')
			parent.frames[1].open('menu2_cmp.html', 'menu2');
		if (id == 'mondiali')
			parent.frames[1].open('menu2_mnd.html', 'menu2');
		if (id == 'documenti')
			parent.frames[1].open('menu2_doc.html', 'menu2');			
			
	}

	function SetOutImg(id)
	{
		pre = id;
	}

	function BackImage(id)
	{
		ImgChange(id, 'blu');
	}
	
	function ImgChange(id, color)
	{	
		eval("document." + id + ".src = " + id + "_" + color + ".src");
	}

	function caso(seed)
	{

	var now = new Date();

  	var sec_divide = now.getSeconds();

  	rnd_number = Math.floor((sec_divide + seed)%14); 

	rnd_number++;
	
  	document.write('<img src="images/foto0' + rnd_number +'.jpg" border=0>');

	}

	function casospecial(seed)
	{

	var now = new Date();

  	var sec_divide = now.getSeconds();

  	rnd_number = Math.floor((sec_divide + seed)%14); 

	rnd_number++;
	
  	document.write('<img src="../images/foto0' + rnd_number +'.jpg" border=0>');

	}

	function casonew(seed)
	{

	var now = new Date();

  	var sec_divide = now.getSeconds();

  	rnd_number = Math.floor((sec_divide + seed)%14); 

	rnd_number++;
	
  	document.write('<img src="images/foto0' + rnd_number +'new.jpg" border=0>');

	}

	function casospecialnew(seed)
	{

	var now = new Date();

  	var sec_divide = now.getSeconds();

  	rnd_number = Math.floor((sec_divide + seed)%14); 

	rnd_number++;
	
  	document.write('<img src="../images/foto0' + rnd_number +'new.jpg" border=0>');

	}

	function protect(e)
	{
	alert("Spiacenti, non puoi salvare l'immagine");
	return false;
	}

	function trap()
	{
	if(document.images)
	for(i=0;i<document.images.length;i++)
	document.images[i].onmousedown = protect;
	}
	
	function ControllaCodice(_id)
	{
		eval("var stringa = provinciali." + _id + ".value;");
		if (stringa.length < 4)
		{
			alert('Il campo Codice deve essere di 4 cifre!');
			eval("provinciali." + _id + ".focus();");
		}
	}
}

function switchImage(_path) {
	this.path = _path;
	this.menu = new Array();
	this.menuOver = new Array();
	
	this.setMenuElement = function setElement(element, over) {
		this.menu.push(element);
		this.menuOver.push(over);
	}
	
	this.setPath = function Path(_path) {
		this.path=_path;
	}
	
	this.setElementOver = function setOver(over) {
		for(i = 0; i < this.menu.length; i++) {
			try {
				if (over == this.menu[i])
					eval("document." + this.menu[i] + ".src = '"+  this.path + this.menuOver[i] +".gif'");
				else 
					eval("document." + this.menu[i] + ".src = '"+ this.path + this.menu[i] +".gif'");
			} catch (e) {}
		}
	}
}