// ********Browser Testing ************************************
var NS4 = (document.layers) ? 1 : 0; var IE4 = (document.all&&(!document.getElementById)) ? 1 : 0;
var IE5 = (document.getElementById && document.all) ? 1 : 0;
if (IE4){document.getElementById = ie4getElementById;};var NS6 = (document.getElementById && (!document.all)) ? 1 : 0;
// ***** Global Preferences (User Modifiable) ***************************************
if(!dm_absolutePath){var dm_absolutePath = "";} //if absolute path has already been set, we'll use it, else, it's nothing. If needed, "dm_absolutePath" should be set by the calling page, before including this file.It's to allow use of the same code from an external site.
if(!dm_homeUrl){var dm_homeUrl = dm_absolutePath;} //if absolute path has already been set, we'll use it, else, it's nothing. If needed, "dm_absolutePath" should be set by the calling page, before including this file.It's to allow use of the same code from an external site.
var dm_imagePath = dm_absolutePath + ""; // location of global menu images
var dm_scriptPath = dm_absolutePath + "js/"; // location of scripts
var dm_minimumMenuHeight = 180; //If a menu needs to be squished to fit, this is the smallest the menu should get before the top position of the menu is raised from its spawn position. 0 = allow menu to raise as needed.
var dm_maximumMenuHeight = 300; //0 = use all space available, else the menu will start to scroll if it is larger.Overridden by srollHeight of menu, unless dm_ignoreScrollHeight is true.
var dm_ignoreScrollHeight = true; //Ignores the "scroll height" parameter of a menu, allowing it to be as large as it needs, or allows dm_maximumMenuHeight to override menu's scrollhieght,
var dm_leftMargin = 12; // Note:If you will be using the "left" arrows, this should be larger than the arrow width
var dm_borderSize = 1; var dm_separationSize = 1; var dm_normalItemHeight = 16;
var dm_doubleItemHeight = 30; 
var dm_menuArrowWidth = 14; //Height of the menu arrow scales with the height of the menu item (normal, or double)
var dm_scrollArrowHeight = 13; var dm_menuScrollArrowImageWidth = 11; var dm_menuScrollArrowImageHeight = 10;
var dm_scrollArrowBackgroundColor = '#CFD7FE'; var dm_scrollArrowEffectColor = '#6674b8';
var dm_scrollSize = 10;var dm_scrollSpeed = 1; var dm_fontSize = '11px';
var dm_largeFontSize = '11px'; // Used for the header of dm_text items
var dm_fontFamily = 'tahoma'; //,verdana,arial,helvetica';
var dm_fontWeight = 'bold';var dm_borderColor = '#8d9dfd';var dm_separationColor = '#6674b8';var dm_backgroundColor = '#ffffff';
var dm_backgroundEffectColor = '#6674b8';
if(NS4){var dm_textColor = '#48487c'; // Text Color if netscape 4
}else{var dm_textColor = '#48487c'; };// Text color for anyone else
var dm_textEffectColor = '#ffffff'; // will not work for NS4.Set to same as dm_textColor for no effect
var dm_allowEffectOnAll = true; // if true, items without children, or HREFSs, will effect
var dm_menuTimer = 600; //number of msec delay before showing/killing menus. 
var dm_hideIntrusiveElements = false; // Should the document be scrubbed for select lists that could get in the way?
// For this to work on netscape, forms that may get in the way of the menus must be put in an "<ilayer>" tag, and must be given an ID of "dm_intrusive_nnn" where nnn is your count (if you have 4 intrusive forms,
// the first would be 1, second 2, and so on.).  Ex: <ilayer id="dm_intrusive_1">[form, elements, etc..]</ilayer>
// This may complicate any scripts you have that interact with the form, and it's elements under NS4. IE and Gecko will find the elements automatically.
// **********DO NOT MODIFY BELOW THIS POINT******************************
// ******* Script setup and defs *************************
// Global Variables
var dm_Tab = 0;var dm_Normal = 1; var dm_Double = 2; var dm_Image = 3; var dm_Text = 4; var dm_dTab = 5;
var dm_cColors = 90; var dm_cScroller = 91; var dm_cFont = 92; var dm_cSizes = 93; var dm_cArrows = 94;
var dm_Inherit = 95; var dm_preloadList = new Array(); var dm_currentMenu = false; var dm_showRequestId, dm_showRequestName, dm_showRequestParent; var dm_globalHideRequests = new Array(); var dm_currentEvent = 0;
var dm_loadComplete = true; var dm_prematureRequest = false; var dm_activeMenus = new Array(); var dm_geckoMenuFix = new Array(); var dm_activeScroller = false; var leftPos = 0; var topPos = 0; var lastElementName;
var dm_intrusiveElements = new Array(); var dm_origWidth = window.innerWidth; var dm_origHeight = window.innerHeight;
function dm_resizeHandler(){if (window.innerWidth != dm_origWidth || window.innerHeight != dm_origHeight){window.location.reload();}}
// Preload Menu "Arrows"
var dm_menuArrow = preloadImage ("img/menuarrow.gif"); var dm_menuArrow_ro = preloadImage ("img/menuarrow_ro.gif");
var dm_menuArrowLeft = preloadImage ("img/menuarrowleft.gif"); var dm_menuArrowLeft_ro = preloadImage ("img/menuarrowleft_ro.gif"); var dm_menuArrowLarge = preloadImage ("img/menuarrowlarge.gif");
var dm_menuArrowLarge_ro = preloadImage ("img/menuarrowlarge_ro.gif"); var dm_menuArrowLeftLarge = preloadImage ("img/menuarrowleftlarge.gif"); var dm_menuArrowLeftLarge_ro = preloadImage ("img/menuarrowleftlarge_ro.gif");
var dm_menuArrowUp = preloadImage ("img/menuarrowup.gif"); var dm_menuArrowUp_ro = preloadImage ("img/menuarrowup_ro.gif"); var dm_menuArrowDown = preloadImage ("img/menuarrowdown.gif");
var dm_menuArrowDown_ro = preloadImage ("img/menuarrowdown_ro.gif");
// ******* Get Browser specific code ************************************
if(NS4){document.write('<script language="JavaScript1.2" src="'+dm_scriptPath+'menu_logic_ns4.js" type="text/javascript"><\/script>');};
if(IE4){document.write('<script language="JavaScript1.2" src="'+dm_scriptPath+'menu_logic_ie4.js" type="text/javascript"><\/script>');};
if(NS6||IE5){document.write('<script language="JavaScript1.2" src="'+dm_scriptPath+'menu_logic_dom.js" type="text/javascript"><\/script>');};
// ******* Misc. functions ************************************
// Return a preloaded image
function preloadImage(tsImageName){tempImage = new Image();tempImage.src = dm_imagePath + tsImageName;return tempImage; };
// This function is used to give IE4 a "getElementById()" method.
function ie4getElementById(tsElementId){return eval("document.all." + tsElementId);};
// Check if we have native javascript support for push() and pop() methods in arrays,if not, make them.This will probably be the case for IE4 and IE5.
if (!dm_globalHideRequests.push){Array.prototype.push = function(v){this[this.length] = v;};};
if (!dm_globalHideRequests.pop){Array.prototype.pop = function(){var r = this[this.length - 1];this.length--;return r;};};
if (!dm_globalHideRequests.shift){Array.prototype.shift = function() { var i = 0;var l = this.length - 1; if (i==l){var r = this[l]; this.length--; return r;}else{var r = this[i]; for (c=i; c<l; c++){this[c]=this[c+1];}; this.length--;return r; }; }; };
// And create some more array methods.This one will let you pop an item out of the middle of the array
Array.prototype.extract = function(i){var l = this.length - 1; if (i==l){var r = this[l]; this.length--; return r;}else{var r = this[i]; for(c=i; c<l; c++){this[c]=this[c+1]; }; this.length--; return r; }; };
// This one will find an item in the array, and return it's position, +1.If nothing is found, 0 is returnd
Array.prototype.find = function(search,increment,startpos){if(!increment){increment=1;}; if(!startpos){startpos=0;}; for (var i=startpos; i<this.length; i+=increment){if (this[i] == search){return i+1;};}; return 0; };
// This one will find an item in the array, and return it's position, +1.If nothing is found, 0 is returnd
Array.prototype.findMin = function(){var curMin; var curPos = 0; if(this.length){curMin = this[0]; curPos = 1; for(var i=0;i<this.length;i++){if(curMin<this[i]){curMin = this[i]; curPos = (i+1); }; }; }; return curPos; };
// This one will push a "," delimited string onto an array
Array.prototype.pushList = function(v){v+=','; // add a comma to the end
var z = 0; var i =0; do{i = v.indexOf(',',z); this.push(v.slice(z,i)); z = i+1; }while(z < v.length); };
function dm_findIntrusiveElements(){var tmpElem; var tmpTopPos, tmpLeftPos;if(IE5||IE4||NS6){for(var i=0;i<document.forms.length;i++){for(var i2=0;i2<document.forms[i].length;i2++){tmpElem = document.forms[i].elements[i2];if((tmpElem.type=='select-one')||(tmpElem.type=='select-multiple')){tmpTopPos = 0; tmpLeftPos = 0;do {tmpTopPos += tmpElem.offsetTop; tmpLeftPos += tmpElem.offsetLeft; tmpElem = tmpElem.offsetParent;}while(tmpElem); tmpElem = document.forms[i].elements[i2];tmpElem.dm_absoluteLeft = tmpLeftPos; tmpElem.dm_absoluteTop = tmpTopPos; tmpElem.dm_hideCue = 0; tmpElem.dm_inc = dm_inrecmentHideCue;tmpElem.dm_dec = dm_decrementHideCue; dm_intrusiveElements.push(tmpElem);};};};}; if(NS4){var tmpElem; for(var i=0;i<document.layers.length;i++){if(document.layers[i].id.substr(0, 12) == "dm_intrusive"){tmpElem = document.layers[i];tmpElem.dm_absoluteLeft = tmpElem.pageX; tmpElem.dm_absoluteTop = tmpElem.pageY; tmpElem.offsetWidth = outerWidth; tmpElem.offsetHeight = outerHeight; tmpElem.dm_hideCue = 0; tmpElem.dm_inc = dm_inrecmentHideCue; tmpElem.dm_dec = dm_decrementHideCue; dm_intrusiveElements.push(tmpElem);};};};};
function dm_bindIntrusiveElements(tmpObject){tmpObject.dm_intrusiveElements = new Array(); var tmpElem; for(var i=0;i<dm_intrusiveElements.length;i++){tmpElem = dm_intrusiveElements[i]; if((tmpElem.dm_absoluteLeft<(tmpObject.dm_absoluteLeft+tmpObject.dm_absoluteWidth)&&(tmpElem.dm_absoluteLeft+tmpElem.offsetWidth)>tmpObject.dm_absoluteLeft)&&(tmpElem.dm_absoluteTop<(tmpObject.dm_absoluteTop+tmpObject.dm_absoluteLength)&&(tmpElem.dm_absoluteTop+tmpElem.offsetHeight)>tmpObject.dm_absoluteTop)){tmpObject.dm_intrusiveElements.push(tmpElem); }; }; };
function dm_inrecmentHideCue(){if(this.dm_hideCue==0){if(NS4){this.visibility = "hide";}else{this.style.visibility = "hidden"; }; }; this.dm_hideCue++; };
function dm_decrementHideCue(){if(this.dm_hideCue>0){this.dm_hideCue--; if(this.dm_hideCue==0){if(NS4){ this.visibility = "show"; }else{ this.style.visibility = "visible"; };}; }; };
// ********** Menu generation code *****************************
function initMenus(){do{dm_makeMenu(dm_preloadList.shift()); }while(dm_preloadList.length); dm_loadComplete = true; if(dm_prematureRequest){setTimeout('dm_showMenu("'+dm_prematureRequest+'",true)',10); }; if(dm_hideIntrusiveElements){ dm_findIntrusiveElements();}; if(typeof dn_firstLoop != "undefined"){dn_scrollnews(0);};}; //Look if news is used
function dm_makeSeparator(tdm_menuWidth){var newRow = document.createElement("tr");newRow.appendChild(dm_makeSideBorder(dm_separationSize)); var newCell = document.createElement("td"); with(newCell){bgColor = dm_separationColor; height = dm_separationSize; width = "100%";};newCell.appendChild(dm_makeImage('', dm_imagePath + 'shim.gif', tdm_menuWidth - (dm_borderSize*2), dm_separationSize)); newRow.appendChild(newCell); newRow.appendChild(dm_makeSideBorder(dm_separationSize)); return newRow;}; 
function dm_makeSideBorder(borderHieght){var newCell = document.createElement("td"); with (newCell){ bgColor = dm_borderColor; height = borderHieght; width = dm_borderSize; style.width = dm_borderSize; }; newCell.appendChild(dm_makeImage('', dm_imagePath + 'shim.gif', dm_borderSize, borderHieght)); return newCell; };
function dm_makeBorder(){var newRow = document.createElement("tr"); var newCell = document.createElement("td");with (newCell){bgColor = dm_borderColor; height = dm_borderSize; };newCell.appendChild(dm_makeImage('', dm_imagePath + 'shim.gif', dm_borderSize, 1));newRow.appendChild(newCell); return newRow;};
function dm_makeImage(imageId, imageSrc, width, height){var newImageObject = document.createElement("img");newImageObject.src = imageSrc;newImageObject.width = width;;newImageObject.height = height;if(imageId){newImageObject.id = imageId;}; return newImageObject;}; 
// ********* Event handelers ********************************
function dm_tabOver(){dm_currentMenu = this.dm_masterParent; if(this.dm_child){dm_showMenu(this.dm_child, this);}; if(this.dm_activeChild){ dm_suppressHideForTree(this.dm_activeChild);}else{dm_suppressHideForTree(this.dm_masterParent);};}; 
function dm_tabOut(){if(this.dm_activeChild){dm_requestHideForTree(this.dm_activeChild); }else{dm_requestHideForTree(this.dm_masterParent);};}; 
function dm_normalOver(){dm_currentMenu = this.dm_masterParent; dm_effectOn(this); if(this.dm_masterParent.dm_parent){dm_effectOn(this.dm_masterParent.dm_parent);}; if(this.dm_child){dm_requestShow(this.dm_child, this);}; if(this.dm_activeChild){dm_suppressHideForTree(this.dm_activeChild);}else{dm_suppressHideForTree(this.dm_masterParent);};};
function dm_normalOut(){dm_effectOff(this);if(this.dm_child){dm_showRequestId = false; }; if(this.dm_activeChild){dm_requestHideForTree(this.dm_activeChild);}else{dm_requestHideForTree(this.dm_masterParent);};}; 
function dm_blockOver(){dm_currentMenu = this.dm_masterParent; if(this.dm_masterParent.dm_parent){dm_effectOn(this.dm_masterParent.dm_parent);}; dm_suppressHideForTree(this.dm_masterParent);}; 
function dm_blockOut(){dm_requestHideForTree(this.dm_masterParent);this.dm_hadMouseOn = false;};
// ******** Handler tools ********************************
// Another bit of bug-fix for the Gecko core. Since Gecko will allow an "onmouseon" on an element, but then miss the "onmouseoff", we need
// to check to see if any items were left "on" by mistake. This only seems to happen the first time an element gets an event.
// It also only seems to happen on elements nested in absolutely positioned DIVs.
function dm_checkEffect(menuName){var menuObject = document.getElementById(menuName); if(menuObject.dm_effectOn&&(menuObject.dm_masterParent.dm_lastEffect!=menuObject)){dm_effectOff(menuObject); if(menuObject.dm_child){if(dm_showRequestId==menuObject.dm_child){dm_showRequestId = false;};}; if(menuObject.dm_activeChild){dm_requestHide(menuObject.dm_activeChild);};};};
function dm_effectOn(menuObject){if(NS6){if(menuObject.dm_masterParent.dm_lastEffect){if(menuObject.dm_masterParent.dm_lastEffect.dm_effectOn&&(menuObject.dm_masterParent.dm_lastEffect!=menuObject)){setTimeout('dm_checkEffect("'+menuObject.dm_masterParent.dm_lastEffect.id+'")', 10);};}; menuObject.dm_masterParent.dm_lastEffect = menuObject;}; if((!menuObject.dm_effectOn)&&menuObject.dm_allowEffect){if(menuObject.dm_image){if(menuObject.dm_onImage){menuObject.dm_image.src=menuObject.dm_onImage;};};if(menuObject.dm_itemType==dm_Normal||menuObject.dm_itemType==dm_Double){if(IE4 || IE5 || NS6){if(menuObject.dm_masterParent.dm_properties.dm_backgroundImage){menuObject.style.backgroundImage = menuObject.dm_masterParent.dm_properties.dm_backgroundImage;}menuObject.style.backgroundColor = menuObject.dm_masterParent.dm_properties.dm_backgroundEffectColor; menuObject.dm_textSpan.style.color = menuObject.dm_textSpan.dm_textEffectColor;};if(NS4){menuObject.bgColor = menuObject.dm_masterParent.dm_properties.dm_backgroundEffectColor;};}; menuObject.dm_effectOn=true;};}; 
function dm_effectOff(menuObject){if(menuObject.dm_effectOn){if(menuObject.dm_image){if(menuObject.dm_offImage){menuObject.dm_image.src=menuObject.dm_offImage;};};if(menuObject.dm_itemType==dm_Normal||menuObject.dm_itemType==dm_Double){if(IE4 || IE5 || NS6){menuObject.style.backgroundImage = 'none'; menuObject.style.backgroundColor = menuObject.dm_bgColor;menuObject.dm_textSpan.style.color = menuObject.dm_textSpan.dm_textColor;};if(NS4){menuObject.bgColor = menuObject.dm_bgColor;};}; menuObject.dm_effectOn=false;};};
function dm_suppressHideForTree(menuObject){if(menuObject.dm_hideRequests.length){if(NS6){var i = menuObject.dm_hideRequests.findMin();if(i){menuObject.dm_hideRequests.extract(i-1);};}else{menuObject.dm_hideRequests.shift();};}; if(menuObject.dm_master){dm_suppressHideForTree(menuObject.dm_master);};}; 
function dm_forceHideForTree(menuObject){menuObject.dm_hideThisObject(); if(menuObject.dm_master){dm_forceHideForTree(menuObject.dm_master);};};
function dm_requestHideForTree(menuObject){dm_requestHide(menuObject); if(menuObject.dm_master){dm_requestHideForTree(menuObject.dm_master);};};
function dm_gotoHref(){if(NS4){setTimeout('window.location.href = "'+this.dm_href+'";', 5);}else{window.location.href = this.dm_href;};};
// ********* Show / Hide menus ********************************
function dm_getEventId(){dm_currentEvent++;return dm_currentEvent;};
function dm_requestHideById(menuName){if(dm_loadComplete){if(NS4){var menuObject = document.layers[menuName];}else{var menuObject = document.getElementById(menuName);}; dm_requestHide(menuObject);};};
function dm_requestHide(menuObject){if(menuObject.dm_isActive){var requestEventId = dm_getEventId(); if(!NS6){dm_globalHideRequests.push(menuObject);};menuObject.dm_hideRequests.push(requestEventId); if(NS6){setTimeout('dm_processHideRequest('+requestEventId+', "'+menuObject.id+'")', dm_menuTimer);}else{setTimeout('dm_processHideRequest('+requestEventId+')', dm_menuTimer);};};};
function dm_requestShow(menuName, menuParent){var requestEventId = dm_getEventId(); dm_showRequestId = requestEventId; dm_showRequestName = menuName; dm_showRequestParent = menuParent; setTimeout('dm_processShowRequest('+requestEventId+')', dm_menuTimer);}; 
function dm_processShowRequest(requestEventId){if(requestEventId==dm_showRequestId){dm_showMenu(dm_showRequestName, dm_showRequestParent);};};
function dm_processHideRequest(requestEventId, menuName){if(NS6){var menuObject = document.getElementById(menuName);if(menuObject.dm_hideRequests.length){i = menuObject.dm_hideRequests.find(requestEventId);if(i){menuObject.dm_hideRequests.extract(i-1);menuObject.dm_hideThisObject();};};}else{var menuObject = dm_globalHideRequests.shift();if(menuObject.dm_hideRequests[0]==requestEventId){menuObject.dm_hideRequests.shift();menuObject.dm_hideThisObject();};};};
function dm_hideThisObject(){if(!this.dm_neverHide){if(IE4 || IE5){this.style.visibility = 'hidden';};if(NS6){this.style.left = -500;if(this.dm_lastEffect){dm_effectOff(this.dm_lastEffect);if(this.dm_lastEffect.dm_child){if(dm_showRequestId==this.dm_lastEffect.dm_child){dm_showRequestId = false;};};};};if(NS4){this.visibility = 'hide';};}if(this.dm_activeChild){this.dm_activeChild.dm_hideThisObject();this.dm_activeChild = false;};if(this.dm_parent){this.dm_parent.dm_activeChild = false;dm_effectOff(this.dm_parent);};var i=dm_activeMenus.find(this);if(i){dm_activeMenus.extract(i-1)};this.dm_hideRequests.length = 0;this.dm_isActive = false;if(this.dm_isVisible){for(var i=0;i<this.dm_intrusiveElements.length;i++){this.dm_intrusiveElements[i].dm_dec();};};this.dm_isVisible = false;};
function dm_showMenu(menuName, menuParent){if(dm_loadComplete){if(NS4){var menuObject = document.layers[menuName];}else{var menuObject = document.getElementById(menuName);};if (menuObject){menuObject.dm_showThisObject(menuParent);}else{dm_makeMenu(menuName, true, menuParent);if(NS4){var menuObject = document.layers[menuName];}else{var menuObject = document.getElementById(menuName);};if(NS6){dm_fixGeckoMenuSnap(menuObject);};menuObject.dm_showThisObject(menuParent);};}else{dm_prematureRequest = menuName;};};
function dm_showThisObject(menuParent){if(!this.dm_isVisible){for(var i=0;i<this.dm_intrusiveElements.length;i++){this.dm_intrusiveElements[i].dm_inc();};if(this.dm_setMenuPosition){this.dm_setMenuPosition()}};this.dm_isVisible = true;if(NS4){this.visibility = 'show';};if(IE4 || IE5){this.style.visibility = 'visible';};if(NS6){this.style.left = this.dm_left;};if(menuParent){menuParent.dm_activeChild = this;menuParent.dm_masterParent.dm_activeChild = this;}else{if(dm_activeMenus.length){do{dm_activeMenus.pop().dm_hideThisObject();}while(dm_activeMenus.length);};if(this.dm_defaultTab){if(this.dm_defaultTab.dm_child){dm_showMenu(this.dm_defaultTab.dm_child, this.dm_defaultTab);dm_currentMenu = this;};};};this.dm_isActive = true;dm_activeMenus.push(this);};