(function(e){var a=window.EYE=function(){var b={init:[]};return{init:function(){e.each(b.init,function(c,d){d.call()})},extend:function(c){for(var d in c)if(c[d]!=undefined)this[d]=c[d]},register:function(c,d){b[d]||(b[d]=[]);b[d].push(c)}}}();e(a.init)})(jQuery);
(function(e){EYE.extend({getPosition:function(a,b){var c=0,d=0,f=a.style,g=false;if(b&&jQuery.curCSS(a,"display")=="none"){var h=f.visibility,i=f.position;g=true;f.visibility="hidden";f.display="block";f.position="absolute"}b=a;if(b.getBoundingClientRect){a=b.getBoundingClientRect();c=a.left+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft)-2;d=a.top+Math.max(document.documentElement.scrollTop,document.body.scrollTop)-2}else{c=b.offsetLeft;d=b.offsetTop;b=b.offsetParent;if(a!=
b)for(;b;){c+=b.offsetLeft;d+=b.offsetTop;b=b.offsetParent}if(jQuery.browser.safari&&jQuery.curCSS(a,"position")=="absolute"){c-=document.body.offsetLeft;d-=document.body.offsetTop}for(b=a.parentNode;b&&b.tagName.toUpperCase()!="BODY"&&b.tagName.toUpperCase()!="HTML";){if(jQuery.curCSS(b,"display")!="inline"){c-=b.scrollLeft;d-=b.scrollTop}b=b.parentNode}}if(g==true){f.display="none";f.position=i;f.visibility=h}return{x:c,y:d}},getSize:function(a){var b=parseInt(jQuery.curCSS(a,"width"),10),c=parseInt(jQuery.curCSS(a,
"height"),10),d=0,f=0;if(jQuery.curCSS(a,"display")!="none"){d=a.offsetWidth;f=a.offsetHeight}else{var g=a.style,h=g.visibility,i=g.position;g.visibility="hidden";g.display="block";g.position="absolute";d=a.offsetWidth;f=a.offsetHeight;g.display="none";g.position=i;g.visibility=h}return{w:b,h:c,wb:d,hb:f}},getClient:function(a){var b;if(a){b=a.clientWidth;a=a.clientHeight}else{a=document.documentElement;b=window.innerWidth||self.innerWidth||a&&a.clientWidth||document.body.clientWidth;a=window.innerHeight||
self.innerHeight||a&&a.clientHeight||document.body.clientHeight}return{w:b,h:a}},getScroll:function(a){var b=0,c=0,d=0,f=0,g=0,h=0;if(a&&a.nodeName.toLowerCase()!="body"){b=a.scrollTop;c=a.scrollLeft;d=a.scrollWidth;f=a.scrollHeight}else{if(document.documentElement){b=document.documentElement.scrollTop;c=document.documentElement.scrollLeft;d=document.documentElement.scrollWidth;f=document.documentElement.scrollHeight}else if(document.body){b=document.body.scrollTop;c=document.body.scrollLeft;d=document.body.scrollWidth;
f=document.body.scrollHeight}if(typeof pageYOffset!="undefined"){b=pageYOffset;c=pageXOffset}g=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;h=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}return{t:b,l:c,w:d,h:f,iw:g,ih:h}},getMargins:function(a,b){var c=jQuery.curCSS(a,"marginTop")||"",d=jQuery.curCSS(a,"marginRight")||"",f=jQuery.curCSS(a,"marginBottom")||"";a=jQuery.curCSS(a,"marginLeft")||"";return b?{t:parseInt(c,
10)||0,r:parseInt(d,10)||0,b:parseInt(f,10)||0,l:parseInt(a,10)}:{t:c,r:d,b:f,l:a}},getPadding:function(a,b){var c=jQuery.curCSS(a,"paddingTop")||"",d=jQuery.curCSS(a,"paddingRight")||"",f=jQuery.curCSS(a,"paddingBottom")||"";a=jQuery.curCSS(a,"paddingLeft")||"";return b?{t:parseInt(c,10)||0,r:parseInt(d,10)||0,b:parseInt(f,10)||0,l:parseInt(a,10)}:{t:c,r:d,b:f,l:a}},getBorder:function(a,b){var c=jQuery.curCSS(a,"borderTopWidth")||"",d=jQuery.curCSS(a,"borderRightWidth")||"",f=jQuery.curCSS(a,"borderBottomWidth")||
"";a=jQuery.curCSS(a,"borderLeftWidth")||"";return b?{t:parseInt(c,10)||0,r:parseInt(d,10)||0,b:parseInt(f,10)||0,l:parseInt(a,10)||0}:{t:c,r:d,b:f,l:a}},traverseDOM:function(a,b){b(a);for(a=a.firstChild;a;){EYE.traverseDOM(a,b);a=a.nextSibling}},getInnerWidth:function(a,b){var c=a.offsetWidth;return b?Math.max(a.scrollWidth,c)-c+a.clientWidth:a.clientWidth},getInnerHeight:function(a,b){var c=a.offsetHeight;return b?Math.max(a.scrollHeight,c)-c+a.clientHeight:a.clientHeight},getExtraWidth:function(a){if(e.boxModel)return(parseInt(e.curCSS(a,
"paddingLeft"))||0)+(parseInt(e.curCSS(a,"paddingRight"))||0)+(parseInt(e.curCSS(a,"borderLeftWidth"))||0)+(parseInt(e.curCSS(a,"borderRightWidth"))||0);return 0},getExtraHeight:function(a){if(e.boxModel)return(parseInt(e.curCSS(a,"paddingTop"))||0)+(parseInt(e.curCSS(a,"paddingBottom"))||0)+(parseInt(e.curCSS(a,"borderTopWidth"))||0)+(parseInt(e.curCSS(a,"borderBottomWidth"))||0);return 0},isChildOf:function(a,b,c){if(a==b)return true;if(!b||!b.nodeType||b.nodeType!=1)return false;if(a.contains&&
!e.browser.safari)return a.contains(b);if(a.compareDocumentPosition)return!!(a.compareDocumentPosition(b)&16);for(b=b.parentNode;b&&b!=c;){if(b==a)return true;b=b.parentNode}return false},centerEl:function(a,b){var c=EYE.getScroll(),d=EYE.getSize(a);if(!b||b=="vertically")e(a).css({top:c.t+(Math.min(c.h,c.ih)-d.hb)/2+"px"});if(!b||b=="horizontally")e(a).css({left:c.l+(Math.min(c.w,c.iw)-d.wb)/2+"px"})}});if(!e.easing.easeout)e.easing.easeout=function(a,b,c,d,f){return-d*((b=b/f-1)*b*b*b-1)+c}})(jQuery);
(function(e){EYE.extend({zoomimage:{libs:{},types:/\.jpg|\.jpeg|\.png|\.gif|\.bmp/g,current:null,moved:false,pointer:{x:0,y:0},diff:{x:0,y:0},trackKey:false,defaults:{opacity:0.3,border:0,shadow:6,duration:300,prevent:14,controls:true,caption:true,hideSource:false,centered:false,className:false,onLoad:function(){return false},beforeZoomIn:function(){return false},onZoomIn:function(){return false},beforeZoomOut:function(){return false},onZoomOut:function(){return false},onFocus:function(){return false},
controlsTrigger:"focus",easing:"linear",preload:"click",forceImage:false,singleOnly:true},template:['<div class="zoomimage">','<div class="zoomimage_s">','<div class="zoomimage_st">','<div class="zoomimage_stl"></div>','<div class="zoomimage_stc"></div>','<div class="zoomimage_str"></div>',"</div>",'<div class="zoomimage_sc">','<div class="zoomimage_scl"></div>','<div class="zoomimage_scc"></div>','<div class="zoomimage_scr"></div>',"</div>",'<div class="zoomimage_sb">','<div class="zoomimage_sbl"></div>',
'<div class="zoomimage_sbc"></div>','<div class="zoomimage_sbr"></div>',"</div>","</div>",'<img />','<div class="zoomimage_controls">','<a href="#" class="zoomimage_prev"></a>','<a href="#" class="zoomimage_next"></a>',"</div>",'<div class="zoomimage_caption"></div>','<div class="zoomimage_loading"></div>',"</div>"],click:function(){var a=this;a.blur();if(a.zoomimageCfg.loading===true)return false;a.zoomimageCfg.zoomed==false?EYE.zoomimage.zoomIn(a):EYE.zoomimage.zoomOut(a,false);return false},
zoomIn:function(a){if(a.zoomimageCfg.loaded===false){if(a.zoomimageCfg.loading!=true){a.zoomimageCfg.loading=true;EYE.zoomimage.preload(a)}}else if(a.zoomimageCfg.zoomed==true)EYE.zoomimage.focus(a);else{a.zoomimageCfg.singleOnly&&jQuery("div.zooimage").zoomimageClear();a.zoomimageCfg.beforeZoomIn.apply(a,[a.zoomimageCfg.box]);var b=EYE.getPosition(a,true),c=a.offsetHeight,d=a.offsetWidth,f=EYE.getScroll(),g=a.zoomimageCfg.border+a.zoomimageCfg.shadow,h=a.zoomimageCfg.width+g*2,i=a.zoomimageCfg.height+
g*2,j=a.zoomimageCfg.width/a.zoomimageCfg.height;if(f.iw/f.ih>j){if(i>f.ih){i=f.ih;h=parseInt(i*j,10)}}else if(h>f.iw){h=f.iw;i=parseInt(h/j,10)}var k=a.zoomimageCfg.centered?f.t+parseInt((f.ih-i)/2,10):Math.min(Math.max(f.t,b.y+(c-i)/2-g),f.t+f.ih-i),l=a.zoomimageCfg.centered?f.l+parseInt((f.iw-h)/2,10):Math.min(Math.max(f.l,b.x+(d-h)/2-g),f.l+f.iw-h),m=h-g*2,n=i-g*2;if(a.zoomimageCfg.hideSource===true)a.style.visibility="hidden";e("#"+a.zoomimageCfg.box).css({top:b.y+"px",left:b.x+"px",width:d+
"px",height:c+"px"}).find(">div").hide().end().find("img").attr("src",a.zoomimageCfg.src).css({top:0,left:0,width:"100%",height:"100%",display:"block",borderWidth:"0px"}).end().animate({width:m,height:n,top:k+g,left:l+g},a.zoomimageCfg.duration,a.zoomimageCfg.easing,function(){e(this).css({top:k+"px",left:l+"px",width:h+"px",height:i+"px"}).find("img").css({top:a.zoomimageCfg.shadow+"px",left:a.zoomimageCfg.shadow+"px",width:m+"px",height:n+"px",borderWidth:a.zoomimageCfg.border+"px"}).end().find(">div:first").find("div.zoomimage_sc").css("height",
i-a.zoomimageCfg.shadow*2+"px").end().show();a.zoomimageCfg.zoomed=true;EYE.zoomimage.focus(a);a.zoomimageCfg.onZoomIn.apply(a,[a.zoomimageCfg.box])})}},showControls:function(a){if(a!=undefined){if(a.zoomimageCfg==undefined)a=e("#"+e(a).attr("zoomimage")).get(0);var b,c,d=a.zoomimageCfg.border+a.zoomimageCfg.shadow;e("#"+a.zoomimageCfg.box).find("img").each(function(){c=parseInt(e.curCSS(this,"width"),10)}).end().get(0).zoomimageControls=true;a.zoomimageCfg.caption&&e("#"+a.zoomimageCfg.box).find(">div:eq(2)").stop().css({bottom:d+
"px",left:d+"px",width:c+"px"}).show().each(function(){this.style.height="auto";b=this.offsetHeight;this.style.height="0"}).animate({height:b},a.zoomimageCfg.duration);a.zoomimageCfg.controls&&EYE.zoomimage.libs[a.zoomimageCfg.lib]>1&&e("#"+a.zoomimageCfg.box).find(">div:eq(1)").show().each(function(){if(!a.zoomimageCfg.controlsHeight)a.zoomimageCfg.controlsHeight=this.offsetHeight;this.style.height="0"}).css({top:d+"px",left:d+"px",width:c+"px"}).animate({height:a.zoomimageCfg.controlsHeight},a.zoomimageCfg.duration)}},
zoomOut:function(a,b){var c,d,f,g;if(a.zoomimageCfg){if(a.zoomimageCfg.zoomed===false)return;a.zoomimageCfg.beforeZoomOut.apply(a,[a.zoomimageCfg.box]);c=document.getElementById(a.zoomimageCfg.box)}else{c=a;a=e("a[href="+e("img",c).attr("src")+"]").get(0)}if(a){d=EYE.getPosition(a,true);a.zoomimageCfg.zoomed=false;f=a.zoomimageCfg.border+a.zoomimageCfg.shadow;g={width:a.offsetWidth,height:a.offsetHeight}}else{f=EYE.zoomimage.defaults.border+EYE.zoomimage.defaults.shadow;g={width:0,height:0};d=EYE.getPosition(c,
true);d.y+=parseInt(c.offsetHeight/2,10);d.x+=parseInt(c.offsetWidth/2,10)}e(c).css({top:c.offsetTop+f+"px",left:c.offsetLeft+f+"px",width:c.offsetWidth-f*2+"px",height:c.offsetHeight-f*2+"px"}).find(">div").stop().hide().end().find("img").css({top:0,left:0,width:"100%",height:"100%",borderWidth:"0px"}).end().animate({top:d.y+"px",left:d.x+"px",width:g.width+"px",height:g.height+"px"},a?a.zoomimageCfg.duration:EYE.zoomimage.defaults.duration,a.zoomimageCfg.easing,function(){EYE.zoomimage.blur();e(this).hide();
if(a){if(a.zoomimageCfg.hideSource===true)a.style.visibility="visible";a.zoomimageCfg.onZoomOut.apply(a,[a.zoomimageCfg.box]);b||EYE.zoomimage.focus(e("div.zoomimage:visible:last").not(":animated").get(0))}else e(c).stop().remove()})},mouseOver:function(){var a=document.getElementById(e(this).attr("zoomimage"));a.zoomimageCfg.zoomed===true&&this.zoomimageControls==false&&EYE.zoomimage.showControls(a);return false},mouseOut:function(a){if(!EYE.isChildOf(this,a.relatedTarget,this)){e(this).find(">div:not(:first)").stop().hide();
this.zoomimageControls=false}return false},mouseDown:function(a){var b=document.getElementById(e(this).attr("zoomimage"));if(b){e.extend(EYE.zoomimage,{current:this,prevent:b.zoomimageCfg.prevent,moved:false,diff:{x:a.pageX-this.offsetLeft,y:a.pageY-this.offsetTop},pointer:{x:a.pageX,y:a.pageY}});e(document).bind("mousemove",EYE.zoomimage.mouseMove).bind("mouseup",EYE.zoomimage.mouseUp)}else e(this).zoomimageClear();return false},mouseMove:function(a){var b=Math.abs(EYE.zoomimage.pointer.x-a.pageX),
c=Math.abs(EYE.zoomimage.pointer.y-a.pageY);if(EYE.zoomimage.moved===false){if(b>EYE.zoomimage.prevent||c>EYE.zoomimage.prevent){EYE.zoomimage.moved=true;e(EYE.zoomimage.current).addClass("zoomimage_move");e(EYE.zoomimage.current).is(".zoomimage_focused")||EYE.zoomimage.focus(EYE.zoomimage.current)}}else{EYE.zoomimage.current.style.top=a.pageY-EYE.zoomimage.diff.y+"px";EYE.zoomimage.current.style.left=a.pageX-EYE.zoomimage.diff.x+"px"}return false},mouseUp:function(){e(EYE.zoomimage.current).removeClass("zoomimage_move");
EYE.zoomimage.current=null;e(document).unbind("mousemove",EYE.zoomimage.mouseMove).unbind("mouseup",EYE.zoomimage.mouseUp);return false},imageClick:function(a){e(document).unbind("mousemove",EYE.zoomimage.mouseMove).unbind("mouseup",EYE.zoomimage.mouseUp);var b=document.getElementById(e(this).attr("zoomimage"));if(b)if(EYE.zoomimage.moved===false&&e(this).is(".zoomimage_focused"))if(e(a.target).is("a")){EYE.zoomimage.zoomNext(b,a.target.className=="zoomimage_next"?1:-1);var c=true}else EYE.zoomimage.zoomOut(b,
c||false);else e(this).is(".zoomimage_focused")||EYE.zoomimage.focus(this);else e(this).zoomimageClear();return false},clear:function(){var a=this;if(a.size()==0)a=e("div.zoomimage");return a.each(function(){var b=document.getElementById(e(this).attr("zoomimage"));b?EYE.zoomimage.zoomOut(b,false):EYE.zoomimage.zoomOut(this,false)})},zoomNext:function(a,b){if(a.zoomimageCfg.zoomed!==false){EYE.zoomimage.zoomOut(a,true);b=a.zoomimageCfg.iteration+b;a=e(a).attr("zoomimage");var c=EYE.zoomimage.libs[a];
if(b<0)b=c-1;else if(b>=c)b=0;EYE.zoomimage.zoomIn(e('a[zoomimage="'+a+'"]').get(b))}},keyPressed:function(a){var b=e("div.zoomimage_focused");if(b.size()==1){a=a.charCode||a.keyCode||-1;b=e("#"+e(b).attr("zoomimage")).get(0);var c=e(b).attr("zoomimage");switch(a){case 35:if(EYE.zoomimage.libs[c]>1&&EYE.zoomimage.libs[c]-1!=b.zoomimageCfg.iteration){EYE.zoomimage.zoomNext(b,EYE.zoomimage.libs[c]-b.zoomimageCfg.iteration-1);return false}break;case 36:if(EYE.zoomimage.libs[c]>1&&b.zoomimageCfg.iteration!=
0){EYE.zoomimage.zoomNext(b,-b.zoomimageCfg.iteration);return false}break;case 40:case 37:case 8:case 33:case 80:case 112:if(EYE.zoomimage.libs[c]>1){EYE.zoomimage.zoomNext(b,-1);return false}break;case 38:case 39:case 34:case 32:case 110:case 78:if(EYE.zoomimage.libs[c]>1){EYE.zoomimage.zoomNext(b,1);return false}break;case 27:EYE.zoomimage.zoomOut(b,false);return false}}},focus:function(a){if(a!=undefined){if(a.zoomimageCfg==undefined)a=e("#"+e(a).attr("zoomimage")).get(0);else var b=true;EYE.zoomimage.blur(a);
e("#"+a.zoomimageCfg.box).not(".zoomimage_focused").addClass("zoomimage_focused");a.zoomimageCfg.onFocus.apply(a,[a.zoomimageCfg.box]);if(a.zoomimageCfg.controlsTrigger=="focus"||b)EYE.zoomimage.showControls(a)}},blur:function(a){e("div.zoomimage_focused").not("#"+(a==undefined?"fakezoomimage":a.zoomimageCfg.box)).removeClass("zoomimage_focused").each(function(){this.zoomimageControls=false}).find(">div:not(:first)").stop().hide()},preload:function(a){var b=e("#"+a.zoomimageCfg.box).show();b.find(">div, img").hide();
var c=EYE.getPosition(a,true);b.find(">div:last").show().end().css({top:c.y+"px",left:c.x+"px",width:a.offsetWidth+"px",height:a.offsetHeight+"px"});var d=new Image;d.src=a.href;if(d.complete)EYE.zoomimage.markPreloaded(d,a);else d.onload=function(){EYE.zoomimage.markPreloaded(d,a)}},markPreloaded:function(a,b){e.extend(b.zoomimageCfg,{loaded:true,width:a.width,height:a.height,src:a.src});e("#"+b.zoomimageCfg.box).find("div.zoomimage_loading").hide();if(b.zoomimageCfg.loading){b.zoomimageCfg.loading=
false;EYE.zoomimage.zoomIn(b)}b.zoomimageCfg.onLoad.apply(b,[b.zoomimageCfg.box])},init:function(a){var b=parseInt(Math.random()*2E3,10);EYE.zoomimage.libs[b]=0;a=e.extend({lib:b},EYE.zoomimage.defaults,a||{});return this.each(function(){var c=e(this),d=this;if(d.href&&a.forceImage||d.href.toLowerCase().match(EYE.zoomimage.types)!=null){d.zoomimageCfg=e.extend({},a,{zoomed:false,loading:false,loaded:false,animated:false,src:d.href,iteration:EYE.zoomimage.libs[b],box:"zoomimage_"+parseInt(Math.random()*
2E3,10)+""});EYE.zoomimage.libs[b]++;c.bind("click",EYE.zoomimage.click).attr("zoomimage",b).attr("zoomimageBox",d.zoomimageCfg.box).addClass("zoomimage_link");var f=c.attr("id");if(!f){f=d.zoomimageCfg.box+"_trigger";c.attr("id",f)}c=e(d).attr("title");if(c==""||c==false)d.zoomimageCfg.caption=false;e(EYE.zoomimage.template.join("")).attr("id",d.zoomimageCfg.box).attr("zoomimage",f).addClass(d.zoomimageCfg.className).appendTo(document.body).bind("mousedown",EYE.zoomimage.mouseDown).bind("click",
EYE.zoomimage.imageClick).each(function(){this.zoomimageControls=false;d.zoomimageCfg.controlsTrigger!="focus"&&e(this).bind("mouseover",EYE.zoomimage.mouseOver).bind("mouseout",EYE.zoomimage.mouseOut)}).find(">div").not(":first").css("opacity",d.zoomimageCfg.opacity).end().filter("div:eq(2)").html("<p>"+c+"</p>");d.zoomimageCfg.preload=="load"&&EYE.zoomimage.preload(d);if(EYE.zoomimage.trackKey===false){EYE.zoomimage.trackKey=true;e(document).bind("keydown",EYE.zoomimage.keyPressed)}}})}}});e.fn.extend({zoomimage:EYE.zoomimage.init,
zoomimageClear:EYE.zoomimage.clear})})(jQuery);