var sub; var subtree = new Array(); var x = 0; var left = 0; var toplvlnav; 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+(149*x); frame.style.left = subtree[0].offsetLeft+(149*x); if (left == 1) { sub.style.left = subtree[0].offsetLeft-(149*x); frame.style.left = subtree[0].offsetLeft-(149*x); } if (x > 1) { sub.style.top = subtree[x-1].offsetTop+item.offsetTop-1; frame.style.top = subtree[x-1].offsetTop+item.offsetTop-1; } else { sub.style.marginTop = item.offsetTop-1; frame.style.marginTop = item.offsetTop-1; } frame.style.width = sub.clientWidth; frame.style.height = sub.clientHeight; 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'; } document.getElementById(toplvlnav).className = ''; clearhidemenu(); } ///////////////////////////////////////////////////////////////////// if (document.getElementById(divid)) { toplvlnav = item.id; item.className = 'hovered'; sub = document.getElementById(divid); // | getElementById('submenu'+located) | sub.style.marginLeft = item.offsetLeft; frame.style.marginLeft = item.offsetLeft; if(located == locate.length - 1) { sub.style.marginLeft = item.offsetLeft - 32; frame.style.marginLeft = item.offsetLeft - 32; } //sub.style.marginTop = -1; x = 0; sub.style.visibility = 'visible'; frame.style.visibility = 'visible'; frame.style.height = sub.clientHeight - 5; frame.style.width = sub.clientWidth; //frame.style.marginTop = -1; item.onmouseout=delayhidemenu; if (located > locate.length / 2) {left = 1;} else {left = 0;} } } /////////////////////// end of top tier dropdown area if (sub) { subtree[x] = 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 + "document.getElementById('"+toplvlnav+"').className=''"; delayhide=setTimeout(strx,500); } function clearhidemenu() { if (typeof delayhide!="undefined") clearTimeout(delayhide); } var menu_id; function open_menu(caller, id) { if( document.getElementById(id) ) { menu_id = id; var menu = document.getElementById(id) var hideframe = document.getElementById('menu_hideframe'); menu.style.visibility = "visible"; hideframe.style.visibility = "visible"; menu.style.marginLeft = caller.offsetLeft; hideframe.style.marginLeft = caller.offsetLeft; hideframe.style.height = menu.clientHeight; hideframe.style.width = menu.clientWidth; menu.onmouseover = clear_close_menu; menu.onmouseout = close_menu; } } function close_menu() { var strx = 'document.getElementById("' + menu_id + '").style.visibility="hidden",'; strx += 'document.getElementById("menu_hideframe").style.visibility="hidden"'; closedelay = setTimeout(strx,500); } function clear_close_menu() { if (typeof closedelay != 'undefined') clearTimeout(closedelay); } function imgro(item) // rollover image replacement { var imgpath = item.src; if(imgpath.match("_ro") == null) { var last_dot = imgpath.lastIndexOf("."); var x = imgpath.substring(0, last_dot) + "_ro" + imgpath.substring(last_dot); item.src = x; } } function imgundo(item) // unrollover image restoration { var imgpath = item.src; if(imgpath.match("_ro") != null) { var x = imgpath.replace('_ro.','.'); item.src = x; } } function getParent(src, tagName) { tagName = tagName.toLowerCase(); while(src != null) { if(src.tagName.toLowerCase() == tagName) { return src; } src = src.parentElement; } return null; } var AttorneySearch = { search: function( urlPrefix ) { var query = getTag( "as_keyword" ).value; var temp; query = escape( query ); if( ( temp = getTag( "as_firstName" ).value ) != " First Name / Nickname" && temp ) query += "&firstName=" + escape( temp ); if( ( temp = getTag( "as_lastName" ).value ) != " Last Name / Maiden Name" && temp ) query += "&lastName=" + escape( temp ); if( ( temp = getTag( "as_practice" ).value ) ) query += "&practice=" + escape( temp ); if( ( temp = getTag( "as_lawschool" ).value ) ) query += "&lawschool=" + escape( temp ); if( ( temp = getTag( "as_title" ).value ) ) query += "&title=" + escape( temp ); if( ( temp = getTag( "as_school" ).value ) ) query += "&school=" + escape( temp ); window.location = urlPrefix + "OurPeople/OurPeopleSearch?search=" + query; }, quickSearch: function( urlPrefix ) { var query = ''; var temp; if( ( temp = getTag( "as_qs_firstName" ).value ) != " First Name / Nickname" && temp ) query += "&firstName=" + escape( temp ); if( ( temp = getTag( "as_qs_lastName" ).value ) != " Last Name / Maiden Name" && temp ) query += "&lastName=" + escape( temp ); window.location = urlPrefix + "OurPeople/OurPeopleSearch?search=" + query; }, quickHomeSearch: function( urlPrefix ) { var query = getTag( "as_qsh_keyword" ).value; var temp; if( query != " Keyword" ) query = escape( query ); else query = ""; if( ( temp = getTag( "as_qsh_firstName" ).value ) != " First Name / Nickname" && temp ) query += "&firstName=" + escape( temp ); if( ( temp = getTag( "as_qsh_lastName" ).value ) != " Last Name / Maiden Name" && temp ) query += "&lastName=" + escape( temp ); if( ( temp = getTag( "as_qsh_practice" ).value ) ) query += "&practice=" + escape( temp ); window.location = urlPrefix + "OurPeople/OurPeopleSearch?search=" + query; }, searchAlpha: function( urlPrefix, letter ) { var query = "&alpha=" + letter; window.location = urlPrefix + "OurPeople/OurPeopleSearch?search=" + query; }, onKeypress: function( urlPrefix, event, qs_flag ) { event = event || window.event; var keyCode = document.all ? event.keyCode : event.which; if( keyCode == 13 ) { if( qs_flag == 1 ) { this.quickSearch( urlPrefix ); } else if( qs_flag == 2 ) { this.quickHomeSearch( urlPrefix ); } else { this.search( urlPrefix ); } event.returnValue = false; event.cancelBubble = true; return false; } } }; var SiteSearch = { search: function( urlPrefix ) { var re = new RegExp("[^\\w\\s&-\/]", "g"); var query = getTag( "as_keyword" ).value; var temp; if( query == ' Keyword / Bio' ) query = ''; else query = escape( query ); if( ( temp = getTag( "as_firstName" ).value ) != " First Name" && temp ) query += "&firstName=" + escape( temp ); if( ( temp = getTag( "as_lastName" ).value ) != " Last Name" && temp ) query += "&lastName=" + escape( temp ); if( ( temp = getTag( "as_industry" ).value ) ) query += "&industry=" + escape( temp.replace(re,"") ); if( ( temp = getTag( "as_practice" ).value ) ) query += "&practice=" + escape( temp.replace(re,"") ); if( ( temp = getTag( "as_school" ).value ) ) query += "&school=" + escape( temp ); if( ( temp = getTag( "as_office" ).value ) ) query += "&office=" + escape( temp ); if( ( temp = getTag( "as_admissions" ).value ) ) query += "&admissions=" + escape( temp ); if( ( temp = getTag( "as_language" ).value ) ) query += "&language=" + escape( temp ); if( ( temp = getTag( "as_biotype" ).value ) ) query += "&biotype=" + escape( temp ); //if( ( temp = getTag( "sortBy" ) ) != null ) //query += "&sortBy=" + temp.value; window.location = urlPrefix + "Lawyers?search=" + query; }, quickSearch: function( urlPrefix ) { var query = ''; if( ( temp = getTag( "ss_qs_keyword" ).value ) != " Site Search" && temp ) query += escape( temp ); window.location = urlPrefix + "Home/AdvancedSearch?search=" + query; }, onKeypress: function( urlPrefix, event, qs_flag ) { event = event || window.event; var keyCode = document.all ? event.keyCode : event.which; if( keyCode == 13 ) { if( qs_flag == 1 ) { this.quickSearch( urlPrefix ); } else { this.search( urlPrefix ); } event.returnValue = false; event.cancelBubble = true; return false; } } }; var NewsSearch = { search: function( urlPrefix ) { var re = new RegExp("[^\\w\\s&-\/]", "g"); var query = getTag( "as_keyword" ).value; var temp; if( query == ' Keyword / Bio' ) query = ''; else query = escape( query ); window.location = urlPrefix + "Lawyers?search=" + query; }, updateDate: function( ) { var todate = document.getElementById('ns_to'); var fromdate = document.getElementById('ns_from'); todate.value = todate.value.replace(/\//g, '.'); fromdate.value = fromdate.value.replace(/\//g, '.'); todate = todate.value.replace(/\./g, ''); fromdate = fromdate.value.replace(/\./g, ''); var hiddendate = document.getElementById('ns_date'); if(fromdate != "") { var tempfrom = fromdate.substring(4,8) + fromdate.substring(0,2) + fromdate.substring(2,4); } if(todate == "") { var tempto = "x"; } else { var tempto = todate.substring(4,8) + todate.substring(0,2) + todate.substring(2,4); } hiddendate.value = '@' + tempfrom + '_' + tempto; WOSWebSearch.searchChanged( hiddendate, "date" ); } }; var pill_id; function openpilldropdown( item, divid ) { clear_close_pill(); pill_id = divid; var div = document.getElementById(divid); div.style.display = 'block'; div.style.width = item.parentNode.clientWidth; item.onmouseout = delayclosepill; div.onmouseout = delayclosepill; div.onmouseover = clear_close_pill; } function delayclosepill() { var strx = 'document.getElementById("' + pill_id + '").style.display="none"'; pillclosedelay = setTimeout(strx,500); } function clear_close_pill() { if (typeof pillclosedelay != 'undefined') clearTimeout(pillclosedelay); } var people_result; function open_people_result( item ) { clear_close_result(); var div = item.getElementsByTagName('DIV')[0]; if( div != people_result && people_result != null ) { people_result.style.display = 'none'; } people_result = div; div.style.display = 'block'; item.onmouseout = delaycloseresult; //div.onmouseout = delaycloseresult; div.onmouseover = clear_close_result; } function delaycloseresult() { var strx = 'people_result.style.display="none"'; resultclosedelay = setTimeout(strx,500); } function clear_close_result() { if (typeof resultclosedelay != 'undefined') clearTimeout(resultclosedelay); } function toggle(item) { togglediv = item.parentNode; if( togglediv.className == "closed" ) { togglediv.className = "open"; } else { togglediv.className = "closed"; } } function viewall_or_some(item) { viewdiv = item.parentNode; if( viewdiv.className == "viewall" ) { viewdiv.className = "viewsome"; } else { viewdiv.className = "viewall"; } } var ImageRotation = { list: null, bannerbg: null, lis: null, showing: null, loop: 1, int: null, initialize : function( seconds, listid, bgid, loop ) { this.list = document.getElementById( listid ); this.bannerbg = document.getElementById( bgid ); this.lis = this.list.getElementsByTagName('LI'); this.showing = 0; this.loadNext(); if( loop != 1 ) { this.loop = 0; } self.int = setInterval( 'ImageRotation.swapImg()', seconds * 1000 ); }, loadNext : function() { this.bannerbg.style.backgroundImage = 'url(' + this.lis[this.showing+1].innerHTML + ')'; }, swapImg : function() { this.bannerbg.getElementsByTagName('IMG')[0].src = this.lis[this.showing+1].innerHTML; this.showing = this.showing + 1; if( this.showing >= this.lis.length - 1 ) { this.showing = -1; if( this.loop != 1 ) { clearInterval(self.int); } } this.loadNext(); } }; var searchPaging = { showAll: function( item, list, guid, numResults ) { if( parseInt(item.getAttribute('all')) == 0 ) { WOSWebSearch.showAll( list, guid ); item.innerHTML = 'View Less'; item.setAttribute('all', 1); } else { WOSWebSearch.hideAll( list, guid ); item.innerHTML = 'View All ' + numResults + ' Results'; item.setAttribute('all', 0); } } }; /* Cookie functions */ function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); }