loadimg=new Image;loadimg.src="/common/images/loader.gif";$jQ(function(){$jQ("a.photo-popup-link").bind("mouseover",showImage);$jQ("a.tag-pop-link").bind("click",showTag);$jQ("a.grande-details").bind("click",showGrande);$jQ(".go-count-jump").bind("change",function(){$jQ(this).parents("form")[0].submit()})});var timeout=new Object();function showImage(A){if(timeout[this.id]){clearTimeout(timeout[this.id])}addPop(this.id,this.href,this.title);$jQ('a[@id="'+this.id+'"]').attr("href","#");$jQ('a[@id="'+this.id+'"]').click(function(){return false});$jQ("#"+this.id).prev().children().show(2);$jQ("#"+this.id).prev().show(2);$jQ(this).bind("mouseout",hideImage)}function keepImage(){timeVar=$jQ(this).parents(".photo-popup-outer").next().attr("id");if(timeout[timeVar]){clearTimeout(timeout[timeVar])}$jQ(this).bind("mouseout",function(){if(timeout[timeVar]){clearTimeout(timeout[timeVar])}timeout[timeVar]=setTimeout("hideit('"+timeVar+"')",250)})}function hideImage(A){timeout[this.id]=setTimeout("hideit('"+this.id+"')",250)}function hideit(A){if(!$jQ.browser.msie){$jQ("#"+A).prev().children().hide(2)}if(!($jQ.browser.safari&&(navigator.userAgent.toLowerCase().match(/.+on[\/ ]([\d.]+)/)||[]).length)){$jQ("#"+A).prev().hide("normal")}}function showTag(B){hideTags();if($jQ("#tpo-"+this.id).length==0){addTagPop(this.id);$jQ('a[@id="'+this.id+'"]').attr("href","#")}var A=this.id.replace(/tag-/,"");$jQ("#tpo-"+this.id).show(2,function(){p=jQuery.getPos($jQ("#tag-"+A)[0]);c=jQuery.getClient();if(c.w<1000){c.w=1000}loc=(((c.w/2)+p.x)/2);if($jQ.browser.safari||$jQ.browser.opera){$jQ("#tpo-"+A).find(".tag-pop-saf").css("left",parseInt(loc-(c.w-p.x))+"")}else{if($jQ.browser.msie&&parseFloat(navigator.userAgent.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/)[1])<7){$jQ("#tpo-tag-"+A).find(".tag-pop").css("left",42)}else{$jQ("#tpo-tag-"+A).find(".tag-pop").css("left",loc-(c.w-p.x))}}});var C=this.id;$jQ("#tpo-"+this.id).show("2",function(){document.getElementById("tpo-"+C).style.zoom="normal"});$jQ("#tc-"+A).ScrollTo(800);$jQ.ajax({url:SelfPage,type:"POST",data:{test:"yes,",go:"tags.addtagpop",pid:this.id.replace(/tag-/,"")},success:function(D){$jQ("#tc-"+A).html(D);$jQ("#tag-form-"+A).bind("submit",actTag);$jQ(".tag-close").unbind("click");$jQ(".tag-close").bind("click",hideTags);$jQ("#tag-form-"+A).children('input[@type="text"]')[0].focus();document.getElementById("tags-"+A).focus()},error:function(){hideTags();if(!$jQ("#span-"+A).children("a").length){$jQ("#span-"+A).css("display","")}$jQ("#span-"+A).children("a").remove();$jQ("#span-"+A).children("span").remove();$jQ("#span-"+A+" em").after('<span style="color:#900;">Oops. An error occurred. Please try again.</span> ');$jQ("#span-"+A).children("span").fadeTo("fast",0).fadeTo("fast",0.7).fadeTo("fast",0.3).fadeTo("fast",1)}});return false}function hideTags(){if(arguments.length){jReturn=arguments[0];if(!$jQ("#span-"+jReturn.pid).children("a").length){$jQ("#span-"+jReturn.pid).css("display","")}if(jReturn.taggood==1){$jQ("#span-"+jReturn.pid).children("a").remove();$jQ("#span-"+jReturn.pid).children("span").remove();for(tag in jReturn.tags){$jQ("#span-"+jReturn.pid+" em").after('<a href="/index.cfm/go/front.tagged/tag/'+jReturn.tags[tag]+'" >'+jReturn.tags[tag]+"</a> ")}$jQ("#span-"+jReturn.pid).children("a").fadeTo("fast",0).fadeTo("fast",0.7).fadeTo("fast",0.3).fadeTo("fast",1)}else{$jQ("#span-"+jReturn.pid).children("a").remove();$jQ("#span-"+jReturn.pid).children("span").remove();$jQ("#span-"+jReturn.pid+" em").after('<span style="color:#900;">There was an error adding your tag.</span> ');$jQ("#span-"+jReturn.pid).children("span").fadeTo("fast",0).fadeTo("fast",0.7).fadeTo("fast",0.3).fadeTo("fast",1)}}$jQ(".tag-popup-outer").css("display","none");$jQ(".tag-popup-outer-saf").hide();return false}function addPop(A,B,D){if(C){delete C}var C=new Object();if($jQ("#po-"+A).length==0){$jQ('a[@id="'+A+'"]').parent().createPrepend("div",{className:"photo-popup-outer",id:"po-"+A},["div",{className:"photo-popup"},["div",{className:"photo-popup-innerwrap"},["div",{className:"photopopup-center-outer"},["div",{className:"photopopup-center-middle"},["div",{className:"photopopup-center-inner"},["h1",{style:"text-align:center;"},D,"img",{src:B,style:"border:0px;",alt:D}]]]]],"div",{className:"photo-popup-pointer"},""])}$jQ("#po-"+A).show("0",function(){$jQ("#po-"+A).children(".photo-popup").css("bottom",-150);$jQ("#po-"+A).children(".photo-popup-pointer").css("bottom",-170);C.s=jQuery.getScroll();C.c=jQuery.getClient();C.p=jQuery.getPos($jQ("#po-"+A).find(".photo-popup")[0]);if(C.p.y<C.s.t&&C.p.y!=0){objTop=(-120-(C.s.t-C.p.y));pbottom=-170}else{if(C.p.y+C.p.h>C.s.t+C.c.h&&C.p.y!=0){objTop=(-160+(C.p.y+C.p.h)-(C.s.t+C.c.h));pbottom=-140}else{objTop=-170;pbottom=-170}}$jQ("#po-"+A).children(".photo-popup").css("bottom",objTop);$jQ("#po-"+A).children(".photo-popup-pointer").css("bottom",pbottom);$jQ("#po-"+A).show(2)});$jQ("#po-"+A).find("div").bind("mouseover",keepImage).end().find("img").bind("mouseover",keepImage);return C}function addTagPop(A){p=jQuery.getPos($jQ("#"+A)[0]);c=jQuery.getClient();if(c.w<1000){c.w=1000}loc=(((c.w/2)+p.x)/2);if($jQ.browser.safari||$jQ.browser.opera){$jQ("#"+A).parent().parent().createAppend("div",{className:"tag-popup-outer-saf",id:"tpo-"+A},["div",{style:"position:absolute"},["div",{className:"tag-pop-saf"},["div",{className:"tag-pop-contents",id:"tc-"+A.replace(/tag-/,"")},["img",{src:"/common/images/ajax-loader-sm-cream.gif",style:"margin:70px 0px 0px 95px"},[]]],"div",{className:"tag-pop-pointer-saf"},""],"img",{src:"/common/images/tag-popup-pointer.png",className:"saf"}]);$jQ("#tpo-"+A).find(".tag-pop-saf").css("left",parseInt(loc-(c.w-p.x)+""))}else{var B=($jQ.browser.version>=1.9&&$jQ.browser.mozilla)?"inherit":"absolute";$jQ("#"+A).parent().parent().createAppend("div",{className:"tag-popup-outer",id:"tpo-"+A},["div",{style:"position:"+B},["div",{className:"tag-pop"},["div",{className:"tag-pop-contents",id:"tc-"+A.replace(/tag-/,"")},["img",{src:"/common/images/ajax-loader-sm-cream.gif",style:"margin:70px 0px 0px 95px"},[]]],"div",{className:"tag-pop-pointer"},["img",{src:"/common/images/tag-popup-pointer.png"}]]]);if($jQ.browser.msie&&parseFloat($jQ.browser.version)<7){$jQ("#tpo-"+A).find(".tag-pop").css("left",42)}else{$jQ("#tpo-"+A).find(".tag-pop").css("left",loc-(c.w-p.x))}}}function actTag(){var A=$jQ(this).children().serialize();$jQ(this).parents(".tag-pop-contents").html('<img src="/common/images/ajax-loader-sm-cream.gif" style="margin:70px 0px 0px 95px" />');$jQ.ajax({type:"POST",url:SelfPage,data:"go=tags.actaddTagpop&"+A,dataType:"json",success:hideTags,error:hideTags});return false}function showGrande(C){hideGrande(C);var A=$jQ(this);var B=A.attr("href").split("/item/")[1];if(B){if($jQ("#grande-pop-bubble-"+B).length){$jQ("#grande-pop-bubble-"+B).show();$jQ("body").click(hideGrande);$jQ("body").keypress(hideGrande)}else{$jQ.ajax({type:"POST",url:SelfPage,data:"go=misc.grandepop&item="+B,success:function(D){A.before(D);$jQ("body").click(hideGrande);$jQ("body").keypress(hideGrande);$jQ("#grande-pop-bubble-"+B).find("*").unbind("click");$jQ("#grande-pop-bubble-"+B).find("a").bind("click",function(E){hideGrande(E);return false})}})}}return false}function hideGrande(A){$jQ("body").unbind();if(A.type=="keypress"&&A.keyCode!=27){return true}$jQ(".grande-pop-bubble").hide();return false}