/*  son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/ */
 
 sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			if (this.className && document.getElementById('frame'+this.className)) {
				document.getElementById('frame'+this.className).className = '';
			}
			this.className+=" sfhover";
			this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			if (this.className && document.getElementById('frame'+this.className)) {
				document.getElementById('frame'+this.className).className = 'frameHover';
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


// Popup Window
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links=document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick=function() {
      // Next two lines should be on one line
        window.open(this.href);
        return false;
      }
    }
  }
}

function setDDMenu() {
	if (document.all) {
		var md = document.getElementById('nav').childNodes;
		for (i in md){
			if (md[i].className) {
				var children = md[i].childNodes;
				for (j=0; j<children.length; j++) {
					if(children[j].nodeName == 'UL') {
						var tul = children[j];
						var iframe = document.createElement("IFRAME");
						iframe.frameBorder = 0;
						iframe.style.position = "absolute";
						iframe.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
						iframe.className = 'frameHover';
						iframe.id =  'frame' + tul.parentNode.className;
						md[i].insertBefore(iframe, tul);
						j++;
						iframe.style.left    = tul.style.left;
						iframe.style.top     = tul.style.top;
						iframe.style.width   = tul.offsetWidth + "px";
						iframe.style.height  = tul.offsetHeight + "px";
					}
				}
			}
		}
	}
}

window.onload= function() {
doPopups();
setDDMenu();
}


