﻿function NascondiVedi(cos,cos2) {
    if (document.getElementById(cos).style.display == 'none') {
        document.getElementById(cos).style.display = '';
        document.getElementById(cos2).title = 'Nascondi ricette';
     }
    else {
        document.getElementById(cos).style.display = 'none';
        document.getElementById(cos2).title = 'Visualizza ricette';
    }
}


function VisSond(si) {
    var DD = document.getElementById('Centro1_MenuSX1_Sondaggio1_DomandaSond');
    var RR = document.getElementById('Centro1_MenuSX1_Sondaggio1_RispostaSond');

    if (si == 0) {
        DD.style.display = 'none';
        RR.style.display = '';
    }
    if (si == 1) {
        DD.style.display = '';
        RR.style.display = 'none';
    }


}


function OnBtnColorClick(color, param) {
    fnShowChooseColorDlg(color, param, "");
}

function OnChangeColor1(color, param) {

    if (color) {
        if (param == 1) {
            Form1.txcol.text = color;
            Form1.txcol.text.style.backgroundColor = color;
        } else if (param == 2) {
            Form1.txcol.text = color;
            Form1.txcol.text.style.backgroundColor = color;
        }
    }
}

function OnChangeColor(color, param) {
    if (color) {
        document.getElementById('txcol').value = color;
        document.getElementById('txcol').style.backgroundColor = color;
    }
}

function salvaSoc() {

var str = document.getElementById("memo").value;
str=str.replace(/\n/g, ";")
    document.getElementById("Centro1_ParteCentrale1_IscrzioneAziendale1_Coor").value = str; //.replace("\n",";");
    
    

    //document.getElementById("memo").value = document.getElementById("Coor").value;
}


function salvaImp() {
    var str = document.getElementById("memo").value;
    str = str.replace(/\n/g, ";")
    document.getElementById("Centro1_ParteCentrale1_IscrizioneAssociazioni1_Coor").value = str; //.replace("\n",";");
    //document.getElementById("memo").value = document.getElementById("Coor").value;
}

//function showAddressMy(address1) {
//    geocoder.getLatLngAsync(
//            address1, 
//            function(latlng) {
//    if (!latlng) {
//        alert(address1 + " Non trovato"); 
//        }
//    else {
//        map.setCenter(latlng, 17);
////        var marker = new GMarker(latlng);
////        map.addOverlay(marker);
////        marker.openInfoWindowHtml(address);
//        }
//    }
//); 
//}
//var geocoder = new GClientGeocoder();

var geocoder = new GClientGeocoder();
function showAddressMy(address, id) {
    geocoder.getLatLng(address, function(point) {
        if (!point) {
            //$(id).style.color = "#ff0000";
        } else {
            map.setCenter(point,16);
            //rectPoly();
            //$(id).style.color = "#000000";
            //$("memo").value = "";
        }
    })
}

function SearcComp(ti) { 
//alert("cambio")
    var vi 
    var pr
    if (ti == '1') {
        vi = document.getElementById("Centro1_ParteCentrale1_IscrizioneAssociazioni1_txtviaMap").value;
        if (document.getElementById("Centro1_ParteCentrale1_IscrizioneAssociazioni1_rbMNMap").checked)
        { pr = " Mantova"; }
        else { pr = " Cremona"; }

    }
    else {
        vi = document.getElementById("Centro1_ParteCentrale1_IscrzioneAziendale1_txtviaMap").value;
        if (document.getElementById("Centro1_ParteCentrale1_IscrzioneAziendale1_rbMNMap").checked)
        { pr = " Mantova"; }
        else { pr = " Cremona"; }
     }


//alert(vi + ' ' +  pr);
showAddressMy(vi + ' ' + pr);
}
