if($.browser.opera){$.support.opacity=true;}var wplus=null;var hplus=null;function emloBox(link){$('#emloBox').stop();var file=$(link).attr('href');var desc=$(link).find('img').attr('alt');var fotoid=$(link).attr('id');var windowWidth=$(window).width();var windowHeight=$(window).height();if($('body').find('#emloBoxBG').length==0){$('body').append('<div id="emloBoxBG"></div><div id="emloBox"><a id="closeFoto" href="#">X</a><span id="emloBoxDesc"></span></div>');$('#emloBoxBG').css({opacity:0.8});$('#emloBoxDesc').css({opacity:.7});wplus=($('#emloBox').outerWidth());hplus=($('#emloBox').outerHeight());$('#emloBox,#closeFoto').click(function(){$('#emloBoxBG').remove();$('#emloBox').remove();return false;});if($(link).hasClass('lbgallery') && fotosy==undefined){var fotosy=new Array();var x=0;var href=null;var clickx=0;$('.lbgallery').each(function(){fotosy[x]=$(this);if($(this).attr('id')==fotoid){clickx=x;}++x;});--x;$('#emloBox').append('<a href="#" class="emloBoxpn" id="emloBoxnfoto">&raquo;</a><a href="#" class="emloBoxpn" id="emloBoxpfoto">&laquo;</a>');$('#emloBoxnfoto').click(function(){clickx++;if(fotosy[clickx]==undefined || fotosy[clickx]==''){clickx=0;}emloBox(fotosy[clickx]);return false;});$('#emloBoxpfoto').click(function(){clickx--;if(fotosy[clickx]==undefined || fotosy[clickx]==''){clickx=x;}emloBox(fotosy[clickx]);return false;});}var l=((windowWidth/2));var t=((windowHeight/2));$('#emloBox').css({left:l+'px',top:t+'px'});}$('#emloBox img').remove();$('#emloBox').css({'backgroundColor':'#fff'});var image=$('<img>').attr('src',file).css({opacity:0}).load(function(){$('#emloBox').append($(this));var w=$(this).width();var h=$(this).height();var l=((windowWidth/2)-((w+wplus)/2));var t=(windowHeight/2)-((h+hplus)/2);$('#emloBox').animate({width:w+'px',left:l+'px',top:t+'px',height:h+'px'},380,function(){$('#emloBox img').animate({opacity:1},function(){$(this).css({opacity:1});$('#emloBox').css({'backgroundColor':'transparent'});});});$('#emloBoxDesc').text(desc);}).each(function(){if(this.complete || (jQuery.browser.msie && parseInt(jQuery.browser.version)==6)) $(this).trigger("load");});return false;};$('.lbgallery img').css({opacity:.8});$('.lbgallery img').hover(function(){$(this).css({opacity:1});},function(){$(this).css({opacity:.8});});function keyDown(e) {if(e.keyCode==27){$('#emloBox').remove();$('#emloBoxBG').remove();}}$(this).keydown(keyDown);$('.fotaNews').append('<img src="/grafika/lupa.jpg" alt="zoom" class="lupa">');$('.fotaNews').click(function(){emloBox(this);return false});$('.lbgallery').click(function(){emloBox(this);return false});$('.lbgallery').append('<img src="/grafika/lupa.jpg" alt="zoom" class="lupa">');$('.lbgallery span').css({opacity:0.7});$('.ajaxForm form').submit(function(){var datas=$(this).serialize();var ajaxResp=$(this).parent().find('.mailAjaxResp');var ajaxForm=$(this);var ajaxSendTo=$(this).attr('action');ajaxResp.css({display:'block'});$(this).hide("blind",{ direction:"vertical" },300);ajaxResp.html('<img src="/grafika/preloader.gif" alt="">');$.post(ajaxSendTo,datas,function(data){if (data=='ok'){ajaxResp.html('<div id="wyslanaOk">OK</div>');}if (data=='nieok'){ajaxResp.html('<div id="wyslanaNieok">ERROR</div>');ajaxForm.show("blind",{ direction:"vertical" },300);}}); return false;});$('.showAjaxForm').each(function(){$(this).parent().find('form').css({display:'none'});});$('.showAjaxForm a').click(function(){$(this).parent().parent().find('form').show("blind",{ direction:"vertical" },300);$(this).parent().remove();return false;});if($('body').find('#playlist').length > 0){plid=$('#playlist').attr('class');h=($('#playlist ul').find('li').length+1)*23;s2=new SWFObject("/grafika/player.swf","playlist","300",h,"7");s2.addVariable("file","/"+plid+".xml");s2.addVariable("backcolor","0x000000");s2.addVariable("frontcolor","0xffffff");s2.addVariable("lightcolor","0x729dff");s2.addVariable("displayheight","0");s2.addVariable("autostart","false");s2.write("playlist");}function changetop(){$('#changedTop li:first').animate({opacity:0},600,function(){$('#changedTop ul').append($('#changedTop ul li:first'));$('#changedTop ul li:last').css({opacity:1});$('#changedTop ul li:first').css({opacity:0});$('#changedTop ul li:first').animate({opacity:1},600,function(){$('#changedTop ul li:first').css({opacity:1});});});}setInterval(changetop,3000);$('.forscrollingtext').SetScroller({velocity:160,direction:'vertical'});
