/* --------------------------------------------------------------------

	UTILITY FUNCTION LIBRARY
	(c) 2000 Encore Development
	
--------------------------------------------------------------------- */
//--------------------------Browser Detection-------------------------
var NS4 = (document.layers) ? 1 : 0;
var IE = (document.all) ? 1 : 0;
var DOM = (document.getElementById) ? 1 : 0;

/* --------------------------------------------------------------------
FUNCTION:  changeImage
PARAMS  :  sName, sImage
RETURNS :  none
PURPOSE :  Change an image
--------------------------------------------------------------------- */

function changeImage(sName,sImage)
{
	document.images[sName].src = sImage
}


/* --------------------------------------------------------------------
FUNCTION:  changeDiv
PARAMS  :  div name, h = hide or s = show
RETURNS :  none
PURPOSE :  Cross Browser hiding and showing of div tags
--------------------------------------------------------------------- */

function changeDiv(DivID,Vis)
{
    if (IE) {
        if (Vis == "h") {
        document.all[DivID].style.display='none';
        }
        else if (Vis == "s") {
        document.all[DivID].style.display = '';
        }
        return false;
    }
    if (DOM) {
        if (Vis == "h") {
            var flipOff = document.getElementById(DivID);
            flipOff.style.display="none";
        }
        else if (Vis == "s") {
            var flipOn = document.getElementById(DivID);
            flipOn.style.display="";
        }
        return false;
    }
    if (NS4) {
        if (Vis == "h") {
            document.layers[DivID].visibility='hide';
        }
        else if (Vis == "s") {
            document.layers[DivID].visibility = 'show';
        }
        return false;
    }
    return false;
}
//
// Function: Open_Window
//
function open_Window(sURL, sWindowName, winWidth, winHeight) 
{
	if (winWidth == null) winWidth = 500;
	if (winHeight == null) winHeight = 350;

	// Get the screen resolution so we can center the dialog box 
	var nWidth  = window.screen.width;
	var nHeight = window.screen.height;
	var sCenter = ""; 

	if (nWidth != "" && nHeight != "")
	{
		sCenter =  ",top=" + (nHeight - winHeight) / 2; 
		sCenter += ",left=" + (nWidth - winWidth) / 2; 
	}
	newWindow = window.open(
		sURL, 
		sWindowName, 
		'width=' + winWidth + ',height=' + winHeight + 
			',scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no' + sCenter);
}

function printWindow()
{  
	if (window.print) 
	{
		window.print() ;  
	} 
	else 
	{
		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    
		WebBrowser1.outerHTML = "";  
	}
}


