//-------------------------------------------------------------------
//|						Copyright JTech Communications 2002
//|	File:	home.js
//|	Author:	John Divelbiss - john@siblevid.com
//|	Description:  This file contains all the javascript functions
//|	needed for the home page of mostofus.org
//-------------------------------------------------------------------

//-------------------------------------------------------------------
//|	Variable Definitions
//-------------------------------------------------------------------

	var menuArray = new Array();
	var hideArray = new Array();
	var c = "";
	var d = "";
	var menuString = "";
	var subMenuString = "";
//-------------------------------------------------------------------

//-------------------------------------------------------------------
//|	Function:	ImagePreload
//|	Descriptione:	Will preload an image
//|	Parameters:	img - path to image to preload
//-------------------------------------------------------------------
	function ImagePreload (img)
		{
			var a=new Image();
			a.src=img;
			return a;
		}
//-------------------------------------------------------------------

//-------------------------------------------------------------------
//|	Function:	toggleVisibility
//|	Descriptione:	Will preload an image
//|	Parameters:	img - path to image to preload
//-------------------------------------------------------------------
	function toggleVisibility(id, NNtype, IEtype, WC3type, ZPos) {
		if (document.getElementById) {
			eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
			eval("document.getElementById(id).style.zIndex = \"" + ZPos + "\"");
		} else {
			if (document.layers) {
				document.layers[id].visibility = NNtype;
							document.layers[id].zIndex = ZPos;
						} else {
							if (document.all) {
								eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
								eval("document.all." + id + ".style.zIndex = \"" + ZPos + "\"");
							}
						}
					}
				}
//-------------------------------------------------------------------

//-------------------------------------------------------------------
//|	Function:	turnOff
//|	Descriptione:	Will preload an image
//|	Parameters:	img - path to image to preload
//-------------------------------------------------------------------

//-------------------------------------------------------------------
//-------------------------------------------------------------------
//|	Function:	toggleLayers
//|	Descriptione:	Will preload an image
//|	Parameters:	img - path to image to preload
//-------------------------------------------------------------------
	function toggleLayers(layers)
		{
			regex = "\,"
			tempArray = new Array;
			for (i=0;i<menuArray.length;i++){
				hideThis = menuArray[i];
				toggleVisibility(hideThis, "hidden", "hidden", "hidden", 0); 
				}
			menuArray = new Array;
			if(layers != null){
				if(layers.match(regex)){
					tempArray = layers.split(","); }
				else{
					tempArray[0] = layers }

				for (i=0;i<tempArray.length;i++){
					toggleVisibility(tempArray[i], "show", "visible", "visible", 100); }
				menuArray = tempArray;	
			}
		}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//|	Function:	createMenu
//|	Descriptione:	Will preload an image
//|	Parameters:	img - path to image to preload
//-------------------------------------------------------------------

	
//-------------------------------------------------------------------
				function launch(newURL, newName, newFeatures, orgName) 
					{
						var remote = open(newURL, newName, newFeatures);
						if (remote.opener == null)
						remote.opener = window;
						remote.opener.name = orgName;
						return remote;
					}
				function launchHelp()
					{
						HelpWindow = launch("help.asp", "Help", "height=700,width=600,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0", "body");
					}

				function launchImage()
					{
						ImageWindow = launch("image.asp", "Help", "height=700,width=600,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0", "body");
					}

					

var nav4 = window.Event ? true : false;

function displayLocation(e) {
  var str = "";
  if (nav4) { // Navigator 4.0x
	if ((e.pageY < 100) || (e.pageY > 500))
		{
			toggleLayers(null);
			turnOff('')
		}
  } else { // Internet Explorer 4.0x
		if (((event.clientY + document.body.scrollTop) < 100 ) || ((event.clientY + document.body.scrollTop) > 500 ))
		{
			toggleLayers(null);
			turnOff('')
			
		}
  }
}



if (nav4) // Navigator 4.0x
  document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = displayLocation;



