
max = 0;
image = new Array();
img_attiva= false;
n=0;
ie=1;

max_man = 0;
image_man = new Array();
img_attiva_man= false;

//Riconoscimento Browser
if (document.layers) {n=1;ie=0}
if (document.all) {n=0;ie=1}

function init_menu() {
    //valorizzo l'Array che contiene tutti i menù
    for (i=0;i<max;i++)
        menu[i].visibility = "hidden"
    menu[0].visibility = "visible";
    if (n)
        menu[0].padding = "0 0 0 0";
}



function precarica_img(name_img, disabilitata_i, disabilitata_e, abilitata) {
//Carico nell'array menu tutte le DIVISION e nell'array image le immagini
    //Valorizzazione onmouseover e on mouseout per Netscape
    if (name_img!='') {
        image[max] = new Array(4);
        image[max][0] = new Image();
        image[max][0].src = disabilitata_i;
        image[max][1] = new Image();
        image[max][1].src = disabilitata_e;
        image[max][2] = new Image();
        image[max][2].src = abilitata;
        image[max][3] = name_img;
        }
    max++;
}


function su_img() {
    img_attiva = true;
}

function fuori_img(language) {
    img_attiva = false;
    setTimeout("disattiva(language)",10);
}

function attiva(indice, language) {
    //Gestione immagine
    for (i=0;i<max;i++) {
        if (language.charAt(0) == 'i')
           document.images[image[i][3]].src = image[i][0].src
        else
           document.images[image[i][3]].src = image[i][1].src
         }
    document.images[image[indice][3]].src = image[indice][2].src
    su_img();
}

function disattiva(language) {
    //Gestione immagine
    for (i=0;i<max;i++) {
        if (language.charAt(0) == 'i')
           document.images[image[i][3]].src = image[i][0].src
        else
           document.images[image[i][3]].src = image[i][1].src
        }
}

function precarica_img_manufacturer(name_img, disabilitata, abilitata) {
//Carico nell'array menu tutte le DIVISION e nell'array image le immagini
    //Valorizzazione onmouseover e on mouseout per Netscape
    if (name_img!='') {
        image_man[max_man] = new Array(3);
        image_man[max_man][0] = new Image();
        image_man[max_man][0].src = disabilitata;
        image_man[max_man][1] = new Image();
        image_man[max_man][1].src = abilitata;
        image_man[max_man][2] = name_img;
        }
    max_man++;
}

function attiva_manufacturer(indice) {
    //Gestione immagine
    for (i=0;i<max_man;i++) {
           if (document.images[image_man[i][2]] != null)
              document.images[image_man[i][2]].src = image_man[i][0].src
           //alert(image_man[i][2]);
           }
    //alert(image_man[indice][2] + image_man[indice][1].src);
    document.images[image_man[indice][2]].src = image_man[indice][1].src
    su_img_manufacturer();
}

function disattiva_manufacturer() {
    //Gestione immagine
    for (i=0;i<max_man;i++) {
           if (document.images[image_man[i][2]] != null)
              document.images[image_man[i][2]].src = image_man[i][0].src
           }
}

function su_img_manufacturer() {
    img_attiva_man = true;
}

