// ENTIRE FILE UPDATED 9-7-2009
// ADDED jkmegamenu, and Smooth Navigational Menu 9-22-2010

/* jQuery Mega Menu v1.02
* Last updated: June 29th, 2009. This notice must stay intact for usage 
* Author: JavaScript Kit at http://www.javascriptkit.com/
* Visit http://www.javascriptkit.com/script/script2/jScale/ for full source code
*/

var jkmegamenu={

effectduration: 300, //duration of animation, in milliseconds
delaytimer: 200, //delay after mouseout before menu should be hidden, in milliseconds

//No need to edit beyond here
megamenulabels: [],
megamenus: [], //array to contain each block menu instances
zIndexVal: 1000, //starting z-index value for drop down menu
$shimobj: null,

addshim:function($){
	$(document.body).append('<IFRAME id="outlineiframeshim" src="'+(location.protocol=="https:"? 'blank.htm' : 'about:blank')+'" style="display:none; left:0; top:0; z-index:999; position:absolute; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
	this.$shimobj=$("#outlineiframeshim")
},

alignmenu:function($, e, megamenu_pos){
	var megamenu=this.megamenus[megamenu_pos]
	var $anchor=megamenu.$anchorobj
	var $menu=megamenu.$menuobj
	var menuleft=($(window).width()-(megamenu.offsetx-$(document).scrollLeft())>megamenu.actualwidth)? megamenu.offsetx : megamenu.offsetx-megamenu.actualwidth+megamenu.anchorwidth //get x coord of menu
	//var menutop=($(window).height()-(megamenu.offsety-$(document).scrollTop()+megamenu.anchorheight)>megamenu.actualheight)? megamenu.offsety+megamenu.anchorheight : megamenu.offsety-megamenu.actualheight
	var menutop=megamenu.offsety+megamenu.anchorheight  //get y coord of menu
	$menu.css({left:menuleft+"px", top:menutop+"px"})
	this.$shimobj.css({width:megamenu.actualwidth+"px", height:megamenu.actualheight+"px", left:menuleft+"px", top:menutop+"px", display:"block"})
},

showmenu:function(e, megamenu_pos){
	var megamenu=this.megamenus[megamenu_pos]
	var $menu=megamenu.$menuobj
	var $menuinner=megamenu.$menuinner
	if ($menu.css("display")=="none"){
		this.alignmenu(jQuery, e, megamenu_pos)
		$menu.css("z-index", ++this.zIndexVal)
		$menu.show(this.effectduration, function(){
			$menuinner.css('visibility', 'visible')
		})
	}
	else if ($menu.css("display")=="block" && e.type=="click"){ //if menu is hidden and this is a "click" event (versus "mouseout")
		this.hidemenu(e, megamenu_pos)
	}
	return false
},

hidemenu:function(e, megamenu_pos){
	var megamenu=this.megamenus[megamenu_pos]
	var $menu=megamenu.$menuobj
	var $menuinner=megamenu.$menuinner
	$menuinner.css('visibility', 'hidden')
	this.$shimobj.css({display:"none", left:0, top:0})
	$menu.hide(this.effectduration)
},

definemenu:function(anchorid, menuid, revealtype){
	this.megamenulabels.push([anchorid, menuid, revealtype])
},

render:function($){
	for (var i=0, labels=this.megamenulabels[i]; i<this.megamenulabels.length; i++, labels=this.megamenulabels[i]){
		if ($('#'+labels[0]).length!=1 || $('#'+labels[1]).length!=1) //if one of the two elements are NOT defined, exist
			return
		this.megamenus.push({$anchorobj:$("#"+labels[0]), $menuobj:$("#"+labels[1]), $menuinner:$("#"+labels[1]).children('ul:first-child'), revealtype:labels[2], hidetimer:null})
		var megamenu=this.megamenus[i]	
		megamenu.$anchorobj.add(megamenu.$menuobj).attr("_megamenupos", i+"pos") //remember index of this drop down menu
		megamenu.actualwidth=megamenu.$menuobj.outerWidth()
		megamenu.actualheight=megamenu.$menuobj.outerHeight()
		megamenu.offsetx=megamenu.$anchorobj.offset().left
		megamenu.offsety=megamenu.$anchorobj.offset().top
		megamenu.anchorwidth=megamenu.$anchorobj.outerWidth()
		megamenu.anchorheight=megamenu.$anchorobj.outerHeight()
		$(document.body).append(megamenu.$menuobj) //move drop down menu to end of document
		megamenu.$menuobj.css("z-index", ++this.zIndexVal).hide()
		megamenu.$menuinner.css("visibility", "hidden")
		megamenu.$anchorobj.bind(megamenu.revealtype=="click"? "click" : "mouseenter", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
			return jkmegamenu.showmenu(e, parseInt(this.getAttribute("_megamenupos")))
		})
		megamenu.$anchorobj.bind("mouseleave", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			if (e.relatedTarget!=menuinfo.$menuobj.get(0) && $(e.relatedTarget).parents("#"+menuinfo.$menuobj.get(0).id).length==0){ //check that mouse hasn't moved into menu object
				menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
					jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
				}, jkmegamenu.delaytimer)
			}
		})
		megamenu.$menuobj.bind("mouseenter", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
		})
		megamenu.$menuobj.bind("click mouseleave", function(e){
			var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
			menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
				jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
			}, jkmegamenu.delaytimer)
		})
	} //end for loop
	if(/Safari/i.test(navigator.userAgent)){ //if Safari
		$(window).bind("resize load", function(){
			for (var i=0; i<jkmegamenu.megamenus.length; i++){
				var megamenu=jkmegamenu.megamenus[i]
				var $anchorisimg=(megamenu.$anchorobj.children().length==1 && megamenu.$anchorobj.children().eq(0).is('img'))? megamenu.$anchorobj.children().eq(0) : null
				if ($anchorisimg){ //if anchor is an image link, get offsets and dimensions of image itself, instead of parent A
					megamenu.offsetx=$anchorisimg.offset().left
					megamenu.offsety=$anchorisimg.offset().top
					megamenu.anchorwidth=$anchorisimg.width()
					megamenu.anchorheight=$anchorisimg.height()
				}
			}
		})
	}
	else{
		$(window).bind("resize", function(){
			for (var i=0; i<jkmegamenu.megamenus.length; i++){
				var megamenu=jkmegamenu.megamenus[i]	
				megamenu.offsetx=megamenu.$anchorobj.offset().left
				megamenu.offsety=megamenu.$anchorobj.offset().top
			}
		})
	}
	jkmegamenu.addshim($)
}

}

jQuery(document).ready(function($){
	jkmegamenu.render($)
})

//** Smooth Navigational Menu- By Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//** Menu created: Nov 12, 2008
var ddsmoothmenu={

transition: {overtime:300, outtime:300}, //duration of slide in/ out animation, in milliseconds
shadow: {enable:false, offsetx:5, offsety:5}, //enable shadow?
showhidedelay: {showdelay: 100, hidedelay: 200}, //set delay in milliseconds before sub menus appear and disappear, respectively

///////Stop configuring beyond here///////////////////////////

detectwebkit: navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1, //detect WebKit browsers (Safari, Chrome etc)
detectie6: document.all && !window.XMLHttpRequest,

getajaxmenu:function($, setting){ //function to fetch external page containing the panel DIVs
	var $menucontainer=$('#'+setting.contentsource[0]) //reference empty div on page that will hold menu
	$menucontainer.html("Loading Menu...")
	$.ajax({
		url: setting.contentsource[1], //path to external menu file
		async: true,
		error:function(ajaxrequest){
			$menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)
		},
		success:function(content){
			$menucontainer.html(content)
			ddsmoothmenu.buildmenu($, setting)
		}
	})
},


buildmenu:function($, setting){
	var smoothmenu=ddsmoothmenu
	var $mainmenu=$("#"+setting.mainmenuid+">ul") //reference main menu UL
	$mainmenu.parent().get(0).className=setting.classname || "ddsmoothmenu"
	var $headers=$mainmenu.find("ul").parent()
	$headers.hover(
		function(e){
			$(this).children('a:eq(0)').addClass('selected')
		},
		function(e){
			$(this).children('a:eq(0)').removeClass('selected')
		}
	)
	$headers.each(function(i){ //loop through each LI header
		var $curobj=$(this).css({zIndex: 100-i}) //reference current LI header
		var $subul=$(this).find('ul:eq(0)').css({display:'block'})
		$subul.data('timers', {})
		this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
		this.istopheader=$curobj.parents("ul").length==1? true : false //is top level header?
		$subul.css({top:this.istopheader && setting.orientation!='v'? this._dimensions.h+"px" : 0})
		 
		if (smoothmenu.shadow.enable){
			this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)} //store this shadow's offsets
			if (this.istopheader)
				$parentshadow=$(document.body)
			else{
				var $parentLi=$curobj.parents("li:eq(0)")
				$parentshadow=$parentLi.get(0).$shadow
			}
		}
		$curobj.hover(
			function(e){
				var $targetul=$subul //reference UL to reveal
				var header=$curobj.get(0) //reference header LI as DOM object
				clearTimeout($targetul.data('timers').hidetimer)
				$targetul.data('timers').showtimer=setTimeout(function(){
					header._offsets={left:$curobj.offset().left, top:$curobj.offset().top}
					var menuleft=header.istopheader && setting.orientation!='v'? 0 : header._dimensions.w
					menuleft=(header._offsets.left+menuleft+header._dimensions.subulw>$(window).width())? (header.istopheader && setting.orientation!='v'? -header._dimensions.subulw+header._dimensions.w : -header._dimensions.w) : menuleft //calculate this sub menu's offsets from its parent
					if ($targetul.queue().length<=1){ //if 1 or less queued animations
						$targetul.css({left:menuleft+"px", width:header._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, ddsmoothmenu.transition.overtime)
					}
				}, ddsmoothmenu.showhidedelay.showdelay)
			},
			function(e){
				var $targetul=$subul
				var header=$curobj.get(0)
				clearTimeout($targetul.data('timers').showtimer)
				$targetul.data('timers').hidetimer=setTimeout(function(){
					$targetul.animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime)
					if (smoothmenu.shadow.enable){
						if (ddsmoothmenu.detectwebkit){ //in WebKit browsers, set first child shadow's opacity to 0, as "overflow:hidden" doesn't work in them
						}
					}
				}, ddsmoothmenu.showhidedelay.hidedelay)
			}
		) //end hover
	}) //end $headers.each()
	$mainmenu.find("ul").css({display:'none', visibility:'visible'})
},

init:function(setting){
	if (typeof setting.customtheme=="object" && setting.customtheme.length==2){ //override default menu colors (default/hover) with custom set?
		var mainmenuid='#'+setting.mainmenuid
		var mainselector=(setting.orientation=="v")? mainmenuid : mainmenuid+', '+mainmenuid
		document.write('<style type="text/css">\n'
			+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
			+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
		+'</style>')
	}
	this.shadow.enable=(document.all && !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow
	jQuery(document).ready(function($){ //ajax menu?
		if (typeof setting.contentsource=="object"){ //if external ajax menu
			ddsmoothmenu.getajaxmenu($, setting)
		}
		else{ //else if markup menu
			ddsmoothmenu.buildmenu($, setting)
		}
	})
}

} //end ddsmoothmenu variable

	ddsmoothmenu.init({
		mainmenuid: "navigationMainTop", //menu DIV id
		orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
		classname: 'ddsmoothmenu', //class added to menu's outer DIV
		contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
	})
// REMOVED	document.write('<link rel="stylesheet" type="text/css" media="all"  href="/design/css/js.css" />');
	jkmegamenu.definemenu("megaanchor", "megamenu1", "mouseover");
	jkmegamenu.definemenu("megaanchor2", "megamenu2", "mouseover");

// ######################################## sIFR ########################################
// ######################################## sIFR ########################################
// ######################################## sIFR ########################################

function initSIFR() {
var swfFont = { src: '/design/images/knowledge_regular.swf', ratios: [6,1.41,9,1.35,15,1.29,21,1.25,22,1.22,27,1.24,29,1.21,34,1.22,41,1.21,45,1.2,46,1.21,59,1.2,68,1.19,69,1.2,96,1.19,97,1.18,102,1.19,103,1.18,112,1.19,114,1.18,116,1.19,120,1.18,121,1.19,1.18] };
sIFR.activate(swfFont)
sIFR.replace(swfFont, {
	selector: 'h1',
	css: [ '.sIFR-root { color:#ffffff; }' ],
	wmode: 'transparent'
});


var swfFont = { src: '/design/images/knowledge_regular.swf', ratios: [6,1.41,9,1.35,15,1.29,21,1.25,22,1.22,27,1.24,29,1.21,34,1.22,41,1.21,45,1.2,46,1.21,59,1.2,68,1.19,69,1.2,96,1.19,97,1.18,102,1.19,103,1.18,112,1.19,114,1.18,116,1.19,120,1.18,121,1.19,1.18] };
sIFR.activate(swfFont)
sIFR.replace(swfFont, {
	selector: 'div#pageTitle',
	css: [ '.sIFR-root { color:#ffffff; }' ],
	wmode: 'transparent'
});


var swfFont = { src: '/design/images/knowledge_medium.swf', ratios: [6,1.41,9,1.35,15,1.29,21,1.25,22,1.22,27,1.24,29,1.21,34,1.22,41,1.21,45,1.2,46,1.21,59,1.2,68,1.19,69,1.2,96,1.19,97,1.18,102,1.19,103,1.18,112,1.19,114,1.18,116,1.19,120,1.18,121,1.19,1.18] };
sIFR.activate(swfFont)
sIFR.replace(swfFont, {
	selector: 'div#pageTitleBold',
	css: [ '.sIFR-root { color:#ffffff; }' ],
	wmode: 'transparent'
});


}

// ######################################## ROLLOVER ########################################
// ######################################## ROLLOVER ########################################
// ######################################## ROLLOVER ########################################
// ###### Insrtuctions ######
// Call to initiate preroll()
//<script type="text/javascript"> preroll(); <//script>
// class="over" added to images
// Rollover/preload script by Matt Ditter (Nov. 2007)
// version 1.6 (August 2008)
var prePaths = [], preImages = [], rollImages = [];
function addEvent(evt,func,obj) {
 obj = obj ? obj : window;
 if (obj.addEventListener) { obj.addEventListener(evt,func,false); return true; }
 else if (obj.attachEvent) { var ev = obj.attachEvent('on'+evt,func,event); return ev; }
 else return false;
}
function preload() {
 for (var i=0, path; path = prePaths[i]; i++) {
  var l = preImages.length;
  preImages[l] = new Image();
  preImages[l].src = path;
}}
function preroll() {
 var imgs, flag, path, dot, d = document, links = d.getElementsByTagName('a'), inps = d.getElementsByTagName('input');
 for (var i=0, a; a = links[i]; i++) {
  imgs = a.getElementsByTagName('img');
  flag = 0;
	if (a.onmouseover && imgs.length) a.onfocus = a.onmouseover;
  for (var j=0, img; img = imgs[j]; j++) {
   if (img.className.match(/(?:^|\s)over(?:\s|$)/i)) {
    path = img.src;
    dot = path.lastIndexOf('.');
    prePaths[prePaths.length] = path.substring(0,dot)+'-o'+path.substring(dot,path.length);
    flag = 1;
  }}
  if (flag) {
   addEvent('mouseover',imageRoll,a);
   addEvent('mouseout',imageRoll,a);
   addEvent('focus',imageRoll,a);
   addEvent('blur',imageRoll,a);
 }}
 for (var i=0, inp; inp = inps[i]; i++) {
  if (inp.type == 'image' && inp.className.match(/(?:^|\s)over(?:\s|$)/i)) {
   addEvent('mouseover',inputRoll,inp);
   addEvent('mouseout',inputRoll,inp);
   addEvent('focus',inputRoll,inp);
   addEvent('blur',inputRoll,inp);
 }}
 for (var i=0, arg; arg = arguments[i]; i++) prePaths[prePaths.length] = arg;
 addEvent('load',preload);
}
function imageRoll(e) {
 var imgs, path, dot, a = this.tagName ? this : e.srcElement;
 while (a.tagName != 'A' && a.parentNode) a = a.parentNode;
 if (a.tagName != 'A') return;
 imgs = a.getElementsByTagName('img');
 for (var i=0, img; img = imgs[i]; i++) {
  if (img.className.match(/(?:^|\s)over(?:\s|$)/i)) {
   path = img.src;
   dot = path.lastIndexOf('.');
   if (img.className.indexOf('activeimg') == -1)
    img.src = path.indexOf('-o.') == -1 ? path.substring(0,dot)+'-o'+path.substring(dot,path.length) : path.replace('-o.','.');
   else img.src = path.indexOf('-a.') == -1 ? path.replace('-o.','-a.') : path.replace('-a.','-o.');
}}}
function inputRoll(e) {
 var inp = this.type ? this : e.srcElement, path = inp.src, dot = path.lastIndexOf('.');
 inp.src = path.indexOf('-o.') == -1 ? path.substring(0,dot)+'-o'+path.substring(dot,path.length) : path.replace('-o.','.'); 
}
function roll(e) {
 var args = arguments;
 if (args.length < 2) for (var i=0, img; img = rollImages[i]; i++) img.src = img.old;
 else {
  var flag, path, ev, a;
  for (var i=0, img; img = document.getElementById(args[i]); i=i+2) {
   flag = 0;
   path = args[i+1];
   if (!i) {
    ev = window.event ? window.event : e;
    a = ev.target ? ev.target : ev.srcElement;
    if (!path || !ev) return;
    addEvent('mouseout',roll,a);
    addEvent('blur',roll,a);
   }
   for (var j=0, rollImg; rollImg = rollImages[j]; j++)
    if (img == rollImg) { flag = 1; break; }
   if (!flag) rollImages[rollImages.length] = img;
   if (!img.old) img.old = img.src;
   img.src = path;
}}}

// ######################################## AUTOFILL ########################################
// ######################################## AUTOFILL ########################################
// ######################################## AUTOFILL ########################################

// Label Hider v1.4 by Matt Ditter (Jan. 2008)
function inputFocus() {
 if (this.value == this.title) {
  this.value = '';
  this.style.fontWeight = 'normal';
}}
function inputBlur() {
 if (!this.value) {
  this.value = this.title;
  if (this.parentNode.getElementsByTagName('label')[0].getElementsByTagName('strong').length) this.style.fontWeight = 'normal';
}}
function toggleLabel(a) {
 var d = document;
 if (!d.getElementById) return;
 var f = d.getElementById(a), labels = f.getElementsByTagName('label');
 f.className += ' ieJS';
 for (var i=0, label; label = labels[i]; i++) {
  var inpID = label.getAttribute('for');
    if (!inpID) inpID = label.attributes['for'].value; // IE Fix
  var inp = d.getElementById(inpID), kind = inp.type.toLowerCase();
    if (kind != 'checkbox' && kind != 'radio') label.className += ' formLabelHide';
  if (label.getElementsByTagName('strong').length) inp.style.fontWeight = 'normal';
  if (!inp.value && inp.title) inp.value = inp.title;
  inp.onfocus = inputFocus;
  inp.onblur = inputBlur
}}

// ################################ FORM VALIDATION 1 ################################

function validateForm(form) { 
		// Validate
		if (isEmpty( form.txtFirstName, "Please enter your first name.")) { return false; }
		if (isEmpty( form.txtLastName, "Please enter your last name.")) { return false; }
		if (emailValidator( form.txtEmail, "Invalid E-mail address. Please ensure e-mail address is formatted correctly, name@domain.xxx .")) { return false; }
		if (isPhoneNumber( form.txtPhone, "Invalid Phone number. Please ensure Phone number is formatted correctly, XXX-XXX-XXXX.")) { return false; }
		if (isEmpty( form.txtMessage, "Please enter a message.")) { return false; }
		form.submit();
		
	}

// If the length of the element's string is 0 then display helper message
function isEmpty(elem, helperMsg){
		if(elem.value.length == 0){
			alert(helperMsg);
			elem.focus(); // set the focus to this input
			return true;
		}
		return false;
	}

// E-Mail address validation
function emailValidator(elem, helperMsg){
		var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		if(elem.value.match(emailExp)){
			return false;
		}else{
			alert(helperMsg);
			elem.focus();
			return true;
		}
	}

// Phone number validation
function isPhoneNumber(elem, helperMsg) {
		var phoneExp = /\d{3}\-\d{3}\-\d{4}/;
		if(elem.value.match(phoneExp) || elem.value==""){
			return false;
		}else{
			alert(helperMsg);
			elem.focus();
			return true;
		}
	}


// Format Phone number
function formatPhone(userInput) {
	 if (userInput.value.length < 10) {
		 
		//alert("Phone number is too short. Please formatt the phone number as follows: xxx-xxx-xxxx.");
		//userInput.value = "";

	  } 
	// XXXXXXXXXX
	if (userInput.value.length == 10 ){
		/* Format a 10 digit number */ 
		_return = "";
		var ini = userInput.value.substring(0,3);
		_return+=ini+"-";
		var st = userInput.value.substring(3,6);
		_return+=st+"-";
		var end = userInput.value.substring(6,10);
		_return+=end;
		
		formattedPhone = _return;
		userInput.value = formattedPhone;
		   
	  }

	 if (userInput.value.length > 12) {
		 
		alert("Please formatt the phone number as follows: xxx-xxx-xxxx.");
		userInput.value = "";

	  } 

}



// ######################################## HIGHLIGHT ########################################
// ######################################## HIGHLIGHT ########################################
// ######################################## HIGHLIGHT ########################################

// See highlight.js

// ######################################## CASCADING ########################################
// ######################################## CASCADING ########################################
// ######################################## CASCADING ########################################

// INSTRUCTIONS - CALL TO LINE BELOW AT INSIDE CLOSING BODY TAG
//<script type="text/javascript"> fixMenu(); <//script>

/* START CASCADING MENU - HORIZONTAL */
	/* set colors and styles */
//		#cascadingMenu { margin:0; padding:0; list-style: none; float: left; }
//		#cascadingMenu ul { width: 23em; background: #002d44; float: left; margin: 0 0 0 -70px; display: inline; position: relative; padding: 5px 0; list-style: none; }
//		#cascadingMenu li { position: relative; float: left; display: block; }
//		#cascadingMenu li a { display: block; }
//		#cascadingMenu li li { float: none; clear: left; }
//		#cascadingMenu img { display: block; }
//		#ie #cascadingMenu li { display: inline; }
//			#cascadingMenu li ul a { color: #fff; text-decoration: none; padding: .3em 15px .3em 12px; font-weight: bold;  }
//			#cascadingMenu li ul a:hover, #cascadingMenu li ul a:focus, #cascadingMenu li ul a.active, #cascadingMenu li ul a.current { background: #13b4e9; }
	/* position sub-level drop-downs */ 
//		#cascadingMenu ul ul { top: 0; margin: -1px 0 0; position: static; display: block; padding: 0; }
	/* special classes */
//		#cascadingMenu li.sublist ul { position: relative; left: 0; border: 0; }
//			#cascadingMenu li.sublist ul a { font-weight:normal; color:#b9dde9; padding-left: 19px; background: url(../images/bg-prac-link.gif) 12px center no-repeat; }
//			#cascadingMenu li.sublist ul a:hover, #cascadingMenu li.sublist ul a:focus, #cascadingMenu li.sublist ul a.active, #cascadingMenu li.sublist ul a.current { color:#fff; background: #13b4e9 url(../images/bg-prac-link.gif) 12px center no-repeat;  }
//			#cascadingMenu li:hover li.sublist ul, #cascadingMenu li:focus li.sublist ul, #cascadingMenu li.menuover li.sublist ul, #cascadingMenu li li.menuover sublist ul{ position: relative; left: 0; }
	/* the magic - only edit where notated */
//		#cascadingMenu li:hover { z-index: 5; }
//		#ie #cascadingMenu li li a { height: 1%;} /* allows IE to use block hovers */
//		#ie6 li.menuover { z-index: 5; } /* overlay fix for IE6 */
		/* hides/shows all levels */
		/* hides 1st */ //#cascadingMenu ul, /*2nd*/ #cascadingMenu li:hover ul ul, #cascadingMenu li:focus ul ul, #cascadingMenu li.menuover ul ul, /*3rd*/ #cascadingMenu li:hover ul ul ul, #cascadingMenu li:focus ul ul ul, #cascadingMenu li.menuover ul ul ul { position: absolute; left: -9999px; z-index:  99; }
		/* shows 1st */ //#cascadingMenu li:hover ul, #cascadingMenu li:focus ul, #cascadingMenu li.menuover ul, #cascadingMenu li li.menuover ul, /*2nd*/ #cascadingMenu li li:hover ul, #cascadingMenu li li:focus ul, #cascadingMenu ul li.menuover ul, /*3rd*/ #cascadingMenu li li li:hover ul, #cascadingMenu li li li:focus ul, #cascadingMenu li li li.menuover ul { position: absolute; display: block; /* adjust position for left or right positioning here*/ left: 0; }
		/* shows 2nd */ //#cascadingMenu ul li:hover ul, #cascadingMenu ul li:focus ul, #cascadingMenu ul li.menuover ul, #cascadingMenu ul li li.menuover ul, /*2nd*/ #cascadingMenu ul li li:hover ul, #cascadingMenu ul li li:focus ul, #cascadingMenu ul ul li.menuover ul, /*3rd*/ #cascadingMenu ul li li li:hover ul, #cascadingMenu ul li li li:focus ul, #cascadingMenu ul li li li.menuover ul { position: absolute; display: block; /* adjust position for left or right positioning here*/ left: 24em; }
/* END CASCADING MENU - HORIZONTAL */


// Fix Cascading Menus v1.6 by Matt Ditter (Jan. 2008; updated May 2009)
// Enables drop downs in IE6, supports tabbing through sublists,
// and adds rollover to top-level image on sublist mouseover
var lastMenuLink = null;
function fixMenu() {
 var lists = document.getElementsByTagName('ul');
 for (var i=0, list; list = lists[i]; i++) {
  if (list.id && !list.id.indexOf('cascadingMenu')) {
   var lis = list.getElementsByTagName('li');
   for (var j=0, li; li = lis[j]; j++) {
    var anchors = li.getElementsByTagName('a'), sublists = li.getElementsByTagName('ul');
    if (li.className && (li.className == 'itemFirst' || li.className == 'itemLast')) {
     var parLIs = li.parentNode.getElementsByTagName('li');
     if (li != parLIs[0] && li != parLIs[parLIs.length-1]) li.className = '';
    }
    if (anchors.length) {
     if (li.parentNode == list) anchors[0].onblur = function() { lastMenuLink = this; }
     else if (sublists.length) {
      anchors[0].onblur = function() {
     	 var n = this.parentNode;
       while (n) {
        if (n.tagName == 'LI') { n.className = n.className.replace(/(?:^|\s)menuover(?:\b|$)/gi,'');	break; }
        n = n.parentNode;
     }}}
     anchors[0].onfocus = function() {
      var n = this.parentNode;
      while (n) {
       var p = n.parentNode, topLI = p && p.tagName == 'UL' && p.id && !p.id.indexOf('cascadingMenu');
       if (topLI && lastMenuLink && (n.getElementsByTagName('a')[0] != lastMenuLink)) {
        var lastMenuItem = lastMenuLink.parentNode;
        while (lastMenuItem) {
         if (lastMenuItem.tagName == 'LI') break;
         else lastMenuItem = lastMenuItem.parentNode;
        }
        lastMenuItem.className = lastMenuItem.className.replace(/(?:^|\s)menuover(?:\b|$)/gi,'');
        var lastItems = lastMenuItem.getElementsByTagName('li');
        if (lastItems)
         for (var k=0, lastItem; lastItem = lastItems[k]; k++)
          lastItem.className = lastItem.className.replace(/(?:^|\s)menuover(?:\b|$)/gi,'');
        lastMenuLink = null;
       }
       if (n.tagName == 'LI') n.className += ' menuover';
       n = n.parentNode;
     }}
     if (sublists.length) {
      li.onmouseover = function() {
       this.className += ' menuover';
       var listPic = this.getElementsByTagName('img')[0];
       if (listPic && listPic.className.match(/(?:^|\s)over(?:\b|$)/gi) && listPic.src.indexOf ('/blank.gif') == -1) {
        var path = listPic.src, dot = path.lastIndexOf('.');
        if (path.indexOf('-o.') == -1) listPic.src = path.substring(0,dot)+'-o'+path.substring(dot,path.length);
      }} 
      li.onmouseout = function() {
       this.className = this.className.replace(/(?:^|\s)menuover(?:\b|$)/gi,'');
       var listPic = this.getElementsByTagName('img')[0];
       if (listPic && listPic.className.match(/(?:^|\s)over(?:\b|$)/gi) && listPic.src.indexOf ('/blank.gif') == -1) {
        var path = listPic.src;
        if (path.indexOf('-o.') > -1) listPic.src = path.replace(/\-o\./gi,'.');
      }}
      anchors[anchors.length-1].onblur = function() {
       var n = this.parentNode;
       while (n) {
        if (n.tagName == 'LI') {
         var subLinks = n.getElementsByTagName('a');
         if (subLinks[subLinks.length-1] == this) n.className = n.className.replace(/(?:^|\s)menuover(?:\b|$)/gi,'');
        }
        n = n.parentNode;
        if (n == list) break;
}}}}}}}}

