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