/* 
	Dynamic Menu 3.0.2

	Written By:  AA
	Created on:  July 14 2000.
	
	Last Modified on:
	
	April 29, 2005		-- Added a better support for contextual CSS on the <a> tag. Must use dhtmlMenu ID, see "menu_style.css"
	April 1, 2004		-- Fixed a bug for extrnal Links. 
	March 30, 2004		-- Added support for subfolders and resolved the issue with menu images not found. 
						   Also, added was the better way to suppor for the hanging menu on <img name="menu".....> property.
	October 9, 2003		-- Added a place holder for the menu. a blank image with name of "menu" must be present in the page.
	May 5, 2003			-- Separated Menu attributes and settings from nav.js
	May 1, 2003			-- Improving the Tooltip positioning.
	April 7, 2003		-- Added more flexibility for design and ToolTip.
	April 2, 2003		-- Added Tooltip Layer capability
	October 23, 2001	-- Added support for Netscape 6.0
*/


var isNav, isIE, isNS6
var isMac, isPC 
var xPixel, yPixel 
var closing, opening 
var tere = "default" 
var coll = "" 
var styleObj = "" 

function FIND(item) {
	if( window.mmIsOpera ) return(document.getElementById(item));
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function moveXbySlicePos (x, img) { 
	if (!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
			if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
			if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
			par = macIE45 ? par.parentElement : par.offsetParent;
		}
	} else if (img.x) x += img.x;
	return x;
}

function moveYbySlicePos (y, img) {
	if(!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
			if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
			if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
			par = macIE45 ? par.parentElement : par.offsetParent;
		}		
	} else if (img.y >= 0) y += img.y;
	return y;
}

function findObj(n, d) 
{
	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=findObj(n,d.layers[i].document);
	
	if(!x && d.getElementById)
		x=d.getElementById(n); 
	
	return x;
}

function showHideLayers() {
	var i,p,v,obj,args=showHideLayers.arguments;
	
	for (i=0; i<(args.length-2); i+=3) 
		if ((obj=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;
		}
}

if (parseInt(navigator.appVersion) >= 4) { 
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4) ) { 
		isNav = true;
		origWidth = innerWidth; 
        origHeight = innerHeight; 
	} else if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 5) ) {
		isNS6 = true;
		origWidth = innerWidth; 
        origHeight = innerHeight;
	} else { 
		isIE = true;
		coll = "all."; 
		styleObj = ".style"; 
	} 
	if (navigator.platform.indexOf('Mac') != -1) { 
		isMac = true
	} else { 
		isPC = true 
	}  
} else { 
	document.location.href = "/upgrade.html" 
} 
 
function NetscapeSux() { 
      if (innerWidth != origWidth || innerHeight != origHeight) { 
		origWidth = innerWidth; 
		origHeight = innerHeight; 
		location.reload() 
		return false 
	} 
} 
if (isNav || isNS6) { 
	window.captureEvents(Event.RESIZE) 
	window.onresize = NetscapeSux 
} 
function fixLayer(lname) { 
	var fixedLayer 
	fixedLayer = eval("document." + coll + lname + styleObj); 
	return fixedLayer; 
} 
function fixImg(imageTitle,lName) { 
	if (isNav) { 
		fixedImage = eval("document." + lName + ".document." + imageTitle); 
	} else { 
		fixedImage = eval("document." + imageTitle); 
	} 
	return fixedImage; 
} 
function fixImg2(imageTitle,lName1,lName2) { 
	if (isNav) { 
		fixedImage = eval("document." + lName1 + ".document." + lName2 + ".document.images['" + imageTitle + "']"); 
	} else { 
		fixedImage = eval("document." + imageTitle); 
	} 
	return fixedImage; 
} 

