﻿function openSendPasswordMailPopup() {
    document.getElementById('outer').style.visibility = "visible";
    document.getElementById('outermost').style.visibility = "visible";
    document.getElementById('outermost').style.height = document.documentElement.scrollHeight + "px";
    document.getElementById('outermost').style.width = document.documentElement.scrollWidth + "px";
    makecenter('outer');
}
function CloseSendPasswordMailPopup() {
    document.getElementById('outer').style.visibility = "hidden";
    document.getElementById('outermost').style.visibility = "hidden";
    document.getElementById('outermost').style.height = document.documentElement.scrollHeight + "px";
    document.getElementById('outermost').style.width = document.documentElement.scrollWidth + "px";
    makecenter('outer');
}

function makecenter(id) {

    var brSize = getBRSize();

    var WWidth = '';
    WWidth = document.getElementById(id).style.width;
    WWidth = parseInt(WWidth.substring(0, WWidth.length - 2));

    var Wheight = '';
    Wheight = document.getElementById(id).style.height;
    Wheight = parseInt(Wheight.substring(0, Wheight.length - 2));

    document.getElementById(id).style.left = ((brSize[0] - WWidth) / 2) + 'px';
    document.getElementById(id).style.top = ((brSize[1] - Wheight) / 2) + 'px';

}

function getBRSize() {
    var bodyWidth = document.documentElement.clientWidth;
    var bodyHeight = document.documentElement.clientHeight;

    var bodyWidth, bodyHeight;
    if (self.innerHeight) { // all except Explorer 
        bodyWidth = self.innerWidth;
        bodyHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        // Explorer 6 Strict Mode 		 
        bodyWidth = document.documentElement.clientWidth;
        bodyHeight = document.documentElement.clientHeight;
    } else if (document.body) {// other Explorers 		 
        bodyWidth = document.body.clientWidth;
        bodyHeight = document.body.clientHeight;
    }
    var nav4 = window.event ? true : false;
    if (nav4) {
        x = document.documentElement.scrollLeft + document.body.scrollLeft;
        y = document.documentElement.scrollTop + document.body.scrollTop;
    }
    else {
        x = window.scrollX;
        y = window.scrollY;
    }
    if (x == 'undefined' || x == null) x = 0;
    if (y == 'undefined' || y == null) y = 0;

    bodyWidth = bodyWidth + x;
    bodyHeight = bodyHeight + y

    return [bodyWidth, bodyHeight];

}
function ValidateUsername(obj) {
    var Username = document.getElementById(obj + '_txtPassUsername');
    var blankCount = 0;
    var errorMsg;

    if (Username.value == '') {
        errorMsg = "Please enter UserName";
        alert(errorMsg);
        blankCount++;
        return false;
    }
    if (blankCount == 0) {
        return true;
    }
    else {
        return false;
    }
} 
