﻿function RefreshProgressPosition(e) {
    var objUpdateProgress = document.getElementById(e);
    var winW = document.body.scrollWidth;
    var winH = document.body.clientHeight;
    var winT = document.body.scrollTop;
    objUpdateProgress.style.left = parseInt(winW, 10) / 2 - 150 + "px";
    objUpdateProgress.style.top = parseInt(winH, 10) / 2 + parseInt(winT, 10) - 150 + "px";
}
var fixLeftPopup = 0;
var fixTopPopup = 0;
function fnShowDetailHW(ref, pcode, h, w) {
    var form = document.createElement("form");
    form.setAttribute("method", "post");
    form.setAttribute("action", ref);
    form.setAttribute("target", "formresult" + pcode);
    var hiddenField = document.createElement("input");
    hiddenField.setAttribute("name", "FromSearch");
    hiddenField.setAttribute("value", "1");
    form.appendChild(hiddenField);
    form.style.display = "none";
    document.body.appendChild(form);
    window.open('', 'formresult' + pcode, 'scrollbars=no,menubar=no,height=' + h + ',width=' + w + ',resizable=0,scrollbars=yes ,toolbar=no,status=no,left=' + fixLeftPopup + ',top=' + fixTopPopup);
    fixLeftPopup += 20;
    fixTopPopup += 20;
    if (fixLeftPopup > 200) {
        fixLeftPopup = 0;
        fixTopPopup = 0;
    }
    form.submit();
}
function fnShowDetail(ref, pcode) {
    fnShowDetailHW(ref, pcode, 600, 800);
}
function fnShowDetailPopup(ref) {
    var form = document.createElement("form");
    form.setAttribute("method", "post");
    form.setAttribute("action", ref);
    var hiddenField = document.createElement("input");
    hiddenField.setAttribute("name", "FromSearch");
    hiddenField.setAttribute("value", "1");
    form.appendChild(hiddenField);
    document.body.appendChild(form);
    form.submit();
}
var ISAlarmShow = false;
function TypeEnglishAlarm(e) {
    if (ISAlarmShow)
        return;
    var strText = e.value
    var sw = false;
    for (var i = 0; i < strText.length; i++) {
        if (strText.charCodeAt(i) >= 65 && strText.charCodeAt(i) <= 122) {
            sw = true;
            break;
        }
    }
    if (sw) {
        window.alert("حروف فارسی وارد نشده");
        ISAlarmShow = true;
    }
}
function DeleteConform() {
    return window.confirm("آیا می خواهید این ملک حذف شود");
}

