function showThumbnailHint(A,C){var B=$A(Element.select(C,".thumbnail_hint")).flatten()[0];B.innerHTML=A}function hideThumbnailHint(A){$A(Element.select(A,".thumbnail_hint")).flatten()[0].innerHTML="&nbsp;"}function toggleGuidedList(B,A){if(A.className.indexOf("selected")==-1){Element.addClassName(A,"selected");Element.show(B)}else{Element.removeClassName(A,"selected");Element.hide(B)}}function toggleAllGuidedLists(){if($("guided_search_header").className.indexOf("selected")!=-1){$$(".guided_list").each(function(C,A){Element.hide(C);var B=Element.select(C.parentNode,".subheader")[0];Element.removeClassName(B,"selected")});Element.removeClassName("guided_search_header","selected")}else{$$(".guided_list").each(function(C,A){Element.show(C);var B=Element.select(C.parentNode,".subheader")[0];Element.addClassName(B,"selected")});Element.addClassName("guided_search_header","selected")}}function togglePreviewBalloons(){var A=$("preview_balloons_toggler");if(A.className.indexOf("disabled")!=-1){turnOnPreviewBalloons()}else{turnOffPreviewBalloons()}}function findIdealPreviewCoordsFor(B){var H={x:0,y:0};var G=$($(B).parentNode).positionedOffset()[0];var D=$($(B).parentNode).positionedOffset()[1];var F=document.viewport.getScrollOffsets();var C=document.viewport.getWidth()+F.left;var A=document.viewport.getHeight()+F.top;var E={width:$("preview_balloon").getWidth(),height:$("preview_balloon").getHeight()};if((G+$(B).getWidth()+E.width)>C){H.x=G-E.width}else{H.x=G+133}if(D>(A-E.height)){H.y=A-E.height}else{if(D<F.top){H.y=F.top}else{H.y=D-13}}return H}function turnOnPreviewBalloons(){createCookie("previewBalloons","on",10950);$$(".preview_balloons_toggler").each(function(B,A){Element.removeClassName(B,"disabled")});$$(".thumbnail_image_holder").each(function(B,A){Element.select(B,".thumbnail_image").each(function(D,C){if(Prototype.Browser.IE){D.onmouseover=function(E){$("preview_balloon_image_id").innerHTML=D.getAttribute("title");$("preview_balloon_image_holder").innerHTML='<img src="'+D.getAttribute("rel")+'" onload="showPreviewBalloon(\''+D.id+"')\"/>"}.bind(this);D.onmouseout=function(E){Element.hide("preview_balloon")}.bind(this)}else{D.onmouseover=function(E){showThumbnailHint(LOADING_PREVIEW,B.parentNode);$("preview_balloon_image_id").innerHTML=D.getAttribute("title");$("preview_balloon_image_holder").innerHTML='<img src="'+D.getAttribute("rel")+'" onload="showPreviewBalloon(\''+D.id+"')\"/>"}.bind(this);D.onmouseout=function(E){Element.hide("preview_balloon");hideThumbnailHint(B.parentNode)}.bind(this)}}.bind(B))})}function showPreviewBalloon(A){var B=findIdealPreviewCoordsFor($(A).parentNode);$("preview_balloon").style.left=B.x+"px";$("preview_balloon").style.top=B.y+"px";Element.show("preview_balloon");if(!Prototype.Browser.IE){hideThumbnailHint($(A).parentNode.parentNode)}}function turnOffPreviewBalloons(){createCookie("previewBalloons","off");$$(".preview_balloons_toggler").each(function(B,A){Element.addClassName(B,"disabled");Element.hide("preview_balloon")});$$(".thumbnail_image").each(function(B,A){B.onmouseover=null;B.onmouseout=null})}function toggleClarificationField(B){var A=$("search_clarifications_"+B);A.disabled=!A.disabled}function renderPreviewFail(A){url_fail=LOC+"/lightboxes/"+A+"/preview_fail";new Ajax.Request(url_fail,{method:"get",asynchronous:true,evalScripts:true})}function load_mini_lightbox(A){time=new Date();url=LOC+"/lightboxes/"+A+"/preview.js?aka=nocache";new Ajax.Request(url,{method:"get",asynchronous:true,evalScripts:true,requestTimeout:3000,retry:3,retryDelay:1000,onSuccess:function(B){B.responseText},onFailure:function(B){renderPreviewFail(A)},onException:function(B){renderPreviewFail(A)},onTimeout:function(B){renderPreviewFail(A)}})}function loading_add_to_mini_lightbox(A,B){new Effect.Highlight(A,{duration:1});$("lightbox_preview_inner_container").update('<h2><img src="/images/ajax-loader-on-fff.gif">'+B+"</h2>")};