/** * Homepage, Rotator * -------------------------- */ function ActionRotator(container) { this.container = container; this.current = -1; this.items = []; this.init(); } ActionRotator.prototype = { TIME_DELAY: 6000, // ms TIME_RESUME: 2000, init:function() { // add items to controller, skip overview link var overview = /overview/i; var items = this.container.getElementsByTagName("li"); for (var item,i=0; i 0)? step : (100 - step); this.setOpacity(t); }, animateEnd:function() { this.animate(100); if(this.direction < 0) { this.display(false); } }, setOpacity:function(opacity) { var css = this.banner.style; css.opacity = opacity / 100; css.mozOpacity = opacity / 100; css.filter = 'alpha(opacity='+opacity+')'; }, display:function(toggle) { this.banner.style.display = toggle? 'block' : 'none'; this.visible = toggle; }, scope:function(method) { var scope = this; return function() { return method.apply(scope, arguments); } } } /** * Business Homepage, Rotator * -------------------------- */ BizActionRotator = Class.extend( ActionRotator, function(){ }, { init:function() { var pages = this.container.getElementsByTagName("ul")[0]; var list = this.container.getElementsByTagName("ol")[0]; var items = list.getElementsByTagName("li"); var buttons = pages.getElementsByTagName("li"); for (var button,item,i=0; i0) { movieURL = $(this).find("a[href$=.flv]").attr("href"); playItem2 = {'url': movieURL, 'linkUrl':targetURL}; } else { imageURL = $(this).find("img").attr("src"); playItem2 = {'url': imageURL, 'duration': 6, 'linkUrl':targetURL}; } staticList.push(playItem2); }); return staticList; }, toggleSound:function() { var player =$f("player"); if($(this).is(".mute")) { player.unmute(); $(this).removeClass("mute"); } else { player.mute(); $(this).addClass("mute"); } }, pageNavigation:function() { var button = $(this).text(); var player =$f("player"); var index = player.getClip().index; if(button == "Vorige") { index -= 1; if(index < 0) { index=player.getPlaylist().length - 1; } } else if(button == "Volgende") { index += 1; if(index == player.getPlaylist().length) { index=0; } } else { parsed = parseInt(button); if(isNaN(parsed)) { return; } else { index = parsed - 1; } } player.play(index); }, createHTML:function() { $paginationElements = $(this.container).find(".rotator-pagination"); $container = $(this.container); $container.empty(); $container.append($paginationElements); $extraControls = $('
'); $paginationElements.find("a").click(this.pageNavigation); $container.append($extraControls); $extraControls.find(".sound").click(this.toggleSound); $container.append("
"); $player = $("#player"); width = parseInt($container.css("width").replace(/px,*\)*/g,"")); height = parseInt($container.css("height").replace(/px,*\)*/g,"")); if(width==474) { $player.css("padding", "4px"); $player.css("width", (width-10)+"px"); $player.css("height",(height-10)+"px"); $player.css("border", "1px solid #D4D4D4"); } else { $player.css("width", (width)+"px"); $player.css("height",(height)+"px"); } }, init:function() { playlist2 = this.createPlaylist(); this.createHTML(); this.compactPagenavigation(); this.player = $f("player", {src: "/static/swf/flowplayer.swf", wmode: 'opaque'}, { playlist: this.playlistStatic, plugins: { controls: null }, debug: false, clip: { loop: true, onStart: function () { if(this.getClip().type=="video") { $(".rotator-controls .sound").show(); } else { $(".rotator-controls .sound").hide(); } $(".rotator-pagination li").removeClass("current"); $(".rotator-pagination li:nth-child("+(this.getClip().index+2)+")").addClass("current"); }, onBeforeFinish: function () { if (this.getClip().index == this.getPlaylist().length - 1) { return false; } } } } ); } });