var currentIndex=0;var sroll={initialize:function(a,b){this.size=a?a:7;this.width=b?b:854;var c=this;this.mvlist=$("mvlist");this.items=$$("#mvlist>li");this.mylist_width=this.items.length*122;this.mvlist.setStyle("width",this.mylist_width);this.mylist_box_width=this.mvlist.getParent().getSize().x;this.mvlistFx=new Fx.Tween(c.mvlist,{fps:50,duration:"800"});this.des=this.mvlist.getParent("div.wrap").getElement("span.des");this.desFx=new Fx.Tween(this.des,{fps:50,duration:"500"});this.tasklist=new taskList(800);this.mylist_target_list=0},bind:function(){var a=this;this.items.each(function(d,c){var b=new Fx.Tween(d.getElement("a"),{fps:50,duration:"150"});d.addEvents({mouseenter:function(){var g=d.getPosition(d.getParent("div.wrap")).x;var f=d.getPosition(d.getParent("div.mvlistarea")).x;var e=d.getPosition(a.mvlist).x;g=f>158&&e>0?g-158:g+110;b.cancel();b.start("margin-top",-67);if(d.getElement("a").get("title")){a.des.set("html",d.getElement("span[name=description]").get("html"));a.desFx.cancel();a.desFx.set("opacity",0);a.desFx.set("left",g);a.desFx.start("opacity",1)}g=f=e=null},mouseleave:function(){b.cancel();b.start("margin-top",0);
																																																																																																																																																																																																																																																																																												   a.desFx.cancel();a.desFx.set("opacity",0);
																																																																																																																																																																																																																																																																																																								if(a.size==5){var e=d.getElement("[name=del]");
																																																																																																																																																																																																																																																																																																																				if(e){e.dispose()}}},click:function(){var e=$("play_noaa");
 }})});


if(this.mylist_width>this.mylist_box_width){this.check_status()}},check_status:function(){var a=this;if(this.mylist_target_list==0){this.tasklist.empty();$("mvlist_next").removeEvents().set("class","default").addEvent("click",function(){this.blur();return false})}else{$("mvlist_next").set("class","allow");$("mvlist_next").removeEvents().addEvents({mouseenter:function(){this.addClass("hover")},mouseleave:function(){this.removeClass("hover")},click:function(){a.tasklist.addFn(function(){a.next()});this.blur();return false}})}if((this.mylist_box_width-this.mylist_width)==this.mylist_target_list){this.tasklist.empty();$("mvlist_prev").removeEvents().set("class","default").addEvent("click",function(){this.blur();return false})}else{$("mvlist_prev").set("class","allow");$("mvlist_prev").removeEvents().addEvents({mouseenter:function(){this.addClass("hover")},mouseleave:function(){this.removeClass("hover")},click:function(){a.tasklist.addFn(function(){a.prev()});this.blur();return false}})}},tween:function(b){if(b>=0){var a=Math.floor(b/this.size);var c=this.mylist_width-this.mylist_box_width;if(c>0){c=c>854*a?854*a:c;this.mylist_target_list=0-c}}this.mvlistFx.start("left",this.mylist_target_list);this.check_status()},prev:function(){var a=this.mvlist.getStyle("left").toInt();var b=this.mylist_width+a-this.mylist_box_width;if(b>0){b=b>854?854:b;this.mylist_target_list=a-b;this.mvlistFx.cancel();this.tween()}return false},next:function(){var a=this.mvlist.getStyle("left").toInt();if(a<0){a=a<-this.width?a+this.width:0;this.mylist_target_list=a;this.mvlistFx.cancel();this.tween()}return false}};var taskList=new Class({initialize:function(a){this.delayTime=a;this.fnList=[];this.flag=true},addFn:function(a){this.fnList.push(a);this.run()},run:function(){if(this.fnList.length&&this.flag){this.flag=false;this.fnList[0]();this.fnList.shift();var a=this;setTimeout(function(){a.flag=true;a.run()},a.delayTime)}},empty:function(){this.fnList=[]}});

//function playerReady(a){player=document.getElementById(a.id)}
function jsPlayListItem(a){if(sroll.mvlist){currentIndex=a;updateNowPlaying(a);$("mvlist").getElements("li").each(function(c,b){if(a==b){c.addClass("current")}else{c.removeClass("current")}})}}

function playItem(b){var d=$("videoplayer");if(d){var a=$$("#mvlist>li");var c=a[b];var h=c.getElement("[name=videoUrl]").get("html");var f=d.getElement("source");if(f){f.dispose()}new Element("source",{type:"video/mp4",src:h}).inject(d);d.load()}else{try{getPlayer().playlistItem(b)}catch(g){}}sroll.tween(b)}

function getPlayer(){if(window.document.yinyuetaiplayer){return window.document.yinyuetaiplayer}else{if(navigator.appName.indexOf("Microsoft")==-1){if(document.embeds&&document.embeds.yinyuetaiplayer){return document.embeds.yinyuetaiplayer}}}return document.getElementById("yinyuetaiplayer")}
function updateNowPlaying(d){try{var a=mvList[d];var c=$("nowPlaying");c.href="/video/"+a.getVideoId();c.set("html",a.getTitle());var b=$("nowPlaying_artist");b.set("html",a.getArtistName());b.href="/fanclub/"+a.getArtistId()}catch(f){}}
function playPrevItem(){if(currentIndex>0){playItem(currentIndex-1)}}

function playNextItem(){if(currentIndex<mvList.length-1){playItem(currentIndex+1)}}window.addEvent("domready",function(){var d=$("videoplayer");if(d){d.addEventListener("ended",function(){var h=$$("#mvlist>li")[currentIndex];var g=h.getNext();if(g){g.fireEvent("clicka")}},false)}var e=$("plContent");if(e){if(e.getSize().y>86){e.setStyles({height:66,overflow:"hidden",position:"relative"});$("plContentMore").setStyles({position:"absolute",bottom:"0",right:"0",display:"block",width:"80px",background:"#fff","text-align":"center"});$("plContentMore").addEvent("click",function(){var g=e.getStyle("height");if(g!="66px"){e.setStyle("height","66px");this.setStyles({position:"absolute",display:"block"});this.getElement("a").set("html","查看全部")}else{e.setStyle("height","auto");this.setStyles({position:"static",display:"inline-block"});this.getElement("a").set("html","收回描述")}return false})}}$$("#videoList>div").each(function(h){var g=new Mv(h.getElement("span[name=videoId]").get("html"),h.getElement("span[name=title]").get("html"),h.getElement("span[name=artistId]").get("html"),h.getElement("span[name=artistName]").get("html"),h.getElement("span[name=headImg]").get("html"),h.getElement("span[name=pubDate]").get("html"),h.getElement("span[name=content]").get("html"),h.getElement("span[name=displayOrder]").get("html"));mvList.put(g)});var b=$("shareVideoDiv");var a;var f=new Fx.Tween(b);var c={mouseenter:function(){a=true;$("postVideo").setStyle("height","5px");b.setStyles({display:"block",left:"660px",zIndex:"1"});if(b.getSize().x>(window.getSize().x-b.getPosition().x)){b.setStyle("left","563px")}},mouseleave:function(){a=false;setTimeout(function(){if(!a){$("postVideo").setStyle("height","30px");b.setStyle("display","none")}},500)}};if($("postVideo")){$("postVideo").addEvents(c)}if(b){b.addEvents(c)}});