// file funzione_javascript.js


/*ACCORPARE LE FUNZIONI window.onload INIZIO*/
window.onload = function(){
doPopups()
sivamtime() /*File .JS esterno orologio_ENG e orologio_ITA*/
}
/*ACCORPARE LE FUNZIONI window.onload FINE*/



<!-- JAVASCRIPT FX TASTI MENU INIZIO -->
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}
<!-- JAVASCRIPT FX TASTI MENU FINE -->




<!-- JAVASCRIPT FINESTRA POP UP INIZIO -->  
function doPopups() { 

  var w = 350; // --------> MISURE FINESTRA POP UP ADVERTISING;
  var h = 520; // --------> MISURE FINESTRA POP UP ADVERTISING;
  var l = Math.floor((screen.width-w)/2); // --------> MISURE FINESTRA POP UP ADVERTISING;
  var t = Math.floor((screen.height-h)/2); // --------> MISURE FINESTRA POP UP ADVERTISING;
  
  var Vw = 450; // --------> MISURE FINESTRA POP UP VIDEO;
  var Vh = 350; // --------> MISURE FINESTRA POP UP VIDEO;  
  var Vl = Math.floor((screen.width-w)/2);// --------> MISURE FINESTRA POP UP VIDEO; 
  var Vt = Math.floor((screen.height-h)/2);// --------> MISURE FINESTRA POP UP VIDEO;

  if (!document.getElementsByTagName) return false;
  var links=document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {    // -------->  Finestra PopUp per Modulo RICHIESTA INFORMAZIONI;
      links[i].onclick=function() {
        
		// MISURE FINESTRA POP UP RICHIESTA INFORMAZIONI;
        window.open(this.href, "", "top=40,left=40,width=500,height=720,scrollbars");
        return false;
      }
    }
	
	if  (links[i].className.match("advertising")) {   // -------->  Finestra PopUp per ADVERTISING;
      links[i].onclick=function() {
        
		// MISURE FINESTRA POP UP ADVERTISING;
        window.open(this.href, "","width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
        return false;
      }
    }
	
	
	if  (links[i].className.match("popup-video")) {   // -------->  Finestra PopUp per VIDEO;
      links[i].onclick=function() {
        
		// MISURE FINESTRA POP UP VIDEO;
        window.open(this.href, "","width=" + Vw + ",height=" + Vh + ",top=" + Vt + ",left=" + Vl);
        return false;
      }
    }
	
	
  }
}
<!-- JAVASCRIPT FINESTRA POP UP FINE -->





<!-- JAVASCRIPT FX MOSTRA NASCONDI "DIV" TABELLA MOD. ORDINE INIZIO -->
var stato = new Array();
// variabile globale che memorizza lo stato
var num_elementi=14;
// variabile globale che memorizza il numero di elementi

if (document.getElementById){
   document.write('<style type="text/css">')
   document.write('.switch{display:none;}')
   document.write('</style>')
}
// imposto l'invisibilitā? degli oggetti di classe .switch
function modifica(elem){
   if (stato[elem]=="block") stato[elem]="none";
   else stato[elem]="block";
// gioco del se č acceso spegnilo
// se č spento accendilo
   document.getElementById(elem).style.display=stato[elem];
// imposta la visibilitā? dell'elemento
}

function modifica_all(num){
    for(i=1;i<=num_elementi;i++){
    stato[i]="none";
    if (num==0) stato[i]="block";   
     modifica(i);
   }
}
<!-- JAVASCRIPT FX MOSTRA NASCONDI "DIV" TABELLA MOD. ORDINE FINE -->




<!-- IMMAGINI RANDOM INIZIO -->
var demoTabs;
	Event.observe(window, "load", function() {
		//Immagini
		var images = [
			"/web/images/img_random/1.jpg",
			"/web/images/img_random/2.jpg",
			"/web/images/img_random/3.jpg",
			"/web/images/img_random/4.jpg",
			"/web/images/img_random/5.jpg",
			"/web/images/img_random/6.jpg",
			"/web/images/img_random/7.jpg"
		];

		new Widget.Fader("defaultDemo", images);

		})
<!-- IMMAGINI RANDOM FINE -->




<!-- ALERT CAMPO OBBLIGATORIO INIZIO -->
      function ControllaTesti(oForm) {
        var cllcElem = oForm.elements; //collection degli elementi della form

        for (i = 0; i < cllcElem.length; i++) {
          if ((cllcElem[i].tagName.toLowerCase() == "input" && cllcElem[i].type.toLowerCase() == "text" && cllcElem[i].disabled==false)
             ) { //Si contrallano i tag input di tipo testo

                if (cllcElem[i].value.replace(/\s+$|^\s+/g,"") == "") { //Se il valore trimmato č vuoto si blocca il submit
                  cllcElem[i].focus();
                  alert("Il campo NOMINATIVO č obbligatorio");
                  return false;
                }
          }
        }

        //Viene ritornato true solo se sono stati valorizzati tutti i campi testuali
        return true;
      }
<!-- ALERT CAMPO OBBLIGATORIO FINE -->


<!-- ALERT CAMPO OBBLIGATORIO INGLESE INIZIO -->
      function ControllaTesti_ENG(oForm) {
        var cllcElem = oForm.elements; //collection degli elementi della form

        for (i = 0; i < cllcElem.length; i++) {
          if ((cllcElem[i].tagName.toLowerCase() == "input" && cllcElem[i].type.toLowerCase() == "text" && cllcElem[i].disabled==false)
             ) { //Si contrallano i tag input di tipo testo

                if (cllcElem[i].value.replace(/\s+$|^\s+/g,"") == "") { //Se il valore trimmato č vuoto si blocca il submit
                  cllcElem[i].focus();
                  alert("Warning! The NAME is required");
                  return false;
                }
          }
        }

        //Viene ritornato true solo se sono stati valorizzati tutti i campi testuali
        return true;
      }
<!-- ALERT CAMPO OBBLIGATORIO INGLESE FINE -->




<!-- TASTO DESTRO DEL MOUSE DISATTIVATO INIZIO -->
function clickIE4(){
if (event.button==2){

return false; } }

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){

return false; } } }

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")
<!-- TASTO DESTRO DEL MOUSE DISATTIVATO FINE -->