var sub; var subtree = new Array(); var x = 0; var left = 0; function opensubmenu(item, divid) { var frame; var located = 0; var locate = item.parentNode.getElementsByTagName('LI'); for (var n = 0; n < locate.length; n++) ///////// find which li in the 'array' has called this { if(locate[n] == item) { located = n; } }//////////////////////////////////////////////// end of find which li in the 'array' if (item.parentNode.parentNode.className=='submenu') // if item is part of a submenu, and not the top tier { while (sub != item.parentNode.parentNode) // if we mouse over item not in last opened div, we will close last { if(sub) /////////// only if the object existed { sub.style.visibility='hidden'; document.getElementById('hideframe'+x).style.visibility='hidden'; x--; sub=subtree[x]; } }//////////////////////////////////// end close last div if mouseover diff object if(document.getElementById(divid)) // open new submenu if it exhists |getElementById(subtree[x].id+'sub'+located)| { sub = document.getElementById(divid); //x-1 |getElementById(subtree[x].id+'sub'+located)| if (sub) /////////////// only if it exists { x++; frame = document.getElementById('hideframe'+x) sub.style.left = subtree[0].offsetLeft+(160*x); frame.style.left = subtree[0].offsetLeft+(160*x); if (left == 1) { sub.style.left = subtree[0].offsetLeft-(160*x); frame.style.left = subtree[0].offsetLeft-(160*x); } if (x > 1) { sub.style.top = subtree[x-1].offsetTop+item.offsetTop; frame.style.top = subtree[x-1].offsetTop+item.offsetTop; } else { sub.style.marginTop = item.offsetTop-5; frame.style.marginTop = item.offsetTop-5; } frame.style.width = 160; // sub.clientWidth frame.style.height = sub.clientHeight+2; // 2 for bottom border sub.style.visibility = 'visible'; frame.style.visibility = 'visible'; } }/////////////////////// end new submenu ///////////////// }//////////////////////end if part of a submenu /////////////////////// else ///////////////////////// if item is the top tier, we want to open first drop down { frame = document.getElementById('hideframe0'); if(sub!=undefined) // if this is not the first time we open a dropdown { for(var y = x; y >= 0; y--) // close all other drop downs { subtree[y].style.visibility='hidden'; document.getElementById('hideframe'+y).style.visibility='hidden'; } clearhidemenu(); } ///////////////////////////////////////////////////////////////////// sub = document.getElementById(divid); // | getElementById('submenu'+located) | if( sub ) { sub.style.marginLeft = item.offsetLeft; frame.style.marginLeft = item.offsetLeft; if (located == 7) { sub.style.marginLeft = item.offsetLeft - 100; frame.style.marginLeft = item.offsetLeft - 100; } sub.style.marginTop = -5; x = 0; sub.style.visibility = 'visible'; frame.style.visibility = 'visible'; frame.style.height = sub.clientHeight+2; // 2 for bottom border frame.style.width = 160; // sub.clientWidth frame.style.marginTop = -5; item.onmouseout=delayhidemenu; if (located > locate.length / 2) {left = 1;} else {left = 0;} } } /////////////////////// end of top tier dropdown area //sub.style.left = item.offsetLeft+item.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.offsetLeft+item.parentNode.parentNode.parentNode.offsetLeft; subtree[x] = sub; if( sub ) { sub.onmouseover=clearhidemenu; sub.onmouseout=delayhidemenu; } } function delayhidemenu() { var strx = ''; //delayhide=setTimeout("sub.style.visibility='hidden'",300); for(var y = x; y >= 0; y--) { strx += "subtree["+y+"].style.visibility='hidden',"; strx += "document.getElementById('hideframe"+y+"').style.visibility='hidden',"; } strx = strx.substring(0,strx.length-1); strx = "" + strx + ""; delayhide=setTimeout(strx,500); } function clearhidemenu() { if (typeof delayhide!="undefined") clearTimeout(delayhide); } function cpSearch( urlPrefix, query, scope ) { if( !query ) query = getTag( "cpSearchField" ).value; if( query ) window.location = urlPrefix + "Home/Search?search=" + query + ( scope ? "&scope=" + scope : "" ); } function emailPage() { var url = window.location.href; window.location = "mailto:&body=" + escape( url ); } function printPage() { var url = window.location.href; url += ( url.indexOf( "?" ) == -1 ? "?" : "&" ) + "printver=true"; window.open( url, 'Print', 'width=700,height=475,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,top=20,left=20'); } var ACTION_NOOP = 'userportal/refresh'; // open popup function function openPopup(href, params) { // Defaults (don't leave it to the browser) var defaultParams = { "width": "450", // Window width "height": "480", // Window height "top": "300", // Y offset (in pixels) from top of screen "left": "200", // X offset (in pixels) from left side of screen "directories": "no", // Show directories/Links bar? "location": "no", // Show location/address bar? "resizeable": "no", // Make the window resizable? "menubar": "no", // Show the menu bar? "toolbar": "no", // Show the tool (Back button etc.) bar? "scrollbars": "no", // Show scrollbars? "status": "no" // Show the status bar? }; var windowName = params["windowName"] || "_blank"; var i, useParams = ""; // Override defaults with custom values while we construct the params string for (i in defaultParams) { useParams += (useParams === "") ? "" : ","; useParams += i + "="; useParams += params[i] || defaultParams[i]; } return window.open(href, windowName, useParams); } function configurePopup(this2) { // Grab parameters using jQuery's data() method var params = $(this2).data("popup") || {}; // Use the target attribute as the window name if($(this2).attr("target")) { params.windowName = $(this2).attr("target"); } // Generate URL var pName = $(this2).attr("pName"); var url = urlPrefix + "Attorneys/Email?email=" + this2.href.replace("mailto:", "") + (pName ? "&name=" + pName : ""); // Pop up the window var windowObject = openPopup(url, params); } $(function(){ // Run this code when the document's done loading // Apply this code to each link with class="popup" $("a.popup").each(function (i) { $(this).removeClass("popup"); // prevents duplicate $(this).click(function(event) { // Prevent the browser's default onClick handler event.preventDefault(); configurePopup(this); }); }); });