(function(f,c){var g=function(k,j){var n=f(k),j=f.extend({},f.fn.jqDropDown.defaults,j),q,s,o=j.defaultOption,m,i,l,t=j.effect,p=j.effectSpeed,r=f('<ul class="'+j.optionListName+'" style="display:none;"></ul>');q=n.width();n.hide().after('<div class="'+j.containerName+'" style="position:relative;"></div>');if(o&&o!==""){m=o}else{m=n.find("option[selected]").text()||n.find("option:eq(0)").text()}i=f('<a href="#" class="'+j.toggleBtnName+'">'+m+"</a>");s=n.next("div."+j.containerName);s.append(i);r.append(d(n,j));l=r.find("a");i.after(r);h(s,q,j);f(document).bind("mousedown",function(w){var v=this,u=f(w.target);if(f(document.activeElement).hasClass(j.toggleBtnName)||f(document.activeElement).hasClass(j.optionListName)){if(!u.hasClass(j.optionGroupName)&&!u.hasClass(j.toggleBtnName)){if(u.parents().filter(r).length){i.data("index",r.find("li").index(u.parent())).focus();e(n,u);b(i,u,j);j.optionChanged(u)}else{if(f(document.activeElement).hasClass(j.toggleBtnName)&&r.is(":visible").length){t==="fade"?r.fadeOut(p):r.hide();return false}else{if(f(document.activeElement).hasClass(j.toggleBtnName)&&!r.filter(":visible").length){i.blur();return false}else{if(j.modal){return false}}}}t==="fade"?r.fadeOut(p):r.hide();return false}else{return false}}});l.bind("mouseenter click",function(v){var u=f(this);v.preventDefault();r.find("a.selected").removeClass("selected");u.addClass("selected");i.data("index",r.find("li").index(u.parent()))});i.bind("mousedown keydown focusout click",function(z){var A=f(this),D,u=A.data("index")||0,w=false,C=false,v,y=r.find("a"),B;if(z.type==="mousedown"&&z.which===1){j.beforeToggle.call(this);a(A,r,j);y.removeClass("selected");A.focus();r.find("li:eq("+u+") a").addClass("selected");if(r.is(":hidden")){t==="fade"?f("."+j.optionListName).fadeOut(p):f("."+j.optionListName).hide();t==="fade"?r.fadeIn(p):r.show()}else{t==="fade"?r.fadeOut(p):r.hide()}j.afterToggle.call(this)}if(z.type==="keydown"){switch(z.keyCode){case 9:C=true;t==="fade"?r.fadeOut(p):r.hide();break;case 27:C=true;t==="fade"?r.fadeOut(p):r.hide();break;case 13:f(document).trigger("mousedown",[{target:r.find("li:eq("+A.data("index")+") a:eq(0)")}]);break;case 38:z.preventDefault();y.removeClass("selected");for(var x=u-1;x>=0;x--){D=r.find("li:eq("+(x)+")");if(!D.hasClass(j.optionGroupName)){u=x;break}}break;case 40:z.preventDefault();y.removeClass("selected");for(var x=u+1;x<r.find("li").length;x++){D=r.find("li:eq("+(x)+")");if(!D.hasClass(j.optionGroupName)){u=x;break}}break;default:B=String.fromCharCode(z.which).toLowerCase();for(var x=u+1;x<r.find("li").length;x++){D=r.find("li:eq("+(x)+")");if(D.text().slice(0,1).toLowerCase()===B&&!D.hasClass(j.optionGroupName)){y.removeClass("selected");u=x;w=true;break}}if(!w){for(var x=0;x<u;x++){D=r.find("li:eq("+(x)+")");if(D.text().slice(0,1).toLowerCase()===B&&!D.hasClass(j.optionGroupName)){y.removeClass("selected");u=x;break}}}break}if(!C){A.data("index",u);v=r.find("li:eq("+A.data("index")+") a:eq(0)");v.addClass("selected");e(n,$target);b(A,v,j)}}else{return false}})};function e(j,i){var k=i.attr("rel")||i.text();j.find("option").each(function(){var l=f(this);if(l.val()===k||l.text()===k){l.trigger("select").attr("selected",true)}})}function b(i,j,k){var l,m;if(j&&j.text()!==""){i.text(j.text()).append("<span></span>")}if(k.placeholder){l=f(k.placeholder);k.useValue?m=j.attr("rel"):m=j.text();if(l.is("input")){l.val(m)}else{l.text(m)}}}function d(m,o){var k,n,p="",j,l="";if(o.data.length){k=o.data}else{k=m.find("option,optgroup")}if(o.defaultOption&&o.defaultOption!==""){p+='<li class="'+o.optionName+'"><a href="#">'+o.defaultOption+"</a></li>"}for(n=0;n<k.length;n++){j=f(k[n]);if(j.is(":selected")&&!o.defaultOption){l="selected"}if(j.is("option")){p+='<li class="'+o.optionName+'"><a class="'+l+'" href="#" rel="'+j.attr("value")+'">'+j.text()+"</a></li>"}else{p+='<li class="'+o.optionGroupName+'">'+j.attr("label")+"</li>"}l=""}return p}function h(p,i,o){var k=p.find("ul:eq(0)"),n=p.find("ul > li > a"),j=p.find("a:eq(0)"),m=parseInt(j.css("padding-left"),10)+parseInt(j.css("padding-right"),10),l;a(j,k,o);if(o.defaultStyle){p.find("li."+o.optionGroupName).length>0?l=20:l=4;k.css({width:i+m});j.css({width:k.width()-m}).append("<span></span>");n.css({"padding-left":l})}}function a(k,n,l){var o,q,i,m=f("select"),j,p;q=parseInt(k.css("padding-top"),10)+parseInt(k.css("padding-bottom"),10)||0;i=parseInt(k.css("border-top-width"),10)+parseInt(k.css("border-bottom-width"),10)||0;if(p==="up"||(k.offset().top+n.height()+20)>f(c).height()+f(c).scrollTop()){o=-(n.height()+q-i);p="up"}else{o=k.height()+q+i;p="down"}n.css({top:o});if(f.browser.msie&&f.browser.version==="6.0"||f.browser.version==="7.0"){p==="up"?j=0:j=m.length;m.each(function(){f(this).next("div").css({"z-index":j});if(p==="up"){j+=1}else{j-=1}})}}f.fn.jqDropDown=function(i){return this.each(function(){var j=f(this);if(j.data("jqDropDown")){return}var k=new g(this,i);j.data("jqDropDown",k)})};f.fn.jqDropDown.Debug=function(i){if(c.console&&c.console.log){c.console.log("hilight selection count: "+i.text())}};f.fn.jqDropDown.defaults={effect:"default",effectSpeed:400,modal:false,data:{},defaultOption:null,containerName:"ddContainer",toggleBtnName:"ddToggle",optionListName:"ddOptionList",optionGroupName:"optgroup",optionName:"ddOption",defaultStyle:true,placeholder:null,useValue:true,direction:"down",beforeToggle:function(){},afterToggle:function(){},optionChanged:function(){}}}(jQuery,window,undefined));(function(b){var a=function(m,s){var j=b.extend({},b.fn.nivoSlider.defaults,s);var p={currentSlide:0,currentImage:"",totalSlides:0,randAnim:"",running:false,paused:false,stop:false};var d=b(m);d.data("nivo:vars",p);d.css("position","relative");d.addClass("nivoSlider");var e=d.children();e.each(function(){var v=b(this);var u="";if(!v.is("img")){if(v.is("a")){v.addClass("nivo-imageLink");u=v}v=v.find("img:first")}var t=v.width();if(t==0){t=v.attr("width")}var i=v.height();if(i==0){i=v.attr("height")}if(t>d.width()){d.width(t)}if(i>d.height()){d.height(i)}if(u!=""){u.css("display","none")}v.css("display","none");p.totalSlides++});if(j.startSlide>0){if(j.startSlide>=p.totalSlides){j.startSlide=p.totalSlides-1}p.currentSlide=j.startSlide}if(b(e[p.currentSlide]).is("img")){p.currentImage=b(e[p.currentSlide])}else{p.currentImage=b(e[p.currentSlide]).find("img:first")}if(b(e[p.currentSlide]).is("a")){b(e[p.currentSlide]).css("display","block")}d.css("background",'url("'+p.currentImage.attr("src")+'") no-repeat');d.append(b('<div class="nivo-caption"><p></p></div>').css({display:"none",opacity:j.captionOpacity}));var q=function(i){var u=b(".nivo-caption",d);if(p.currentImage.attr("title")!=""){var t=p.currentImage.attr("title");if(t.substr(0,1)=="#"){t=b(t).html()}if(u.css("display")=="block"){u.find("p").fadeOut(i.animSpeed,function(){b(this).html(t);b(this).fadeIn(i.animSpeed)})}else{u.find("p").html(t)}u.fadeIn(i.animSpeed)}else{u.fadeOut(i.animSpeed)}};q(j);var c=0;if(!j.manualAdvance&&e.length>1){c=setInterval(function(){r(d,e,j,false)},j.pauseTime)}if(j.directionNav){d.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+j.prevText+'</a><a class="nivo-nextNav">'+j.nextText+"</a></div>");if(j.directionNavHide){b(".nivo-directionNav",d).hide();d.hover(function(){b(".nivo-directionNav",d).show()},function(){b(".nivo-directionNav",d).hide()})}b("a.nivo-prevNav",d).live("click",function(){if(p.running){return false}clearInterval(c);c="";p.currentSlide-=2;r(d,e,j,"prev")});b("a.nivo-nextNav",d).live("click",function(){if(p.running){return false}clearInterval(c);c="";r(d,e,j,"next")})}if(j.controlNav){var n=b('<div class="nivo-controlNav"></div>');d.append(n);for(var l=0;l<e.length;l++){if(j.controlNavThumbs){var f=e.eq(l);if(!f.is("img")){f=f.find("img:first")}if(j.controlNavThumbsFromRel){n.append('<a class="nivo-control" rel="'+l+'"><img src="'+f.attr("rel")+'" alt="" /></a>')}else{n.append('<a class="nivo-control" rel="'+l+'"><img src="'+f.attr("src").replace(j.controlNavThumbsSearch,j.controlNavThumbsReplace)+'" alt="" /></a>')}}else{n.append('<a class="nivo-control" rel="'+l+'">'+(l+1)+"</a>")}}b(".nivo-controlNav a:eq("+p.currentSlide+")",d).addClass("active");b(".nivo-controlNav a",d).live("click",function(){if(p.running){return false}if(b(this).hasClass("active")){return false}clearInterval(c);c="";d.css("background",'url("'+p.currentImage.attr("src")+'") no-repeat');p.currentSlide=b(this).attr("rel")-1;r(d,e,j,"control")})}if(j.keyboardNav){b(window).keypress(function(i){if(i.keyCode=="37"){if(p.running){return false}clearInterval(c);c="";p.currentSlide-=2;r(d,e,j,"prev")}if(i.keyCode=="39"){if(p.running){return false}clearInterval(c);c="";r(d,e,j,"next")}})}if(j.pauseOnHover){d.hover(function(){p.paused=true;clearInterval(c);c=""},function(){p.paused=false;if(c==""&&!j.manualAdvance){c=setInterval(function(){r(d,e,j,false)},j.pauseTime)}})}d.bind("nivo:animFinished",function(){p.running=false;b(e).each(function(){if(b(this).is("a")){b(this).css("display","none")}});if(b(e[p.currentSlide]).is("a")){b(e[p.currentSlide]).css("display","block")}if(c==""&&!p.paused&&!j.manualAdvance){c=setInterval(function(){r(d,e,j,false)},j.pauseTime)}j.afterChange.call(this)});var g=function(v,u,x){for(var t=0;t<u.slices;t++){var w=Math.round(v.width()/u.slices);if(t==u.slices-1){v.append(b('<div class="nivo-slice"></div>').css({left:(w*t)+"px",width:(v.width()-(w*t))+"px",height:"0px",opacity:"0",background:'url("'+x.currentImage.attr("src")+'") no-repeat -'+((w+(t*w))-w)+"px 0%"}))}else{v.append(b('<div class="nivo-slice"></div>').css({left:(w*t)+"px",width:w+"px",height:"0px",opacity:"0",background:'url("'+x.currentImage.attr("src")+'") no-repeat -'+((w+(t*w))-w)+"px 0%"}))}}};var h=function(u,i,x){var t=Math.round(u.width()/i.boxCols);var y=Math.round(u.height()/i.boxRows);for(var v=0;v<i.boxRows;v++){for(var w=0;w<i.boxCols;w++){if(w==i.boxCols-1){u.append(b('<div class="nivo-box"></div>').css({opacity:0,left:(t*w)+"px",top:(y*v)+"px",width:(u.width()-(t*w))+"px",height:y+"px",background:'url("'+x.currentImage.attr("src")+'") no-repeat -'+((t+(w*t))-t)+"px -"+((y+(v*y))-y)+"px"}))}else{u.append(b('<div class="nivo-box"></div>').css({opacity:0,left:(t*w)+"px",top:(y*v)+"px",width:t+"px",height:y+"px",background:'url("'+x.currentImage.attr("src")+'") no-repeat -'+((t+(w*t))-t)+"px -"+((y+(v*y))-y)+"px"}))}}}};var r=function(H,G,K,D){var F=H.data("nivo:vars");if(F&&(F.currentSlide==F.totalSlides-1)){K.lastSlide.call(this)}if((!F||F.stop)&&!D){return false}K.beforeChange.call(this);if(!D){H.css("background",'url("'+F.currentImage.attr("src")+'") no-repeat')}else{if(D=="prev"){H.css("background",'url("'+F.currentImage.attr("src")+'") no-repeat')}if(D=="next"){H.css("background",'url("'+F.currentImage.attr("src")+'") no-repeat')}}F.currentSlide++;if(F.currentSlide==F.totalSlides){F.currentSlide=0;K.slideshowEnd.call(this)}if(F.currentSlide<0){F.currentSlide=(F.totalSlides-1)}if(b(G[F.currentSlide]).is("img")){F.currentImage=b(G[F.currentSlide])}else{F.currentImage=b(G[F.currentSlide]).find("img:first")}if(K.controlNav){b(".nivo-controlNav a",H).removeClass("active");b(".nivo-controlNav a:eq("+F.currentSlide+")",H).addClass("active")}q(K);b(".nivo-slice",H).remove();b(".nivo-box",H).remove();if(K.effect=="random"){var M=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade","boxRandom","boxRain","boxRainReverse","boxRainGrow","boxRainGrowReverse");F.randAnim=M[Math.floor(Math.random()*(M.length+1))];if(F.randAnim==undefined){F.randAnim="fade"}}if(K.effect.indexOf(",")!=-1){var M=K.effect.split(",");F.randAnim=M[Math.floor(Math.random()*(M.length))];if(F.randAnim==undefined){F.randAnim="fade"}}F.running=true;if(K.effect=="sliceDown"||K.effect=="sliceDownRight"||F.randAnim=="sliceDownRight"||K.effect=="sliceDownLeft"||F.randAnim=="sliceDownLeft"){g(H,K,F);var L=0;var I=0;var t=b(".nivo-slice",H);if(K.effect=="sliceDownLeft"||F.randAnim=="sliceDownLeft"){t=b(".nivo-slice",H)._reverse()}t.each(function(){var i=b(this);i.css({top:"0px"});if(I==K.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},K.animSpeed,"",function(){H.trigger("nivo:animFinished")})},(100+L))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},K.animSpeed)},(100+L))}L+=50;I++})}else{if(K.effect=="sliceUp"||K.effect=="sliceUpRight"||F.randAnim=="sliceUpRight"||K.effect=="sliceUpLeft"||F.randAnim=="sliceUpLeft"){g(H,K,F);var L=0;var I=0;var t=b(".nivo-slice",H);if(K.effect=="sliceUpLeft"||F.randAnim=="sliceUpLeft"){t=b(".nivo-slice",H)._reverse()}t.each(function(){var i=b(this);i.css({bottom:"0px"});if(I==K.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},K.animSpeed,"",function(){H.trigger("nivo:animFinished")})},(100+L))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},K.animSpeed)},(100+L))}L+=50;I++})}else{if(K.effect=="sliceUpDown"||K.effect=="sliceUpDownRight"||F.randAnim=="sliceUpDown"||K.effect=="sliceUpDownLeft"||F.randAnim=="sliceUpDownLeft"){g(H,K,F);var L=0;var I=0;var B=0;var t=b(".nivo-slice",H);if(K.effect=="sliceUpDownLeft"||F.randAnim=="sliceUpDownLeft"){t=b(".nivo-slice",H)._reverse()}t.each(function(){var i=b(this);if(I==0){i.css("top","0px");I++}else{i.css("bottom","0px");I=0}if(B==K.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},K.animSpeed,"",function(){H.trigger("nivo:animFinished")})},(100+L))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},K.animSpeed)},(100+L))}L+=50;B++})}else{if(K.effect=="fold"||F.randAnim=="fold"){g(H,K,F);var L=0;var I=0;b(".nivo-slice",H).each(function(){var i=b(this);var v=i.width();i.css({top:"0px",height:"100%",width:"0px"});if(I==K.slices-1){setTimeout(function(){i.animate({width:v,opacity:"1.0"},K.animSpeed,"",function(){H.trigger("nivo:animFinished")})},(100+L))}else{setTimeout(function(){i.animate({width:v,opacity:"1.0"},K.animSpeed)},(100+L))}L+=50;I++})}else{if(K.effect=="fade"||F.randAnim=="fade"){g(H,K,F);var z=b(".nivo-slice:first",H);z.css({height:"100%",width:H.width()+"px"});z.animate({opacity:"1.0"},(K.animSpeed*2),"",function(){H.trigger("nivo:animFinished")})}else{if(K.effect=="slideInRight"||F.randAnim=="slideInRight"){g(H,K,F);var z=b(".nivo-slice:first",H);z.css({height:"100%",width:"0px",opacity:"1"});z.animate({width:H.width()+"px"},(K.animSpeed*2),"",function(){H.trigger("nivo:animFinished")})}else{if(K.effect=="slideInLeft"||F.randAnim=="slideInLeft"){g(H,K,F);var z=b(".nivo-slice:first",H);z.css({height:"100%",width:"0px",opacity:"1",left:"",right:"0px"});z.animate({width:H.width()+"px"},(K.animSpeed*2),"",function(){z.css({left:"0px",right:""});H.trigger("nivo:animFinished")})}else{if(K.effect=="boxRandom"||F.randAnim=="boxRandom"){h(H,K,F);var J=K.boxCols*K.boxRows;var I=0;var L=0;var w=o(b(".nivo-box",H));w.each(function(){var i=b(this);if(I==J-1){setTimeout(function(){i.animate({opacity:"1"},K.animSpeed,"",function(){H.trigger("nivo:animFinished")})},(100+L))}else{setTimeout(function(){i.animate({opacity:"1"},K.animSpeed)},(100+L))}L+=20;I++})}else{if(K.effect=="boxRain"||F.randAnim=="boxRain"||K.effect=="boxRainReverse"||F.randAnim=="boxRainReverse"||K.effect=="boxRainGrow"||F.randAnim=="boxRainGrow"||K.effect=="boxRainGrowReverse"||F.randAnim=="boxRainGrowReverse"){h(H,K,F);var J=K.boxCols*K.boxRows;var I=0;var L=0;var y=0;var E=0;var C=new Array();C[y]=new Array();var w=b(".nivo-box",H);if(K.effect=="boxRainReverse"||F.randAnim=="boxRainReverse"||K.effect=="boxRainGrowReverse"||F.randAnim=="boxRainGrowReverse"){w=b(".nivo-box",H)._reverse()}w.each(function(){C[y][E]=b(this);E++;if(E==K.boxCols){y++;E=0;C[y]=new Array()}});for(var A=0;A<(K.boxCols*2);A++){var u=A;for(var x=0;x<K.boxRows;x++){if(u>=0&&u<K.boxCols){(function(S,N,R,O,T){var Q=b(C[S][N]);var v=Q.width();var P=Q.height();if(K.effect=="boxRainGrow"||F.randAnim=="boxRainGrow"||K.effect=="boxRainGrowReverse"||F.randAnim=="boxRainGrowReverse"){Q.width(0).height(0)}if(O==T-1){setTimeout(function(){Q.animate({opacity:"1",width:v,height:P},K.animSpeed/1.3,"",function(){H.trigger("nivo:animFinished")})},(100+R))}else{setTimeout(function(){Q.animate({opacity:"1",width:v,height:P},K.animSpeed/1.3)},(100+R))}})(x,u,L,I,J);I++}u--}L+=100}}}}}}}}}}};var o=function(u){for(var v,t,w=u.length;w;v=parseInt(Math.random()*w),t=u[--w],u[w]=u[v],u[v]=t){}return u};var k=function(i){if(this.console&&typeof console.log!="undefined"){console.log(i)}};this.stop=function(){if(!b(m).data("nivo:vars").stop){b(m).data("nivo:vars").stop=true;k("Stop Slider")}};this.start=function(){if(b(m).data("nivo:vars").stop){b(m).data("nivo:vars").stop=false;k("Start Slider")}};j.afterLoad.call(this);return this};b.fn.nivoSlider=function(c){return this.each(function(e,g){var d=b(this);if(d.data("nivoslider")){return d.data("nivoslider")}var f=new a(this,c);d.data("nivoslider",f)})};b.fn.nivoSlider.defaults={effect:"random",slices:15,boxCols:8,boxRows:4,animSpeed:500,pauseTime:3000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8,prevText:"Prev",nextText:"Next",beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};b.fn._reverse=[].reverse})(jQuery);(function(B,P){var C={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true},t="colorbox",M="cbox",O=M+"_open",e=M+"_load",N=M+"_complete",q=M+"_cleanup",U=M+"_closed",i=M+"_purge",I=M+"_loaded",r=B.browser.msie&&!B.support.opacity,X=r&&B.browser.version<7,T=M+"_IE6",K,Y,Z,d,z,m,b,J,c,S,F,j,h,l,p,Q,o,L,v,aa,k,g,a,s,A,V,x,R,E=false,D,n=M+"Element";function H(ac,ab){ac=ac?' id="'+M+ac+'"':"";ab=ab?' style="'+ab+'"':"";return B("<div"+ac+ab+"/>")}function G(ab,ac){ac=ac==="x"?S.width():S.height();return(typeof ab==="string")?Math.round((/%/.test(ab)?(ac/100)*parseInt(ab,10):parseInt(ab,10))):ab}function w(ab){return V.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(ab)}function W(ac){for(var ab in ac){if(B.isFunction(ac[ab])&&ab.substring(0,2)!=="on"){ac[ab]=ac[ab].call(s)}}ac.rel=ac.rel||s.rel||"nofollow";ac.href=ac.href||B(s).attr("href");ac.title=ac.title||s.title;return ac}function y(ab,ac){if(ac){ac.call(s)}B.event.trigger(ab)}function u(){var ac,ae=M+"Slideshow_",af="click."+M,ag,ad,ab;if(V.slideshow&&c[1]){ag=function(){Q.text(V.slideshowStop).unbind(af).bind(N,function(){if(A<c.length-1||V.loop){ac=setTimeout(D.next,V.slideshowSpeed)}}).bind(e,function(){clearTimeout(ac)}).one(af+" "+q,ad);Y.removeClass(ae+"off").addClass(ae+"on");ac=setTimeout(D.next,V.slideshowSpeed)};ad=function(){clearTimeout(ac);Q.text(V.slideshowStart).unbind([N,e,q,af].join(" ")).one(af,ag);Y.removeClass(ae+"on").addClass(ae+"off")};if(V.slideshowAuto){ag()}else{ad()}}}function f(ab){if(!E){s=ab;V=W(B.extend({},B.data(s,t)));c=B(s);A=0;if(V.rel!=="nofollow"){c=B("."+n).filter(function(){var ad=B.data(this,t).rel||this.rel;return(ad===V.rel)});A=c.index(s);if(A===-1){c=c.add(s);A=c.length-1}}if(!x){x=R=true;Y.show();if(V.returnFocus){try{s.blur();B(s).one(U,function(){try{this.focus()}catch(ad){}})}catch(ac){}}K.css({opacity:+V.opacity,cursor:V.overlayClose?"pointer":"auto"}).show();V.w=G(V.initialWidth,"x");V.h=G(V.initialHeight,"y");D.position(0);if(X){S.bind("resize."+T+" scroll."+T,function(){K.css({width:S.width(),height:S.height(),top:S.scrollTop(),left:S.scrollLeft()})}).trigger("scroll."+T)}y(O,V.onOpen);p.add(L).add(o).add(Q).add(l).hide();v.html(V.close).show()}D.load(true)}}D=B.fn[t]=B[t]=function(ab,ae){var ac=this,ad;if(!ac[0]&&ac.selector){return ac}ab=ab||{};if(ae){ab.onComplete=ae}if(!ac[0]||ac.selector===undefined){ac=B("<a/>");ab.open=true}ac.each(function(){B.data(this,t,B.extend({},B.data(this,t)||C,ab));B(this).addClass(n)});ad=ab.open;if(B.isFunction(ad)){ad=ad.call(ac)}if(ad){f(ac[0])}return ac};D.init=function(){S=B(P);Y=H().attr({id:t,"class":r?M+"IE":""});K=H("Overlay",X?"position:absolute":"").hide();Z=H("Wrapper");d=H("Content").append(F=H("LoadedContent","width:0; height:0; overflow:hidden"),h=H("LoadingOverlay").add(H("LoadingGraphic")),l=H("Title"),p=H("Current"),o=H("Next"),L=H("Previous"),Q=H("Slideshow").bind(O,u),v=H("Close"));Z.append(H().append(H("TopLeft"),z=H("TopCenter"),H("TopRight")),H(false,"clear:left").append(m=H("MiddleLeft"),d,b=H("MiddleRight")),H(false,"clear:left").append(H("BottomLeft"),J=H("BottomCenter"),H("BottomRight"))).children().children().css({"float":"left"});j=H(false,"position:absolute; width:9999px; visibility:hidden; display:none");B("body").prepend(K,Y.append(Z,j));d.children().hover(function(){B(this).addClass("hover")},function(){B(this).removeClass("hover")}).addClass("hover");aa=z.height()+J.height()+d.outerHeight(true)-d.height();k=m.width()+b.width()+d.outerWidth(true)-d.width();g=F.outerHeight(true);a=F.outerWidth(true);Y.css({"padding-bottom":aa,"padding-right":k}).hide();o.click(D.next);L.click(D.prev);v.click(D.close);d.children().removeClass("hover");B("."+n).live("click",function(ab){if(!((ab.button!==0&&typeof ab.button!=="undefined")||ab.ctrlKey||ab.shiftKey||ab.altKey)){ab.preventDefault();f(this)}});K.click(function(){if(V.overlayClose){D.close()}});B(document).bind("keydown",function(ab){if(x&&V.escKey&&ab.keyCode===27){ab.preventDefault();D.close()}if(x&&V.arrowKey&&!R&&c[1]){if(ab.keyCode===37&&(A||V.loop)){ab.preventDefault();L.click()}else{if(ab.keyCode===39&&(A<c.length-1||V.loop)){ab.preventDefault();o.click()}}}})};D.remove=function(){Y.add(K).remove();B("."+n).die("click").removeData(t).removeClass(n)};D.position=function(af,ac){var ae,ad=Math.max(document.documentElement.clientHeight-V.h-g-aa,0)/2+S.scrollTop(),ab=Math.max(S.width()-V.w-a-k,0)/2+S.scrollLeft();ae=(Y.width()===V.w+a&&Y.height()===V.h+g)?0:af;Z[0].style.width=Z[0].style.height="9999px";function ag(ah){z[0].style.width=J[0].style.width=d[0].style.width=ah.style.width;h[0].style.height=h[1].style.height=d[0].style.height=m[0].style.height=b[0].style.height=ah.style.height}Y.dequeue().animate({width:V.w+a,height:V.h+g,top:ad,left:ab},{duration:ae,complete:function(){ag(this);R=false;Z[0].style.width=(V.w+a+k)+"px";Z[0].style.height=(V.h+g+aa)+"px";if(ac){ac()}},step:function(){ag(this)}})};D.resize=function(ab){if(x){ab=ab||{};if(ab.width){V.w=G(ab.width,"x")-a-k}if(ab.innerWidth){V.w=G(ab.innerWidth,"x")}F.css({width:V.w});if(ab.height){V.h=G(ab.height,"y")-g-aa}if(ab.innerHeight){V.h=G(ab.innerHeight,"y")}if(!ab.innerHeight&&!ab.height){var ac=F.wrapInner("<div style='overflow:auto'></div>").children();V.h=ac.height();ac.replaceWith(ac.children())}F.css({height:V.h});D.position(V.transition==="none"?0:V.speed)}};D.prep=function(ae){if(!x){return}var ad,af=V.transition==="none"?0:V.speed;S.unbind("resize."+M);F.remove();F=H("LoadedContent").html(ae);function ab(){V.w=V.w||F.width();V.w=V.mw&&V.mw<V.w?V.mw:V.w;return V.w}function ag(){V.h=V.h||F.height();V.h=V.mh&&V.mh<V.h?V.mh:V.h;return V.h}F.hide().appendTo(j.show()).css({width:ab(),overflow:V.scrolling?"auto":"hidden"}).css({height:ag()}).prependTo(d);j.hide();B("#"+M+"Photo").css({cssFloat:"none",marginLeft:"auto",marginRight:"auto"});if(X){B("select").not(Y.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(q,function(){this.style.visibility="inherit"})}function ac(ak){var am,an,aj,ai,al=c.length,ah=V.loop;D.position(ak,function(){function ao(){if(r){Y[0].style.removeAttribute("filter")}}if(!x){return}if(r){if(ad){F.fadeIn(100)}}F.show();y(I);l.show().html(V.title);if(al>1){if(typeof V.current==="string"){p.html(V.current.replace(/\{current\}/,A+1).replace(/\{total\}/,al)).show()}o[(ah||A<al-1)?"show":"hide"]().html(V.next);L[(ah||A)?"show":"hide"]().html(V.previous);am=A?c[A-1]:c[al-1];aj=A<al-1?c[A+1]:c[0];if(V.slideshow){Q.show()}if(V.preloading){ai=B.data(aj,t).href||aj.href;an=B.data(am,t).href||am.href;ai=B.isFunction(ai)?ai.call(aj):ai;an=B.isFunction(an)?an.call(am):an;if(w(ai)){B("<img/>")[0].src=ai}if(w(an)){B("<img/>")[0].src=an}}}h.hide();if(V.transition==="fade"){Y.fadeTo(af,1,function(){ao()})}else{ao()}S.bind("resize."+M,function(){D.position(0)});y(N,V.onComplete)})}if(V.transition==="fade"){Y.fadeTo(af,0,function(){ac(0)})}else{ac(af)}};D.load=function(ae){var ad,ac,af,ab=D.prep;R=true;s=c[A];if(!ae){V=W(B.extend({},B.data(s,t)))}y(i);y(e,V.onLoad);V.h=V.height?G(V.height,"y")-g-aa:V.innerHeight&&G(V.innerHeight,"y");V.w=V.width?G(V.width,"x")-a-k:V.innerWidth&&G(V.innerWidth,"x");V.mw=V.w;V.mh=V.h;if(V.maxWidth){V.mw=G(V.maxWidth,"x")-a-k;V.mw=V.w&&V.w<V.mw?V.w:V.mw}if(V.maxHeight){V.mh=G(V.maxHeight,"y")-g-aa;V.mh=V.h&&V.h<V.mh?V.h:V.mh}ad=V.href;h.show();if(V.inline){H().hide().insertBefore(B(ad)[0]).one(i,function(){B(this).replaceWith(F.children())});ab(B(ad))}else{if(V.iframe){Y.one(I,function(){var ag=B("<iframe frameborder='0' style='width:100%; height:100%; border:0; display:block'/>")[0];ag.name=M+(+new Date());ag.src=V.href;if(!V.scrolling){ag.scrolling="no"}if(r){ag.allowtransparency="true"}B(ag).appendTo(F).one(i,function(){ag.src="//about:blank"})});ab(" ")}else{if(V.html){ab(V.html)}else{if(w(ad)){ac=new Image();ac.onload=function(){var ag;ac.onload=null;ac.id=M+"Photo";B(ac).css({border:"none",display:"block",cssFloat:"left"});if(V.scalePhotos){af=function(){ac.height-=ac.height*ag;ac.width-=ac.width*ag};if(V.mw&&ac.width>V.mw){ag=(ac.width-V.mw)/ac.width;af()}if(V.mh&&ac.height>V.mh){ag=(ac.height-V.mh)/ac.height;af()}}if(V.h){ac.style.marginTop=Math.max(V.h-ac.height,0)/2+"px"}if(c[1]&&(A<c.length-1||V.loop)){B(ac).css({cursor:"pointer"}).click(D.next)}if(r){ac.style.msInterpolationMode="bicubic"}setTimeout(function(){ab(ac)},1)};setTimeout(function(){ac.src=ad},1)}else{if(ad){j.load(ad,function(ah,ag,ai){ab(ag==="error"?"Request unsuccessful: "+ai.statusText:B(this).children())})}}}}}};D.next=function(){if(!R){A=A<c.length-1?A+1:0;D.load()}};D.prev=function(){if(!R){A=A?A-1:c.length-1;D.load()}};D.close=function(){if(x&&!E){E=true;x=false;y(q,V.onCleanup);S.unbind("."+M+" ."+T);K.fadeTo("fast",0);Y.stop().fadeTo("fast",0,function(){y(i);F.remove();Y.add(K).css({opacity:1,cursor:"auto"}).hide();setTimeout(function(){E=false;y(U,V.onClosed)},1)})}};D.element=function(){return B(s)};D.settings=C;B(D.init)}(jQuery,this));
