function printPage(b,a){Mediabox.open(b,a,"660 600");return false}function mailArticlePage(a){Mediabox.open(a,"","460 420");return false}var prevElement=new Object();var nextElement=new Object();var galleryScroll=new Object();var galleryCurrent=new Object();var galleryWidth=new Object();function galleryScrollPrev(a){prev=galleryCurrent[a].toInt()-1;prevElement[a]=$("innergal"+a+"-"+prev);if(prevElement[a]){galleryScroll[a].toElement(prevElement[a]);galleryCurrent[a]=prev;setPrevLink(a)}}function galleryScrollNext(b,a){var c=a||0;next=galleryCurrent[b].toInt()+1;nextElement[b]=$("innergal"+b+"-"+next);if(nextElement[b]){if(c==0){galleryScroll[b].toElement(nextElement[b])}else{galleryScroll[b].set(c,0)}galleryCurrent[b]=next;setPrevLink(b)}}function setPrevLink(a){prev=galleryCurrent[a].toInt()-1;prevElement[a]=$("innergal"+a+"-"+prev);if(prevElement[a]){$("innergal"+a+"-overlaylink").style.display="block";$("innergal"+a+"-overlaylink").setAttribute("href",prevElement[a].getAttribute("href"))}else{$("innergal"+a+"-overlaylink").style.display="none"}}function showLifestyleToptip(){Cookie.dispose("toptip");Cookie.write("toptip","lifestyle",{domain:"ibiza-style.com",path:"/pages/"});Cookie.write("toptip","lifestyle",{domain:"ibzstyle-entwicklung.teuto.net",path:"/pages/"});$("toptips-content-lifestyle").className="toptips-content-active";$("tab-toptips-lifestyle").className="toptips-tabs-active";$("tab-toptips-events").className="toptips-tabs-normal";$("toptips-content-events").className="toptips-content-normal"}function showEventsToptip(){Cookie.dispose("toptip");Cookie.write("toptip","events",{domain:"ibiza-style.com",path:"/pages/"});Cookie.write("toptip","events",{domain:"ibzstyle-entwicklung.teuto.net",path:"/pages/"});$("toptips-content-lifestyle").className="toptips-content-normal";$("tab-toptips-lifestyle").className="toptips-tabs-normal";$("tab-toptips-events").className="toptips-tabs-active";$("toptips-content-events").className="toptips-content-active"}var ContentSlider=new Class({Implements:[Options,Events],options:{debug:false,slides:[],switcher:[],nextLink:null,prevLink:null,container:null,autoplayToggler:null,autoplayStart:null,autoplayStop:null,slideName:"",startIndex:0,wrap:true,transition:Fx.Transitions.Quart.easeOut,duration:1000,autoplay:false,autoplayTime:10000},initialize:function(a){this.setOptions(a);this.addSlides(this.options.slides);this.addSwitcher(this.options.switcher);this.prepareNavigation();if(this.slides.length){this.showSlide(this.options.startIndex,true)}if(this.options.autoplay){this.prepareAutoplay()}},isPlaying:false,timer:null,prepareAutoplay:function(){this.log("preparing autoplay ...");if($chk(this.options.autoplayToggler)){var a=this.options.autoplayToggler;a.addEvent("click",function(b){b.stop();if(this.isPlaying){this.stopAutoplay();this.options.autoplayToggler.className="toparticleswitcher-toggler-start"}else{this.startAutoplay();this.options.autoplayToggler.className="toparticleswitcher-toggler-stop"}}.bind(this))}if($chk(this.options.autoplayStart)){var a=this.options.autoplayStart;a.addEvent("click",function(b){b.stop();if(!this.isPlaying){this.startAutoplay()}}.bind(this))}if($chk(this.options.autoplayStop)){var a=this.options.autoplayStop;a.addEvent("click",function(b){b.stop();if(this.isPlaying){this.stopAutoplay()}}.bind(this))}this.startAutoplay()},startAutoplay:function(){this.log("start autoplay");if($chk(this.options.autoplayToggler)){this.options.autoplayToggler.className="toparticleswitcher-toggler-stop"}this.timer=this.showNextSlide.periodical(this.options.autoplayTime,this);this.isPlaying=true;this.log(this.timer)},stopAutoplay:function(){this.log("stop autoplay");if($chk(this.options.autoplayToggler)){this.options.autoplayToggler.className="toparticleswitcher-toggler-start"}this.timer=$clear(this.timer);this.isPlaying=false},prepareNavigation:function(){if($chk(this.options.prevLink)){this.log("adding prevLink action");this.options.prevLink.addEvent("click",function(a){a.stop();this.showPrevSlide()}.bind(this))}if($chk(this.options.nextLink)){this.log("adding nextLink action");this.options.nextLink.addEvent("click",function(a){a.stop();this.showNextSlide()}.bind(this))}},slides:[],switcher:[],addSlides:function(a){$$(a).each(function(b){b.style.display="block";this.slides.include($(b))},this);this.log(this.slides)},addSwitcher:function(a){$$(a).each(function(b,c){b.addEvent("click",function(d){d.stop();this.log("CLICK EVENT: this.showSlide("+c+")");if(this.options.autoplay&&this.isPlaying){this.stopAutoplay()}this.showSlide(c)}.bind(this));this.switcher.include(b)},this);this.log(this.switcher)},showNextSlide:function(){if($chk(this.currentSlide)&&this.currentSlide<(this.slides.length-1)){this.showSlide(this.currentSlide+1)}else{if((this.currentSlide)&&this.options.wrap){this.showSlide(0)}else{if(!$defined(this.currentSlide)){this.showSlide(this.options.startIndex)}}}},showPrevSlide:function(){if(this.currentSlide>0){this.showSlide(this.currentSlide-1)}else{if(this.options.wrap){this.showSlide(this.slides.length-1)}}},showSlide:function(e,d){if(this.options.slideName=="lifestyle"){Cookie.dispose("lifestyleindex");Cookie.write("lifestyleindex",e,{domain:"ibiza-style.com",path:"/pages/"});Cookie.write("lifestyleindex",e,{domain:"ibzstyle-entwicklung.teuto.net",path:"/pages/"})}else{if(this.options.slideName=="events"){Cookie.dispose("eventsindex");Cookie.write("eventsindex",e,{domain:"ibiza-style.com",path:"/pages/"});Cookie.write("eventsindex",e,{domain:"ibzstyle-entwicklung.teuto.net",path:"/pages/"})}}this.log("showing slide");this.log(e);if(!$chk(this.currentSlide)){this.currentSlide=this.options.startIndex}var b=this.currentSlide;var c=this.slides[b];var a=this.slides[e];this.log("function slide");this.log(e);if(!$chk(this.fxScroll)){this.fxScroll=new Fx.Scroll(this.options.container,{wheelStops:false,link:"cancel",duration:this.options.duration,transition:this.options.transition})}this.log(this.fxScroll);if($chk(d)&&d){this.fxScroll.set(e*this.slides[this.currentSlide].getSize().x,0);this.log("SET"+e*this.slides[this.currentSlide].getSize().x)}else{this.fxScroll.toElement(this.slides[e])}this.currentSlide=e;this.setNavigationImages()},setNavigationImages:function(){this.switcher.each(function(a){a.className="page-switcher-item page-switcher-item-normal"});this.switcher[this.currentSlide].className="page-switcher-item page-switcher-item-active"},log:function(a){if(this.options.debug){console.log(a)}}});var ContentFader=new Class({Extends:ContentSlider,initialize:function(a){this.setOptions(a);this.addSlides(this.options.slides);this.addSwitcher(this.options.switcher);this.prepareNavigation();if(this.slides.length){this.log("ContentFader: Verstecke alle Slides");this.slides.each(function(c,b){c.fade("hide")}.bind(this));this.showSlide(this.options.startIndex,true)}if(this.options.autoplay){this.prepareAutoplay()}},showSlide:function(e,d){if(!$chk(this.currentSlide)){this.currentSlide=this.options.startIndex}var b=this.currentSlide;var c=this.slides[b];var a=this.slides[e];if($chk(d)&&d){this.log("ContentFader: zeige ersten Slide");this.slides[e].fade("show")}else{this.log("ContentFader: verstecke:"+this.currentSlide+" zeige: "+e);this.slides[this.currentSlide].fade("out");this.slides[e].fade("in")}this.currentSlide=e;this.setNavigationImages()}});