// JavaScript Document


// Dal MYSON in poi, per fare l'abilitazione del pulsante di conferma
function AbilitaPulsante(se,rif){
	if(se==1) {
		document.getElementById(rif).disabled=false;
		document.getElementById(rif).style.filter='alpha(opacity=100)';
		document.getElementById(rif).style.opacity='1';
		document.getElementById(rif).style.cursor='pointer';
	} else if(se==0) {
		document.getElementById(rif).disabled=true;
		document.getElementById(rif).style.filter='alpha(opacity=60)';
		document.getElementById(rif).style.opacity='0.60';
		document.getElementById(rif).style.cursor='default';
		document.getElementById(rif).style.text='#FFF';
	}
}

// Dal MYSON in poi, per fare comparire l'informativa privacy
function apri(m){
	document.getElementById(m).style.display = "inline";
	document.getElementById('overlay').style.display = "inline";
}
		
function chiudi(m){
	document.getElementById(m).style.display = "none";
	document.getElementById('overlay').style.display = "none";
}


// Da SUPERLASTMINUTE, per aprire una finestra che manda  direttamente in stampa
function OpenStamp(linker)
{	
   //alert (linker);
   open(linker,"printers", "height=800, width=700,left=100,top=50, scrollbars=1, resizable=0, status=0, menubar=0, toolbar=0");
}

// Dal HELIOS ARREDO URBANO, per cambiare stile al menu onmouseover
function evidenzia(ogg,stato) {
	var ogg;
	var voce = ogg.getElementsByTagName('span');
	if(stato==0) {
	voce[0].style.background='url(images/bg_menu_on.gif) center left repeat-x';
	} else if(stato!=0) {
	voce[0].style.background='none';
	}
}


function openWindow(cod)
{
  open("index.php?lang="+cod, "new", "height=500, width=600,left=370,top=100, scrollbars=1, resizable=0, status=1, menubar=0, toolbar=0")
}

function ApriImmagine(immagine){
	window.open(immagine,'','width=100, height=100,top=100,left=100');
}

// Da STRAGLIOTTO, per aprire le immagini dei certificati
function nuovaFinestra(){window.open('images/inet.jpg','','width=500, height=700,top=0,left=100')
}

function nuovaFinestra1(){window.open('images/icila.jpg','','width=500, height=700,top=0,left=100')
}

// Per cambiare opacità a un oggetto
function  Opacity(idrif,stato) {
	var idrif;
	if(stato==1) {
	idrif.style.filter='alpha(opacity=100)';
	idrif.style.opacity='1';
	}
	if(stato!=1) {
	idrif.style.filter='alpha(opacity=50)';
	idrif.style.opacity='0.50';
	}
}


// Per cambiare un'immagine con un'altra
function cambiaImmagine(rif,sorgente) {
	document.getElementById(rif).setAttribute('src',sorgente);
}

// Per cambiare immagine di sfondo
function cambiaSfondo(ogg,stato,sfondo) {
	var ogg;
	if(stato==1) {
	document.getElementById(ogg).style.background='url('+sfondo+') top left no-repeat';
	} else if(stato!=1) {
	document.getElementById(ogg).sstyle.background='url('+sfondo+') top left no-repeat';
	}
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null)
  	{
	document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
	}
}

// Per mostrare o nascondere un oggetto
function Mostra(stato,rif) {
	if(stato=='on') {
	document.getElementById(rif).style.display='inline';
	} else if(stato=='off') {
	document.getElementById(rif).style.display='none';
	}
}

// Per cambiare colore sfondo
function Bg(stato,rif) {
	if(stato=='on') {
	rif.style.background='#FFF3CA';
	} else if(stato=='off') {
	rif.style.background='#FFF';
	}
}

// Da MYSON, per cambiare stile al menu onMouseOut
function ColoreOff(rif) {
	var list = document.getElementById(rif).getElementsByTagName('li');
	for(i=0;i<list.length;i++) {
		list[0].style.color='#323232';
		list[0].style.borderTop='1px solid #CCC';
		list[1].style.color='#323232';
		list[1].style.borderTop='1px solid #CCC';
		list[2].style.color='#323232';
		list[2].style.borderTop='1px solid #CCC';
		list[3].style.color='#323232';
		list[3].style.borderTop='1px solid #CCC';
	}
}



function vediMappa(){window.open('images/mappa.jpg','','width=760, height=480,top=0,left=100')
}

// Funzione base per aprire un link in nuova finestra, ossia un popup
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function ActPul(Riferimento,nomeClasse){
	document.getElementById(Riferimento).className = nomeClasse;
}
function Toggle(idrif){
	if(document.getElementById(idrif).style.display=="none"){
		document.getElementById(idrif).style.display='';
	}else{
		document.getElementById(idrif).style.display='none';
	}
}

// Funzione per fare in modo che le opzioni di un select diventino link a altri template
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function VisualizzaElemento(objMenu)
{
	elem=window.document.getElementById(objMenu);
   if ( elem.style.display == "none")
   {
        elem.style.display = "block";
   }
   else
   {
        elem.style.display = "none";
   }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}