// JavaScript Document
/* corregge un bug presente su Netscape 4 relativo a probemi nel resize della finestra; mi chiedo quanti ancora usino questa versione del browser... comunque ..per ora ancora lo tengo ... del resto altro mio codice è scritto apposta per netscape 4 ma tanto il sito non si vede con quel browser .. :-()  questo script l'ho preso da WebMonkey */
<!--
function WM_netscapeCssFix() {
   if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}
function WM_netscapeCssFixCheckIn() {
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}
WM_netscapeCssFixCheckIn()
// -->
<!--
/* script che gestisce il rollover dei pulsanti del sito*/

function preloadImages(){
	if (document.images) { 
		menuImages = new Array(9)
		menuImages_over = new Array(9)
		menuImages_down = new Array(9)
		menuImages_active = new Array(9)
		for(i=1; i<10; i++) {
			menuImages[i] = new Image;
			menuImages[i].src = "templates/button_" + i + ".jpg";	
			menuImages_over[i] = new Image;
			menuImages_over[i].src = "templates/button_" + i + "_over" + ".jpg";	
			menuImages_down[i] = new Image;
			menuImages_down[i].src = "templates/button_" + i + "_down" + ".jpg";	
			menuImages_active[i] = new Image;
			menuImages_active[i].src = "templates/button_" + i + "_active" + ".jpg";
		}
		menuImages_en = new Array(6)
		menuImages_en_over = new Array(6)
		menuImages_en_down = new Array(6)
		menuImages_en_active = new Array(6)
		for(i=2; i<8; i++) {
			menuImages_en[i] = new Image;
			menuImages_en[i].src = "templates/button_en_" + i + ".jpg";	
			menuImages_en_over[i] = new Image;
			menuImages_en_over[i].src = "templates/button_en_" + i + "_over" + ".jpg";	
			menuImages_en_down[i] = new Image;
			menuImages_en_down[i].src = "templates/button_en_" + i + "_down" + ".jpg";	
			menuImages_en_active[i] = new Image;
			menuImages_en_active[i].src = "templates/button_en_" + i + "_active" + ".jpg";
		}
	}
}
function off_image(loc,img) {
	loc.src = menuImages[img].src
}
function down_image(loc,img) {
	loc.src = menuImages_down[img].src
}
function active_image(loc,img) {
	loc.src = menuImages_active[img].src
}
function on_image(loc,img) {
	loc.src = menuImages_over[img].src
}
function off_image_en(loc,img) {
	loc.src = menuImages_en[img].src
}
function down_image_en(loc,img) {
	loc.src = menuImages_en_down[img].src
}
function active_image_en(loc,img)	{
	loc.src = menuImages_en_active[img].src
}
function on_image_en(loc,img)	{
	loc.src = menuImages_en_over[img].src
}

// -->


<!--
var actItem = "logo";
function reveal(actItem) {
	if (document.layers) {
		document.layers[actItem].visibility = "show";
	} else if (document.all) {
			document.all[actItem].style.visibility = "visible";
		} else if (document.getElementById) {
				document.getElementById(actItem).style.visibility= "visible";
			} else {};
}
function hide(actItem) {
	if (document.layers) {
		document.layers[actItem].visibility = "hide";
	} else if (document.all) {
			document.all[actItem].style.visibility = "hidden";
		} else if (document.getElementById) {
				document.getElementById(actItem).style.visibility= "hidden";
			} else {}
}
// -->


// open new window images

<!--
var done=false;
function openwin (page) { 
	if (!done) {
		OpenWindow=window.open(page, "images", 			"height=600,width=800,toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=no,directories=no,status=no,left=0,top=24");
		OpenWindow.focus();
		OpenWindow.document.close();
		self.name="main";
	}
return done;
}
//-->

function hide_win(){
window.blur()	 
}
function close_win(){
window.close();
self.close() 
}





/* preload images */
function preloadImages(){
	if (document.images) { 
		logo_fa = new Image();
		logo_fa.src = "images/logo_fa.jpg";
		logo_fa_over = new Image();
		logo_fa_over.src = "images/logo_fa_over.jpg";
	}
}



/* logo famiglie arcobaleno */

function imgOff(imgName) {
	if (document.images) {
  	  document[imgName].src = eval("logo_" + imgName + ".src");
	}
}

function imgOn(imgName) {
	if (document.images) {
 	   document[imgName].src = eval("logo_" + imgName + "_over.src");
	}
}



var actItem = "Info_FA";
function reveal(actItem) {
	if (document.layers) {
		document.layers[actItem].visibility = "show";
	} else if (document.all) {
			document.all[actItem].style.visibility = "visible";
		} else if (document.getElementById) {
				document.getElementById(actItem).style.visibility= "visible";
			} else {};
}
function hide(actItem) {
	if (document.layers) {
		document.layers[actItem].visibility = "hide";
	} else if (document.all) {
			document.all[actItem].style.visibility = "hidden";
		} else if (document.getElementById) {
				document.getElementById(actItem).style.visibility= "hidden";
			} else {}
}



/*apre finestra cartina campania*/
var done=false;
function open_window() {
	if (!done) {
		mywindow=window.open("","window","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=516,height=469,screenX=0,screenY=180");
		mywindow.document.write('<HTML><HEAD>');
		mywindow.document.write('<TITLE>Cartina della Campania</TITLE>');
		mywindow.document.write('</HEAD><BODY style="background-color:#000000; color:#FFFFFF; padding:0px; margin:0px; ">');
		mywindow.document.write('<img src="http://www.ilsolesullarcobaleno.it/images/cartina_campania.jpg">');
		mywindow.document.write('</BODY></HTML>');
		mywindow.focus();
		mywindow.document.close();
		self.name='main';
	}
	return done;
}

