// JavaScript Document
var isNew = 0;
var isNS4 = 0;
var isIE4 = 0;

var brow = ((navigator.appName) + (parseInt(navigator.appVersion)));
if (parseInt(navigator.appVersion) >= 5)
	isNew = 1;
else if (brow == "Netscape4")
	isNS4 = 1;
else if (brow == "Microsoft Internet Explorer4")
	isIE4 = 1;

function popUp(evt, currElem, currImg)
{
  var leftVal=0;
  var PARENT;
  
  if ((isNS4 && currElem != 0) || (isIE4 && currElem != 0) || (isNew && currElem != 0))
  {
  	if (isNS4)
	{
		docObj = 'document.'+currElem;
		styleObj = '';
	} else if (isIE4)
	{
		docObj ='document.all.'+currElem;
		styleObj = '.style';
	} else
	{
		docObj ='document.getElementById("'+currElem+'")';
		styleObj = '.style';
	}

  	dom = eval(docObj + styleObj);
	state = dom.visibility;
	if (state == "visible" || state == "show")
	  dom.visibility = "hidden";
	else {
	  if (isNS4)
	  {
		topVal = eval(evt.pageY);
	//	topVal = 30;
		leftVal = eval(evt.pageX);
	  }
	  if (isIE4)
	  {
		topVal = eval(event.y);
//		leftVal = eval(event.x);
	//	topVal = 35;
// This approach for finding the left value only works if the image is sitting within
//   one table.  I'm going to look into settting up a loop so that it can handle
//   nested tables automatically.
//		alert(TABLE.offsetLeft);
/*		TD = currImg.offsetParent;
		TABLE = TD.offsetParent;
		leftVal = TD.offsetLeft + TABLE.offsetLeft;
*/
//Ok, this should handle an image within nested tables.  Ugly, ugly, ugly...
		PARENT = currImg.offsetParent;
		while (PARENT)
		{
			leftVal = leftVal + PARENT.offsetLeft;
			PARENT = PARENT.offsetParent;
		}
	  }
	  if (isNew)
	  {
		topVal = eval(evt.pageY);
		leftVal = eval(evt.pageX);
//		topVal = 30;
//		leftVal = currImg.offsetLeft;
	  }
	  if (leftVal < 2) 
	    leftVal=2;
	  dom.top = topVal;
// This is specific for our menu.  Keeps the last one from going off the right side
// of the screen.  I'm sure there is a better way to do this, so feel free to improve
// upon it....
	  if (currElem == 'kids')
	  		dom.left = leftVal - 50;
	  else
		  dom.left = leftVal;
	  dom.visibility = "visible";
	}
  }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
