﻿function changeGeoMap() {
    $get(imgGeo).src="/images/home/geo_loading.gif";
    setTimeout('loadGeoMap()', 100);
}
function loadGeoMap() {
    var r = $get(lstRegio).options[$get(lstRegio).selectedIndex].value;
    var o = $get(lstOmzet).options[$get(lstOmzet).selectedIndex].value;
    var s = $get(lstSector).options[$get(lstSector).selectedIndex].value;
    $get(imgGeo).src="/RenderMap.ashx?mini=1&seg=" + OrigSegment + "&r=" + r + "&s=" + s + "&o=" + o;
}


var attachSectorsDone = 0;
function attachSectors() {
    if (attachSectorsDone==0) {
        var service = new SiteService();
        service.GetSectorList(Language, OrigSegment, onGetSectorList, null);
        attachSectorsDone=1;
    }
}
function onGetSectorList(result, context, methodName) 
{
    var lst = $get(lstSector);
    for (var i = 0; i < result.length; i++) {
        var sectorcode = result[i].split('|')[1];
        if (sectorcode!='HLD' && sectorcode !='ASS' && sectorcode!='BNK') {
            lst.length = lst.length + 1;
            lst.options[lst.length - 1] = new Option(result[i].split('|')[0], sectorcode);
        }
    }   
}

function BenchChanged(lst) {
    var r = lst.options[lst.selectedIndex].value;
    document.location.href="/tools/benchmark/default.aspx?create=top&r="+r;
}

function setBench() { 
    $get(lstBench).selectedIndex=0;
}
