﻿function search_code() {
    var panel = document.getElementById("panel_serach_code")
    if (panel.style.display == "block") {
        panel.style.display = "none";
    }
    else {
        panel.style.display = "block";
    }
}
function val_date(source, arguments) {
    var result = true;
    var cmbDataDa=document.getElementById("ctl00_ContentPlaceHolder1_ricerca1_cmbDa");
    var cmbDurata=document.getElementById("ctl00_ContentPlaceHolder1_ricerca1_cmbDurata");
    if (cmbDataDa.selectedIndex > 0) {
        if (cmbDurata.selectedIndex <= 0) {
            alert(ric_msg_durata);
            result = false;
        }
    }
    else {
        if (cmbDurata.selectedIndex > 0) {
            alert(ric_msg_data);
            result = false;
        }
    }
    arguments.IsValid = result
}
function val_date_properties(source, arguments) {
    var result = true;
    var cmbDataDa = document.getElementById("ctl00_ContentPlaceHolder1_ricerca_properties1_cmbDa");
    var cmbDurata = document.getElementById("ctl00_ContentPlaceHolder1_ricerca_properties1_cmbDurata");
    if (cmbDataDa.selectedIndex > 0) {
        if (cmbDurata.selectedIndex <= 0) {
            alert(ric_msg_durata);
            result = false;
        }
    }
    else {
        if (cmbDurata.selectedIndex > 0) {
            alert(ric_msg_data);
            result = false;
        }
    }
    arguments.IsValid = result
}

/*  MAP */
function sel_area(cod) {
    //document.getElementById(id_selmap).value = cod;
    document.location="/properties"+path_lingua+".aspx?query=s&area="+cod
}
function sel_area_combo(cod) {
    var mappa = document.getElementById("cartina")
    switch (cod) {
        case '01':
            mappa.GotoFrame(17)
            break;
        case '02':
            mappa.GotoFrame(13)
            break;
        case '03':
            mappa.GotoFrame(11)
            break;
        case '04':
            mappa.GotoFrame(10)
            break;
        case '05':
            mappa.GotoFrame(9)
            break;
        case '06':
            mappa.GotoFrame(7)
            break;
        case '07':
            mappa.GotoFrame(8)
            break;
        case '08':
            mappa.GotoFrame(4)
            break;
        case '09':
            mappa.GotoFrame(3)
            break;
        case '10':
            mappa.GotoFrame(20)
            break;
        case '11':
            mappa.GotoFrame(5)
            break;
        case '12':
            mappa.GotoFrame(1)
            break;
        case '13':
            mappa.GotoFrame(18)
            break;
        default:
            mappa.GotoFrame(0)
            break;
    }
}