/*
* File: popup.js
* Include with: <script src="popup.js"></script>
*
* This file defines the javascript fuctions popup menus dynamically
*
*/
var ver4=1;
var Nav4=0;
if (parseInt(navigator.appVersion) < 4) {
	ver4=0;
	alert("This web page requires a version 4 browser or higher to be viewed correctly");
}
if (navigator.appName.indexOf("Netscape") != -1) {
	if (parseInt(navigator.appVersion) < 5) {
		Nav4=1;
	}
	else {
		Nav4=0;
	}
}

// Function to popup the correct menu and close other menus
function popUp(menuName,yCoord,display) {
        if (ver4) {
                if (display) {
			if (document.getElementById)
			{
				document.getElementById(menuName).style.visibility = "visible";
                               if (yCoord > 40) {
                                        yCoord = yCoord - 40;
                                }
                                document.getElementById(menuName).top = yCoord;
			}
			else if (document.all) {
				document.all[menuName].style.visibility = "visible";
                                if (yCoord > 40) {
                                        yCoord = yCoord - 40;
                                }
				document.all[menuName].style.top = yCoord;
			}
			else if (document.layers) {
				document.layers[menuName].visibility = "show";
				if (yCoord > 40) {
					yCoord = yCoord - 40;
				}
				document.layers[menuName].top = yCoord;
			}
                } else {
                       if (document.getElementById)
                        {
                                document.getElementById(menuName).style.visibility = "hidden";
                        }
                        else if (document.all) {
                                document.all[menuName].style.visibility = "hidden";
                        }
                        else if (document.layers) {
                                document.layers[menuName].visibility = "hide";

                        } 
                }
        }
}

function closePopups() {
        if (ver4) {
        	popUp('AboutPopup',100,false);
			popUp('AdminPopup',100,false);
			popUp('UserPopup',100,false);
			popUp('EducPopup',100,false);
			popUp('ContactPopup',100,false);
		}
}


function getY(e) {
	var y=190;
	if (ver4) {
		
		if (Nav4) {
			y=e.pageY;
		} else {
			y=e.y;
		}
	}
	return y;
}


function openwin(url,winName,h,w){
    url = url.replace(/\\/g,"/");
	window.open(url, winName, "location=yes,status=yes,menubar=yes,scrollbars=yes,personalbar=yes,toolbar=yes,resizable=yes,width="+w+ ",height="+h+")");
}
