/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var ReteCommerciale =
{
    init : function()
    {
        var italia = document.getElementById("italia");
        var regione = document.getElementById("regione");

        if (italia != null) {
            var regbuttons = italia.getElementsByTagName("area");
            for (var i = 0; i < regbuttons.length; i++) {
                regbuttons[i].onclick = ReteCommerciale.caricaRegione;
            }
        }

        if (regione != null) {
            var provbuttons = regione.getElementsByTagName("area");
            for (var j = 0; j < provbuttons.length; j++) {
                provbuttons[j].onclick = ReteCommerciale.caricaProvincia;
                //provbuttons[j].onmouseover = Main.elencoKc;
            }
        }
    },

    caricaRegione : function()
    {
        var idRegione = this.id;        
        var theURL = "retecommerciale.action?idRegione="+idRegione;
        window.location=theURL;
        return false;
    },

    caricaProvincia : function()
    {
        var theURL = this.href;
        var provId = this.href.substring(theURL.indexOf("=")+1);
        Accordion.collapseAll(document.getElementById("myAccordion"));
        Accordion.expandFold(document.getElementById(provId).parentNode);
        return false;
    }
    
    
}

Core.start(ReteCommerciale);



