function openNewWindow( newURL ) { var w = (window.open (newURL, 'relsearch', 'width=550,height=650,status=yes,scrollbars=yes,resizable')); w.focus (); return false; } function setToolVisibility(obj, sVisible, obj2, sVisible2) { if ( !document.images ) return; if ( typeof obj == "string" ) obj = document.getElementById (obj); obj.style.display = sVisible; if ( typeof obj2 == "string" ) obj2 = document.getElementById (obj2); obj2.style.display = sVisible2; return false; } function initReview() { var sourceElem = document.getElementById("reviewblock"); //loop through the review blocks children to find the divs to hide var elems = sourceElem.childNodes; var pattern1 = /review[0-9]+/; for(var i=0; i < elems.length; i++) { var elem = elems[i]; if(pattern1.test(elem.id) ) { var children = elem.childNodes; var pattern2 = /reviewFull[0-9]+/; var pattern3 = /reviewHeadline[0-9]+/; for(var j=0; j < children.length; j++) { var chile = children[j]; if(pattern2.test(chile.id)) { chile.className="hideElem"; break; } if(pattern3.test(chile.id)) { chile.onclick = toggleReview; } } } } } function toggleReview(e) { var sourceElem; if (!e) var e = window.event; if (e.target) sourceElem = e.target; else if (e.srcElement) sourceElem = e.srcElement //traverse the document tree to find the select element from the link var elem = sourceElem.nextSibling; var count=0; while(elem) { count++; if(elem.nodeName=="DIV") { break; } if(count==4) break;//make sure we don't spiral out of control the span obviously needs to be within 4 elements var elem = elem.nextSibling; } (elem.getAttribute("className")=="showReview"||elem.getAttribute("class")=="showReview") ? elem.className="hideElem" : elem.className="showReview"; elem.onmouseout = returnToNormal; } function returnToNormal(e) { if (!e) var e = window.event; var tg = (window.event) ? e.srcElement : e.target; var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement; if( closeMenu(tg,reltg) ) { var pattern = /reviewFull[0-9]+/; //reverse up the DOM to find the parent element named reviewFulln+ while( !pattern.test(tg.id)) { tg = tg.parentNode; } tg.className="hideElem"; tg.onmouseout = null; return; } } function closeMenu(from,to) { if(from.nodeName=='A'|from.nodeName=='IMG') return false; if(to.nodeName=='A'|to.nodeName=='IMG') return false; // if the mouse isn't on an element whose id matches the pattern: review followed by 0 or more characters followed by one or more numbers var extContainer = /^review.*[0-9]+$/; //if we are going to a container that follows the pattern above //and the element we're coming from follows the same pattern //we know we're in the nested divs
//or if we are going to an element without an id that isn't an A or IMG if( extContainer.test(to.id) && extContainer.test(from.id) || to.id=="" ) { //alert("MATCH\nTO:"+to.id+"\nFROM:"+from.id); return true; } //NOTES: hopefully the second test will trigger true if the divs are simplified //adding padding to the div's class,showReview, (dynamically assigned in toggleReview) on which the event is attached //makes it harder for the user to mouseout in a weird way which could make us bypass the containing divs //if we've reached to outermost containing block if(to.id=="reviewblock") return true; } //SORT FUNCTIONS function sortBrowse(){ if( document.searchtool.searchtype != null && savedTag != null ) document.searchtool.searchtype.options.selectedIndex = savedTag; if( document.searchtool.searcharg != null && savedSearch != null ) document.searchtool.searcharg.value = savedSearch; if( document.searchtool.searchscope != null && savedScope != null ) document.searchtool.searchscope.options.selectedIndex = savedScope; document.searchtool.submit(); } function sortExactBrowse() { var new_url; var k = sortExactBrowseURL.lastIndexOf("indexsort="); var selector = document.searchtool.sortdropdown; var sortopt = selector.options[ selector.selectedIndex ].value; if( k == -1) new_url = sortExactBrowseURL + "/indexsort=" + sortopt; else new_url = sortExactBrowseURL.substring(0, k) + "indexsort=" + sortopt; window.location = new_url; } isIE=document.all; isNN=!document.all&&document.getElementById; isHot=false; revIdent = null; function getReview(id){ revIdent=document.getElementById(id); } function ddInit(e){ topElement=isIE ? "BODY" : "HTML"; whichReview=revIdent; revTitle=isIE ? event.srcElement : e.target; while (revTitle.id!="reviewTitleBar"&&revTitle.tagName!=topElement){ revTitle=isIE ? revTitle.parentElement : revTitle.parentNode; } if (revTitle.id=="reviewTitleBar"){ offsetx=isIE ? event.clientX : e.clientX; offsety=isIE ? event.clientY : e.clientY; nowX=parseInt(whichReview.style.left); nowY=parseInt(whichReview.style.top); ddEnabled=true; document.onmousemove=dd; } } function dd(e){ if (!ddEnabled) return; whichReview.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; whichReview.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety; return false; } function hideMe(){ if (isIE||isNN) whichReview.style.visibility="hidden"; } function showMe(){ if (isIE||isNN) whichReview.style.visibility="visible"; }