// <!-- Javascript for FC Web Site -->

var layerRef;
var styleRef;

// Creates a list of all layers, and determines which is being displayed, if any
var menus = new Array('"adminL"', '"bookL"', '"dirL"', '"onlineL"', '"libraryL"', '"myFCL"', '"newsL"', '"resourcesL"', '"studentSrvL"', '"quickHelp"');
var displayMenu = new Array( false, false, false, false, false, false, false, false, false, false );

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function browserType() {
	// Test for browser type
	if (navigator.appName == "Netscape") {		
   		layerRef="document.layers";
	    styleRef="";
		// Capture all events
		document.captureEvents();
	} else {
   		layerRef="document.all";
   		styleRef=".style";
	}
}

function showMenu(menu) {
	eval(layerRef + '["' + menu +'"]' + styleRef + '.left =' + event.x);
	eval(layerRef + '["' + menu + '"]' + styleRef + '.top =' + event.y);
	eval(layerRef + '["' + menu + '"]' + styleRef + '.visibility = "visible"');
	
	for(var i = 0; i < menus.length; i++) {
		if('"'+menu+'"' != menus[i]) {
			eval(layerRef + '[' + menus[i] + ']' + styleRef + '.visibility = "hidden"');
			displayMenu[i] = false;
		} else {
			displayMenu[i] = true;
			switch(i) {
				case 0:
					setTimeout('hideMenu("adminL")', 6000);
					break;
				case 1:
					setTimeout('hideMenu("bookL")', 6000);
					break;
				case 2:
					setTimeout('hideMenu("dirL")', 6000);
					break;
				case 3:
					setTimeout('hideMenu("onlineL")', 6000);
					break;
				case 4:
					setTimeout('hideMenu("libraryL")', 6000);
					break;
				case 5:
					setTimeout('hideMenu("myFCL")', 6000);
					break;
				case 6:
					setTimeout('hideMenu("newsL")', 6000);
					break;
				case 7:
					setTimeout('hideMenu("resourcesL")', 6000);
					break;
				case 8:
					setTimeout('hideMenu("studentSrvL")', 6000);
					break;
				case 9:
					setTimeout('hideMenu("quickHelp")', 6000);
					break;
			}
		}
	}	
}

function hideMenu(menu) {
	var index;
	for(var i = 0; i < menus.length; i++) {
		if(menus[i] == '"'+menu+'"')
			index = i;
	}
	
	if(displayMenu[index] == true)
		eval(layerRef + '["'+menu+'"]' + styleRef + '.visibility = "hidden"');	
}

function hideAll() {	
	for(var i = 0; i < menus.length; i++) {
		eval(layerRef + '[' + menus[i] + ']' + styleRef + '.visibility = "hidden"');
	}	
}

/* Basic Navigation for FC Templates */

function MM_swapImgRestore() { //v2.0
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore  
}

function openBrWindow(theURL,winName,features) {

window.open(theURL,winName,features);

}

function displayStatusMsg(msgStr) {

status=msgStr;

document.returnValue = true;

}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=1,resizable=1,width=300,height=300');");
}


