document.cookie="SID=" + (new Date()).getTime()

window.onerror = handleError;

function handleError() { return true; }

if (top.location != self.location) { top.location.replace(self.location); }

function setFU() {
	var t=setTimeout("FocusUN()",500);
}
function FocusUN() {
	var txt = document.getElementById("txtUserName");
	if (txt!=null) { txt.focus(); txt.select(); }
}

function showAlert(msg) {
	if (msg!=null || msg!="") {
	    //alert(msg);
	    //setTimeout('', 500);
	    //$.prompt(msg, { useiframe: true });
	}
}

function capsDetect(e){
    //if the browser did not pass event information to the handler,
    //check in window.event
    if( !e ) { e = window.event; } if( !e ) { return; }
    //what (case sensitive in good browsers) key was pressed
    //this uses all three techniques for checking, just in case
    var theKey = 0;
    if( e.which ) { theKey = e.which; } //Netscape 4+, etc.
    else if( e.keyCode ) { theKey = e.keyCode; } //Internet Explorer, etc.
    else if( e.charCode ) { theKey = e.charCode } //Gecko - probably not needed
    //was the shift key was pressed
    var theShift = false;
    if( e.shiftKey ) { theShift = e.shiftKey; } //Internet Explorer, etc.
    else if( e.modifiers ) { //Netscape 4
    //check the third bit of the modifiers value (says if SHIFT is pressed)
    if( e.modifiers & 4 ) { //bitwise AND
    theShift = true;
    }
    }
    //alert(theKey + ", " + theShift);
    document.getElementById('divMayus').style.visibility = 'hidden';
    //if upper case, check if shift is not pressed
    if( theKey > 64 && theKey < 91 && !theShift ) {
    document.getElementById('divMayus').style.visibility = 'visible';
    }
    //if lower case, check if shift is pressed
    else if( theKey > 96 && theKey < 123 && theShift ) {
    document.getElementById('divMayus').style.visibility = 'visible';
    }                  
}
function ShowMD(title, src, width, height) {
    clearPopUp();
    var rn = Math.floor(Math.random() * 1000);
    var dId = 'divBUIPU' + rn;
    var dX = '<div id="' + dId + '" style="cursor: default;"><div style="background-color: #404040; height: 23px; width: 100%;"><div style="float: right; width: 25px; height: 23px; padding: 2px;"><img id="aiClose" alt="Close" src="Images/CloseButton.gif" onclick="clearPopUp();" /></div><div style="width: 250px; text-align: left; padding-top: 3px;"><span style="font-weight: bold; color: White; padding: 3px; height: 23px; font-size: 10pt; text-align: left; font-family: Verdana;">' + title + '</span></div></div><iframe id="ifBUIPU" scrolling="no" height="' + height + '" width="' + width + '" src="' + src + '" frameborder="0"></iframe></div>';
    $.blockUI({ message: dX, css: {
        width: width + 'px',
        height: (height + 28) + 'px',
        left: ($(window).width() - width) / 2 + 'px',
        top: '20px'
    }
    });
}
function clearPopUp(noUnblock) {
    $("div[id^=divBUIPU]").unbind().remove();
    if (!noUnblock) {
        $.unblockUI();
    }
}
