﻿// File JavaScript

function showsub(source, who) {
    var trfocus = source;
    var trCollection = document.getElementsByTagName("tr");
    var j = 0;
    for (j == 0; j < trCollection.length; j++) {
        if (trCollection.item(j).id.indexOf("main", 0) > 0) {

            trCollection.item(j).style.background = "transparent";
        }
    }

    trfocus.style.background = "#80FF80";



    var Focus = document.getElementById(who);
    var divCollection = document.getElementsByTagName("div");
    var j = 0;
    for (j == 0; j < divCollection.length; j++) {
        if (divCollection.item(j).id.indexOf("subcat", 0) > 0) {

            divCollection.item(j).style.visibility = "hidden";
        }
    }

    Focus.style.visibility = "visible";
}

function showRsub(source, who) {
    var trfocus = source;
    var trCollection = document.getElementsByTagName("tr");
    var j = 0;
    for (j == 0; j < trCollection.length; j++) {
        if (trCollection.item(j).id.indexOf("Regione", 0) > 0) {

            trCollection.item(j).style.background = "transparent";
        }
    }

    trfocus.style.background = "#80FF80";



    var Focus = document.getElementById(who);
    var divCollection = document.getElementsByTagName("div");
    var j = 0;
    for (j == 0; j < divCollection.length; j++) {
        if (divCollection.item(j).id.indexOf("Regione", 0) > 0) {

            divCollection.item(j).style.visibility = "hidden";
        }
    }

    Focus.style.visibility = "visible";
}

function changebgcolor(source, event) {

    if (event.type == "mouseout") {
        source.style.background = "transparent";
    }
    else {

        source.style.background = "#80FF80";
    }



}
    