/**************************************************** ** functions.js - Main javascript function library ** ****************************************************/ /***************************************** NAVIGATION MENU *****************************************/ var sub; var subtree = new Array(); var x = 0; var openOnLeft = false; var maxNavWidth; var offsetHeight = 0; var offsetWidth = 0; function opensubmenu(item, divid) { var frame; if(maxNavWidth == undefined) { // set init values maxNavWidth = getTag("nav").clientWidth; //alert(maxNavWidth); } var navPos = findPos(getTag("nav"), "header"); //alert("navPos.x="+navPos.x+", navPos.y="+navPos.y); 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'; getTag('hideframe'+x).style.visibility='hidden'; x--; sub=subtree[x]; } }//////////////////////////////////// end close last div if mouseover diff object if(getTag(divid)) { // open new submenu if it exhists |getElementById(subtree[x].id+'sub'+located)| sub = getTag(divid); if(sub) { /////////////// only if it exists x++; //alert("subtree[x-1].style.marginLeft=" + parseInt(subtree[x-1].style.marginLeft) + " + " + subtree[x-1].clientWidth + "\n" + (parseInt(subtree[x-1].style.marginLeft) - sub.clientWidth) + "px"); frame = getTag('hideframe'+x); if(!openOnLeft) { // right side var temp = (parseInt(subtree[x-1].style.marginLeft) + subtree[x-1].clientWidth + offsetWidth); if((temp + sub.clientWidth) > (navPos.x + maxNavWidth)) { // too wide openOnLeft = true; } else { sub.style.marginLeft = temp + "px"; frame.style.marginLeft = temp + "px"; } } if(openOnLeft) { // left side sub.style.marginLeft = (parseInt(subtree[x-1].style.marginLeft) - (sub.clientWidth + offsetWidth)) + "px"; frame.style.marginLeft = (parseInt(subtree[x-1].style.marginLeft) - (sub.clientWidth + offsetWidth)) + "px"; } sub.style.marginTop = (parseInt(subtree[x-1].style.marginTop) + item.offsetTop) + "px"; frame.style.marginTop = (parseInt(subtree[x-1].style.marginTop) + item.offsetTop) + "px"; sub.style.visibility = 'visible'; frame.style.visibility = 'visible'; frame.style.height = sub.clientHeight; frame.style.width = sub.clientWidth; } }/////////////////////// end new submenu ///////////////// }//////////////////////end if part of a submenu /////////////////////// else { ///////////////////////// if item is the top tier, we want to open first drop down frame = getTag('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'; getTag('hideframe'+y).style.visibility='hidden'; } clearhidemenu(); } ///////////////////////////////////////////////////////////////////// if(getTag(divid)) { sub = getTag(divid); var pos = findPos(item, "nav"); var subWidth = sub.clientWidth; pos.x += navPos.x; pos.y += navPos.y; sub.style.marginLeft = pos.x + "px"; frame.style.marginLeft = pos.x + "px"; sub.style.marginTop = (pos.y + item.clientHeight) + offsetHeight + "px"; frame.style.marginTop = (pos.y + item.clientHeight) + offsetHeight + "px"; if((pos.x + subWidth) > (navPos.x + maxNavWidth)) { // hug right side sub.style.marginLeft = (navPos.x + maxNavWidth - subWidth) + "px"; frame.style.marginLeft = (navPos.x + maxNavWidth - subWidth) + "px"; openOnLeft = true; } else { openOnLeft = false; } x = 0; sub.style.visibility = 'visible'; frame.style.visibility = 'visible'; frame.style.height = sub.clientHeight; frame.style.width = sub.clientWidth; item.onmouseout=delayhidemenu; } } /////////////////////// end of top tier dropdown area if(sub) { subtree[x] = sub; sub.onmouseover=clearhidemenu; sub.onmouseout=delayhidemenu; } } function delayhidemenu() { var strx = ''; for(var y = x; y >= 0; y--) { strx += "subtree["+y+"].style.visibility='hidden',"; strx += "getTag('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); } } /* Return x/y offset of an object up to a limit container */ function findPos(ctrl, limitId) { var pos = {x:0, y:0}; if(ctrl.offsetParent) { while(ctrl && ctrl.id != limitId) { pos.x += ctrl.offsetLeft; pos.y += ctrl.offsetTop; ctrl = ctrl.offsetParent; } } else if(ctrl.x && ctrl.y) { pos.x += ctrl.x; pos.y += ctrl.y; } return pos; } function imgro(item) { var imgpath = item.src; var x = imgpath.replace('.gif','_ro.gif'); item.src = x; } function imgundo(item) { var imgpath = item.src; var x = imgpath.replace('_ro.gif','.gif'); item.src = x; } function cpSearch( urlPrefix, query, scope ) { if( !query ) query = getTag( "cpSearchField" ).value; if( query ) window.location = urlPrefix + "Home/Search?search=" + query + ( scope ? "&scope=" + scope : "" ); } /* Page options builder and search tips popup */ (function($) { /* Page options builder */ $.fn.buildPageOptions = function() { return this.each(function () { $(this).find("a[poType=html]").click(function() { window.open($(this).attr("href"), 'Print', 'width=725,height=475,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,top=20,left=20'); return false; }); }); } })(jQuery); /* Disclaimer */ var MAILTO_CONFIRMATION = "Confidential/Privileged Information\n\n" + "While we would like to hear from you, you should be aware that any of the information you submit to us via this website will not be treated as confidential or privileged as a lawyer/client communication unless we have previously sent you an engagement letter. You are not a client of the Firm until you receive such an engagement letter. Please click the \"OK\" button if you understand and accept the forgoing statement and wish to proceed." function mailTo( email ) { if( confirm( MAILTO_CONFIRMATION ) ) window.parent.location = "mailto:" + email; } /* Search paging functions */ (function($) { $.cpPaging = { testMode: false, loadPageContent : function(newPage, group, groupUID) { var div = $("#searchresult-group-" + group); //div.innerHTML = "
"; var url = document.location.href; var paramSep = url.indexOf( "?" ); var urlParams = url.substring( paramSep ); $.ajax({ url: urlPrefix + 'websearch/fetchSearchPage.v' + urlParams + '&guid=' + groupUID + '&vetemplateId=none' + '&page=' + newPage + ( div.wosSortString ? div.wosSortString : "" ) + ($.cpPaging.testMode ? "&rand=" + parseInt(Math.random()*99999999) : ""), success: function(data) { $(div).html(data); } }); }, changePage : function(sectionName2, pageNum, numPages, sectionOid) { var delimiter = ", "; var threshhold = 2; var container = $("#searchresult-paging-" + sectionName2).get(0); var pagingWrapper = $(container).find(".pagingPages"); var showAllWrapper = $(container).find(".pagingShowAll"); if(container.pageOn == undefined) { container.pageOn = 1; } var pageOn = container.pageOn; if(pageOn != pageNum) { // Make sure we are doing a page change if(pageNum != "ShowAll" && ( (pageNum == "Previous" && pageOn > 1) || (pageNum == "Next" && pageOn < numPages) || (pageNum >= 1 && pageNum <= numPages) )) { // Changing pages // Coming from a "view all" if(pageOn == "ShowAll") { $(showAllWrapper).html("VIEW ALL"); $(pagingWrapper).css("visibility", "visible"); } pageOn = (pageNum == "Previous" ? (pageOn - 1) : (pageNum == "Next" ? (pageOn + 1) : pageNum) ); // Load new page $.cpPaging.loadPageContent(pageOn, sectionName2, sectionOid); var minPage = pageOn - threshhold; minPage = (minPage > (numPages - threshhold * 2) ? (numPages - threshhold * 2) : minPage); minPage = (minPage < 1 ? 1 : minPage); var maxPage = pageOn + threshhold; maxPage = (maxPage < (threshhold * 2 + 1) ? (threshhold * 2 + 1) : maxPage); maxPage = (maxPage > numPages ? numPages : maxPage); var pagingHTML = ""; // Previous link if(pageOn > 1) { pagingHTML += "< Prev "; if(minPage > 1) { // not showing first page pagingHTML += "... "; } } // Navigable pages for(var i = minPage; i <= maxPage; i++) { pagingHTML += (i > minPage ? ", " : "") + "" + i + ""; } pagingHTML += " of " + numPages + ""; // Next link if(pageOn < numPages) { pagingHTML += " Next > "; } $(pagingWrapper).html(pagingHTML); container.pageOn = pageOn; } else if(pageNum == "ShowAll") { // Show all pages and unlink $(showAllWrapper).html("BACK TO PAGING"); $(pagingWrapper).css("visibility", "hidden"); // Load all pages $.cpPaging.loadPageContent(0, sectionName2, sectionOid); container.pageOn = pageNum; } if(container.cloneTo != undefined) { // clone these paging updates to another paging list if($("#" + container.cloneTo).length) { // clone paging id exists $("#" + container.cloneTo).html($(container).html()); } } } } }; changePage = $.cpPaging.changePage; })(jQuery); (function($) { $.fn.buildBowditchSearch = function() { return this.each(function () { $(this).find(".inputFieldSelect").each(function () { var wrapper = this; $(wrapper).find("div:eq(0)").addClass("cb_inputParent"); $(wrapper).removeClass("inputFieldSelect").addClass("inputField"); $(this).buildSelectBox({ "optionBorderHeight": 2, "additionalWrapperWidth": 2, "popupMarginTop": 1, "selectWrapPosition": "fhWrapper", "selectInputParentClass": "cb_inputParent" }); }); $(this).buildSearchHandler(); }); } })(jQuery); // Contact Us form submitted successfully function contactUsValidateSuccess(fhWrapper) { $(fhWrapper).addClass("sf_submitted"); } // Contact Us form submitted successfully function contactUsAjaxSuccess(fhWrapper, data) { $(fhWrapper).height($(fhWrapper).height()); // force wrapper height to what it is now so page doesn't move when content is replaced $(fhWrapper).fadeTo(1, 0.01, function() { $(fhWrapper).html(data); // replace with ajax return content $(fhWrapper).fadeTo("slow", 1); }); }