﻿function transliteracja(t) {
  if (document.getElementById("trans").checked) {
	t = t.replace(/ą/g, "a")
	t = t.replace(/ć/g, "c")
	t = t.replace(/ę/g, "e")
	t = t.replace(/ł/g, "l")
	t = t.replace(/ś/g, "s")
	t = t.replace(/ó/g, "o")
	t = t.replace(/ż/g, "z")
	t = t.replace(/ź/g, "z")
	t = t.replace(/Ą/g, "A")
	t = t.replace(/Ć/g, "C")
	t = t.replace(/Ę/g, "E")
	t = t.replace(/Ł/g, "L")
	t = t.replace(/Ś/g, "S")
	t = t.replace(/Ó/g, "O")
	t = t.replace(/Ż/g, "Z")
	t = t.replace(/Ź/g, "Z")
    document.getElementById("g").value=t;
  }
}

//cookie
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;};var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();};var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}};return cookieValue;}};

//auroramenu 
var auroraMenuSpeed=150;
$(document).ready(function(){
$.cookie('testcookie','expanded')
var auroramenucount=0;
$('.auroramenu').each(function(){
var auroramenuitemcount=0;
$(this).children('li').children('ul').each(function(){
if($.cookie('arMenu_'+auroramenucount+'_arItem_'+auroramenuitemcount)==1){
$(this).siblings('a').attr('href','javascript:auroraMenuItem(\''+auroramenucount+'\' , \''+auroramenuitemcount+'\' , 0)');
$(this).parent().children('.aurorahide').css("display","block").attr('title','zwiń');
$(this).parent().children('.aurorashow').css("display","none").attr('title','rozwiń');
}else{
$(this).css("display","none");
$(this).siblings('a').attr('href','javascript:auroraMenuItem(\''+auroramenucount+'\' , \''+auroramenuitemcount+'\' , 1)');
$(this).parent().children('.aurorahide').css("display","none").attr('title','zwiń');
$(this).parent().children('.aurorashow').css("display","block").attr('title','rozwiń');
}
auroramenuitemcount++;
});
auroramenucount++;
});
});
function auroraMenuItem(menu,item,show){
$.cookie('arMenu_'+menu+'_arItem_'+item,show);
var auroramenucount=0;
$('.auroramenu').each(function(){
if(menu==auroramenucount){
var auroramenuitemcount=0;
$(this).children('li').children('ul').each(function(){
if(item==auroramenuitemcount){
if(show==1){
$(this).slideDown(auroraMenuSpeed);
$(this).siblings('a').attr('href','javascript:auroraMenuItem(\''+menu+'\' , \''+item+'\' , 0)');
$(this).parent().children('.aurorahide').css("display","block").attr('title','zwiń');
$(this).parent().children('.aurorashow').css("display","none").attr('title','rozwiń');
}else{
$(this).slideUp(auroraMenuSpeed);
$(this).siblings('a').attr('href','javascript:auroraMenuItem(\''+menu+'\' , \''+item+'\' , 1)');
$(this).parent().children('.aurorahide').css("display","none").attr('title','zwiń');
$(this).parent().children('.aurorashow').css("display","block").attr('title','rozwiń');
}
}
auroramenuitemcount++;
});
}
auroramenucount++;
});
}

//easing
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return -c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return -c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return -c*Math.cos(t/d * (Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d * (Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return -c/2 * (Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return -c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI) * Math.asin (c/a);return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI) * Math.asin (c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI) * Math.asin (c/a);if(t<1)return -.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d) < (1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});

//codaslider

$(function(){
$("body").removeClass("coda-slider-no-js");
$(".coda-slider").children('.panel').hide().end().prepend('<p class="loading">Loading...</p>');
});
var sliderCount=1;
$.fn.codaSlider=function(settings){
settings=$.extend({
autoHeight:true,
autoHeightEaseDuration:1000,
autoHeightEaseFunction:"easeInOutExpo",
autoSlide:false,
autoSlideInterval:7000,
autoSlideStopWhenClicked:true,
crossLinking:true,
dynamicArrows:true,
dynamicArrowLeftText:"w lewo",
dynamicArrowRightText:"w prawo",
dynamicTabs:true,
dynamicTabsAlign:"right",
dynamicTabsPosition:"top",
externalTriggerSelector:"a.xtrig",
firstPanelToLoad:1,
panelTitleSelector:"h2.title",
slideEaseDuration:1000,
slideEaseFunction:"easeInOutExpo"
},settings);
return this.each(function(){
var slider=$(this);
if(settings.dynamicArrows){
slider.parent().addClass("arrows");
slider.before('<div class="coda-nav-left" id="coda-nav-left-'+sliderCount+'"><a href="#">'+settings.dynamicArrowLeftText+'</a></div>');
slider.after('<div class="coda-nav-right" id="coda-nav-right-'+sliderCount+'"><a href="#">'+settings.dynamicArrowRightText+'</a></div>');
};
var panelWidth=slider.find(".panel").width();
var panelCount=slider.find(".panel").size();
var panelContainerWidth=panelWidth*panelCount;
var navClicks=0;
$('.panel',slider).wrapAll('<div class="panel-container"></div>');
$(".panel-container",slider).css({width:panelContainerWidth});
if(settings.crossLinking&&location.hash&&parseInt(location.hash.slice(1))<=panelCount){
var currentPanel=parseInt(location.hash.slice(1));
var offset=-(panelWidth*(currentPanel-1));
$('.panel-container',slider).css({marginLeft:offset});
}else if(settings.firstPanelToLoad!=1&&settings.firstPanelToLoad<=panelCount){
var currentPanel=settings.firstPanelToLoad;
var offset=-(panelWidth*(currentPanel-1));
$('.panel-container',slider).css({marginLeft:offset});
}else{
var currentPanel=1;
};
$("#coda-nav-left-"+sliderCount+" a").click(function(){
navClicks++;
if(currentPanel==1){
offset=-(panelWidth*(panelCount-1));
alterPanelHeight(panelCount-1);
currentPanel=panelCount;
slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('li:last a').addClass('current');
}else{
currentPanel-=1;
alterPanelHeight(currentPanel-1);
offset=-(panelWidth*(currentPanel-1));
slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().prev().find('a').addClass('current');
};
$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);
if(settings.crossLinking){location.hash=currentPanel};
return false;
});
$('#coda-nav-right-'+sliderCount+' a').click(function(){
navClicks++;
if(currentPanel==panelCount){
offset=0;
currentPanel=1;
alterPanelHeight(0);
slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('a:eq(0)').addClass('current');
}else{
offset=-(panelWidth*currentPanel);
alterPanelHeight(currentPanel);
currentPanel+=1;
slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().next().find('a').addClass('current');
};
$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);
if(settings.crossLinking){location.hash=currentPanel};
return false;
});
if(settings.dynamicTabs){
var dynamicTabs='<div class="coda-nav" id="coda-nav-'+sliderCount+'"><ul></ul></div>';
switch(settings.dynamicTabsPosition){
case "bottom":
slider.parent().append(dynamicTabs);
break;
default:
slider.parent().prepend(dynamicTabs);
break;
};
ul=$('#coda-nav-'+sliderCount+' ul');
$('.panel',slider).each(function(n){
ul.append('<li class="tab'+(n+1)+'"><a href="#'+(n+1)+'">'+$(this).find(settings.panelTitleSelector).text()+'</a></li>');
});
navContainerWidth=slider.width()+slider.siblings('.coda-nav-left').width()+slider.siblings('.coda-nav-right').width();
ul.parent();
switch(settings.dynamicTabsAlign){
case "center":
ul.css({width:($("li",ul).width()+2)*panelCount});
break;
case "right":
ul.css({float:'right'});
break;
};
};
$('#coda-nav-'+sliderCount+' a').each(function(z){
$(this).bind("click",function(){
navClicks++;
$(this).addClass('current').parents('ul').find('a').not($(this)).removeClass('current');
offset=-(panelWidth*z);
alterPanelHeight(z);
currentPanel=z+1;
$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);
if(!settings.crossLinking){return false};
});
});
$(settings.externalTriggerSelector).each(function(){
if(sliderCount==parseInt($(this).attr("rel").slice(12))){
$(this).bind("click",function(){
navClicks++;
targetPanel=parseInt($(this).attr("href").slice(1));
offset=-(panelWidth*(targetPanel-1));
alterPanelHeight(targetPanel-1);
currentPanel=targetPanel;
slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq('+(targetPanel-1)+') a').addClass('current');
$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);
if(!settings.crossLinking){return false};
});
};
});
if(settings.crossLinking&&location.hash&&parseInt(location.hash.slice(1))<=panelCount){
$("#coda-nav-"+sliderCount+" a:eq("+(location.hash.slice(1)-1)+")").addClass("current");
}else if(settings.firstPanelToLoad!=1&&settings.firstPanelToLoad<=panelCount){
$("#coda-nav-"+sliderCount+" a:eq("+(settings.firstPanelToLoad-1)+")").addClass("current");
}else{
$("#coda-nav-"+sliderCount+" a:eq(0)").addClass("current");
};
if(settings.autoHeight){
panelHeight=$('.panel:eq('+(currentPanel-1)+')',slider).height();
slider.css({height:panelHeight});
};
if(settings.autoSlide){
slider.ready(function(){
setTimeout(autoSlide,settings.autoSlideInterval);
});
};
function alterPanelHeight(x){
if(settings.autoHeight){
panelHeight=$('.panel:eq('+x+')',slider).height()
slider.animate({height:panelHeight},settings.autoHeightEaseDuration,settings.autoHeightEaseFunction);
};
};
function autoSlide(){
if(navClicks==0||!settings.autoSlideStopWhenClicked){
if(currentPanel==panelCount){
var offset=0;
currentPanel=1;
}else{
var offset=-(panelWidth*currentPanel);
currentPanel+=1;
};
alterPanelHeight(currentPanel-1);
slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq('+(currentPanel-1)+') a').addClass('current');
$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);
setTimeout(autoSlide,settings.autoSlideInterval);
};
};
$('.panel',slider).show().end().find("p.loading").remove();
slider.removeClass("preload");
sliderCount++;
});
};
$().ready(function(){
$('#coda-slider-1').codaSlider({
autoSlide:true,
autoSlideInterval:10000,
dynamicArrows:true,
autoSlideStopWhenClicked:true,
slideEaseDuration:1000
});
});

//ddsmothmenu

var ddsmoothmenu={
transition:{overtime:300,outtime:300},
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+">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:'ddsmoothmenu',
contentsource:"markup"
})

//topfixed
$(function(){var msie6=$.browser=='msie'&&$.browser.version<7;if(!msie6){var top=$('#searchbox').offset().top-parseFloat($('#searchbox').css('margin-top').replace(/auto/,0));$(window).scroll(function(event){var y=$(this).scrollTop();if(y>=top){$('#searchbox').addClass('fixed');}else{$('#searchbox').removeClass('fixed');}});}});

//toppage
$(document).ready(function(){$('a[href=#top]').click(function(){$('html, body').animate({scrollTop:0},'slow');return false;});});

//colorbox
/*	ColorBox v1.3.6 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 */
(function(c){function r(b,d){d=d==="x"?m.width():m.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function M(b){b=c.isFunction(b)?b.call(i):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function Y(){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(i);a.rel=a.rel||i.rel;a.href=a.href||i.href;a.title=a.title||i.title}function Z(b){i=b;a=c(i).data(q);Y();if(a.rel&&a.rel!=="nofollow"){g= c(".cboxElement").filter(function(){return(c(this).data(q).rel||this.rel)===a.rel});j=g.index(i);if(j<0){g=g.add(i);j=g.length-1}}else{g=c(i);j=0}if(!B){C=B=n;N=i;N.blur();c(document).bind("keydown.cbox_close",function(d){if(d.keyCode===27){d.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(d){if(g.length>1)if(d.keyCode===37){d.preventDefault();D.click()}else if(d.keyCode===39){d.preventDefault();E.click()}});a.overlayClose&&s.css({cursor:"pointer"}).one("click",e.close);c.event.trigger(aa); a.onOpen&&a.onOpen.call(i);s.css({opacity:a.opacity}).show();a.w=r(a.initialWidth,"x");a.h=r(a.initialHeight,"y");e.position(0);O&&m.bind("resize.cboxie6 scroll.cboxie6",function(){s.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll.cboxie6")}P.add(D).add(E).add(t).add(Q).hide();R.html(a.close).show();e.slideshow();e.load()}var q="colorbox",F="hover",n=true,e,x=!c.support.opacity,O=x&&!window.XMLHttpRequest,aa="cbox_open",H="cbox_load",S="cbox_complete", T="resize.cbox_resize",s,k,u,p,U,V,W,X,g,m,l,I,J,K,Q,P,t,E,D,R,y,z,v,w,i,N,j,a,B,C,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:n,scrolling:n,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.6,preloading:n,current:"{current} / {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:n,slideshow:false, slideshowAuto:n,slideshowSpeed:4500,slideshowStart:"start",slideshowStop:"stop",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};e=c.fn.colorbox=function(b,d){var h=this;if(!h.length)if(h.selector===""){h=c("<a/>");b.open=n}else return this;h.each(function(){var f=c.extend({},c(this).data(q)?c(this).data(q):$,b);c(this).data(q,f).addClass("cboxElement");if(d)c(this).data(q).onComplete=d});b&&b.open&&Z(h);return this};e.init=function(){function b(d){return c('<div id="cbox'+ d+'"/>')}m=c(window);k=c('<div id="colorbox"/>');s=b("Overlay").hide();u=b("Wrapper");p=b("Content").append(l=b("LoadedContent").css({width:0,height:0}),J=b("LoadingOverlay"),K=b("LoadingGraphic"),Q=b("Title"),P=b("Current"),t=b("Slideshow"),E=b("Next"),D=b("Previous"),R=b("Close"));u.append(c("<div/>").append(b("TopLeft"),U=b("TopCenter"),b("TopRight")),c("<div/>").append(V=b("MiddleLeft"),p,W=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),X=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"}); I=c("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");c("body").prepend(s,k.append(u,I));if(x){k.addClass("cboxIE");O&&s.css("position","absolute")}p.children().bind("mouseover mouseout",function(){c(this).toggleClass(F)}).addClass(F);y=U.height()+X.height()+p.outerHeight(n)-p.height();z=V.width()+W.width()+p.outerWidth(n)-p.width();v=l.outerHeight(n);w=l.outerWidth(n);k.css({"padding-bottom":y,"padding-right":z}).hide();E.click(e.next);D.click(e.prev);R.click(e.close);p.children().removeClass(F); c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined")return n;else{Z(this);return false}})};e.position=function(b,d){function h(A){U[0].style.width=X[0].style.width=p[0].style.width=A.style.width;K[0].style.height=J[0].style.height=p[0].style.height=V[0].style.height=W[0].style.height=A.style.height}var f=m.height();f=Math.max(f-a.h-v-y,0)/2+m.scrollTop();var o=Math.max(document.documentElement.clientWidth-a.w-w-z,0)/2+m.scrollLeft();b=k.width()===a.w+w&&k.height()=== a.h+v?0:b;u[0].style.width=u[0].style.height="9999px";k.dequeue().animate({width:a.w+w,height:a.h+v,top:f,left:o},{duration:b,complete:function(){h(this);C=false;u[0].style.width=a.w+w+z+"px";u[0].style.height=a.h+v+y+"px";d&&d()},step:function(){h(this)}})};e.resize=function(b){function d(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function h(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}function f(G){e.position(G,function(){if(B){if(x){A&&l.fadeIn(100);k[0].style.removeAttribute("filter")}if(a.iframe)l.append("<iframe id='cboxIframe'"+ (a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+a.href+"' "+(x?"allowtransparency='true'":"")+" />");l.show();Q.show().html(a.title);if(g.length>1){P.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,g.length)).show();E.html(a.next).show();D.html(a.previous).show();a.slideshow&&t.show()}J.hide();K.hide();c.event.trigger(S);a.onComplete&&a.onComplete.call(i);a.transition==="fade"&&k.fadeTo(L,1,function(){x&&k[0].style.removeAttribute("filter")}); m.bind(T,function(){e.position(0)})}})}if(B){var o,A,L=a.transition==="none"?0:a.speed;m.unbind(T);if(b){l.remove();l=c('<div id="cboxLoadedContent"/>').html(b);l.hide().appendTo(I).css({width:d(),overflow:a.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});O&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition=== "fade"&&k.fadeTo(L,0,function(){f(0)})||f(L);if(a.preloading&&g.length>1){b=j>0?g[j-1]:g[g.length-1];o=j<g.length-1?g[j+1]:g[0];o=c(o).data(q).href||o.href;b=c(b).data(q).href||b.href;M(o)&&c("<img />").attr("src",o);M(b)&&c("<img />").attr("src",b)}}else setTimeout(function(){var G=l.wrapInner("<div style='overflow:auto'></div>").children();a.h=G.height();l.css({height:a.h});G.replaceWith(G.children());e.position(L)},1)}};e.load=function(){var b,d,h,f=e.resize;C=n;i=g[j];a=c(i).data(q);Y();c.event.trigger(H); a.onLoad&&a.onLoad.call(i);a.h=a.height?r(a.height,"y")-v-y:a.innerHeight?r(a.innerHeight,"y"):false;a.w=a.width?r(a.width,"x")-w-z:a.innerWidth?r(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=r(a.maxWidth,"x")-w-z;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=r(a.maxHeight,"y")-v-y;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href;J.show();K.show();if(a.inline){c('<div id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(H+" cbox_cleanup",function(){c(this).replaceWith(l.children())}); f(c(b))}else if(a.iframe)f(" ");else if(a.html)f(a.html);else if(M(b)){d=new Image;d.onload=function(){var o;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){h=function(){d.height-=d.height*o;d.width-=d.width*o};if(a.mw&&d.width>a.mw){o=(d.width-a.mw)/d.width;h()}if(a.mh&&d.height>a.mh){o=(d.height-a.mh)/d.height;h()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";f(d);g.length>1&&c(d).css({cursor:"pointer"}).click(e.next); if(x)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div />").appendTo(I).load(b,function(o,A){A==="success"?f(this):f(c("<p>Request unsuccessful.</p>"))})};e.next=function(){if(!C){j=j<g.length-1?j+1:0;e.load()}};e.prev=function(){if(!C){j=j>0?j-1:g.length-1;e.load()}};e.slideshow=function(){function b(){t.text(a.slideshowStop).bind(S,function(){h=setTimeout(e.next,a.slideshowSpeed)}).bind(H,function(){clearTimeout(h)}).one("click",function(){d();c(this).removeClass(F)});k.removeClass(f+ "off").addClass(f+"on")}var d,h,f="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(h);k.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);t.text(a.slideshowStart).unbind(S+" "+H).one("click",function(){b();h=setTimeout(e.next,a.slideshowSpeed);c(this).removeClass(F)});k.removeClass(f+"on").addClass(f+"off")};if(a.slideshow&&g.length>1)a.slideshowAuto?b():d()};e.close=function(){c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(i);B=false;c(document).unbind("keydown.cbox_close keydown.cbox_arrows"); m.unbind(T+" resize.cboxie6 scroll.cboxie6");s.css({cursor:"auto"}).fadeOut("fast");k.stop(n,false).fadeOut("fast",function(){c("#colorbox iframe").attr("src","about:blank");l.remove();k.css({opacity:1});try{N.focus()}catch(b){}c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(i)})};e.element=function(){return c(i)};e.settings=$;c(e.init)})(jQuery);

$(document).ready(function(){
$("a[rel='lightbox']").colorbox({slideshow:false});
$("a[rel='referencje']").colorbox({slideshow:false});
$("a[rel='kamera_1']").colorbox({slideshow:true});
$("a[rel='kamera_2']").colorbox({slideshow:true});
$("a[rel='kamera_3']").colorbox({slideshow:true});
$("a[rel='kamera_4']").colorbox({slideshow:true});
$("a[rel='kamera_5']").colorbox({slideshow:true});
$("a[rel='kamera_6']").colorbox({slideshow:true});
$("a[rel='kamera_7']").colorbox({slideshow:true});
$("a[rel='kamera_8']").colorbox({slideshow:true});
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".youtube2").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".window").colorbox({width:"700px", height:"500px", iframe:true});
$(".popup").colorbox({height:"300px", width:"600px", inline:true, href:"#popup"});
$(".popup").trigger('click'); 	
});

//fadebox
$(document).ready(function(){$(".rss a").hover(function(){$(this).next("p").animate({opacity:"show",top:"-40"},"slow");},function(){$(this).next("p").animate({opacity:"hide",top:"-90"},"fast");});$(".naszteamphoto ul").hover(function(){$(this).next("ul").animate({opacity:"show",top:"-100"},{duration:500,queue:true});},function(){$(this).next("ul").animate({opacity:"hide",top:"-160"},{duration:500,queue:true});});});

//fadeleftmenu
$(document).ready(function(){$("#menu1").hover(function(){$("#menu1 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu1 .z1").animate({"opacity":"1"},"slow");});$("#menu2").hover(function(){$("#menu2 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu2 .z1").animate({"opacity":"1"},"slow");});$("#menu3").hover(function(){$("#menu3 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu3 .z1").animate({"opacity":"1"},"slow");});$("#menu4").hover(function(){$("#menu4 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu4 .z1").animate({"opacity":"1"},"slow");});$("#menu5").hover(function(){$("#menu5 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu5 .z1").animate({"opacity":"1"},"slow");});$("#menu6").hover(function(){$("#menu6 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu6 .z1").animate({"opacity":"1"},"slow");});$("#menu7").hover(function(){$("#menu7 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu7 .z1").animate({"opacity":"1"},"slow");});$("#menu8").hover(function(){$("#menu8 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu8 .z1").animate({"opacity":"1"},"slow");});$("#menu9").hover(function(){$("#menu9 .z1").animate({"opacity":"0"},"slow");},function(){$("#menu9 .z1").animate({"opacity":"1"},"slow");});});

//scroll
$(document).ready(function(){
$("a[href*=#scrollto-]").click(function() {
if (location.pathname.replace(/^\//,"") == this.pathname.replace(/^\//,"")
&& location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target 
|| $("[name=" + this.hash.slice(1) +"]");
if ($target.length) {
var targetOffset = $target.offset().top;
$("html,body").animate({scrollTop: targetOffset}, 500);
return false;
}
}
});
});

//tablerow
$(document).ready(function() {
$('table.tablerow tbody tr:odd').addClass('odd');
$('table.tablerow tbody tr:even').addClass('even');
});

//tooltip
ShowTooltip=function(e){var text=$(this).next('.show-tooltip-text');if(text.attr('class')!='show-tooltip-text')return false;text.fadeIn();return false;};HideTooltip=function(e){var text=$(this).next('.show-tooltip-text');if(text.attr('class')!='show-tooltip-text')return false;text.fadeOut();};SetupTooltips=function(){$('.show-tooltip').each(function(){$(this).after($('<div/>').attr('class','show-tooltip-text').html($(this).attr('title'))).attr('title','');}).hover(ShowTooltip,HideTooltip);};$(document).ready(function(){SetupTooltips();});

//prawy
jQuery(document).ready(function () {var hideDelay=300;var hideDelayTimer=null;jQuery("#fb_box").hover(function(){if(hideDelayTimer)clearTimeout(hideDelayTimer);jQuery("#fb_box").animate({right:'0'},"normal");},function(){if(hideDelayTimer)clearTimeout(hideDelayTimer);hideDelayTimer=setTimeout(function(){hideDelayTimer=null;jQuery("#fb_box").animate({right:'-250'},"normal");},hideDelay);});});
