﻿function testFunction(){
    alert("HEJ")
}

function pictureViewer(intImageID) {
    window.open("/Illustrationer/Default.aspx?ID=" + intImageID + "&Type=Pictureviewer", "PictureViewer", "height=630,width=790,status=no,resizable=yes,toolbar=no,menubar=no,location=no");
    return false;

}


function getFontSize(elm) {
    if (elm.currentStyle)
        var value = elm.currentStyle['fontSize'];
    else if (window.getComputedStyle)
        var value = document.defaultView.getComputedStyle(elm, null).getPropertyValue('font-size');
    return value;
}

function increaseFontSize(id) {
    var elm = document.getElementById(id);
    var fontSize = getFontSize(elm);
    var fontSizeNumeric = parseInt(fontSize, 10);
    var fontSizeUnit = fontSize.replace(fontSizeNumeric.toString(), '');
    if ((fontSizeUnit == "%" && fontSizeNumeric < 150) || (fontSizeUnit == "px" && fontSizeNumeric < 15)) {
        elm.style.fontSize = Math.round(fontSizeNumeric * 1.2) + fontSizeUnit;
    }
}

function decreaseFontSize(id) {
    var elm = document.getElementById(id);
    var fontSize = getFontSize(elm);
    var fontSizeNumeric = parseInt(fontSize, 10);
    var fontSizeUnit = fontSize.replace(fontSizeNumeric.toString(), '');
    if ((fontSizeUnit == "%" && fontSizeNumeric > 70) || (fontSizeUnit == "px" && fontSizeNumeric > 7)) {
        elm.style.fontSize = Math.round(fontSizeNumeric / 1.2) + fontSizeUnit;
    }
}

window.onload = function() {
    document.getElementById('increase').onclick = function() {
        increaseFontSize('main');
    }
    document.getElementById('decrease').onclick = function() {
        decreaseFontSize('main');
    }

}
