var ef=function(){return{}}();ef.core=function(){function a(e,b,c){var d=new YAHOO.util.Anim(null,{scroll:{from:YAHOO.util.Dom.getDocumentScrollTop(),to:e}},b,c);d.setAttribute=function(g,f,h){window.scroll(0,f)};d.animate()}return{scrollTo:function(c,b){a(YAHOO.util.Dom.getXY(c)[1],b,YAHOO.util.Easing.easeOut)},fixClickOnTree:function(b,c){if(c===undefined){c=[]}b.subscribe("expandComplete",function(){var e=YAHOO.util.Dom.get(b.getEl()).getElementsByTagName("a");for(var g=0;g<e.length;g++){var d=e[g];for(var f=0;f<c.length;f++){if(c[f].test(d)){c[f].map(d);continue}}if(!YAHOO.util.Dom.hasClass(d,"ygtvspacer")&&d.href!="#"&&d.href!=""){(function(h){YAHOO.util.Event.on(h,"click",function(i){location.href=h.href;YAHOO.util.Event.stopEvent(i)})})(d)}}})}}}();(function(){var c=YAHOO.util.Dom,b=YAHOO.util.Event;CAROUSEL_LABELS=["Szukasz oryginalnego prezentu dla bliskiej osoby?","Mamy dla Ciebie wyjątkową ofertę !","Plakat-mozaika stworzony z Twoich zdjęć","Przetestuj już teraz - to nic nie kosztuje !"];var a={wymagania:function(){return c.getElementsByClassName("list-item","div",c.get("content-menu"))[3]}};ef.frontpage=function(){function h(){var i=new YAHOO.widget.Carousel("carousel-container",{numVisible:1,autoPlayInterval: 3000, isCircular: true, animation:{speed:1,effect:YAHOO.util.Easing.backOut}});i.on("itemSelected",function(l){var k=i.getElementForItem(l);k.blur();var j='<span style="float: left;">'+CAROUSEL_LABELS[l]+'</span><span style="float: right; margin-right: 6px;">'+(l+1)+" z "+CAROUSEL_LABELS.length+"</span>";c.get("carousel-title").innerHTML=j});i.render();i.show(); i.startAutoPlay();c.get("carousel-image-2").src="1.png";c.get("carousel-image-3").src="3.jpg";c.get("carousel-image-4").src="4.png";}  function g(){var j=c.getElementsByClassName("header","a",c.get("content-menu"));for(var k=0;k<j.length;k++){b.on(j[k],"click",function(i){if(c.hasClass(this.parentNode,"active")){c.removeClass(this.parentNode,"active")}else{c.addClass(this.parentNode,"active")}b.stopEvent(i)})}}function d(){var j=new ef.frontpage.SubscribeBox(c.get("subscription-email"),c.get("subscription-button"),c.get("subscription-email-error"),c.get("subscription-server-error"),c.get("subscription-success"));var i=new ef.frontpage.InvitationBox(c.get("invitation-email"),c.get("invitation-button"),c.get("invitation-email-error"),c.get("invitation-server-error"),c.get("invitation-success"))}function f(){faqTree=new YAHOO.widget.TreeView("faq-tree");faqTree.render();ef.core.fixClickOnTree(faqTree)}function e(){var r=navigator.appVersion,m=navigator.userAgent,n=navigator.appName,o=""+parseFloat(navigator.appVersion),l=parseInt(navigator.appVersion,10),s,j,k;if((j=m.indexOf("MSIE"))!=-1){n="Internet Explorer";o=m.substring(j+5)}else{if((j=m.indexOf("Opera"))!=-1){n="Opera";o=m.substring(j+6)}else{if((j=m.indexOf("Chrome"))!=-1){n="Chrome";o=m.substring(j+7)}else{if((j=m.indexOf("Safari"))!=-1){n="Safari";o=m.substring(j+7)}else{if((j=m.indexOf("Firefox"))!=-1){n="Firefox";o=m.substring(j+8)}else{if((s=m.lastIndexOf(" ")+1)<(j=m.lastIndexOf("/"))){n=m.substring(s,j);o=m.substring(j+1);if(n.toLowerCase()==n.toUpperCase()){n=navigator.appName}}}}}}}if((k=o.indexOf(";"))!=-1){o=o.substring(0,k)}if((k=o.indexOf(" "))!=-1){o=o.substring(0,k)}l=parseInt(""+o,10);if(isNaN(l)){o=""+parseFloat(navigator.appVersion);l=parseInt(navigator.appVersion,10)}var i=c.get("useragent");var q="Używasz przeglądarki "+n+" "+o+".";i.appendChild(document.createTextNode(q))}return{init:function(){var i=location.href;if(i.indexOf("#")!=-1){var j=a[i.substr(i.indexOf("#")+1)]();c.addClass(j,"active");ef.core.scrollTo(j,0)}h();g();d();f();e()}}}();ef.frontpage.SubscribeBox=function(f,e,g,h,d){this.emailInput=f;this.sendButton=e;this.emailError=g;this.serverError=h;this.successMsg=d;b.on(this.emailInput,"focus",function(){if(this.value=="adres e-mail"){this.value=""}});b.on(this.emailInput,"blur",function(){if(this.value==""){this.value="adres e-mail"}});this.init()};ef.frontpage.SubscribeBox.prototype={_url:"subscribe.php",handleSuccess:function(d){if(d.responseText=="ok"){this.successShow();this.loaderHide()}else{this.serverErrorShow();this.loaderHide()}},handleFailure:function(){this.serverErrorShow();this.loaderHide()},init:function(){b.on(this.sendButton,"click",this.send,this,true)},send:function(){var f={success:this.handleSuccess,failure:this.handleFailure,scope:this,timeout:1000*10};var d=this.emailInput.value;this.serverErrorHide();this.successHide();if(this.isValidEmail(d)){this.loaderShow();this.emailErrorHide();var e=YAHOO.util.Connect.asyncRequest("POST",this._url,f,"email="+d)}else{this.emailErrorShow()}},isValidEmail:function(d){return(/^\w+@(\w+\.)+(\w)+$/).test(d)},loaderShow:function(){this.buttonLabel=this.sendButton.value;this.sendButton.value="";c.addClass(this.sendButton,"ajax");this.sendButton.blur()},loaderHide:function(){this.sendButton.value=this.buttonLabel;c.removeClass(this.sendButton,"ajax")},successShow:function(){c.addClass(this.successMsg,"active")},successHide:function(){c.removeClass(this.successMsg,"active")},serverErrorShow:function(){c.addClass(this.serverError,"active")},serverErrorHide:function(){c.removeClass(this.serverError,"active")},emailErrorShow:function(){c.addClass(this.emailError,"active")},emailErrorHide:function(){c.removeClass(this.emailError,"active")}};ef.frontpage.InvitationBox=function(f,e,g,h,d){ef.frontpage.InvitationBox.superclass.constructor.call(this,f,e,g,h,d)};YAHOO.lang.extend(ef.frontpage.InvitationBox,ef.frontpage.SubscribeBox,{_url:"inform.php"})})();YAHOO.util.Event.onDOMReady(ef.frontpage.init,ef.frontpage,true);
