function bmvSongList(b,a,c){if(c!==false){this.create(b,a,c)}}bmvSongList.inherit(top.bmHTMLView);bmvSongList.prototype.lastElements={};bmvSongList.prototype.suspendDropdown=null;bmvSongList.prototype.currentEgg=null;bmvSongList.prototype.lastPlayerState=-1;bmvSongList.prototype.inlineItemsContainer="inlineItemsContainer";bmvSongList.prototype.inlinePlayerList="inlinePlayerList";bmvSongList.prototype.create=function(b,a,d){this.type="bmvSongList";this.className="bmvSongList";top.bmHTMLView.prototype.create.call(this,b,a,d);var c=this;c.load=function(e){c.suspendDropdown=b.createObject("bmSuspendDropdown",c,{name:"suspendDropdown",elementWindow:c.window,top:"rounded"});b.player.attachEvent("statechange",c.onPlayerStateChange);c.findAndTouchEggs()};c.unload=function(e){b.player.detachEvent("statechange",c.onPlayerStateChange)};c.inside=function(g){var f=c.getListElement(g);var e=f.id.match(/songList_(\w+)_\d+/)[1];if(c.suspendDropdown.element&&!b.elementInContainer(c.suspendDropdown.element,f,c.window)){c.suspendDropdown.hide()}if(!c.currentEgg||!b.elementInContainer(c.currentEgg.instance,c.lastElements[e])){c.hideEggs(c.lastElements[e])}c.lastElements[e]=f;c.showEggs(f)};c.outside=function(e){};c.onListOutside=function(i){var g=b.isIE()?i.toElement:i.relatedTarget;var e=b.getOriginalEventElement(i);while(e.className.indexOf("songListContainer_")==-1){e=e.parentNode}if(!b.elementInContainer(g,e,c.window)&&!b.elementInContainer(g,c.suspendDropdown.instance,c.window)){var f=e.className.match(/songListContainer_(\w+)/)[1];if(c.lastElements[f]){if(c.suspendDropdown.element){c.suspendDropdown.hide()}var h=b.getElementsByClassName(c.window,c.inlinePlayerList,"*",c.lastElements[f])[0];if(c.currentEgg==null||h.parentNode.parentNode.id!=c.currentEgg.instance.parentNode.parentNode.id){c.hideEggs(c.lastElements[f])}}}};c.onPlayClick=function(f){var e=b.getOriginalEventElement(f);var g=c.setCurrentEgg(e);if(g&&c.isPlayingEgg()){c.play(f);e.parentNode.className+=" play_Player"}else{if(c.isPlayingEgg()){switch(b.player.readyState){case b.player.PLAYER_PLAY:b.player.pause();break;case b.player.PLAYER_PAUSE:b.player.play();break}}else{c.play(f);c.lastPlayerState=-1}}b.eventPreventDefault(f);return false};c.showDropdown=function(f){var e=b.getOriginalEventElement(f,"i");e.className+=e.className.indexOf("active")==-1?" active":"";c.suspendDropdown.setFollowElement(e);c.suspendDropdown.show(c.getSuspendIds(e));c.suspendDropdown.attachEvent("hide",c.onDropdownHide)};c.onDropdownHide=function(){var e=c.suspendDropdown.element;e.className=e.className.replace(/[\s]?active/g,"");c.suspendDropdown.detachEvent("hide",c.onDropdownHide);c.suspendDropdown.setFollowElement(null)};c.play=function(f){var e=b.getOriginalEventElement(f,"b");var g=c.getPlayIds(e);switch(g.type){case"song":if(g.ids.length>1){b.player.playContent(0,"playlist","new",g.ids.length,{firstId:g.ids})}else{b.player.playContent(g.ids[0],"audio","new")}break;case"album":case"playlist":if(g.offset!==false){b.player.playContent(g.ids[0],g.type,"new",0,null,"any",g.offset)}else{b.player.playContent(g.ids[0],g.type,"new")}break}};c.onPlayerStateChange=function(f){if(c.currentEgg!=null&&c.isPlayingEgg()){var e=c.currentEgg.instance;e.className=e.className.replace(/([\s]?(play|pause)_Player)/g,"");switch(f){case b.player.PLAYER_SONG_COMPLETE:c.hideEggs(c.getListElement(e,"element"));c.currentEgg=null;break;case b.player.PLAYER_PLAY:e.className+=" play_Player";break;case b.player.PLAYER_PAUSE:e.className+=" pause_Player";break}c.lastPlayerState=f}}};bmvSongList.prototype.getListElement=function(b,a){a=a||"event";if(a=="event"){b=application.getOriginalEventElement(b)}while(b!=null){var c=(b||0).id||"";if(c.indexOf("songList_")!=-1){break}else{b=b.parentNode}}return b};bmvSongList.prototype.getFirstListElement=function(a){var b=this.document.getElementById("songList_"+a+"_0");if(!b){b=this.document.getElementById("songList_"+a+"_1")}return b};bmvSongList.prototype.showEggs=function(a){a=this.getListElement(a,"element");if(a){if(a.className.indexOf("activePlay")==-1){a.className+=" activePlay"}}};bmvSongList.prototype.hideEggs=function(a){a=this.getListElement(a,"element");if(a){a.className=a.className.replace(/[\s]?activePlay/g,"")}};bmvSongList.prototype.getSuspendIds=function(el){return eval(application.getElementsByClassName(this.window,"suspendSongIds","*",el.parentNode)[0].innerHTML)};bmvSongList.prototype.getPlayIds=function(el){var res={};el=application.getElementsByClassName(this.window,"playIds","*",el.parentNode)[0];res.ids=eval(el.innerHTML);res.type=el.getAttribute("playtype");res.offset=el.getAttribute("playlistoffset")||false;res.offset=res.offset!==false?parseInt(res.offset):false;return res};bmvSongList.prototype.isPlayingEgg=function(e){var g=null;if(application.player.currentSong){g=application.player.currentSong.identifier}if(g){var f={};var c=null;if(e){f=this.getPlayIds(e);c=e}else{e=this.currentEgg;f=e.songs;c=e.instance}if(!f){return false}var b=application.player.getListenContentType();var d=application.player.getListenContentId();var a=parseInt(application.elementIndex(this.getSuspendIds(c),g));b=b=="audio"?"song":b;if(f.offset!==false){return a===0}if(b=="playlist"&&d==0){if(f.type=="song"&&a===0){return true}}else{return(b==f.type&&d==f.ids[0])}}return false};bmvSongList.prototype.setCurrentEgg=function(a){if(this.currentEgg){if(this.currentEgg.instance!=a.parentNode){this.currentEgg.instance.className=this.currentEgg.instance.className.replace(/([\s]?(play|pause)_Player)/g,"");this.hideEggs(this.currentEgg.instance)}else{return null}}var b=this.currentEgg;this.currentEgg={instance:a.parentNode,songs:this.getPlayIds(a)};return b};bmvSongList.prototype.findNextEgg=function(){var c=this.getListElement(this.currentEgg.instance,"element");c=c.id.match(/songList_(\w+)_(\d)+/);var a=this.document.getElementById("songList_"+c[1]+"_"+(parseInt(c[2])+1));if(a){var b=application.getElementsByClassName(this.window,this.inlinePlayerList,"*",a)[0];b=b.getELementsByTagName("i");this.setCurrentEgg(b);return true}return false};bmvSongList.prototype.fixOperaEggPosition=function(a){a.className=a.className.replace(/[\s]?eggOpera/,"")+" eggOpera"};bmvSongList.prototype.findAndTouchEggs=function(a){a=a||this.document;var e=application.getElementsByClassName(this.window,this.inlinePlayerList,"*",a),b=e.length,g=0,c=this.window.opera?true:false;while(g<b){var j=e[g];application.attachEvent(this.getListElement(j,"element"),"mouseover",this.inside);if(c){this.fixOperaEggPosition(j)}application.attachEvent(j.getElementsByTagName("i")[0],"click",this.showDropdown);application.attachEvent(j.getElementsByTagName("b")[0],"click",this.onPlayClick);g++}var d=application.getElementsByClassName(this.window,this.inlineItemsContainer,"*",a),h=d.length;g=0;while(g<h){application.attachEvent(d[g],"mouseout",this.onListOutside);g++}if(c){var f=application.getElementsByClassName(this.window,"inlinePlayerText","*",a);var k=f.length;if(k>0){g=0;while(g<k){this.fixOperaEggPosition(f[g]);g++}}}};var application=top.application;application.bmvSongList=new bmvSongList(application,application,{name:"application.bmvSongList",window:self});