﻿var mainEmail = 'Main_emailText';
var emailControl = 'PageHeading_emailText';
var passwordControl = 'PageHeading_passwordText';

function PrintTable(tableToPrint,pageTitle) {
    var disp_setting = "toolbar=no,location=no,directories=yes,menubar=yes,";
    disp_setting += "scrollbars=yes,width=800, height=600, left=100, top=25";
    var content_vlue = document.getElementById(tableToPrint).innerHTML;

    var docprint = window.open("", "", disp_setting);
    docprint.document.open();
    docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml">');
    docprint.document.write('<head>');
    docprint.document.write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8">');
    docprint.document.write('<link href="http://www.PredictionMachine.com/StyleSheets/AllCSS.css" type="text/css" rel="stylesheet">');
    docprint.document.write('<link href="http://www.PredictionMachine.com/Images/favicon.ico" rel="shortcut icon">');
    docprint.document.write('<title>' + pageTitle + '</title>');
    docprint.document.write('</head><body onLoad="self.print()">');
    docprint.document.write('<div class="content CMS"><table class="standard">' + content_vlue + '</table></div>');
    docprint.document.write('</body></html>');
    docprint.document.close();
    docprint.focus();
}

clearPassword = {
    init: function () {
        checkTextBox(mainEmail, 'inputText', ' emailInput');
        checkTextBox(emailControl, 'loginTxt', ' loginEmail');
        checkTextBox(passwordControl, 'loginTxt', ' loginPassword');
        checkTextBox('ctl00_' + mainEmail, 'inputText', ' emailInput');
        checkTextBox('ctl00_' + emailControl, 'loginTxt', ' loginEmail');
        checkTextBox('ctl00_' + passwordControl, 'loginTxt', ' loginPassword');
    }
}

/* for Mozilla/Opera9 */
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", clearPassword.init, false);
}

/* for Internet Explorer */
/*@cc_on@*/
/*@if (@_win32)
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function () {
    if (this.readyState == "complete") {
        clearPassword.init(); // call the onload handler
    }
};
/*@end@*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function () {
        if (/loaded|complete/.test(document.readyState)) {
            clearPassword.init(); // call the onload handler
        }
    }, 10);
}

/* for other browsers */
window.onload = clearPassword.init;
function checkTextBox(textBoxToClear, normal, cssClass) {
    if (document.getElementById(textBoxToClear) != null) {
        document.getElementById(textBoxToClear).className = normal;
        if (document.getElementById(textBoxToClear).value == '') {
            document.getElementById(textBoxToClear).className += cssClass;
        }
    }
}


function showHide(showElem, hideElem) {
    document.getElementById(hideElem).style.display = 'none';
    document.getElementById(showElem).style.display = '';
}

function showHide2(elem, show) {
    if (show == 1) {
        document.getElementById(elem).style.display = '';
    } else {
        document.getElementById(elem).style.display = 'none';
    }
}
