var doWatchLot;var doSaveLot;var doSetNotify;var onLotDetailsPage=(/\/auction-lot\//).test(window.location.href);if(onLotDetailsPage){jQ.fn.hasScrollBar=function(){var a=jQ(this)[0];var b=false;if((a.clientHeight<a.scrollHeight)||(a.clientWidth<a.scrollWidth)){b=true}return b}}function closeIt(){jQ("#rfaTYContent").fadeOut("slow",function(){jQ("#mask").fadeOut("slow")})}function setNotify(){var d="saveReminderNotification",b=jQ("input[name='notification']:checked").val(),c=jQ("#notificationMinutes").val(),a=jQ("input[name='approvalRef']").attr("value");b?b=1:b=0;doWatchLot=jQ.getJSON("/lib/jQueryObj/jFineArtObj.cfc?wsdl",{method:d,notification:b,notificationMinutes:c,approvalRef:a},function(){jQ("#updateAlert").html("Alert added to your <a href='/myLive/myWatchedLots.cfm'>watched lots</a>.</span>");closeIt()});return false}function watchLot(d,b,f,c){var a=jQ(this);var e="";e+="<p class='saveLot left2 clearfix'>";e+="<span>You are <a href='"+f+"/myLive/myWatchedLots.cfm'>watching this lot</a>.</span>";e+="<span id='updateAlert' lotRef='"+d+"' memberRef='"+c+"'>&nbsp;Set an <a href='javascript:void(0);'>email alert</a>.</span>";e+="</p>";if(doWatchLot){doWatchLot.abort()}doWatchLot=jQ.getJSON("/lib/jQueryObj/jFineArtObj.cfc?wsdl",{method:"watchLot",lotRef:d,mID:b},function(g){if(g!=""){alert(g)}else{jQ("#watchThisLot").html(e)}})}function saveLot(d,b,e){var a=jQ(this);var c="<p class='saveLot left2'>Lot Saved in <a href='"+e+"/features/viewArtistAlertGallery.cfm?savedLots=true&cache=false'>My Saved Lots</a></p>";if(doSaveLot){doSaveLot.abort()}doSaveLot=jQ.getJSON("/lib/jQueryObj/jFineArtObj.cfc?wsdl",{method:"saveLot",lotRef:d,mID:b},function(f){if(f!=""){alert(f)}else{jQ("#saveMyLot").html(c)}})}function showDetails(){var a=jQ(this).next(".fieldName").height();jQ(this).parent().animate({height:a},500).children(".expand").removeClass("expand").addClass("hide").html("<a href='#'>- Hide</a>");return false}function hideDetails(){jQ(this).parent().animate({height:"26px"},500).children(".hide").removeClass("hide").addClass("expand").html("<a href='#'>+ Expand</a>");return false}function showAddress(){var c=jQ("#locDetails");var a=jQ(this);var b=a.text();switch(b){case"+ Show Location Details":a.html("<a href='##'>- Hide Location Details</a>");break;case"- Hide Location Details":a.html("<a href='##'>+ Show Location Details</a>");break}c.toggle(500);return false}function setExpand(){var b=jQ(this);var a=b.height();if(a>28){b.parent().children(".expand").show("slow")}}function closeModal(){if(jQ("#bidIncrementsTable")){var a=jQ("#bidIncrementsTable");jQ("#bidInfo").append(a);a.css("display","none")}jQ("#modal").stop().fadeOut().remove();jQ("#opaque").css({opacity:0}).fadeOut().remove();jQ("#footerButtons").fadeIn("fast");jQ("#largePicFrame").stop().fadeOut().attr("src","").css("marginLeft","-9999px").css({width:1,height:1}).fadeIn("fast")}function resizeIframe(){if(jQ(this).attr("src")==""){return}var a=this.contentWindow.document.body.scrollHeight;var d=this.contentWindow.document.body.scrollWidth+10;var c=485-(d/2);var e=jQ(window).height();var b;if(e>a){b=(e/2)-(a/2)}else{b=0}jQ("#modal").animate({height:a,top:b}).animate({width:d,left:c},function(){jQ("#largePicFrame").hide().css("marginLeft",0).height(a).width(d).fadeIn("slow");jQ("#modal").removeClass("modalload")})}function modulize(){jQ("#container-inner").append("<div id='modal' class='modalload'></div>").append("<div id='opaque'></div>");jQ("#opaque").css({opacity:0.5}).fadeIn();jQ("#modal").append("<img id='closeWindow' src='/wwwImages/lotDetails/icnCloseWindow.png' alt='icnCloseWindow' width='30' height='30'/>")}function thumbClick(){modulize();jQ("#modal").append('<iframe id="largePicFrame" src="" scrolling="no"></iframe>');var a=this.id;jQ("#largePicFrame").attr("src",a);jQ("#footerButtons").fadeOut("fast");jQ("div#modal").addClass("modalload").fadeIn();jQ("#largePicFrame").load(resizeIframe)}function showIncrements(){var a=jQ("#bidIncrementsTable").clone();modulize();jQ("#modal img#closeWindow").hide();jQ("#modal").append(a).css({display:"block",height:"auto",width:"354px"}).removeClass("modalload");a.css("display","block")}function thumbBox(){jQ("#thumbBox").toggle("slow")}function onBorder(){jQ(this).css({borderColor:"#000"})}function offBorder(){jQ(this).css({borderColor:"#ccc"})}function bidIncrement(){var a;a=jQ(this).text();jQ("input#bidAmt").val(a);jQ("#nextIncrements").animate({height:"0px",opacity:0},500)}function showRegInfo(){jQ("#bidReg ").fadeIn();jQ("#lb_bidAmt").attr("disabled",true);return false}function hideRegInfo(){jQ("#results.lotDetails .description #bidInfo #bidReg ").fadeOut()}function hidePopUp(){jQ("#popUp").fadeOut()}function bidButton(){var a=jQ("#bidAmt").val();if(a==""){return false}}jQ(function(){var b=500;var a=null;var d=false;var c=false;var e=250;var f=10;jQ("#singleThumbBox a").delegate("img","click",function(){_gaq.push(["_trackEvent","lightbox_link","clicked","lot_image_link"])});jQ("#singleThumbBox div.imgInfo").delegate("a","click",function(){_gaq.push(["_trackEvent","lightbox_link","clicked","lot_view_more_link"])});jQ("#results.lotDetails  p.expand").live("click",showDetails);jQ("#results.lotDetails  p.hide").live("click",hideDetails);jQ("#results.lotDetails p.showDetails").click(showAddress);jQ("#modal #closeWindow, #opaque,#bidIncrementsTable img,#bidIncrementsTable p a").live("click",closeModal);jQ("#bidIncrements").live("click",showIncrements);jQ("#nextIncrements li").live("click",bidIncrement);jQ(".imgInfo, #closeThumbBox").live("click",function(){var g=(jQ("#thumbBox center").length?(jQ("#af_carouselThumbList").length?10:300):300);jQ.colorbox({overlayClose:true,opacity:0.5,transition:"none",width:460,top:g,inline:true,href:"#thumbBox",close:'<span style="border: 1px solid black; font-weight:bold; font-size: 16px; padding:2px 6px; border-radius: 15px;"><span style="color: #444; font-size: 18px;">x</span><span>'});jQ(".caroufredsel_wrapper").css({height:"101px"});jQ("#af_carouselThumbList").css({left:"25px"})});jQ("#af_carouselThumbList li img").live("click",setActiveThumbInCarousel);jQ("#thumbBox ul li").hover(onBorder,offBorder);jQ("#bidAmt").val("").attr("autocomplete","off");jQ("div#nextIncrements").css("height","0px");jQ("#lb_bidAmt, input.lb_bidAmt").live("click",showRegInfo);jQ("#bidInfo #biddingWrapper #bidButton").live("click",bidButton);jQ("#bidReg p a").live("click",hideRegInfo);jQ("#popUp p.right2 a").live("click",hidePopUp);jQ("#placeAbsBid").click(function(){jQ("#popUp").fadeIn(e)});jQ("#bidAmt, #bidButton.bidAmt, div#nextIncrements").hover(function(){if(a){clearTimeout(a)}if(d||c){return}else{d=true;jQ("#results div#nextIncrements").animate({height:"130px",opacity:1},e);c=true}},function(){if(a){clearTimeout(a)}a=setTimeout(function(){a=null;c=false;jQ("#results div#nextIncrements").animate({height:"0px",opacity:0},e)},b);d=false});jQ("#af_carouselThumbList").carouFredSel({prev:"#af_carouselPrevBtn",next:"#af_carouselNextBtn",auto:false,circular:false,infinite:false,width:400,items:3})});function closeModals(c){var b=c.target;var a=b.id;if((a!=="lb_bidAmt")&&(a!=="bidButton")&&(a!=="secureBidLink")&&(a!=="placeAbsBidLink")){if(jQ("#bidReg").is(":visible")){jQ("#bidReg").fadeOut();jQ("#lb_bidAmt").attr("disabled",false)}if(jQ("#popUp").is(":visible")){jQ("#popUp").fadeOut("slow",function(){jQ("#bidNotices").remove();jQ("#secureBid").show()})}}}function buildToolTip(a,d){var b="",c,e;if(a=="pricesVerified"){c="/wwwImages/pricesVerified.png";e="This symbol indicates that this auction house has verified this price result."}else{c="/wwwImages/pricesNotVerified.png";e="This symbol indicates that this auction house has NOT verified this price result."}b+='<img class="priceVerification" class="priceVerIcon" src="'+c+'" alt="pricesVerified" />';b+="<p><strong>What is this symbol? </strong>"+e+"</p>";jQ("#priceVerInfo").html("").html(b);d.parent().append(jQ("#priceVerInfo"));if(jQ.browser.msie){jQ("#priceVerInfo").show()}else{jQ("#priceVerInfo").animate({opacity:"show"},"slow")}}function showToolTip(){var b=jQ(this),a=b.attr("alt");if(jQ("#priceVerInfo").is(":visible")==false){buildToolTip(a,b)}}function hideToolTip(){if(jQ.browser.msie){jQ("#priceVerInfo").hide()}else{jQ("#priceVerInfo").animate({opacity:"hide"},"fast")}jQ("#priceVerInfo").html("")}jQ(function(){var j,g,d,b,c,e,k,h;j="<div id='printable'></div>";b=jQ("#logo").clone();if(jQ("#singleThumbBox").length){c=jQ("#singleThumbBox").clone();k=jQ("#priceInfo").clone();e=jQ("#lotcontent").clone();d=jQ(j).append(c).append(k).append(e)}else{if(jQ("#catalogCoverTop").length){h=jQ("#content").clone();d=jQ(j).append(h)}}jQ("body").append(d);jQ("#printable div, #printable span").each(function(){var l;l=jQ(this).attr("id");if(l.length!==0){l+="-printable";jQ(this).attr("id",l)}});jQ("#rfaTYContent input.submit").live("click",setNotify);jQ("body").live("click",closeModals);jQ("img.tooltip").hover(showToolTip,hideToolTip);jQ(".af_bidIncrementButton").live("click",function(m){var l=jQ(this).html().match(/\d+/)[0];jQ("#bidAmt").val(l);jQ("#bidButton").click()});if(onLotDetailsPage){var f=jQ("h1#lotTitle");if(f.hasScrollBar()){jQ("#detailsHeader").removeAttr("style");f.after('<span id="lotTitleToggler" class="collapsed"><span id="lotTitleTogglerText">show title</span></span>');var a=jQ("#lotTitleToggler"),i=jQ("#addThis");a.live("click",function(){var l=jQ(this),m=l.hasClass("collapsed"),n=(m?"":"23px"),o=(m?"hide title":"show title");jQ("#lotTitleTogglerText").html(o);f.css({"max-height":n});l.toggleClass("collapsed");return false})}}});
