<!--

// open a child window with the specified url in a window that is
// % of the size the main app window.
// Note: width and height should be excluded from features string

var g_OpenScaledChildWindow = null;

function openScaledChildWindow(theURL,percent, features) {

	// close scaled child window if one is open
	if (g_OpenScaledChildWindow != null)
		g_OpenScaledChildWindow.close();
	
	var newWindowHeight = 400; // set defaults
	var newWindowWidth = 600;
	
	if (isNaN(percent) || percent < 0){
		percent = 100;
	}
	
	// get inner window dimensions
	if (document.layers) {                 // Netscape
		 newWindowHeight = window.innerHeight;
		 newWindowWidth = window.innerWidth;

	}else if (document.all) {                 // IE
		newWindowHeight = document.body.clientHeight;
		newWindowWidth = document.body.clientWidth;
	}
	
	if (newWindowHeight > 0){
		newWindowHeight = newWindowHeight * percent / 100;
	}
	
	if (newWindowWidth > 0){
		newWindowWidth = newWindowWidth * percent / 100;
	}
	
	features = 'width=' + newWindowWidth + ',height=' + newWindowHeight + ',' + features;
	
	g_OpenScaledChildWindow = window.open(theURL,"outside_links",features);	
}


var g_OpenPrintWindow = null;

function openPrintWindow(theURL,features) {

	// close print window if one is open
	if (g_OpenPrintWindow != null)
		g_OpenPrintWindow.close();
	
	var newWindowHeight = 400; // set default
	
	// get inner window dimensions
	if (document.layers) {                 // Netscape
		 newWindowHeight = window.innerHeight;

	}else if (document.all) {                 // IE
		newWindowHeight = document.body.clientHeight;
	}
	
	
	features = 'width=580,height=' + newWindowHeight + ',' + features;
	
	g_OpenPrintWindow = window.open(theURL,"printwindow",features);	
}


var g_OpenGlossaryWindow = null;

function openGlossaryWindow(termId) {
        
        var features = "menubar=yes,scrollbars=yes,resizable=yes";
	var newWindowHeight = 400; // set default
	
	// get inner window dimensions
	if (document.layers) {                 // Netscape
             newWindowHeight = window.innerHeight;

	} else if (document.all) {              // IE
            newWindowHeight = document.body.clientHeight;
	}
		
	features += ',width=580,height=' + newWindowHeight;
	
	g_OpenGlossaryWindow = window.open("glossary.jsp#"+termId,"_glossarywindow_",features);

        //if (g_OpenGlossaryWindow != null) g_OpenGlossaryWindow.focus();
}

//-->
