var Debug=function(B,A){if(!$("#Debug")){$("body").append("<div id='Debug'></div>")}if(A){$("#Debug").html($("#Debug").html()+"<br/>"+B)}else{$("#Debug").html($("#Debug").html()+B)}};(function(A){A.fn.ImageSwitch=function(L,D){var F={Type:"FadeIn",NewImage:"",EffectOriginal:true,Speed:1000,StartLeft:50,StartTop:0,StartOpacity:0,EndLeft:-50,EndTop:0,EndOpacity:0,Direction:"RightLeft",Door1:"",Door2:""};var Q=A.extend(F,L);var I=this;var H=0;var K;var P;var O;var J=function(){I.data("imageswitch",-1)};if(A.isFunction(D)){J=function(){D();I.data("imageswitch",-1)}}var C=function(){I.parent().append("<img class='GrpEffectImg' id='"+K.replace("#","")+"'/>");A(K).attr("src",I.attr("src"));A(K).css("position","absolute");A(K).css("top",I.position().top);A(K).css("left",I.position().left);A(K).css("opacity",1);I.attr("src",Q.NewImage);if(Q.EffectOriginal){I.css("opacity",Q.StartOpacity);I.animate({opacity:1},Q.Speed)}A(K).animate({opacity:0},Q.Speed,function(){A(K).remove();J()})};var G=function(R){A("body").append("<img class='GrpEffectImg' id='"+K.replace("#","")+"'/>");A(K).css("position","absolute");if(R){A(K).attr("src",Q.NewImage);A(K).css("top",I.offset().top+Q.StartTop);A(K).css("left",I.offset().left+Q.StartLeft);A(K).css("opacity",Q.StartOpacity);EndTop=I.offset().top;EndLeft=I.offset().left;EndOpacity=1}else{A(K).attr("src",I.attr("src"));I.attr("src",Q.NewImage);A(K).css("top",I.offset().top);A(K).css("left",I.offset().left);A(K).css("opacity",1);EndTop=I.offset().top+Q.EndTop;EndLeft=I.offset().left+Q.EndLeft;EndOpacity=Q.EndOpacity}A(K).animate({opacity:EndOpacity,top:EndTop,left:EndLeft},Q.Speed,function(){I.attr("src",Q.NewImage);A(K).remove();J()})};var B=function(U){var T=I.clone(true);I.wrap("<div id='GrpViewport-"+H+"'></div>");A("#GrpViewport-"+H).css("overflow","hidden");A("#GrpViewport-"+H).width(I.width());A("#GrpViewport-"+H).height(I.height());A("#GrpViewport-"+H).append("<img class='GrpEffectImg' id='"+K.replace("#","")+"'/>");A(K).css("position","absolute");var R=0;var S=0;switch(Q.Direction){case"RightLeft":S=-I.width();break;case"LeftRight":S=I.width();break;case"TopDown":R=-I.height();break;case"DownTop":R=I.height();break}if(U){A(K).attr("src",Q.NewImage);A(K).css("top",R);A(K).css("left",S);A(K).css("opacity",Q.StartOpacity);EndTop=0;EndLeft=0;EndOpacity=1}else{A(K).attr("src",I.attr("src"));A(K).css("left",0);A(K).css("top",0);I.attr("src",Q.NewImage);EndTop=R;EndLeft=S;EndOpacity=Q.EndOpacity}if(I.css("position")!="absolute"){A("#GrpViewport-"+H).css("position","relative");I.css("position","absolute")}else{A("#GrpViewport-"+H).css("position","absolute");A("#GrpViewport-"+H).css("left",I.css("left"));A("#GrpViewport-"+H).css("top",I.css("top"));I.css("top",0);I.css("left",0)}if(Q.EffectOriginal&&U){I.animate({top:-R,left:-S},Q.Speed)}A(K).animate({opacity:EndOpacity,top:EndTop,left:EndLeft},Q.Speed,function(){T.attr("src",Q.NewImage);T.removeAttr("imageswitch");T.data("imageswitch",-1);A("#GrpViewport-"+H).replaceWith(T);J()})};var N=function(){var T=I.clone(true);I.wrap("<div id='GrpViewport'></div>");A("#GrpViewport").css("overflow","hidden");A("#GrpViewport").width(I.width());A("#GrpViewport").height(I.height());A("#GrpViewport").append("<div class='GrpEffectDiv' id='"+P.replace("#","")+"'/>");A(P).attr("src",Q.NewImage);A(P).css("position","absolute");A(P).css("background-color","#FFF");if(Q.Door1.length>0){A(P).css("background",Q.Door1)}A(P).width(I.width());A(P).height(I.height());var R=0;var S=0;switch(Q.Direction){case"RightLeft":S=-I.width();break;case"LeftRight":S=I.width();break;case"TopDown":R=-I.height();break;case"DownTop":R=I.height();break}A(P).css("top",R);A(P).css("left",S);if(I.css("position")!="absolute"){A("#GrpViewport").css("position","relative");I.css("position","absolute")}else{A("#GrpViewport").css("position","absolute");A("#GrpViewport").css("left",I.css("left"));A("#GrpViewport").css("top",I.css("top"));I.css("top",0);I.css("left",0)}A(P).animate({top:0,left:0},Q.Speed,function(){I.attr("src",Q.NewImage);A(P).animate({top:R,left:S},Q.Speed,function(){T.attr("src",Q.NewImage);T.removeAttr("imageswitch");T.data("imageswitch",-1);A("#GrpViewport").replaceWith(T);J()})})};var E=function(){var V=I.css("position");var R=I.css("left");var U=I.css("top");I.wrap("<div id='GrpViewport'></div>");A("#GrpViewport").css("overflow","hidden");A("#GrpViewport").width(I.width());A("#GrpViewport").height(I.height());A("#GrpViewport").append("<div class='GrpEffectDiv' id='"+P.replace("#","")+"'/>");A(P).css("position","absolute");A(P).css("background-color","#FFF");if(Q.Door1.length>0){A(P).css("background",Q.Door1)}A(P).width(I.width());A(P).height(I.height());A("#GrpViewport").append("<div class='GrpEffectDiv1' id='"+O.replace("#","")+"'/>");A(O).css("position","absolute");A(O).css("background-color","#FFF");if(Q.Door2.length>0){A(O).css("background",Q.Door2)}A(O).width(I.width());A(O).height(I.height());var S=0;var T=0;switch(Q.Direction){case"RightLeft":T=-I.width();break;case"LeftRight":T=I.width();break;case"TopDown":S=-I.height();break;case"DownTop":S=I.height();break}A(P).css("top",S);A(P).css("left",T);A(O).css("top",-S);A(O).css("left",-T);if(!Q.EffectOriginal){A(P).css("background","#FFF url("+Q.NewImage+") no-repeat "+-T/2+"px "+-S/2+"px");A(O).css("background","#FFF url("+Q.NewImage+") no-repeat "+T/2+"px "+S/2+"px")}if(I.css("position")!="absolute"){A("#GrpViewport").css("position","relative");I.css("position","absolute")}else{A("#GrpViewport").css("position","absolute");A("#GrpViewport").css("left",R);A("#GrpViewport").css("top",U);I.css("position","absolute");I.css("top",0);I.css("left",0)}A(P).animate({top:S/2,left:T/2},Q.Speed,function(){I.attr("src",Q.NewImage);if(!Q.EffectOriginal){I.css("position",V);I.css("top",U);I.css("left",R);A("#GrpViewport").replaceWith(I)}else{A(P).animate({top:S,left:T},Q.Speed,function(){I.css("position",V);I.css("top",U);I.css("left",R);A("#GrpViewport").replaceWith(I)})}});A(O).animate({top:-S/2,left:-T/2},Q.Speed,function(){I.attr("src",Q.NewImage);if(!Q.EffectOriginal){J()}else{A(O).animate({top:-S,left:-T},Q.Speed,function(){J()})}})};var M=function(S){var R=I.clone(true);if(I.css("z-index")=="auto"){I.css("z-index",100)}if(I.css("position")!="absolute"){I.css("position","relative")}A("body").append("<img class='GrpEffectImg'  id='"+K.replace("#","")+"'/>");A(K).css("position","absolute");A(K).css("top",I.offset().top);A(K).css("left",I.offset().left);if(S){A(K).css("opacity",Q.StartOpacity);A(K).css("z-index",I.css("z-index")-1);A(K).attr("src",Q.NewImage)}else{A(K).css("opacity",1);A(K).css("z-index",I.css("z-index")+1);A(K).attr("src",I.attr("src"));I.attr("src",Q.NewImage)}if(Math.abs(Q.EndTop)<I.height()&&Math.abs(Q.EndLeft)<I.width()){EndTop=I.offset().top;EndLeft=I.offset().left+I.width()}else{EndTop=I.offset().top+Q.EndTop;EndLeft=I.offset().left+Q.EndLeft}EndOpacity=1;A(K).animate({opacity:EndOpacity,top:EndTop,left:EndLeft},Q.Speed,function(){if(S){A(K).css("z-index",101)}else{EndOpacity=Q.EndOpacity;A(K).css("z-index",2)}A(K).animate({opacity:EndOpacity,top:I.offset().top,left:I.offset().left},Q.Speed,function(){R.attr("src",Q.NewImage);R.removeAttr("imageswitch");R.data("imageswitch",-1);I.replaceWith(R);A(K).remove();J()})})};return this.each(function(){I=A(this);if(!I.ImageAnimating()){H=I.attr("id").replace(":","_");I.data("imageswitch",1);K="#GrpEffectImg-"+H;P="#GrpEffectDiv1-"+H;O="#GrpEffectDiv2-"+H;var R=new Image();R.src=Q.NewImage;A.ImagePreload(Q.NewImage,function(){switch(Q.Type){case"FadeIn":C();break;case"FlyIn":G(true);break;case"FlyOut":G(false);break;case"FlipIn":M(true);break;case"FlipOut":M(false);break;case"ScrollIn":B(true);break;case"ScrollOut":B(false);break;case"SingleDoor":N();break;case"DoubleDoor":E();break}})}})}})(jQuery);(function(A){A.fn.ImageAnimating=function(){if(this.data("imageswitch")>0){return true}else{return false}}})(jQuery);(function(A){A.fn.ImageStop=function(C,B,D){return this.each(function(){if(A(this).ImageAnimating()){var E=A.data(this,"imageswitch");A("#GrpEffectImg-"+E).stop(C,B);A("#GrpEffectDiv-"+E).stop(C,B);A("#GrpEffectDiv1-"+E).stop(C,B);A(this).stop(C,B);A("#GrpEffectImg-"+E).remove();A("#GrpEffectDiv-"+E).remove();A("#GrpEffectDiv1-"+E).remove();if(A.isFunction(D)){D()}}})}})(jQuery);(function(A){A.ImageStopAll=function(C,B,D){A(".GrpEffectImg").stop(C,B);A(".GrpEffectDiv").stop(C,B);A(".GrpEffectDiv1").stop(C,B);A(this).stop(C,B);A(".GrpEffectImg").remove();A(".GrpEffectDiv").remove();A(".GrpEffectDiv1").remove();A.data(this,"imageswitch",-1);if(A.isFunction(D)){D()}}})(jQuery);(function(A){A.ImagePreload=function(B,D){var C=new Image();C.src=B;if(A.isFunction(D)){A(C).load(D())}}})(jQuery);PrimeFaces.widget.ImageSwitch=function(B,C,A){this.imgClientId=PrimeFaces.escapeClientId(B);this.cfg=C;this.images=A;this.imgIdx=0;for(var D=0;D<A.length;D++){jQuery.ImagePreload(A[D])}if(this.cfg.slideshowAuto){this.startSlideshow()}};PrimeFaces.widget.ImageSwitch.prototype.switchImage=function(){jQuery(this.imgClientId).ImageSwitch({Type:this.cfg.effect,NewImage:this.images[this.imgIdx],Speed:this.cfg.speed})};PrimeFaces.widget.ImageSwitch.prototype.startSlideshow=function(){var A=this;this.animation=setInterval(function(){A.next()},this.cfg.slideshowSpeed)};PrimeFaces.widget.ImageSwitch.prototype.stopSlideshow=function(){clearInterval(this.animation)};PrimeFaces.widget.ImageSwitch.prototype.next=function(){if(this.imgIdx==(this.images.length-1)){this.imgIdx=0}else{this.imgIdx++}this.switchImage()};PrimeFaces.widget.ImageSwitch.prototype.previous=function(){if(this.imgIdx==0){this.imgIdx=this.images.length-1}else{this.imgIdx--}this.switchImage()};