﻿var somewindow;

function LoginWindow() {
    CenteredDialog("/Login.aspx", "", "", 200, 180);
}

function SkladInfo() {
    CenteredDialog("/InfoWindow.aspx?type=sklad", "", "", 350, 300);
}

function ManiPoplInfo() {
    CenteredDialog("/InfoWindow.aspx?type=manipopl", "", "", 400, 300);
}

function DopravaInfo(DoprKey) {
    CenteredDialog("/InfoWindow.aspx?type=dopr&id=" + DoprKey, "", "", 400, 300);
}

function PlatbaInfo(PlatKey) {
    CenteredDialog("/InfoWindow.aspx?type=plat&id=" + PlatKey, "", "", 400, 300);
}

function Galerie(crdKey) {
    somewindow = window.open('/Images.aspx?id=' + crdKey, "", "resizable=yes,scrollbars=yes,width=950px,height=750px");
}

function ItemMenu(crdKey) {
    window.open('/MenuZbozi/ItemMenu.aspx?id=' + crdKey, "", "menubar=no,resizable=yes,scrollbars=yes,width=600px,height=400px");
}


function CenteredDialog(url, title, features, width, height) {
    var iMyWidth;
    var iMyHeight;
    //half the screen width minus half the new window width (plus 5 pixel borders).
    iMyWidth = (window.screen.width / 2) - (width/2 + 10);
    //half the screen height minus half the new window height (plus title and status bars).
    iMyHeight = (window.screen.height / 2) - (height/2 + 50);
    //Open the window.
    var win2 = window.open(url, title, "height=" + height + ",width=" + width
            + ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight
            + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no,resizable=yes" + features);
    win2.focus();
}

