//<!--
function preloadImages() { // v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
} // preloadImages

function getDocument(psURL, pnWidth, pnMaxHeight) {
	// load the requested document in a pop-up window.
	var sURL = psURL;
	var nWidth = pnWidth;
	var nHeight = (screen.height-100);
	if ((pnMaxHeight != null) && (pnMaxHeight != 0)) {
		if (pnMaxHeight < nHeight) {
			nHeight = pnMaxHeight;
		}
	}
	var nTop = ((screen.height-100) - nHeight + 10) / 2;
	
	if ((nWidth == null) || (nWidth == 0)) { nWidth = 760; }
	
    if ((window) && (window.popupwindow) && (!window.popupwindow.closed) && (window.popupwindow.location)) {
        window.popupwindow.navigate(sURL);
	    window.popupwindow.focus();
    } else if (window) {
        window.popupwindow=window.open(sURL, '','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,top=' + nTop + ',left=' + ((screen.width - nWidth) / 2) + ',width=' + nWidth + ',height=' + nHeight);
		
        if (!window.popupwindow.opener) {
           window.popupwindow.opener = window;
        }
    }
    return false;
} // getDocument

function getDocSize(pbWidth) {
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	if (pbWidth) {
		return x;
	} else {
		return y;
	}
} // getDocSize
function getDocWidth() {
	return getDocSize(true);
} // getDocWidth
function getDocHeight() {
	return getDocSize(false);
} // getDocHeight

function getDocElement(n, d) {
	var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
} // getDocElement

function setControlsDisabled(pbTrueFalse, paCtrlList) {
    var i;
    var oCtrl = null;
    
    for(i=1; i<paCtrlList.length; i++) {
        oCtrl = getDocElement(paCtrlList[i]);
        try {
            oCtrl.disabled = pbTrueFalse;
        } catch (e) {}
    } // for i<paCtrlList.length
} // setControlsDisabled

function disableControls() {
    setControlsDisabled(true, disableControls.arguments);
} // disableControls

function enableControls() {
    setControlsDisabled(false, enableControls.arguments);
} // enableControls

function fireAnthemClick(psCtrlName, psWorkingImg, psWorkingStr, pPostCallbackFn, pbInclValuesWithCallback, pbUpdateAfterCallback) {
    var oCtrl = getDocElement(psCtrlName);
    var preProcessOut = new Anthem_PreProcessCallBackOut();
    Anthem_FireEvent(
        psCtrlName,
        '',
        function(result) {
            Anthem_PostProcessCallBack(
                result, 
                oCtrl, 
                'click',
                psCtrlName,
                null, 
                null, 
                psWorkingImg, 
                psWorkingStr, 
                pPostCallbackFn, 
                preProcessOut
            );
        },
        null,
        pbInclValuesWithCallback,
        pbUpdateAfterCallback
    );
} // fireAnthemClick

//-->

