﻿// JScript File

var popupWindow;

function LaunchHelpWindow(evt, helpUrl) {
    try {
        evt = (evt) ? evt : ((window.event) ? window.event : "")


        if (evt.type == 'click' || (evt.type == 'keypress' && evt.keyCode == 13)) {
            if (!popupWindow || popupWindow.closed)
                popupWindow = window.open(helpUrl, "", "scrollbars,resizable,width=430,height=520");
            else {
                popupWindow.close();
                popupWindow = window.open(helpUrl, "", "scrollbars,resizable,width=430,height=520");
            }

            evt.returnValue = false;
            return false;
        }
    }
    catch (dummy) {
        alert("Error launching help window.");
    }
}

function LaunchHelpPopup(helpId) {
    getElementWithId(helpId).style.visibility = 'visible';
}

function CloseHelpPopup(helpId) {
    getElementWithId(helpId).style.visibility = 'hidden';
}



function disableSelection(target){
    if (typeof target.onselectstart!="undefined") //IE route
	    target.onselectstart=function(){return false}
    else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	    target.style.MozUserSelect="none"
    else //All other route (ie: Opera)
	    target.onmousedown=function(){return false}
    target.style.cursor = "default"
}

