9f4/** * flowplayer.playlist.js 3.0.5. Flowplayer JavaScript plugin. * * This file is part of Flowplayer, http://flowplayer.org * * Author: Tero Piirainen, * Copyright (c) 2008 Flowplayer Ltd * * Dual licensed under MIT and GPL 2+ licenses * SEE: http://www.opensource.org/licenses * * Version: 3.0.5 - Tue Feb 24 2009 11:42:22 GMT-0000 (GMT+00:00) */ (function($){$f.addPlugin("playlist",function(wrap,options){var self=this;var opts={playingClass:'playing',pausedClass:'paused',progressClass:'progress',template:'${title}',loop:false,playOnClick:true,manual:false};$.extend(opts,options);wrap=$(wrap);var manual=self.getPlaylist().length<=1||opts.manual;var els=null;if(!manual){var template=wrap.is(":empty")?opts.template:wrap.html();wrap.empty();$.each(self.getPlaylist(),function(){if(this.duration===0){return false;}var el=template;var self=this;$.each(this,function(key,val){if(!$.isFunction(val)){el=el.replace("$\{"+key+"\}",val).replace("$%7B"+key+"%7D",val);}});wrap.append(el);});els=wrap.children().click(function(){return play($(this),els.index(this));});}else{els=wrap.children();if(els.eq(0).hasClass("__scrollable")){els=els.children();}if($.isFunction(els.live)){$(wrap.selector+"> *").live("click",function(){var el=$(this);return play(el,el.attr("href"));});}else{els.click(function(){var el=$(this);return play(el,el.attr("href"));});}var clip=self.getClip(0);if(!clip.url&&opts.playOnClick){clip.update({url:els.eq(0).attr("href")});}}function play(el,clip){if(el.hasClass(opts.playingClass)||el.hasClass(opts.pausedClass)){self.toggle();}else{el.addClass(opts.progressClass);self.play(clip);}return false;}function clearCSS(){if(manual){els=wrap.children();}els.removeClass(opts.playingClass);els.removeClass(opts.pausedClass);els.removeClass(opts.progressClass);}function getEl(clip){return(manual)?els.filter("[href="+clip.url+"]"):els.eq(clip.index);}self.onBegin(function(clip){clearCSS();getEl(clip).addClass(opts.playingClass);});self.onPause(function(clip){getEl(clip).removeClass(opts.playingClass).addClass(opts.pausedClass);});self.onResume(function(clip){getEl(clip).removeClass(opts.pausedClass).addClass(opts.playingClass);});if(!opts.loop&&!manual){self.onBeforeFinish(function(clip){if(clip.index -1 ) { adVendorNameSeparator = document.getElementById( "vendor_name_separator" + vendorNames[vendorNameCount][0] ); if ( adVendorNameSeparator != null ) adVendorNameSeparator.style.display = "none"; } } function containElement( array, element ) { for ( var i = 0; i < array.length; i++ ) { if( array[i] == element ) return true; } return false; } function changeAdCheckbox( elID ) { var el = document.getElementById( elID ); el.checked = !el.checked; } function activatePopupBox( index ) { var popupBoxCount = 5; for ( var i = 0; i < popupBoxCount; i++ ) { var popupBox = document.getElementById( "popupBox" + i ); if ( popupBox != null && popupBox.style.display == "block" ) return; } popupBox = document.getElementById( "popupBox" + index ); if ( popupBox != null ) popupBox.style.display = "block"; else { for ( var j = index + 1; j < popupBoxCount; j++ ) { popupBox = document.getElementById( "popupBox" + j ); if ( popupBox != null ) { popupBox.style.display = "block"; return; } } } } function openPopupInfoPage( url ) { window.open(url, "", "top=110, left=350, width=560, height=705,scrollbars=1,resizable=0,toolbar=1,location=1,menubar=1,status=1,directories=1"); }