function WM_toggle(id){

   if (document.all){

     if(document.all[id].style.display == 'none'){

       document.all[id].style.display = '';

     } else {

       document.all[id].style.display = 'none';

     }

  return false;

   } else if (document.getElementById){

     if(document.getElementById(id).style.display == 'none'){

       document.getElementById(id).style.display = 'block';

     } else {

       document.getElementById(id).style.display = 'none';

     }

  return false;

   }

 }

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		menu_01_over = newImage("img/home_on.gif");
		menu_02_over = newImage("img/moravia_on.gif");
		menu_03_over = newImage("img/contatti_on.gif");
		menu_04_over = newImage("img/comunicazioni_on.gif");
		menu_05_over = newImage("img/dovesiamo_on.gif");
		menu_06_over = newImage("img/links_on.gif");
		menu_07_over = newImage("img/credits_on.gif");
		menu_08_over = newImage("img/butt_exterioron.gif");
		menu_09_over = newImage("img/butt_interioron.gif");
		menu_10_over = newImage("img/butt_videoon.gif");
		preloadFlag = true;
	}
}

/*submit once*/
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
/*fine*/ 


/*inizio*/	  

var titulopordefecto = "Moravia Yacht"; //Si no se especifica un título al llamar a la función colocará el que se especifique aquí
var ventana;
var cont=0;

function afoto(cual,titulo)
{
if(cont==1){ventana.close();ventana=null}
if(titulo==null){titulo=titulopordefecto}
ventana=window.open('','ventana','resizable=no,scrollbars=no,left=0,top=0,width=640,height=480,') 
ventana.document.write('<html><head><title>' + titulo + '</title><meta http-equiv="imagetoolbar" content="no"></head><body onclick="window.close()" style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0" ><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)">');
ventana.document.close();
cont++;
}
function redimensionar(ancho, alto)
{
ventana.resizeTo(ancho+10,alto+48); // 10x50 con resizable=yes
// ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2); 
}		

/*fine*/   


/*inizio checkbox selezione multipla */
function CheckboxSeleziona_onclick(v) {
	var ck = document.getElementsByTagName("INPUT");
	for(var i = 0; i < ck.length; i++)
		if(ck[i].type == 'checkbox') ck[i].checked = v.checked;

}
/*fine*/	
