
//v1.1.0.2 by PVII-www.projectseven.com
function P7_ExpMenu()
{ 
 if(navigator.appVersion.indexOf("MSIE")==-1)
 {
    return;
 }
 var i; // UL counter
 var k; // LI counter
 var g; // UL object
 var lg; // LI object collection
 var r=/\s*p7hvr/; // regex for finding the p7hvr class
 var nn=''; // Used for nexted UL's (headernav->headernav1->headernav2)
 var c; // used in the function creation? 
 var cs='p7hvr'; // p7hvr class that gets appended to the UL
 var bv='headernav'; // UL name
 
 for( i=0; i<10; i++)// aparent limit of 10 nested levels
 {
    g=document.getElementById(bv+nn); //getting the UL
    if(g)// making sure we have a UL
    {
        lg = g.getElementsByTagName("LI");//get the child LIs
        if(lg) // make sure we have LIs
        {
            for( k = 0; k < lg.length; k++)// loop through the LIs
            {
                lg[k].onmouseover = function()
                    {
                        c = this.className;
                        cl = (c)?c+' '+cs:cs; //cs = p7hvr, basicly adding onto the assigned class (classname p7hvr)
                        this.className=cl;
                    };
                 lg[k].onmouseout = function()
                    {
                        c=this.className;
                        this.className=(c)?c.replace(r,''):''; // removing the p7hvr class (r is regex to match p7hvr)
                    };
              }
        }
    }
    nn=i+1; // update nn to loop through the next layer of nested ULs
 }
}

function populateFields(chkThis, frmThis, arFieldsFrom, arFieldsTo){
	var i, j;
	var fefrom;
	var feto;
	var fetorep;
	
	if (chkThis.checked){
		for (i=0; i < arFieldsFrom.length; i++){
			if(frmThis[arFieldsTo[i]]) {
				fefrom = frmThis[arFieldsFrom[i]];
				feto = frmThis[arFieldsTo[i]];
				if (fefrom.tagName.toLowerCase() == "select" && feto.tagName.toLowerCase() == "select") {
					feto.options.length = 1;
					
					for (j=1; j < fefrom.options.length; j++) {
						fetorep = feto.options.add ? feto.options : feto;
						fetorep.add(document.createElement("option"));
						feto.options[feto.options.length-1].value = fefrom.options[j].value;
						feto.options[feto.options.length-1].text = fefrom.options[j].text;
					}
					feto.selectedIndex = fefrom.selectedIndex;
				} else {
					frmThis[arFieldsTo[i]].value = frmThis[arFieldsFrom[i]].value;
				}
			}
		}
	}else{
		for (i=0; i < arFieldsFrom.length; i++){
			if(frmThis[arFieldsTo[i]])
				frmThis[arFieldsTo[i]].value = '';
		}
	}
}



//JONK's getAcuElementById------
// some browser sniffing:
document.version = parseFloat(navigator.appVersion);
document.hostApplication = navigator.appName.substring(0,3);
document.browserClass = parseInt(document.version);
			
if(document.browserClass < 4) 
{
 // redirect -- no CSS support
 // if you used &lt;script language=javascript1.2&gt; 
 // this won't be necessary
 // ALL this code will be ignored!
}
else      // isolate this setup from "modern" browsers!!
if(document.browserClass == 4) // might need to check NN5 browsers as well
{

	if(document.hostApplication == "Net") // got netscape?
	{
		  // need to "fake" the style attribute
		  // so we add a little misdirection
		  // by creating an object that will
		  // intercept the property setting.
		  // we make NN think it's setting properties 
		  // in A style object, when it is actually
		  // redirected to set the property to the actual layer
		   // and you might have thought it couldn't be done...
		 function _style()
		 {
		  this.layerRef = null;    // this will be set when <B style="COLOR: black; BACKGROUND-COLOR: #ffff66">getElementByID</B> is called

		  /* we don't actually need these -- it's just pseudocode
		  this.visibility = "";
		  this.top = 0;
		  this.left = 0;
		  */
						   
		   // very cool method in NN (only) -- 
		   // since these aren't "real" object properties
		   // it's more like a watchdog
		   // for more info -- check Netscape's docs
		  this.watch("visibility", 
		     function(id, old, nval) 
		      {  // set the "real" property of the layer here
		       eval("this.layerRef." + id + " = '" + nval + "'");
		       return nval; });
		        // you must return either old or nval
		  this.watch("top",
		     function(id, old, nval) {
		       eval("this.layerRef." + id + " = '" + nval + "'");
		      return nval;});
		  this.watch("left",
		     function(id, old, nval) {
		       eval("this.layerRef." + id + " = '" + nval + "'");
		      return nval;});
						  
		   // note: all the inline functions are exactly the same
		   //  you can cut'n'paste for each property you need to watch!
		}

	 // here we set up the "appearance" of a style property

	 Layer.prototype.style = new _style();
	  // each time a new layer is created, a new _style() object
	  // is attached to it
				    
	} // end if NN

	 // here, getElementById is getting declared by BOTH IE4 and NN4 browsers
	document.getAcuElementById = function(name)
	{
		if(document.hostApplication == "Net") // netscape 4
		{
			if (document.browserClass == 4){
				var lyr = eval("document." + name);
						   
			 // only need to do this once, but
			 // what the hey...
			 if(lyr.style != null) lyr.style.layerRef = lyr;
								    
			return lyr;
			}else{
				return document.layers('" + name + "');
			}
		}
		  else // IE
		  {
			return eval("document.all." + name);
		  }
  }
}else // end browserClass == 4
	{
	if(document.hostApplication == "Net"){
		document.getAcuElementById = function(name){
				if(!eval("document." + name)){
					return document.getElementById(name);
				}else{
					return eval("document." + name);
				}
			}
	}else
	{
		document.getAcuElementById = function(name){
				return document.getElementById(name);
			}
	}
}
//END JONK's getAcuElementById---------

function showHideDisplay(obj) {
	if (typeof(obj) == "string") obj = $(obj);
	if (obj) 
	{
	  if (getStyleByObj(obj, "display") == "none") 
	  {
	       obj.style.display = "block";
	  } else if (getStyleByObj(obj, "display") == "block") 
	  {
	       obj.style.display = "none";
	  }
		
	}
}


