//colorbox
(function(D){var t="colorbox",r="hover",z=true,S=false,X,p=D.browser.msie&&!D.support.opacity,U=p&&D.browser.version<7,A="cbox_open",L="cbox_load",w="cbox_complete",K="cbox_cleanup",q="cbox_closed",O="resize.cbox_resize",I,V,W,d,Q,j,B,m,b,H,c,P,F,h,g,v,l,o,M,n,J,u,Y,k,f,a,s,i,C,R,y,N,E={transition:"elastic",speed:500,width:S,height:S,innerWidth:S,innerHeight:S,initialWidth:"100",initialHeight:"100",maxWidth:S,maxHeight:S,scalePhotos:z,scrolling:z,inline:S,html:S,iframe:S,photo:S,href:S,title:S,rel:S,opacity:0.5,preloading:z,current:"{current} z {total}",previous:"wróć",next:"dalej",close:"zamknij",open:S,overlayClose:z,slideshow:S,slideshowAuto:z,slideshowSpeed:5000,slideshowStart:"play",slideshowStop:"stop",onOpen:S,onLoad:S,onComplete:S,onCleanup:S,onClosed:S};function G(Z,aa){aa=aa==="x"?P.width():P.height();return(typeof Z==="string")?Math.round((Z.match(/%/)?(aa/100)*parseInt(Z,10):parseInt(Z,10))):Z}function x(Z){Z=D.isFunction(Z)?Z.call(s):Z;return R.photo||Z.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function T(){for(var Z in R){if(D.isFunction(R[Z])&&Z.substring(0,2)!=="on"){R[Z]=R[Z].call(s)}}R.rel=R.rel||s.rel;R.href=R.href||s.href;R.title=R.title||s.title}function e(Z){s=Z;R=D.extend({},D(s).data(t));T();if(R.rel&&R.rel!=="nofollow"){c=D(".cboxElement").filter(function(){var aa=D(this).data(t).rel||this.rel;return(aa===R.rel)});C=c.index(s);if(C<0){c=c.add(s);C=c.length-1}}else{c=D(s);C=0}if(!y){y=z;N=z;i=s;i.blur();D(document).bind("keydown.cbox_close",function(aa){if(aa.keyCode===27){aa.preventDefault();X.close()}}).bind("keydown.cbox_arrows",function(aa){if(c.length>1){if(aa.keyCode===37){aa.preventDefault();J.click()}else{if(aa.keyCode===39){aa.preventDefault();n.click()}}}});if(R.overlayClose){I.css({cursor:"pointer"}).one("click",X.close);Q.css({display:"block"});if(D(".flow").length!=0){D(".flow").css({opacity:0.1})}}D.event.trigger(A);if(R.onOpen){R.onOpen.call(s)}I.css({opacity:R.opacity}).show();R.w=G(R.initialWidth,"x");R.h=G(R.initialHeight,"y");X.position(0);if(U){P.bind("resize.cboxie6 scroll.cboxie6",function(){I.css({width:P.width(),height:P.height(),top:P.scrollTop(),left:P.scrollLeft()})}).trigger("scroll.cboxie6")}}o.add(J).add(n).add(M).add(l).hide();u.html(R.close).show();X.slideshow();X.load()}X=D.fn.colorbox=function(Z,ab){var aa=this;if(!aa.length){if(aa.selector===""){aa=D("<a/>");Z.open=z}else{return this}}aa.each(function(){var ac=D.extend({},D(this).data(t)?D(this).data(t):E,Z);D(this).data(t,ac).addClass("cboxElement");if(ab){D(this).data(t).onComplete=ab}});if(Z&&Z.open){e(aa)}return this};X.init=function(){function Z(aa){return D('<div id="cbox'+aa+'"/>')}P=D(window);Q=Z("Controls").append(j=Z("ControlsWrappers").append(J=Z("Previous").attr("title","wróć"),M=Z("Slideshow"),n=Z("Next").attr("title","dalej"),u=Z("Close").attr("title","zamknij"),o=Z("Current"))).hide();V=D('<div id="colorbox"/>');I=Z("Overlay").hide();W=Z("Wrapper");d=Z("Content").append(l=Z("Title"),g=Z("LoadingOverlay"),v=Z("LoadingGraphic"),F=Z("LoadedContent").css({width:0,height:0}));W.append(D("<div/>").append(Z("TopLeft"),B=Z("TopCenter"),Z("TopRight")),D("<div/>").append(m=Z("MiddleLeft"),d,b=Z("MiddleRight")),D("<div/>").append(Z("BottomLeft"),H=Z("BottomCenter"),Z("BottomRight"))).children().children().css({"float":"left"});h=D("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");D("body").prepend(Q,I,V.append(W,h));if(p){V.addClass("cboxIE");if(U){I.css("position","absolute")}}d.children().bind("mouseover mouseout",function(){D(this).toggleClass(r)}).addClass(r);Y=B.height()+H.height()+d.outerHeight(z)-d.height();k=m.width()+b.width()+d.outerWidth(z)-d.width();f=F.outerHeight(z);a=F.outerWidth(z);V.css({"padding-bottom":Y,"padding-right":k}).hide();n.click(X.next);J.click(X.prev);u.click(X.close);d.children().removeClass(r);D(".cboxElement").live("click",function(aa){if(aa.button!==0&&typeof aa.button!=="undefined"){return z}else{e(this);return S}})};X.position=function(ae,ab){var ad,aa=P.height(),ac=Math.max(aa-R.h-f-Y,0)/2+P.scrollTop(),Z=Math.max(document.documentElement.clientWidth-R.w-a-k,0)/2+P.scrollLeft();ad=(V.width()===R.w+a&&V.height()===R.h+f)?0:ae;W[0].style.width=W[0].style.height="9999px";function af(ag){B[0].style.width=H[0].style.width=d[0].style.width=ag.style.width;v[0].style.height=g[0].style.height=d[0].style.height=m[0].style.height=b[0].style.height=ag.style.height}V.dequeue().animate({width:R.w+a,height:R.h+f,top:ac,left:Z},{duration:ad,complete:function(){af(this);N=S;W[0].style.width=(R.w+a+k)+"px";W[0].style.height=(R.h+f+Y)+"px";if(ab){ab()}},step:function(){af(this)}})};X.resize=function(ad){if(!y){return}var ae,ac,aa,ag,ak,Z,ai,ab=R.transition==="none"?0:R.speed;P.unbind(O);if(!ad){ai=setTimeout(function(){var al=F.wrapInner("<div style='overflow:auto'></div>").children();R.h=al.height();F.css({height:R.h});al.replaceWith(al.children());X.position(ab)},1);return}F.remove();F=D('<div id="cboxLoadedContent"/>').html(ad);function ah(){R.w=R.w||F.width();R.w=R.mw&&R.mw<R.w?R.mw:R.w;return R.w}function af(){R.h=R.h||F.height();R.h=R.mh&&R.mh<R.h?R.mh:R.h;return R.h}F.hide().appendTo(h).css({width:ah(),overflow:R.scrolling?"auto":"hidden"}).css({height:af()}).prependTo(d);D("#cboxPhoto").css({cssFloat:"none"});if(U){D("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(K,function(){this.style.visibility="inherit"})}function aj(al){X.position(al,function(){if(!y){return}if(p){if(Z){F.fadeIn(100)}V[0].style.removeAttribute("filter")}if(R.iframe){F.append("<iframe id='cboxIframe'"+(R.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+R.href+"' "+(p?"allowtransparency='true'":"")+" />")}F.show();l.show().html(R.title);if(c.length>1){o.html(R.current.replace(/\{current\}/,C+1).replace(/\{total\}/,c.length)).show();n.html(R.next).show();J.html(R.previous).show();if(R.slideshow){M.show()}}g.hide();v.hide();D.event.trigger(w);if(R.onComplete){R.onComplete.call(s)}if(R.transition==="fade"){V.fadeTo(ab,1,function(){if(p){V[0].style.removeAttribute("filter")}})}P.bind(O,function(){X.position(0)})})}if((R.transition==="fade"&&V.fadeTo(ab,0,function(){aj(0)}))||aj(ab)){}if(R.preloading&&c.length>1){ac=C>0?c[C-1]:c[c.length-1];ag=C<c.length-1?c[C+1]:c[0];ak=D(ag).data(t).href||ag.href;aa=D(ac).data(t).href||ac.href;if(x(ak)){D("<img />").attr("src",ak)}if(x(aa)){D("<img />").attr("src",aa)}}};X.load=function(){var aa,Z,ac,ab=X.resize;N=z;s=c[C];R=D.extend({},D(s).data(t));T();D.event.trigger(L);if(R.onLoad){R.onLoad.call(s)}R.h=R.height?G(R.height,"y")-f-Y:R.innerHeight?G(R.innerHeight,"y"):S;R.w=R.width?G(R.width,"x")-a-k:R.innerWidth?G(R.innerWidth,"x"):S;R.mw=R.w;R.mh=R.h;if(R.maxWidth){R.mw=G(R.maxWidth,"x")-a-k;R.mw=R.w&&R.w<R.mw?R.w:R.mw}if(R.maxHeight){R.mh=G(R.maxHeight,"y")-f-Y;R.mh=R.h&&R.h<R.mh?R.h:R.mh}aa=R.href;g.show();v.show();if(R.inline){D('<div id="cboxInlineTemp" />').hide().insertBefore(D(aa)[0]).bind(L+" "+K,function(){D(this).replaceWith(F.children())});ab(D(aa))}else{if(R.iframe){ab(" ")}else{if(R.html){ab(R.html)}else{if(x(aa)){Z=new Image();Z.onload=function(){var ad;Z.onload=null;Z.id="cboxPhoto";D(Z).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(R.scalePhotos){ac=function(){Z.height-=Z.height*ad;Z.width-=Z.width*ad};if(R.mw&&Z.width>R.mw){ad=(Z.width-R.mw)/Z.width;ac()}if(R.mh&&Z.height>R.mh){ad=(Z.height-R.mh)/Z.height;ac()}}if(R.h){Z.style.marginTop=Math.max(R.h-Z.height,0)/2+"px"}ab(Z);if(c.length>1){D(Z).css({cursor:"pointer"}).click(X.next)}if(p){Z.style.msInterpolationMode="bicubic"}};Z.src=aa}else{D("<div />").appendTo(h).load(aa,function(ad,ae){if(ae==="success"){ab(this)}else{ab(D("<p>Request unsuccessful.</p>"))}})}}}}};X.next=function(){if(!N){C=C<c.length-1?C+1:0;X.load()}};X.prev=function(){if(!N){C=C>0?C-1:c.length-1;X.load()}};X.slideshow=function(){var aa,Z,ab="cboxSlideshow_";M.bind(q,function(){M.unbind();clearTimeout(Z);Q.removeClass(ab+"off "+ab+"on")});function ac(){M.text(R.slideshowStop).attr("title","stop").bind(w,function(){Z=setTimeout(X.next,R.slideshowSpeed)}).bind(L,function(){clearTimeout(Z)}).one("click",function(){aa();D(this).removeClass(r)});Q.removeClass(ab+"off").addClass(ab+"on")}aa=function(){clearTimeout(Z);M.text(R.slideshowStart).attr("title","play").unbind(w+" "+L).one("click",function(){ac();Z=setTimeout(X.next,R.slideshowSpeed);D(this).removeClass(r)});Q.removeClass(ab+"on").addClass(ab+"off")};if(R.slideshow&&c.length>1){if(R.slideshowAuto){ac()}else{aa()}}};X.close=function(){D.event.trigger(K);if(R.onCleanup){R.onCleanup.call(s)}y=S;D(document).unbind("keydown.cbox_close keydown.cbox_arrows");P.unbind(O+" resize.cboxie6 scroll.cboxie6");I.css({cursor:"auto"}).fadeOut("fast");Q.css({display:"none"});V.stop(z,S).fadeOut("fast",function(){D("#colorbox iframe").attr("src","about:blank");F.remove();V.css({opacity:1});try{i.focus()}catch(Z){}D.event.trigger(q);if(R.onClosed){R.onClosed.call(s)}})};X.element=function(){return D(s)};X.settings=E;D(X.init)}(jQuery));

//mosaic
(function(a){if(!a.omr){a.omr=new Object()}a.omr.mosaic=function(c,b){var d=this;d.$el=a(c);d.el=c;d.$el.data("omr.mosaic",d);d.init=function(){d.options=a.extend({},a.omr.mosaic.defaultOptions,b);d.load_box()};d.load_box=function(){if(d.options.preload){a(d.options.backdrop,d.el).hide();a(d.options.overlay,d.el).hide();a(window).load(function(){if(d.options.options.animation=="fade"&&a(d.options.overlay,d.el).css("opacity")==0){a(d.options.overlay,d.el).css("filter","alpha(opacity=0)")}a(d.options.overlay,d.el).fadeIn(200,function(){a(d.options.backdrop,d.el).fadeIn(200)});d.allow_hover()})}else{a(d.options.backdrop,d.el).show();a(d.options.overlay,d.el).show();d.allow_hover()}};d.allow_hover=function(){switch(d.options.animation){case"fade":a(d.el).hover(function(){a(d.options.overlay,d.el).stop().fadeTo(d.options.speed,d.options.opacity)},function(){a(d.options.overlay,d.el).stop().fadeTo(d.options.speed,0)});break;case"slide":startX=a(d.options.overlay,d.el).css(d.options.anchor_x)!="auto"?a(d.options.overlay,d.el).css(d.options.anchor_x):"0px";startY=a(d.options.overlay,d.el).css(d.options.anchor_y)!="auto"?a(d.options.overlay,d.el).css(d.options.anchor_y):"0px";var f={};f[d.options.anchor_x]=d.options.hover_x;f[d.options.anchor_y]=d.options.hover_y;var e={};e[d.options.anchor_x]=startX;e[d.options.anchor_y]=startY;a(d.el).hover(function(){a(d.options.overlay,d.el).stop().animate(f,d.options.speed)},function(){a(d.options.overlay,d.el).stop().animate(e,d.options.speed)});break}};d.init()};a.omr.mosaic.defaultOptions={animation:"fade",speed:150,opacity:1,preload:0,anchor_x:"left",anchor_y:"bottom",hover_x:"0px",hover_y:"0px",overlay:".mosaic-overlay",backdrop:".mosaic-backdrop"};a.fn.mosaic=function(b){return this.each(function(){(new a.omr.mosaic(this,b))})}})(jQuery);

			$(document).ready(function($){
				$('.cover1').mosaic({
					animation	:	'slide',
					anchor_y	:	'top',
					hover_y		:	'130px'
				});
				$('.cover2').mosaic({
					animation	:	'slide',
					anchor_y	:	'top',
					hover_y		:	'120px'
				});
				$('.cover3').mosaic({
					animation	:	'slide',
					anchor_y	:	'top',
					hover_y		:	'145px'
				});
		    });
			
//ddsmothmenu
var ddsmoothmenu={
transition:{overtime:200,outtime:200},
shadow:{enable:false,offsetx:5,offsety:5},
detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,
detectie6:document.all&&!window.XMLHttpRequest,
getajaxmenu:function($,setting){
var $menucontainer=$('#'+setting.contentsource[0])
$menucontainer.html("Loading Menu...")
$.ajax({
url:setting.contentsource[1],
async:true,
error:function(ajaxrequest){
$menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)
},
success:function(content){
$menucontainer.html(content)
ddsmoothmenu.buildmenu($,setting)
}
})
},
buildmenu:function($,setting){
var smoothmenu=ddsmoothmenu
var $mainmenu=$("#"+setting.mainmenuid+">div>ul")
$mainmenu.parent().get(0).className=setting.classname||"ddsmoothmenu"
var $headers=$mainmenu.find("ul").parent()
$headers.hover(
function(e){
$(this).children('a:eq(0)').addClass('selected')
},
function(e){
$(this).children('a:eq(0)').removeClass('selected')
}
)
$headers.each(function(i){
var $curobj=$(this).css({zIndex:100-i})
var $subul=$(this).find('ul:eq(0)').css({display:'block'})
this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:$subul.outerWidth(),subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1?true:false
//$subul.css({top:this.istopheader&&setting.orientation!='v'?this._dimensions.h+"px":0})
if(smoothmenu.shadow.enable){
this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx:this._dimensions.w),y:(this.istopheader?$subul.offset().top+smoothmenu.shadow.offsety:$curobj.position().top)}
if(this.istopheader)
$parentshadow=$(document.body)
else{
var $parentLi=$curobj.parents("li:eq(0)")
$parentshadow=$parentLi.get(0).$shadow
}
this.$shadow=$('<div class="ddshadow'+(this.istopheader?' toplevelshadow':'')+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+'px',top:this._shadowoffset.y+'px'})
}
$curobj.hover(
function(e){
var $targetul=$(this).children("ul:eq(0)")
this._offsets={left:$(this).offset().left,top:$(this).offset().top}
var menuleft=this.istopheader&&setting.orientation!='v'?0:this._dimensions.w
menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())?(this.istopheader&&setting.orientation!='v'?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):menuleft
if($targetul.queue().length<=1){
$targetul.css({left:menuleft+"px",width:this._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'},ddsmoothmenu.transition.overtime)
if(smoothmenu.shadow.enable){
var shadowleft=this.istopheader?$targetul.offset().left+ddsmoothmenu.shadow.offsetx:menuleft
var shadowtop=this.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety:this._shadowoffset.y
if(!this.istopheader&&ddsmoothmenu.detectwebkit){
this.$shadow.css({opacity:1})
}
this.$shadow.css({overflow:'',width:this._dimensions.subulw+'px',left:shadowleft+'px',top:shadowtop+'px'}).animate({height:this._dimensions.subulh+'px'},ddsmoothmenu.transition.overtime)
}
}
},
function(e){
var $targetul=$(this).children("ul:eq(0)")
$targetul.animate({height:'hide',opacity:'hide'},ddsmoothmenu.transition.outtime)
if(smoothmenu.shadow.enable){
if(ddsmoothmenu.detectwebkit){
this.$shadow.children('div:eq(0)').css({opacity:0})
}
this.$shadow.css({overflow:'hidden'}).animate({height:0},ddsmoothmenu.transition.outtime)
}
}
)
})
$mainmenu.find("ul").css({display:'none',visibility:'visible'})
},
init:function(setting){
if(typeof setting.customtheme=="object"&&setting.customtheme.length==2){
var mainmenuid='#'+setting.mainmenuid
var mainselector=(setting.orientation=="v")?mainmenuid:mainmenuid+', '+mainmenuid
document.write('<style type="text/css">\n'
+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
+'</style>')
}
this.shadow.enable=(document.all&&!window.XMLHttpRequest)?false:this.shadow.enable
jQuery(document).ready(function($){

if(typeof setting.contentsource=="object"){
ddsmoothmenu.getajaxmenu($,setting)
}
else{
ddsmoothmenu.buildmenu($,setting)
}
})
}
}
ddsmoothmenu.init({
mainmenuid:"smoothmenu",
orientation:'h',
classname:'bannerbox',
contentsource:"markup"
})


jQuery(document).ready(function(){
$("a[rel='lightbox']").colorbox({slideshow:true});
$('a[href=#top]').click(function(){$('html, body').animate({scrollTop:0},'slow');return false;});
});

