﻿//        $(document).ready(function() {
//        $("#Button_login").click(function() {
//                jAlert('This is a custom alert box', 'Alert Dialog');
//            });
//        });

function Button_sostoyanie_onclick() {
    // var googlewin2 = dhtmlwindow.open("Информация", "iframe", "Info_Nakladnaya.aspx?id=" + document.getElementById("TextBox_Состояние").value, "Информация", "width=700px,height=600px,resize=0,scrolling=0,center=1", "recal");
		            var width = 696;
            var height = 250;
            var left = (window.innerWidth - width) / 2;
            var top = (window.innerHeight - height) / 2;
            var To = document.getElementById("TextBox_Состояние").value;
            var googlewin = window.open("Info_Nakladnaya.aspx?id=" + encodeURIComponent(To), "Информация", "width=" + width + "px,height=" + height + "px,resize=0,scrolling=0,center=1,left=" + left + ",top=" + top);
}

function offer() {
//    var X = (screen.width / 2) - (657 / 2);
    //    var Y = ((screen.height / 2) - (666 / 2)) / 2;
    var googlewin = dhtmlwindow.open("Сообщение", "iframe", "offer.aspx", "Сообщение", "width=660px,height=666px,resize=0,scrolling=0,center=1", "recal");
//    var img_win = window.open("offer.aspx", "Сообщение", "dependent=yes,resizable=yes,scrollbars=yes,titlebar=yes,top=" + Y + ",left=" + X + ",height=766,width=657");
}




function MaxFillSearch() {
    var searcht = document.getElementById('TextBox_Состояние');
    if (searcht.value == "Введите номер накладной") {
        searcht.value = "";
    }
    MaxCheckSearch();
}

function MaxOutSearch() {
    var searcht = document.getElementById('TextBox_Состояние');
    if (searcht.value == "" || searcht.value == " ") {
        searcht.value = "Введите номер накладной";
    }
}

function MaxCheckSearch() {
}

function Button_zakaz_onclick() {
//    var X = (screen.width / 2) - (690 / 2);
//    var Y = ((screen.height / 2) - (350 / 2)) / 2;
//    var img_win = window.open("New_zakaz.aspx?Откуда=" + document.getElementById("DropDownList_Откуда").value + "&Куда=" + document.getElementById("DropDownList_Куда").value + "&Вес=" + document.getElementById("DropDownList_Вес").value, "Накладная", "dependent=yes,resizable=yes,scrollbars=yes,titlebar=yes,top=" + Y + ",left=" + X + ",height=350,width=690");

    // var googlewin = dhtmlwindow.open("Новый заказ", "iframe", "New_zakaz.aspx?From=" + encodeURIComponent(document.getElementById("HiddenField_Откуда").value) + "&To=" + encodeURIComponent(document.getElementById("HiddenField_Куда").value) + "&Ves=" + encodeURIComponent(document.getElementById("HiddenField_Вес").value), "Новый заказ", "width=690px,height=350px,resize=0,scrolling=0,center=1", "recal");
	
	            var width = 496;
            var height = 400;
            var left = (window.innerWidth - width) / 2;
            var top = (window.innerHeight - height) / 2;
            var To = document.getElementById("DropDownList_To").value;
            var Ves = document.getElementById("DropDownList_Ves").value;
            var From = document.getElementById("DropDownList_From").value;
            var googlewin = window.open("New_zakaz.aspx?From=" + encodeURIComponent(From) + "&To=" + encodeURIComponent(To) + "&Ves=" + encodeURIComponent(Ves), "Заказ", "width=" + width + "px,height=" + height + "px,resize=0,scrolling=0,center=1,left=" + left + ",top=" + top);
	
}


        function Button_Raschet_onclick() {
            var width = 496;
            var height = 400;
            var left = (window.innerWidth - width) / 2;
            var top = (window.innerHeight - height) / 2;
            var To = document.getElementById("DropDownList_To").value;
            var Ves = document.getElementById("DropDownList_Ves").value;
            var From = document.getElementById("DropDownList_From").value;
            var googlewin = window.open("Info_Calc.aspx?From=" + encodeURIComponent(From) + "&To=" + encodeURIComponent(To) + "&Ves=" + encodeURIComponent(Ves), "Расчет", "width=" + width + "px,height=" + height + "px,resize=0,scrolling=0,center=1,left=" + left + ",top=" + top);
        }





