// for targed links in the popup window

if (window.name != "preview") {
	window.name = "mla_main";
	this.focus();
	}

// pop up window

var docs_popup;

// If the window already exists (but closed or in the background) bring it to the foreground.  Otherwise, open it.

function popup(url, name, w, h) {

	var temp;
	eval('temp = ' + name);
	
	if (!w) {w = 460;}
	if (!h) {h = 500;}

	temp = window.open(url, name, 'width=' + w + ',height=' + h + ',scrollbars,resizable');
	if (goodBrowser()) {
		temp.focus();
	}

	eval(name + ' = temp');
}

function goodBrowser() {

	if ( (navigator.appName == "Netscape" && (navigator.appVersion.substring(0,1) >= "3") ) || 
		(navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.substring(0,1) >= "4") ) ) {
		return true;
	} else {
		return false;
	}
}


// drop-downs

var DOCSMenu = null;
function menuOver(MenuID) {

	// old netscape browsers
	if (document.layers) {
		if (document.layers[MenuID]!=null) {
			// the window is already open
			if (DOCSMenu==document.layers[MenuID]){
				clearTimeout(Timeout_ID);
				} else{
				// opening a new menu, so close the old one
				if(DOCSMenu!=null){
					clearTimeout(Timeout_ID);
					hideNow();
					}
				}
			// show the menu
			DOCSMenu = document.layers[MenuID];
			if (DOCSMenu.visibility!=null) {
				DOCSMenu.visibility = 'visible';
				}
			}

	// newer browsers
		} else {
		
		if ((document.getElementById)&&(document.getElementById(MenuID)!=null)) {
		// the window is already open
			if (DOCSMenu==document.getElementById(MenuID)){
				clearTimeout(Timeout_ID);
				} else{
				// opening a new menu, so close the old one
				if(DOCSMenu!=null){
					clearTimeout(Timeout_ID);
					hideNow();
					}
				}
			// show the menu
			DOCSMenu = document.getElementById(MenuID);
			if ((DOCSMenu.style)&&(DOCSMenu.style.visibility!=null)) {
				DOCSMenu.style.visibility = 'visible';
				}
			}
		}
	
	
}


function menuOut(MenuID){

	// old netscape browsers
	if (document.layers) {
		
		if (document.layers[MenuID]!=null) {
			DOCSMenu = document.layers[MenuID];
			Timeout_ID = window.setTimeout('hideNow();',600);
			}

	// newer browsers
		} else {
		
		if ((document.getElementById)&&(document.getElementById(MenuID)!=null)) {
			DOCSMenu = document.getElementById(MenuID);
			Timeout_ID = window.setTimeout('hideNow();',600);
			}
		
		}
	
}

function hideNow() {

	// old netscape browsers
	if (document.layers) {
		
		DOCSMenu.visibility = 'hidden';

	// newer browsers
		} else {
		
		if ((DOCSMenu.style)&&(DOCSMenu.style.visibility)) {
			DOCSMenu.style.visibility = 'hidden';
			}
		
		}
		
}
	

		
function getInsideWindowHeight() {
	
    if (window.innerHeight) {
        return window.innerHeight;
        } else if (document.body && document.body.clientHeight) {
		return document.body.clientHeight;
		} else {
		return 600;
		}
}
