var jQ=jQuery.noConflict(); (function(a){jQuery.fn.superbgimage=function(c){var e=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options,c);a.superbg_inAnimation=!1;a.superbg_slideshowActive=!1;a.superbg_imgIndex=1;a.superbg_imgActual=1;a.superbg_imgLast=-1;a.superbg_imgSlide=0;a.superbg_interval=0;a.superbg_preload=0;a.superbg_direction=0;a.superbg_max_randomtrans=7;a.superbg_lasttrans=-1;a.superbg_isIE6=!1;a.superbg_firstLoaded=!1;a.superbg_saveId=a(this).attr("id");a("#"+e.id).length===0?a("body").prepend('
'):a("body").prepend(a("#"+e.id));a("#"+e.id).css("display","none").css("overflow","hidden").css("z-index",e.z_index);e.inlineMode===0&&a("#"+e.id).css("position","fixed").css("width","100%").css("height","100%").css("top",0).css("left",0);e.reload&&a("#"+e.id+" img").remove();a("#"+e.id+" img").hide().css("position","absolute");a("#"+e.id).children("img").each(function(){a(this).attr("rel",a.superbg_imgIndex++);e.showtitle||a(this).attr("title","")});a(this).children("a").each(function(){a(this).attr("rel", a.superbg_imgIndex++).click(function(){a(this).superbgShowImage();return!1}).addClass("preload")});a.superbg_imgIndex--;a(window).bind("load",function(){a(this).superbgLoad()});a(window).bind("resize",function(){a(this).superbgResize()});a.superbg_isIE6=/msie|MSIE 6/.test(navigator.userAgent);a.superbg_isIE6&&e.inlineMode===0&&(a("#"+e.id).css("position","absolute").width(a(window).width()).height(a(window).height()),a(window).bind("scroll",function(){a(this).superbgScrollIE6()}));e.reload&&a(this).superbgLoad(); return this};jQuery.fn.superbgScrollIE6=function(){var c=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);a("#"+c.id).css("top",document.documentElement.scrollTop+"px")};jQuery.fn.superbgLoad=function(){var c=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);(a("#"+c.id).children("img").length>0||a("#"+a.superbg_saveId).children("a").length>0)&&a("#"+c.id).show();if(typeof c.showimage!="undefined"&&c.showimage>=0)a.superbg_imgActual=c.showimage;if(c.randomimage===1)a.superbg_imgActual= 1+parseInt(Math.random()*(a.superbg_imgIndex-1+1),10);a(this).superbgShowImage(a.superbg_imgActual)};jQuery.fn.superbgimagePreload=function(){var c=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);clearInterval(a.superbg_preload);!a.superbg_firstLoaded&&a("#"+a.superbg_saveId).children("a").length>0?a.superbg_preload=setInterval("jQ(this).superbgimagePreload()",111):a("#"+a.superbg_saveId).children("a.preload:first").each(function(){var e=a(this).attr("rel"),b=a(this).attr("title"), d=new Image;a(d).load(function(){a(this).css("position","absolute").hide();a("#"+c.id).children("img[rel='"+e+"']").length===0&&(a(this).attr("rel",e),c.showtitle===1&&a(this).attr("title",b),a("#"+c.id).prepend(this));d.onload=function(){}}).error(function(){d.onerror=function(){}}).attr("src",a(this).attr("href"));a.superbg_preload=setInterval("jQ(this).superbgimagePreload()",111)}).removeClass("preload")};jQuery.fn.startSlideShow=function(){var c=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options); a.superbg_imgSlide=a.superbg_imgActual;a.superbg_interval!==0&&clearInterval(a.superbg_interval);a.superbg_interval=setInterval("jQ(this).nextSlide()",c.slide_interval);a.superbg_slideshowActive=!0;return!1};jQuery.fn.stopSlideShow=function(){a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);clearInterval(a.superbg_interval);return a.superbg_slideshowActive=!1};jQuery.fn.nextSlide=function(){var c=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);if(a.superbg_inAnimation)return!1; a.superbg_slideshowActive&&clearInterval(a.superbg_preload);a.superbg_direction=0;a.superbg_imgSlide++;if(a.superbg_imgSlide>a.superbg_imgIndex)a.superbg_imgSlide=1;if(c.randomimage===1)for(a.superbg_imgSlide=1+parseInt(Math.random()*(a.superbg_imgIndex-1+1),10);a.superbg_imgSlide===a.superbg_imgLast;)a.superbg_imgSlide=1+parseInt(Math.random()*(a.superbg_imgIndex-1+1),10);a.superbg_imgActual=a.superbg_imgSlide;return a(this).superbgShowImage(a.superbg_imgActual)};jQuery.fn.prevSlide=function(){var c= a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);if(a.superbg_inAnimation)return!1;a.superbg_direction=1;a.superbg_imgSlide--;if(a.superbg_imgSlide<1)a.superbg_imgSlide=a.superbg_imgIndex;if(c.randomimage===1)for(a.superbg_imgSlide=1+parseInt(Math.random()*(a.superbg_imgIndex-1+1),10);a.superbg_imgSlide===a.superbg_imgLast;)a.superbg_imgSlide=1+parseInt(Math.random()*(a.superbg_imgIndex-1+1),10);a.superbg_imgActual=a.superbg_imgSlide;return a(this).superbgShowImage(a.superbg_imgActual)}; jQuery.fn.superbgResize=function(){var c=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options),e=a("#"+c.id+" img.activeslide"),b=a(this).superbgCalcSize(a(e).width(),a(e).height()),d=b[0],f=b[1],h=b[2],b=b[3];a(e).css("width",d+"px");a(e).css("height",f+"px");a.superbg_isIE6&&c.inlineMode===0&&(a("#"+c.id).width(d).height(f),a(e).width(d),a(e).height(f));a(e).css("left",h+"px");c.vertical_center===1?a(e).css("top",b+"px"):a(e).css("top","0px")};jQuery.fn.superbgCalcSize=function(c,e){var b= a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options),d=a(window).width(),f=a(window).height();b.inlineMode===1&&(d=a("#"+b.id).width(),f=a("#"+b.id).height());var h=e/c,g=b=0;f/d>h?(b=f,g=Math.round(f/h)):(b=Math.round(d*h),g=d);d=Math.round((d-g)/2);f=Math.round((f-b)/2);return[g,b,d,f]};jQuery.fn.superbgShowImage=function(c){var e=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);a.superbg_imgActual=a(this).attr("rel");if(typeof c!=="undefined")a.superbg_imgActual=c;if(a("#"+ e.id+" img.activeslide").attr("rel")===a.superbg_imgActual)return!1;if(a.superbg_inAnimation)return!1;else a.superbg_inAnimation=!0;var b=c="";a("#"+e.id).children("img[rel='"+a.superbg_imgActual+"']").length===0?(c=a("#"+a.superbg_saveId+" a[rel='"+a.superbg_imgActual+"']").attr("href"),b=a("#"+a.superbg_saveId+" a[rel='"+a.superbg_imgActual+"']").attr("title")):c=a("#"+e.id).children("img[rel='"+a.superbg_imgActual+"']").attr("src");if(typeof e.onHide==="function"&&e.onHide!==null&&a.superbg_imgLast>= 0)e.onHide(a.superbg_imgLast);a("#"+e.id+" img.activeslide").superbgLoadImage(c,b);a("#"+a.superbg_saveId+" a").removeClass("activeslide");a("#"+a.superbg_saveId).children("a[rel='"+a.superbg_imgActual+"']").addClass("activeslide");a.superbg_imgSlide=a.superbg_imgActual;a.superbg_imgLast=a.superbg_imgActual;return!1};jQuery.fn.superbgLoadImage=function(c,e){var b=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options);if(a("#"+b.id).children("img[rel='"+a.superbg_imgActual+"']").length===0){var d= new Image;a(d).load(function(){a(this).css("position","absolute").hide();a("#"+b.id).children("img[rel='"+a.superbg_imgActual+"']").length===0&&(a(this).attr("rel",a.superbg_imgActual),b.showtitle===1&&a(this).attr("title",e),a("#"+b.id).prepend(this));var c=a("#"+b.id).children("img[rel='"+a.superbg_imgActual+"']"),f=a(this).superbgCalcSize(d.width,d.height);a(this).superbgTransition(c,f);if(!a.superbg_firstLoaded&&(b.slideshow===1&&a(this).startSlideShow(),b.preload===1&&a("#"+a.superbg_saveId).children("a").length> 0))a.superbg_preload=setInterval("jQ(this).superbgimagePreload()",250);a.superbg_firstLoaded=!0;d.onload=function(){}}).error(function(){a.superbg_inAnimation=!1;d.onerror=function(){}}).attr("src",c)}else{var f=a("#"+b.id).children("img[rel='"+a.superbg_imgActual+"']"),h=a(this).superbgCalcSize(a(f).width(),a(f).height());a(this).superbgTransition(f,h);if(!a.superbg_firstLoaded){b.slideshow===1&&a(this).startSlideShow();if(b.preload===1&&a("#"+a.superbg_saveId).children("a").length>0)a.superbg_preload= setInterval("jQ(this).superbgimagePreload()",250);a.superbg_firstLoaded=!0}}};jQuery.fn.superbgTransition=function(c,e){var b=a.extend(a.fn.superbgimage.defaults,a.fn.superbgimage.options),d=e[0],f=e[1],h=e[2],g=e[3];a(c).css("width",d+"px").css("height",f+"px").css("left",h+"px");typeof b.onClick==="function"&&b.onClick!==null&&a(c).unbind("click").click(function(){b.onClick(a.superbg_imgActual)});typeof b.onMouseenter==="function"&&b.onMouseenter!==null&&a(c).unbind("mouseenter").mouseenter(function(){b.onMouseenter(a.superbg_imgActual)}); typeof b.onMouseleave==="function"&&b.onMouseleave!==null&&a(c).unbind("mouseleave").mouseleave(function(){b.onMouseleave(a.superbg_imgActual)});typeof b.onMousemove==="function"&&b.onMousemove!==null&&a(c).unbind("mousemove").mousemove(function(c){b.onMousemove(a.superbg_imgActual,c)});if(b.randomtransition===1){for(d=0+parseInt(Math.random()*(a.superbg_max_randomtrans-0+1),10);d===a.superbg_lasttrans;)d=0+parseInt(Math.random()*(a.superbg_max_randomtrans-0+1),10);b.transition=d}b.vertical_center=== 1?a(c).css("top",g+"px"):a(c).css("top","0px");f=b.transitionout;if(b.transition===6||b.transition===7)f=0;f===1?a("#"+b.id+" img.activeslide").removeClass("activeslide").addClass("lastslide").css("z-index",0):a("#"+b.id+" img.activeslide").removeClass("activeslide").addClass("lastslideno").css("z-index",0);a(c).css("z-index",1);b.transition=parseInt(b.transition,10);a.superbg_lasttrans=b.transition;d=g="";b.transition===0?a(c).show(1,function(){if(typeof b.onShow==="function"&&b.onShow!==null)b.onShow(a.superbg_imgActual); a.superbg_inAnimation=!1;a.superbg_slideshowActive&&a("#"+b.id).startSlideShow()}).addClass("activeslide"):b.transition===1?a(c).fadeIn(b.speed,function(){if(typeof b.onShow==="function"&&b.onShow!==null)b.onShow(a.superbg_imgActual);a("#"+b.id+" img.lastslideno").hide(1,null).removeClass("lastslideno");a.superbg_inAnimation=!1;a.superbg_slideshowActive&&a("#"+b.id).startSlideShow()}).addClass("activeslide"):(b.transition===2&&(g="slide",d="up"),b.transition===3&&(g="slide",d="right"),b.transition=== 4&&(g="slide",d="down"),b.transition===5&&(g="slide",d="left"),b.transition===6&&(g="blind",d="horizontal"),b.transition===7&&(g="blind",d="vertical"),b.transition===8&&(g="slide",d="left",a.superbg_direction===1&&(d="right")),b.transition===9&&(g="slide",d="down",a.superbg_direction===1&&(d="up")),a(c).show(g,{direction:d},b.speed,function(){if(typeof b.onShow==="function"&&b.onShow!==null)b.onShow(a.superbg_imgActual);a("#"+b.id+" img.lastslideno").hide(1,null).removeClass("lastslideno");a.superbg_inAnimation= !1;a.superbg_slideshowActive&&a("#"+b.id).startSlideShow()}).addClass("activeslide"));f===1?(f=b.speed,f=b.speed=="slow"?800:b.speed=="normal"?600:b.speed=="fast"?600:b.speed+200,b.transition===0?a("#"+b.id+" img.lastslide").hide(1,null).removeClass("lastslide"):b.transition==1?a("#"+b.id+" img.lastslide").fadeOut(f).removeClass("lastslide"):(b.transition===2&&(g="slide",d="down"),b.transition===3&&(g="slide",d="left"),b.transition===4&&(g="slide",d="up"),b.transition===5&&(g="slide",d="right"),b.transition=== 6&&(d=g=""),b.transition===7&&(d=g=""),b.transition===8&&(g="slide",d="right",a.superbg_direction===1&&(d="left")),b.transition===9&&(g="slide",d="up",a.superbg_direction===1&&(d="down")),a("#"+b.id+" img.lastslide").hide(g,{direction:d},f).removeClass("lastslide"))):a("#"+b.id+" img.lastslide").hide(1,null).removeClass("lastslide")};jQuery.fn.superbgimage.defaults={id:"superbgimage",z_index:0,inlineMode:0,showimage:1,vertical_center:1,transition:1,transitionout:1,randomtransition:0,showtitle:0,slideshow:1, slide_interval:5E3,randomimage:0,speed:"slow",preload:1,onShow:null,onClick:null,onHide:null,onMouseenter:null,onMouseleave:null,onMousemove:null}})(jQuery);