/*
 CSS Image Gallery
 Version: 1.1.2
 (c) 2011 DMXzone.com
 @build 23-08-2011 13:21:24
*/
(function(a){a.delayedTask=function(a,c,d){var e=null;this.delay=function(h,g,i,f){e&&clearTimeout(e);a=g||a;c=i||c;d=f||d;e=setTimeout(function(){a.call(c,d)},h)};this.cancel=function(){e&&(clearTimeout(e),e=null)}};if(!a.fn.stop)a.fn.stop=function(){this.each(function(){a.dequeue(this,"fx")});return this}})(jQuery);function hImgRes(a){this.src=a;this.loading=this.loaded=!1;this.onfocus=this.onblur="";this.toString=function(){return this.src}}
jQuery.dmxGallery={aMessages:{missingList:"The list with images is missing"},bDebug:!0,build:function(a){return this.each(function(){if($(this).data("dmxGallery")!=="loaded"){$(this).data("dmxGallery","loaded");var b=this;if(!this.id)this.id="dmxZoneGallery_"+jQuery.dmxGallery.counter++;var c=this.id;b.isIE6=window.XMLHttpRequest==void 0&&ActiveXObject!=void 0;var d={width:500,height:380,containerTag:"div",containerClass:"dmxGallery",imageHolderClass:"dmxImageHolder",prevLinkText:"",nextLinkText:"",
playLinkText:"",pauseLinkText:"",prevLinkClass:"dmxPrevious",nextLinkClass:"dmxNext",playLinkClass:"dmxPlay",pauseLinkClass:"dmxPause",swapImageClass:"dmxSwap",thumbWidth:95,thumbHeight:80,thumbPadding:5,thumbHolderHeight:80,thumbHolderWidth:"auto",thumbHolderPosition:"right",thumbHolderHorizontal:!1,thumbHolderVertical:!0,thumbShowOnHover:!1,thumbListHidden:!0,captionPosition:"top",playerDelay:3,autoPlay:!1,showInfoMessage:!1,autosize:!0,loaded:0,messageHidden:!0,captionOpacity:40,imgIndex:0,
preloadTreshold:2,allPreloaded:!1};if(a)b.options=jQuery.extend(d,a);jQuery(this).attr("tabIndex",-1);if(jQuery("ul",this).length==0)jQuery.dmxGallery.debug(jQuery.dmxGallery.aMessages.missingList);else{var e=jQuery("."+d.imageHolderClass,this);e.length==0&&(e=jQuery('<div class="'+d.imageHolderClass+'" />').append(jQuery("ul",this)).appendTo(jQuery(this)));jQuery(this).height(d.height+"px");jQuery(this).width(d.width+"px");b.thumbList=[];b.imageList=[];b.linkList=[];jQuery(e).find("ul").css("display",
"none");jQuery(e).find("ul li").each(function(){var a=jQuery(this).find(".image"),c=new hImgRes(a.attr("src"));if((a=a.parent().get(0))&&a.tagName&&a.tagName.toUpperCase()=="A"){if(a.onfocus)c.onfocus=a.onfocus,a.removeAttribute("onfocus");if(a.onblur)c.onblur=a.onblur,a.removeAttribute("onblur");a.style.display="block";a.style.display="inline-block";a.style.height="100%";a.style.zoom=1;b.linkList.push(a)}else b.linkList.push(null);b.imageList.push(c);jQuery("img",this).remove()});c=jQuery("#"+c+
"_thumb");c.length>0?(jQuery(c).find("ul li").each(function(){b.thumbList.push(new hImgRes(jQuery(this).find("img").attr("src")))}),jQuery(c).empty()):b.thumbList=b.imageList;c=jQuery.dmxGallery.buildThumbnailList(b);jQuery.dmxGallery.buildMessage(b);b.options.messageHide=new jQuery.delayedTask(function(){jQuery.dmxGallery.doHideMessage(b)});jQuery.dmxGallery.buildImageHolders(b);jQuery.dmxGallery.buildCaption(b);jQuery.dmxGallery.buildGalleryNavigation(b);jQuery.dmxGallery.buildWaiting(b);window.setTimeout(function(){jQuery.dmxGallery.showImage(b,
0)},10);jQuery.dmxGallery.showMessage(b,"loading images...");jQuery.dmxGallery.hideMessage(b);b.options.player=new jQuery.delayedTask(function(){jQuery.dmxGallery.nextImage(b);jQuery.dmxGallery.play(b)});jQuery(b).keydown(function(a){jQuery.event.fix(a);a.keyCode==37&&jQuery.dmxGallery.previousImage(b);a.keyCode==39&&jQuery.dmxGallery.nextImage(b)});b.options.thumbsHide=new jQuery.delayedTask(function(){jQuery.dmxGallery.hideThumbnailList(b)});b.options.thumbsShow=new jQuery.delayedTask(function(){jQuery.dmxGallery.showThumbnailList(b)});
jQuery(b).hover(function(a){jQuery.event.fix(a);b.options.thumbShowOnHover&&(b.options.thumbsHide.cancel(),b.options.thumbsShow.delay(100))},function(a){jQuery.event.fix(a);b.options.thumbShowOnHover&&!b.options.swapping&&(b.options.thumbsShow.cancel(),b.options.thumbsHide.delay(400))});jQuery(c).keydown(function(a){jQuery.event.fix(a);if(a.keyCode==37)return jQuery.dmxGallery.scrollThumbnailList(b,"left"),a.preventDefault(),a.stopPropagation(),!1;if(a.keyCode==39)return jQuery.dmxGallery.scrollThumbnailList(b,
"right"),a.preventDefault(),a.stopPropagation(),!1});jQuery(this).bind("focus",function(){jQuery(this).addClass("dmxGalleryFocused")});b.options.autoPlay&&jQuery.dmxGallery.play(b)}}})},pngFix:function(a){if(a.currentStyle.backgroundImage.indexOf(".png")!=-1)a.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+a.currentStyle.backgroundImage.split('"')[1]+", sizingMethod='crop')",a.runtimeStyle.backgroundImage="none";else if(a.tagName=="IMG"&&a.src.indexOf(".png")!=-1)a.runtimeStyle.filter=
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+src+", sizingMethod='scale')",a.src="transparent.gif"},buildGalleryNavigation:function(a){var b=jQuery(a).find(".imageMainContainer:first"),c=jQuery('<a href="javascript:;" class="'+a.options.prevLinkClass+'" />').click(function(){jQuery(a).focus();jQuery.dmxGallery.previousImage(a)}).appendTo(b).append(jQuery("<span />").html(a.options.prevLinkText)),d=jQuery('<a href="javascript:;" class="'+a.options.nextLinkClass+'" />').click(function(){jQuery(a).focus();
jQuery.dmxGallery.nextImage(a)}).appendTo(b).append(jQuery("<span />").html(a.options.nextLinkText)),e=jQuery('<a href="javascript:;" class="'+a.options.playLinkClass+'" />').click(function(){jQuery(a).focus();jQuery.dmxGallery.play(a)}).appendTo(b).append(jQuery("<span />").html(a.options.playLinkText)),b=jQuery('<a href="javascript:;" class="'+a.options.pauseLinkClass+'" />').css({display:"none"}).click(function(){jQuery(a).focus();jQuery.dmxGallery.pause(a)}).appendTo(b).append(jQuery("<span />").html(a.options.pauseLinkText));
a.isIE6&&(jQuery.dmxGallery.pngFix(c.get(0)),jQuery.dmxGallery.pngFix(d.get(0)),jQuery.dmxGallery.pngFix(e.get(0)),jQuery.dmxGallery.pngFix(b.get(0)))},buildImageHolders:function(a){var b=a.id,c=jQuery("#"+b+"_thumb");jQuery(a).width();jQuery(a).height();var d={left:parseInt(jQuery(a).css("paddingLeft"))||0,top:parseInt(jQuery(a).css("paddingTop"))||0,right:parseInt(jQuery(a).css("paddingRight"))||0,bottom:parseInt(jQuery(a).css("paddingBottom"))||0,overflow:"hidden",position:"absolute"};if(!a.options.thumbShowOnHover)switch(a.options.thumbHolderPosition){case "left":d.left+=
a.options.thumbHolderWidth+parseInt(c.css("paddingLeft"))||0+parseInt(c.css("paddingRight"))||0+parseInt(c.css("marginLeft"))||0+parseInt(c.css("marginRight"))||0;break;case "right":d.right+=a.options.thumbHolderWidth+parseInt(c.css("paddingLeft"))||0+parseInt(c.css("paddingRight"))||0+parseInt(c.css("marginLeft"))||0+parseInt(c.css("marginRight"))||0;break;case "top":d.top+=a.options.thumbHolderHeight+parseInt(c.css("paddingTop"))||0+parseInt(c.css("paddingBottom"))||0+parseInt(c.css("marginTop"))||
0+parseInt(c.css("marginBottom"))||0;break;case "bottom":d.bottom+=a.options.thumbHolderHeight+parseInt(c.css("paddingTop"))||0+parseInt(c.css("paddingBottom"))||0+parseInt(c.css("marginTop"))||0+parseInt(c.css("marginBottom"))||0}d=jQuery('<div class="imageMainContainer" id="'+b+'_c0" />').appendTo(a).css(d);jQuery('<div class="imageContainer" id="'+b+'_1" />').appendTo(d).hide();jQuery('<div class="imageContainer" id="'+b+'_2" />').appendTo(d).hide();if(a.isIE6||jQuery.browser.msie&&!jQuery.boxModel){var b=
"this.parentNode.style.pixelWidth - (parseInt(this.parentNode.currentStyle.borderTopWidth) || 0) - (parseInt(this.parentNode.currentStyle.borderBottomWidth) || 0) - this.style.pixelTop - this.style.pixelBottom",e="this.parentNode.style.pixelHeight - (parseInt(this.parentNode.currentStyle.borderTopWidth) || 0) - (parseInt(this.parentNode.currentStyle.borderBottomWidth) || 0) - this.style.pixelTop - this.style.pixelBottom";a.options.thumbHolderVertical?(jQuery.boxModel&&(b="this.parentNode.style.pixelWidth - (parseInt(this.currentStyle.borderLeftWidth) || 0) - (parseInt(this.currentStyle.borderRightWidth) || 0)",
a.options.thumbShowOnHover||(b+=" - "+a.options.thumbHolderWidth),e="this.parentNode.style.pixelHeight - (parseInt(this.currentStyle.borderBottomWidth) || 0) - (parseInt(this.currentStyle.borderTopWidth) || 0)"),c.get(0).style.setExpression("height",e)):(jQuery.boxModel&&(b="this.parentNode.style.pixelWidth - (parseInt(this.currentStyle.borderLeftWidth) || 0) - (parseInt(this.currentStyle.borderRightWidth) || 0)",e="this.parentNode.style.pixelHeight - (parseInt(this.currentStyle.borderBottomWidth) || 0) - (parseInt(this.currentStyle.borderTopWidth) || 0)",
a.options.thumbShowOnHover||(e+=" - "+a.options.thumbHolderHeight)),c.get(0).style.setExpression("width",b));d.get(0).style.setExpression("width",b);d.get(0).style.setExpression("height",e)}d.mousewheel(function(b,c){c>0&&jQuery.dmxGallery.previousImage(a);c<0&&jQuery.dmxGallery.nextImage(a);a.focus();b.preventDefault();b.stopPropagation();return!1})},buildWaiting:function(a){jQuery('<div class="dmxWaiting" />').css({width:jQuery(a).width(),height:jQuery(a).height()}).appendTo(a)},showWaiting:function(a){jQuery(".dmxWaiting",
a).css({display:"block"});jQuery(".dmxWaiting",a).animate({opacity:1})},hideWaiting:function(a){jQuery(".dmxWaiting",a).animate({opacity:0},"fast","linear",function(){jQuery(".dmxWaiting",a).css({display:"none"})})},buildMessage:function(a){var b=0.5;a.options.showInfoMessage||(b=0);b=jQuery('<div class="message" />').css({opacity:b}).appendTo(a);b.css({top:jQuery(a).height()-b.height()})},showMessage:function(a,b){if(a.options.showInfoMessage){var c=jQuery(a).find("div.message"),d=jQuery(a).height(),
e=c.height();a.options.messageHidden&&c.animate({top:d-e,opacity:0.5},"slow");c.text(b);a.options.messageHide.cancel();a.options.messageHidden=!1}},hideMessage:function(a){a.options.messageHide&&a.options.messageHide.delay(1E3)},doHideMessage:function(a){var b=jQuery(a).find("div.message"),c=jQuery(a).height();jQuery(b).animate({top:c,opacity:0},"slow");a.options.messageHidden=!0},buildCaption:function(a){var b=jQuery(a).find(".imageMainContainer:first"),b=jQuery('<div class="imageCaption" />').appendTo(b);
b.height();var c;c=a.options.captionPosition=="bottom"?jQuery(a).height():-jQuery(b).height();b.css({top:c,left:0,width:"100%",opacity:a.options.captionOpacity/100,display:"none"})},showCaption:function(a){if(jQuery.dmxGallery.captionHidden(a)){var b=jQuery("div.imageCaption",a),c=jQuery(a).find("div.dmxImageHolder").find("ul li");if(c.eq(a.options.imgIndex).find("h3").length>0||c.eq(a.options.imgIndex).find("p").length>0){var d=jQuery(a).height();b.find("h3").remove();b.find("p").remove();c.eq(a.options.imgIndex).find("h3").clone().appendTo(b);
c.eq(a.options.imgIndex).find("p").clone().appendTo(b);jQuery(b).css({display:"block"});var e;a.options.captionPosition=="bottom"?(e=d+b.height(),a.options.thumbShowOnHover||a.options.thumbHolderHorizontal&&(e-=a.options.thumbHolderHeight)):e=-b.height();b.css({top:e});a.options.captionPosition=="bottom"?e-=2*b.height():e=0;window.setTimeout(function(){b.animate({top:e,opacity:a.options.captionOpacity/100},"slow")},100)}}else jQuery.dmxGallery.hideCaption(a,!0)},hideCaption:function(a,b){var c=jQuery("div.imageCaption",
a),d;d=a.options.captionPosition=="bottom"?jQuery(a).height():-jQuery(c).height();b?c.animate({top:d,opacity:0},"slow","linear",function(){jQuery(c).css({display:"none"});jQuery.dmxGallery.showCaption(a)}):c.animate({top:d,opacity:0},"slow")},captionHidden:function(a){var b=jQuery("div.imageCaption",a),a=jQuery(a).height(),c=parseInt(b.css("top"))||0;if(jQuery(b).css("display")=="none"||a==c)return!0;return!1},buildThumbnailList:function(a){var b=a.id;jQuery(a).width();jQuery(a).height();jQuery(a).offset();
if(a.options.thumbHolderPosition=="top"||a.options.thumbHolderPosition=="bottom")a.options.thumbHolderHorizontal=!0,a.options.thumbHolderVertical=!1;var c=jQuery("#"+b+"_thumb");c.length==0&&(c=jQuery('<div class="dmxThumbList" id="'+b+'_thumb" />'));c.css({left:"auto",top:"auto",right:"auto",bottom:"auto"});a.options.thumbHolderVertical&&c.addClass("dmxThumbListVertical");a.options.thumbHolderHeight=a.options.thumbHeight+2*a.options.thumbPadding;a.options.thumbHolderWidth=a.options.thumbWidth+2*
a.options.thumbPadding;var b=parseInt(jQuery(a).css("paddingLeft"))||0,d=parseInt(jQuery(a).css("paddingTop"))||0,e=parseInt(jQuery(a).css("paddingRight"))||0,h=parseInt(jQuery(a).css("paddingBottom"))||0;switch(a.options.thumbHolderPosition){case "top":c.css({right:e,left:b,top:d,width:"auto",height:a.options.thumbHolderHeight});break;case "bottom":c.css({right:e,left:b,bottom:h,width:"auto",height:a.options.thumbHolderHeight});break;case "left":c.css({top:d,left:b,bottom:h,width:a.options.thumbHolderWidth,
height:"auto"});break;case "right":c.css({top:d,right:e,bottom:h,width:a.options.thumbHolderWidth,height:"auto"})}var g=jQuery("<ul />");c.append(g).appendTo(a);var i=0,f=0;jQuery.each(a.thumbList,function(b,c){var d=jQuery("<li />").css({width:a.options.thumbWidth,height:a.options.thumbHeight,margin:a.options.thumbPadding,display:"inline"}),e=jQuery('<a href="#" />').css({width:a.options.thumbWidth,height:a.options.thumbHeight}).click(function(){jQuery.dmxGallery.showImage(a,b);return!1}).appendTo(d);
d.appendTo(g);jQuery.boxModel?e.css({width:a.options.thumbWidth-parseInt(e.css("borderLeftWidth"))||0-parseInt(e.css("borderRightWidth"))||0,height:a.options.thumbHeight-parseInt(e.css("borderTopWidth"))||0-parseInt(e.css("borderBottomWidth"))||0}):e.css({width:a.options.thumbWidth,height:a.options.thumbHeight});e.hover(function(){var b=this;window.setTimeout(function(){jQuery&&(jQuery.boxModel?jQuery(b).css({width:a.options.thumbWidth-parseInt(e.css("borderLeftWidth"))||0-parseInt(e.css("borderRightWidth"))||
0,height:a.options.thumbHeight-parseInt(e.css("borderTopWidth"))||0-parseInt(e.css("borderBottomWidth"))||0}):jQuery(b).css({width:a.options.thumbWidth,height:a.options.thumbHeight}))},1)},function(){var b=this;window.setTimeout(function(){jQuery&&(jQuery.boxModel?jQuery(b).css({width:a.options.thumbWidth-parseInt(e.css("borderLeftWidth"))||0-parseInt(e.css("borderRightWidth"))||0,height:a.options.thumbHeight-parseInt(e.css("borderTopWidth"))||0-parseInt(e.css("borderBottomWidth"))||0}):jQuery(b).css({width:a.options.thumbWidth,
height:a.options.thumbHeight}))},1)});jQuery("<img />").load(function(){c.loaded=!0;a.options.loaded++;jQuery.dmxGallery.showMessage(a,"loaded "+a.options.loaded+" images");jQuery.dmxGallery.hideMessage(a);d.css("backgroundImage",'url( "'+jQuery(this).attr("src")+'" )');d.css("backgroundPosition","center center")}).attr("src",c.toString());i+=a.options.thumbWidth+2*a.options.thumbPadding;f+=a.options.thumbHeight+2*a.options.thumbPadding});a.options.thumbHolderVertical?g.css({height:f,left:0,top:0}):
g.css({width:i,left:0,top:0});b=jQuery('<a href="javascript:;" class="'+a.options.prevLinkClass+'" />').click(function(b){jQuery.dmxGallery.scrollThumbnailList(a,"left");b.preventDefault();b.stopPropagation();return!1}).appendTo(c).append(jQuery("<span />").html(a.options.prevLinkText));d=jQuery('<a href="javascript:;" class="'+a.options.nextLinkClass+'" />').click(function(b){jQuery.dmxGallery.scrollThumbnailList(a,"right");b.preventDefault();b.stopPropagation();return!1}).appendTo(c).append(jQuery("<span />").html(a.options.nextLinkText));
a.isIE6&&(jQuery.dmxGallery.pngFix(b.get(0)),jQuery.dmxGallery.pngFix(d.get(0)));c.mousewheel(function(b,c){c>0&&jQuery.dmxGallery.scrollThumbnailList(a,"left",200);c<0&&jQuery.dmxGallery.scrollThumbnailList(a,"right",200);a.focus();b.preventDefault();b.stopPropagation();return!1});return c},hideThumbnailList:function(a){var b=jQuery("#"+a.id+"_thumb");a.options.thumbListHidden=!0;b.animate({opacity:0},200)},showThumbnailList:function(a){if(a.options.thumbListHidden){var b=jQuery("#"+a.id+"_thumb");
a.options.thumbListHidden=!1;b.animate({opacity:1},200)}},initThumbnailListEvents:function(a){a=jQuery("#"+a.id+"_thumb");a.find("ul");a.mousemove(function(a){jQuery.event.fix(a)});a.mouseout(function(a){jQuery.event.fix(a)})},scrollThumbnailList:function(a,b,c){c=c?c:400;if(!a.options.scrollingThumbnails){var d=jQuery("#"+a.id+"_thumb").find("ul"),e=jQuery(a).width(),h=jQuery(a).height(),g=parseInt(jQuery(d).css("left"));g||(g=0,jQuery(d).css({left:0}));var i=jQuery(d).outerWidth(),f=parseInt(jQuery(d).css("top"));
f||(f=0,jQuery(d).css({top:"0px"}));var j=jQuery(d).outerHeight();if(a.options.thumbHolderHorizontal)switch(b){case "left":if(g<0)b=g+Math.min(e,Math.abs(g)),a.options.scrollingThumbnails=!0,jQuery(d).stop(!0,!0).animate({left:b},c,"linear",function(){a.options.scrollingThumbnails=!1});break;case "right":if(Math.abs(g)<i-e)b=g-Math.min(e,Math.abs(i-e+g)),a.options.scrollingThumbnails=!0,jQuery(d).stop(!0,!0).animate({left:b},c,"linear",function(){a.options.scrollingThumbnails=!1})}else if(a.options.thumbHolderVertical)switch(b){case "left":if(f<
0)b=f+Math.min(h,Math.abs(f)),a.options.scrollingThumbnails=!0,jQuery(d).stop(!0,!0).animate({top:b},c,"linear",function(){a.options.scrollingThumbnails=!1});break;case "right":if(Math.abs(f)<j-h)b=f-Math.min(h,Math.abs(j-h+f)),a.options.scrollingThumbnails=!0,jQuery(d).stop(!0,!0).animate({top:b},c,"linear",function(){a.options.scrollingThumbnails=!1})}}},fixThumbnailListPosition:function(a){if(!a.options.scrollingThumbnails){var b=jQuery("#"+a.id+"_thumb"),c=jQuery(b).width(),b=b.find("ul"),d=parseInt(jQuery(b).css("left"));
d||(d=0,jQuery(b).css({left:0}));var e=jQuery(b).outerWidth();e+d<c&&jQuery(b).animate({left:c-e},1E3,"linear",function(){a.options.scrollingThumbnails=!1})}},markThumbnail:function(a,b){var c=jQuery("#"+a.id+"_thumb").find("ul a");c.removeClass("selected");c.eq(b).addClass("selected");jQuery.dmxGallery.scrollMarkedThumbIntoView(a,b)},scrollMarkedThumbIntoView:function(a,b){var c=jQuery("#"+a.id+"_thumb");c.find("ul a");var d=jQuery(c).width(),e=jQuery(c).height(),c=c.find("ul"),h=parseInt(jQuery(c).css("left"))||
0,g=parseInt(jQuery(c).css("top"))||0;jQuery(c).outerWidth();var i=a.options.thumbWidth+2*a.options.thumbPadding,f=a.options.thumbHeight+2*a.options.thumbPadding;a.options.thumbHolderHorizontal?(e=b*i,e+h<0&&jQuery(c).stop(!0,!0).animate({left:-e},300,"linear",function(){a.options.scrollingThumbnails=!1}),e+h+i>d&&jQuery(c).stop(!0,!0).animate({left:-e+d-i},300,"linear",function(){a.options.scrollingThumbnails=!1})):a.options.thumbHolderVertical&&(d=b*f,d+g<0&&jQuery(c).stop(!0,!0).animate({top:-d},
300,"linear",function(){a.options.scrollingThumbnails=!1}),d+g+f>e&&jQuery(c).stop(!0,!0).animate({top:-d+e-f},300,"linear",function(){a.options.scrollingThumbnails=!1}));jQuery.dmxGallery.fixThumbnailListPosition(a)},nextImage:function(a){a.options.imgIndex+=1;var b=jQuery(a).find("div.dmxImageHolder").find("ul li");if(a.options.imgIndex>=b.length)a.options.imgIndex=0;jQuery.dmxGallery.swapImages(a,a.options.imgIndex)},previousImage:function(a){a.options.imgIndex-=1;var b=jQuery(a).find("div.dmxImageHolder").find("ul li");
if(a.options.imgIndex<0)a.options.imgIndex=b.length-1;jQuery.dmxGallery.swapImages(a,a.options.imgIndex)},play:function(a){jQuery("a.dmxPause",a).css({display:""});jQuery("a.dmxPlay",a).css({display:"none"});a.options.player.delay(a.options.playerDelay*1E3)},pause:function(a){jQuery("a.dmxPause",a).css({display:"none"});jQuery("a.dmxPlay",a).css({display:""});a.options.player.cancel()},swapImages:function(a,b){a.options.swapping=!0;jQuery("."+a.options.imageHolderClass,a);jQuery("div.imageContainer",
a).eq(1).empty();var c=jQuery('<img id="'+jQuery(a).find(".imageContainer").eq(1).attr("id")+'_image" border="0" />');jQuery(a).find(".imageContainer").eq(1).append(c);a.linkList[b]&&c.wrap(a.linkList[b]);a.imageList[b].loaded?(c.attr("src",a.imageList[b]),jQuery.dmxGallery.hideWaiting(a),jQuery.dmxGallery.doSwapImages(a),a.options.autosize?jQuery.dmxGallery.resizeGalleryToContent(a):window.setTimeout(function(){jQuery.dmxGallery.showCaption(a)},100),a.options.swapping=!1,a.imageList[b].onfocus&&
(c=c.parent().get(0),a.imageList[b].onfocus.call(c))):(a.imageList[b].loading=!0,c.load(function(){a.imageList[b].loading=!1;a.imageList[b].loaded=!0;jQuery.dmxGallery.hideWaiting(a);jQuery.dmxGallery.doSwapImages(a);a.options.autosize?jQuery.dmxGallery.resizeGalleryToContent(a):window.setTimeout(function(){jQuery.dmxGallery.showCaption(a)},100);a.options.swapping=!1;a.imageList[b].onfocus&&a.imageList[b].onfocus.call(this.parentNode)}).attr("src",a.imageList[b]));jQuery.dmxGallery.markThumbnail(a,
b);jQuery.dmxGallery.preloadImages(a,b);if(typeof soundManager!="undefined")try{soundManager.play("gallery")}catch(d){}},doSwapImages:function(a){jQuery("div.imageContainer",a).eq(1).insertBefore(jQuery("div.imageContainer",a).eq(0));jQuery("div.imageContainer",a).eq(0).stop(!0,!0).fadeIn(1E3);jQuery("div.imageContainer",a).eq(1).stop(!0,!0).fadeOut(1E3)},showImage:function(a,b){jQuery.dmxGallery.showWaiting(a);var c=a.options.imgIndex;b!=c&&a.imageList[c].onblur&&a.imageList[c].onblur.call(a.linkList[c]);
a.options.imgIndex=b;jQuery.dmxGallery.swapImages(a,a.options.imgIndex)},preloadImages:function(a,b){if(!a.options.allPreloaded){for(var c=0;c<a.imageList.length;c++)if(!a.imageList[c].loaded)break;if(c==a.imageList.length)a.options.allPreloaded=!0;else for(var c=function(a,b,c){for(var d=[],f=1,c=c>a.length?Math.floor(a.length/2):c;f<=c;)d[d.length]=b-f<0?a.length+b-f:b-f,d[d.length]=b+f>=a.length?(b+f)%a.length:b+f,f++;return d}(a.imageList,b,a.options.preloadTreshold),d;c.length>0;)if(d=c.shift(),
!a.imageList[d].loaded)a.imageList[d].loading=!0,jQuery("<img />").load(function(){a.imageList[d].loading=!1;a.imageList[d].loaded=!0}).attr("src",a.imageList[d])}},resizeGalleryToContent:function(a){var b=jQuery("#"+a.id+"_thumb"),c=jQuery("div.imageMainContainer:first",a),d=jQuery("div.imageContainer:first",a).attr("id")+"_image",e=jQuery("#"+d);jQuery(a).width()==e.width()&&jQuery(a).height()==e.height()?window.setTimeout(function(){jQuery.dmxGallery.showCaption(a)},10):(d=e.width(),e=e.height(),
a.options.thumbShowOnHover||(a.options.thumbHolderHorizontal?e+=a.options.thumbHolderHeight+parseInt(b.css("paddingTop"))||0+parseInt(b.css("paddingBottom"))||0+parseInt(b.css("marginTop"))||0+parseInt(b.css("marginBottom"))||0:a.options.thumbHolderVertical&&(d+=a.options.thumbHolderWidth+parseInt(b.css("paddingLeft"))||0+parseInt(b.css("paddingRight"))||0+parseInt(b.css("marginLeft"))||0+parseInt(b.css("marginRight"))||0),jQuery.boxModel||(e+=parseInt(jQuery(a).css("paddingTop"))||0+parseInt(jQuery(a).css("paddingBottom"))||
0+parseInt(jQuery(a).css("borderTopWidth"))||0+parseInt(jQuery(a).css("borderBottomWidth"))||0+parseInt(jQuery(a).css("marginTop"))||0+parseInt(jQuery(a).css("marginBottom"))||0,d+=parseInt(jQuery(a).css("paddingLeft"))||0+parseInt(jQuery(a).css("paddingRight"))||0+parseInt(jQuery(a).css("borderLeftWidth"))||0+parseInt(jQuery(a).css("borderRightWidth"))||0+parseInt(jQuery(a).css("marginLeft"))||0+parseInt(jQuery(a).css("marginRight"))||0),jQuery.boxModel&&jQuery.browser.msie&&jQuery.browser.version<
7&&(e+=parseInt(c.css("borderTopWidth"))||0+parseInt(c.css("borderBottomWidth"))||0,d+=parseInt(c.css("borderLeftWidth"))||0+parseInt(c.css("borderRightWidth"))||0)),jQuery(a).stop(),jQuery(a).animate({width:d,height:e},"slow","linear",function(){window.setTimeout(function(){jQuery.dmxGallery.showCaption(a)},10)}))},debug:function(a){this.bDebug&&(typeof window.console!="undefined"?arguments.length>1?window.console.log(arguments):window.console.log(a):alert(a))},dir:function(a){this.bDebug&&(typeof window.console!=
"undefined"?arguments.length>1?window.console.dir(arguments):window.console.dir(a):alert(a))}};jQuery.dmxGallery.counter=0;jQuery.fn.dmxGallery=jQuery.dmxGallery.build;

