﻿//Popup Blocker Detector Response
function popupBlocker(detected) {
    if (detected == "yes") {
        msg = document.getElementById("pnlPopupBlockerMsg");
        msg.innerHTML = "A Popup Blocker has been detected.  This site may not function properly.  Please disable any Popup Blockers before logging in.&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript://\">Show me how to do this.</a><br /><br />";
        document.forms[0].Submit.value = "Log In, Anyway";
    }
}

//Popup Blocker Detector Definition
function detectPopupBlocker() {
    var test = window.open(null,"","width=100,height=100");
    try {
	        test.close();
	        popupBlocker("no");
    } catch (e) {
	        popupBlocker("yes");
    }
}

//Popup Blocker Detector Instantiation
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() { if (oldonload) { oldonload(); } func(); }
    }
}

//Popup Blocker Detector Call
addLoadEvent(detectPopupBlocker);
