﻿var min = 10;
var max = 14;
function increaseFontSize() {

    var divMain = document.getElementById('main');

    if (divMain.style.fontSize) {
        var s = parseInt(divMain.style.fontSize.replace("px", ""));
    } else {
        var s = 12;
    }
    if (s != max) {
        s += 2;
    }
    divMain.style.fontSize = s + "px";
    
}


function decreaseFontSize() {

    var divMain = document.getElementById('main');

    if (divMain.style.fontSize) {
        var s = parseInt(divMain.style.fontSize.replace("px", ""));
    } else {
        var s = 12;
    }
    if (s != min) {
        s -= 2;
    }
    divMain.style.fontSize = s + "px";
    
}


function restoreFontSize() {

    var divMain = document.getElementById('main');
   
    divMain.style.fontSize = 12 + "px";

}


//Flash Map
function SelectCity(cityID, locationType) {

    if (cityID == 0) {
        return false;
    }

    var location = new String(window.location);

    var index = location.toLowerCase().indexOf("/branchnetwork/");

    var pageID;
    if (index > (-1)) { //offices

        index = index + 15;

        //pageID = location.substr(location.indexOf("/",index) + 1,location.length -1);
        
        var fIndex = location.indexOf("/", index) + 1;
        var lIndex = location.indexOf("/", fIndex);

        if (lIndex == -1) {
            lIndex = location.length;
        }

        pageID = location.substr(fIndex, lIndex - fIndex);

        window.location = location.slice(0, index) + 'CityBranches/' + pageID + '/' + cityID;
    }
    else { //atms

        index = location.toLowerCase().indexOf("/atmnetwork/") + 12;

        var fIndex = location.indexOf("/", index) + 1;
        var lIndex = location.indexOf("/", fIndex);
        
        if (lIndex == -1) {
            lIndex = location.length;
        }

        pageID = location.substr(fIndex, lIndex - fIndex);

        window.location = location.slice(0, index) + 'CityATMs/' + pageID + '/' + cityID;
    }

}





