﻿function MoveZoomLayer() {
    var objZoomLayer;

    try {
        objZoomLayer = window.document.getElementById('zoomLayer');
        objZoomLayer.style.top = (parseInt(window.document.body.scrollTop) + 100).toString() + 'px';
    }
    catch (sError) {
    }
}

function ZoomImage(ImageLink) {
    window.document.getElementById('zoomLayer').style.display = 'block';
    window.document.getElementById('zoomFrame').src = ImageLink;
}
function CloseImage() {
    window.document.getElementById('zoomLayer').style.display = 'none';
}

function InitZoom() {
    MoveZoomLayer();
    window.onscroll = MoveZoomLayer;
}

function popDraw(filename, forhandler, lid) {
    var digiLid = 0;

    switch (lid) {
        case "1030":
            digiLid = 1;
            break;
        case "1033":
            digiLid = 3;
            break;
        case "1031":
            digiLid = 2;
            break;
        case "1053":
            digiLid = 5;
            break;
    }

    //var URL = "http://localhost/cp2/client/tegneprogram/Default.aspx?filename=" + filename + "&forhandler=" + forhandler + "&lid=" + digiLid;
    var URL = "http://concepta-mediacenter.digizuite.dk/client/tegneprogram/Default.aspx?filename=" + filename + "&forhandler=" + forhandler + "&lid=" + digiLid;

    if (window.document.getElementById("statusDrawFrame")) {
        window.document.getElementById("statusContent").style.display = 'none';
        window.document.getElementById("statusMenu").style.display = 'none';
        window.document.getElementById("statusBottom").style.display = 'none';
        window.document.getElementById("statusDrawFrame").style.display = '';
        window.frames["statusDrawFrame"].location = encodeURI(URL);
    }
    if (window.document.getElementById("stepDrawFrame")) {
        window.document.getElementById("stepContent").style.display = 'none';
        window.document.getElementById("stepMenu").style.display = 'none';
        window.document.getElementById("stepBottom").style.display = 'none';
        window.document.getElementById("stepDrawFrame").style.display = '';
        window.frames["stepDrawFrame"].location = encodeURI(URL);
    }
}

function redirect(changeFront) {
    if (changeFront == "true") {
        //var url = "http://localhost/CP2/client/step_2.aspx?statusAction=1&featureTypeID=5&sender=draw";
        var url = "http://concepta-mediacenter.digizuite.dk/client/step_2.aspx?statusAction=1&featureTypeID=5&sender=draw";
        parent.window.location.href = url;
    }
    else {
        //var url = "http://localhost/cp2/client/step_3.aspx";
        var url = "http://concepta-mediacenter.digizuite.dk/client/step_3.aspx";
        parent.window.location.href = url;
    }
}

function noFront() {
    alert("Du skal vælge en front, før du kan åbne tegneprogrammet");
}
function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
    return "";
}
