/*
function changeOpac(value, id) { 
    var object = $(id).style; 
    object.opacity = (value / 100); 
    object.MozOpacity = (value / 100); 
    object.KhtmlOpacity = (value / 100); 
    object.filter = "alpha(opacity=" + value + ")"; 
} 
*/


function openMap(event, _idArea){
    var _element = Event.element(event); 
    // Nascondo tutto
    $$('#statiBox div.imgStato').each(function(s){
        $(s).hide();
     });
    $$('#statiBox img.icoStato').each(function(s){
        $(s).src='img/destinazioni/parentover.gif';
     });  
    // Evidenzio il cliccato       
    $(_element.parentNode).next().show();
    _element.select("img.icoStato")[0].src='img/destinazioni/parentselected.gif';
    
    new Ajax.Request("Action_destinazioni.elencoStati.aspx", {
          method: "post",
          parameters: '' + _idArea + '',
            onSuccess: function(transport) {
                var _stati = transport.responseText.evalJSON();
                
                $("sottoareeBox").update("");
                for(var i=0;i<_stati.length;i++){
                    $("sottoareeBox").insert({bottom: tplBoxStati.evaluate(_stati[i])});
                }  
            }
          });    
}

function createDestination(){
   elencoAree.each(function(stato) {
        $("statiBox").insert({bottom: tplBoxAree.evaluate(stato)});
    });

}

function openDestinazioni(_idStato){
    new Ajax.Request("Action_destinazioni.elencoDestinazioni.aspx", {
          method: "post",
          parameters: '' + _idStato + '',
            onSuccess: function(transport) {
                var _dest = transport.responseText.evalJSON();
                $("destinazioniBox").update("");
                for(var i=0;i<_dest.length;i++){
                    $("destinazioniBox").insert({bottom: tplBoxDestinazioni.evaluate(_dest[i])});
                }  
            }
          });    
}