(function(){var g={jQuery:"http://code.jquery.com/jquery-latest.min.js"};var j=function(){(function(k){k.fn.idTabs=function(){var n={};for(var m=0;m<arguments.length;++m){var l=arguments[m];switch(l.constructor){case Object:k.extend(n,l);break;case Boolean:n.change=l;break;case Number:n.start=l;break;case Function:n.click=l;break;case String:if(l.charAt(0)=="."){n.selected=l}else{if(l.charAt(0)=="!"){n.event=l}else{n.start=l}}break}}if(typeof n["return"]=="function"){n.change=n["return"]}return this.each(function(){k.idTabs(this,n)})};k.idTabs=function(n,m){var q=(k.metadata)?k(n).metadata():{};var o=k.extend({},k.idTabs.settings,q,m);if(o.selected.charAt(0)=="."){o.selected=o.selected.substr(1)}if(o.event.charAt(0)=="!"){o.event=o.event.substr(1)}if(o.start==null){o.start=-1}var l=function(){if(k(this).is("."+o.selected)){return o.change}var u="#"+this.href.split("#")[1];var s=[];var t=[];k("a",n).each(function(){if(this.href.match(/#/)){s.push(this);t.push("#"+this.href.split("#")[1])}});if(o.click&&!o.click.apply(this,[u,t,n,o])){return o.change}for(i in s){k(s[i]).removeClass(o.selected)}for(i in t){k(t[i]).hide()}k(this).addClass(o.selected);k(u).show();return o.change};var p=k("a[href*='#']",n).unbind(o.event,l).bind(o.event,l);p.each(function(){k("#"+this.href.split("#")[1]).hide()});var r=false;if((r=p.filter("."+o.selected)).length){}else{if(typeof o.start=="number"&&(r=p.eq(o.start)).length){}else{if(typeof o.start=="string"&&(r=p.filter("[href*='#"+o.start+"']")).length){}}}if(r){r.removeClass(o.selected);r.trigger(o.event)}return o};k.idTabs.settings={start:0,change:false,click:null,selected:".active",event:"!click"};k.idTabs.version="2.2";k(function(){k(".idTabs").idTabs()})})(jQuery)};var a=function(l,k){k=k.split(".");while(l&&k.length){l=l[k.shift()]}return l};var c=document.getElementsByTagName("head")[0];var f=function(k){var l=document.createElement("script");l.type="text/javascript";l.src=k;c.appendChild(l)};var e=document.getElementsByTagName("script");var h=e[e.length-1].src;var b=true;for(d in g){if(a(this,d)){continue}b=false;f(g[d])}if(b){return j()}f(h)})();
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:><\/script>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"){if(script.parentNode){script.parentNode.removeChild(script)}callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return}if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return}}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return}var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return}var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return}widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();FLYFI.cloudsPaging=new FLYFI.Paging();FLYFI.playlistsPaging=new FLYFI.Paging();FLYFI.externalPlaylistsPaging=new FLYFI.Paging();FLYFI.communityCloudPaging=new FLYFI.Paging();FLYFI.setPagingForLibrary=function(c,f,g){var a=f.length;for(var e=0;e<a;++e){var b=f[e];if(b.name==g){c.start=e;return true}}return false};FLYFI.grooveHashPrefix="groove-";FLYFI.playlistHashPrefix="playlist-";FLYFI.updatePagedClouds=function(){if(FLYFI.initialLibraryFromURL&&FLYFI.initialLibraryFromURL.substr(0,FLYFI.grooveHashPrefix.length)==FLYFI.grooveHashPrefix){$("#groove_tab_li a").click();var a=FLYFI.initialLibraryFromURL.slice(FLYFI.grooveHashPrefix.length);FLYFI.setPagingForLibrary(FLYFI.cloudsPaging,FLYFI.me_clouds,a);FLYFI.initialLibraryFromURL=null}FLYFI._updatePagedLibraries(FLYFI.cloudsPaging,"FLYFI.cloudsPaging","#participant_clouds_paging","#participant_clouds","FLYFI.me_clouds")};FLYFI.updatePagedPlaylists=function(){if(FLYFI.initialLibraryFromURL&&FLYFI.initialLibraryFromURL.substr(0,FLYFI.playlistHashPrefix.length)==FLYFI.playlistHashPrefix){$("#playlist_tab_li a").click();var a=FLYFI.initialLibraryFromURL.slice(FLYFI.playlistHashPrefix.length);FLYFI.setPagingForLibrary(FLYFI.playlistsPaging,FLYFI.me_playlists,a)}FLYFI._updatePagedLibraries(FLYFI.playlistsPaging,"FLYFI.playlistsPaging","#participant_playlists_paging","#participant_playlists","FLYFI.me_playlists")};FLYFI.updatePagedExternalPlaylists=function(){FLYFI._updatePagedLibraries(FLYFI.externalPlaylistsPaging,"FLYFI.externalPlaylistsPaging","#participant_externalplaylists_paging","#participant_externalplaylists","FLYFI.me_external_playlists")};FLYFI.getRecCountInPlaylist=function(c){tracks=c.tracks;if(!tracks){return null}var a=0;for(var b=0;b<tracks.length;b++){if(!tracks[b].approved){a++}}return a};FLYFI.updatePagedCommunityCloud=function(a,e,b){FLYFI.communityCloudPaging.available=1;var c=a.libraryID;if(!e||e.libraryID!=c){return}e.tracks=a.tracks;e.voteCallback=function(g,f){FLYFI.ensureEnoughCommunityPlaylistRecs(e);return true};e.deleteCallback=function(f){return e.voteCallback(false,f)};e.showHideRecsCallback=FLYFI.ensureEnoughCommunityPlaylistRecs;e.autoPlay=b;FLYFI.me_community_cloud=[e];FLYFI._updatePagedLibraries(FLYFI.communityCloudPaging,"FLYFI.communityCloudPaging","#community_cloud_paging",".community_cloud","FLYFI.me_community_cloud",true,"FLYFI.communityPlaylist_onSoundFinishedCallback","FLYFI.onServer_CommunityCloudEdited_UIcallback");if(a.reccommendationsRequested){FLYFI.ensureEnoughCommunityPlaylistRecs(e)}};FLYFI.onServer_CommunityCloudEdited_UIcallback=function(c,k,e){var f=c.seedsChanged;var h=c.nonMatchingArtists;if(f){FLYFI_MEDIA_ACCESS.load_library(k.libraryID)}if(k.name!=e){var g=$(".libraryname,.groove_name,.selected_groove,.station_name");var a=0;for(var b=0;b<g.length;b++){if(g.eq(b).text()==e){g.eq(b).text(k.name)}}}};FLYFI.communityPlaylist_onSoundFinishedCallback=function(b){var a=b.nextTrackWidget();b.setNotPlaying();b._onVoteUp(false,true);if(a.length>0){b.playWidget_TrackList(a)}};FLYFI.ensureEnoughCommunityPlaylistRecs=function(f){if(f.hide_recs){return}var e=f.libraryID;var a=FLYFI.getRecCountInPlaylist(f);if(a===null){return}var c=FLYFI.MAX_JSON_RECOMMENDED_TRACKS-a;if(c<=0){return}try{FLYFI.getJSONWithSpinner("/library/"+e+"/json/cloud_tracks/approved_count/0/unapproved_start/"+a+"/unapproved_count/"+c+"/","#player_shell .playlist_container .spinner",function(g){FLYFI.updateCommunityPlaylistTracks(f,g)},function(g,j,h){console.log("Error in request: "+g+"; status="+j+"; error="+h)})}catch(b){console.log("Error try block: for FLYFI.ensureEnoughCommunityPlaylistRecs; error="+b)}};FLYFI.updateCommunityPlaylistTracks=function(e,o){var n=o.libraryID;if(!e||e.libraryID!=n){return}if(o.tracks.length>0){var m=o.tracks;var l=e.tracks;var g=m.length;var b=l.length;var f=0;while(f<g){for(var c=0;c<b;c++){if(m[f].trackID===l[c].trackID){m.splice(f,1);g--;f--;break}}f++}e.tracks=e.tracks.concat(m);var k=$(".community_cloud .trackitems_list");for(var f=0;f<m.length;f++){var a=m[f];var h=new FLYFI.PlayerTrackCell(a,e.writable,FLYFI.peoplePlayerControls[e.libraryID]);k.append(h.html())}}if(o.reccommendationsRequested){setTimeout(function(){FLYFI.ensureEnoughCommunityPlaylistRecs(e)},5000)}};FLYFI._updatePagedLibraries=function(a,f,c,h,e,g,j,b){var k=$(c);var l=k.find(".spinner");if(a.allOnOnePage()){k.hide()}else{k.show()}l.show();setTimeout("FLYFI._updatePagedClouds("+f+", '"+c+"', '"+h+"', "+e+", '"+e+"'"+(g?", true":", false")+(j!=""?", "+j:", null")+(b!=""?", "+b:", null")+")",50)};FLYFI._updatePagedClouds=function(b,e,n,c,k,l,o,r){var p=$(e);var q=p.find(".spinner");var a=b.start+1;var g=b.getPageEnd();p.find(".list_select").val(a);if(a==g){p.find(".end").hide();p.find(".pagingdash").hide()}else{p.find(".pagingdash").show();p.find(".end").show()}p.find(".start").text(a);p.find(".end").text(g);p.find(".total").text(b.available);var m=$(n);var f=m.hasClass("controls_on_page");if(f){FLYFI._setStaticPlayerHeader(m,c[0],r)}else{m=FLYFI._buildPlayerControls(m,b,g,c,r)}b.end=g;q.hide();FLYFI.peoplePlayerControls=[];for(i=b.start;i<b.end;++i){libraryDict=c[i];var j=f?n:n+" .library-"+libraryDict.libraryID;var h=new FLYFI.PlayerControls(j+(f?" .player_controls":" .tracklistcontrols"),f?"videoplayer":"artist_videoplayer_"+libraryDict.libraryID,libraryDict,true,o,f);FLYFI._updatePagedClouds_trackList(libraryDict,j,h,f);h.selectFirstTrack();if(f&&libraryDict.autoPlay){h.play()}FLYFI.peoplePlayerControls[libraryDict.libraryID]=h}$(".libraryname").hover(function(){$(this).addClass("active")},function(){$(this).removeClass("active")}).click(function(){$(this).hide();$(this).siblings(".librarynameedit").show().select()});$(".librarynameedit").blur(FLYFI.onBlur_libraryNameEdit).keypress(function(s){if(s.keyCode==13){$(this).blur()}});m.find(".copylibrary").click(function(s){s.preventDefault();FLYFI.copy_library(libraryDict.libraryID,$(this).hasClass("copyasgroove"))});m.find(".shareplaylist").click(function(s){s.preventDefault();FLYFI.onClick_sharePlaylist(libraryDict)})};FLYFI._setStaticPlayerHeader=function(b,c,a){$(".station_label").show();$(".station_name").text(c.name).show();FLYFI._setupLibraryEdit(b,c,a)};FLYFI._buildPlayerControls=function(m,b,h,e,p){var c=m.clone(true);c.empty();for(var k=b.start;k<h;++k){var j=e[k];var o=[];o.push('<ul id="groove_'+j.libraryID+'" class="library library-'+j.libraryID+' hasborder collapsable_container">');o.push('<li class="head">');var g=(j.writable&&!j.isitunescloud?"libraryname":"librarynamenowrite");o.push('<span class="'+g+'" id="'+j.name+'">'+(j.isitunescloud?"(Groove for) ":"")+j.name+"</span>");if(j.writable&&!j.isitunescloud){o.push('<input class="librarynameedit" type="text" style="display:None;" value="'+j.name+'"></input>')}if(j.isshared&&p){o.push('<p class="edit_cloud_btn linkbutton"><a href="#">Add/Edit Artists in this Playlist</a></p>')}if(j.name=="Uploaded Tracks"){o.push('    <span class="right_link"><a href="../../broadcast/track/new/">Upload New Tracks</a></span>')}o.push('<div class="tracklistpaging" style="display:None;">');o.push('<img class="spinner" style="display:None;opacity:100;" src="/static/');o.push(window.level);o.push('/images/loading.gif" alt="Fetching Tracks" width="16" height="16" />');o.push('<span class="tracklistpagingcounts">');o.push('<span class="start"></span>');o.push('<span class="pagingdash">&nbsp;-&nbsp;</span>');o.push('<span class="end"></span>');o.push("&nbsp;of&nbsp;");o.push("</span>");o.push('<span class="total"></span>&nbsp;<span class="tracksword">Tracks</span>&nbsp;');o.push('<span class="tracklistpagingcontrols">');o.push('<a class="gotostart" href="#">|&lt;</a>&nbsp;');o.push('<a class="prev" href="#">&lt; prev</a>&nbsp;');o.push('<a class="next" href="#">next &gt;</a>&nbsp;');o.push('<a class="gotoend" href="#">&gt;|</a>&nbsp;');o.push("</span>");o.push("</div>");var f=j.iscloud?"groove":"playlist";o.push('<br><div class="copylibraries">');o.push('<img class="spinner inline copy_groove_spinner" style="display:None;opacity:100;" src="/static/');o.push(window.level);o.push('/images/loading.gif" alt="Copying tracks" width="16" height="16" />');o.push('<a class="copylibrary copyasgroove" href="" title="Make a copy of this playlist ');o.push(f);o.push(' for yourself.">[Copy as a groove]</a>&nbsp;&nbsp;');o.push('<img class="spinner inline copy_playlist_spinner" style="display:None;opacity:100;" src="/static/');o.push(window.level);o.push('/images/loading.gif" alt="Copying tracks" width="16" height="16" />');o.push('<a class="copylibrary copyasplaylist" href="" title="Copy this ');o.push(f);o.push(' to a new playlist.">[Copy as a playlist]</a>');o.push('  <a class="shareplaylist" href="" title="Share this ');o.push(f);o.push('" style="margin-left:20px;"><img src="/static/');o.push(window.level);o.push('/flyfi/images/ff_toolbar_shareicon21x21.gif" alt="" width="16" height="16" border="0" style="margin:0 4px -3px 0;" />Share This Playlist</a>');o.push("</div>");o.push("	</li>");o.push('	<li class="collapsable_items">');o.push('		<div class="trackhead collapsed">');o.push('			<ul class="tracklistcontrols">');o.push('				<li class="current_track_info"><a class="artistlink" href=""><span class="artist" style="position:relative;"></span></a><br><span class="titletext" style="position:relative;"></span></li>');o.push('				<li class="track_btns _dim">');o.push('					<ul class="tracklistcontrols_ul">');o.push('						<li class="artandvideo">');o.push('						   <ul class="mevideos">');o.push('                           		 <li class="albumart artwork artistphoto"><img src="/static/images/s.gif" width="100" height="100" align="left" alt="" class="artistphoto" /></li>');o.push('								<li class="video artwork" style="display:none;"><div id="artist_videoplayer_'+j.libraryID+'"></div></li>');o.push('								<!-- li class="trackinfo"><img class="spinner" src="/static/images/loading.gif" alt="Fetching Tracks" width="16" height="16" style="position:absolute; left:-27px; display:none;" /></li -->');o.push("							</ul>");o.push('							<ul class="ff_youtube_controls video_btn" style="display:none;">');o.push('								<li class="vid_toggle video_btn" style="display:none;"><span title="Make This Video BIGGER">Make This Video Bigger</span></li>');if(FLYFI.current_user&&FLYFI.current_user.hasRoleTasteMaker){o.push('								<li class="bad_video_btn video_btn" style="display:none;"><a href="" title="This video does not match this Track">This Video Ain\'t Right</a></li>')}o.push('								<li class="prev_video_btn video_btn" style="display:none;"><a href="" title="Play previous video for this Track">Play Previous Video</a></li>');o.push('								<li class="next_video_btn video_btn" style="display:none;"><a href="" title="Play next video for this Track">Play Next Video</a></li>');o.push("							</ul>");o.push("						</li>");o.push('						<li class="back_btn"><span title="Previous Track">Back Track</span></li>');o.push('						<li class="play_btn"><span title="Play/Pause" class="play">Play/Pause</span></li>');o.push('						<li class="next_btn"><span title="Next Track">Next Track</span></li>');o.push('						<li class="scrubber_shell">');o.push('							<div class="scrubber nohide">');o.push('								<div class="progress_bars">');o.push('									<div class="load_progress"></div>');o.push('									<div class="play_progress"></div>');o.push('									<div class="scrub_thumb"><a href=""></a></div>');o.push("								</div>");o.push("							</div>");o.push("						</li>");o.push('						<!--<li class="volume"><a href="" title="Change Volume">Change Volume</a></li>-->');o.push('						<li class="trackoptions">');o.push("							<ul>");o.push('								<li class="vote_up_btn"><a href="" title="Like It">Thumbs Up</a></li>');o.push('								<li class="vote_down_btn"><a href="" title="Don\'t Like It">Thumbs Down</a></li>');o.push('								<li class="download_btn"><a href="" title="Download this Track">Download Now</a></li>');o.push('								<li class="buy_btn"><a href="" title="Buy Track">Buy</a></li>');o.push('								<li class="add_btn"><a href="" title="Copy This Track to Another '+(FLYFI.isCustomRadioPlayer()?"Station":"Playlist")+'">Add Song</a></li>');o.push('    							<li class="share sharemenu">');o.push('    							    <a href="#" title="Share This Track" class="more">Share This</a>');o.push("    							</li>");o.push("							</ul>");o.push("						</li>");o.push("					</ul>");o.push("				</li>");o.push("			</ul>");o.push("		</div>");o.push('		<ul class="tracklist_ul">');o.push("			<li>");o.push('				<ul class="tracklist_headerer">');if(j.writable){o.push('				<li class="checkbox_title"><a style="display:None;" href="#">Delete</a></li>')}o.push('					<li class="artist_title">Artist</li>');o.push('					<li class="track_title">Track</li>');o.push('					<li class="album_title">Album</li>');o.push('					<li class="clearboth"></li>');o.push("				</ul>");o.push("			</li>");o.push('			<li class="trackitems"><ul class="trackitems_list"></ul></li>');o.push("		</ul>");o.push("	</li>");o.push("</ul>");var l=$(o.join("\n"));l.find(".collapselink").click(FLYFI.onClick_CollapseLink);c.append(l);FLYFI._setupLibraryEdit(c,j,p)}var n=m.replaceWith(c);n=null;return c};FLYFI._setupLibraryEdit=function(b,c,a){if(a){b.parents().find(".edit_cloud_btn a").unbind("click").click(function(e){FLYFI.onClick_EditPlaylist(e,c)});$("#edit_groove_form").unbind("submit");$("#edit_groove_form").submit(function(e){FLYFI.onSubmit_EditGroove(e,c,a)});$("#edit_groove_name").val(c.name);if(!FLYFI.current_user||FLYFI.current_user.id!=c.owner_id){$("#edit_groove_name").attr("disabled","disabled")}else{$("#edit_groove_name").removeAttr("disabled")}}};FLYFI._updatePagedClouds_trackList=function(f,b,a,e){var c=e?"static":["checkbox","tracknumber","tracktype","artistname","trackname","albumname","play","download"];if(!e&&!f.writable){c.shift()}FLYFI.setTrackList(f.tracks,b+" .trackitems_list",c,1,a,b+" .tracklistpaging");list=$(b+" .trackitems_list");if(FLYFI.tracklists_people_sortable){list.sortable({axis:"y",update:FLYFI.onSortUpdate_tracklist_people})}if(list.children().length>0){var g=$(b+" .checkbox_title a");g.unbind("click");g.show().click(FLYFI.onClickDelete_myLibrary)}};FLYFI.onBlur_libraryNameEdit=function(e){$(this).hide();var b=$(this).siblings(".libraryname");var c=b.text();var a=$(this).val();if(c!=a){FLYFI.setLibraryName(FLYFI.libraryIDFromWidget(b.parents(".library")),c,a,b)}b.show()};FLYFI.libraryIsPlaylist=function(b){var a=FLYFI.me_playlists.length;for(i=0;i<a;++i){if(FLYFI.me_playlists[i].name==b){return true}}return false};FLYFI.setLibraryName=function(e,c,b,a){FLYFI.post_NoResponse("/library/"+e+"/json/update_library_name/",{new_name:b},function(){FLYFI.onServer_setLibraryName(c,b,a)},FLYFI.showJSONError)};FLYFI.onServer_setLibraryName=function(h,c,b){b.text(c);var e=b.parents(".genericcontentbox").find(".list_select option");var a=e.length;for(var f=0;f<a;++f){var g=e.eq(f);if(g.text()==h){g.text(c);break}}};FLYFI.onClickDelete_myLibrary=function(a){a.preventDefault();var k=$(a.target).parents(".library");var c=k.find("input:checked");if(c.length===0){alert("Click on the checkboxes to select the tracks to delete and then click this link again.");return}var f=[];var e=c.length;for(var g=0;g<e;++g){var h=c.eq(g);var b=h.parents(".trackcell");f.push(FLYFI.trackIDFromWidget(b));b.remove()}var j=k.find(".trackitems_list .trackcell");e=j.length;for(g=0;g<e;++g){b=j.eq(g);b.find(".tracknumber").text((g+1).toString())}FLYFI.post_NoResponse("/library/"+FLYFI.libraryIDFromWidget(k)+"/json/remove_tracks_by_ids/",{remove_tracks:f.join(",")})};FLYFI.onSortUpdate_tracklist_people=function(g,h){var e=h.item.parents(".trackitems_list").find(".trackcell:not(.ui-sortable-helper)");var j=[];var b=e.length;for(var f=0;f<b;++f){var a=e.eq(f);j.push(FLYFI.trackIDFromWidget(a));a.find(".tracknumber").text((f+1).toString())}var c=h.item.parents(".library");FLYFI.server_updateTrackOrder(FLYFI.libraryIDFromWidget(c),j)};FLYFI.onClick_cloudPaging_Prev=function(a){a.preventDefault();if(FLYFI.cloudsPaging.prev()){FLYFI.updatePagedClouds()}};FLYFI.onClick_cloudPaging_Next=function(a){a.preventDefault();if(FLYFI.cloudsPaging.next()){FLYFI.updatePagedClouds()}};FLYFI.onChange_cloudPaging_ListSelect=function(a){a.preventDefault();FLYFI.cloudsPaging.start=parseInt($(a.target).val(),10)-1;FLYFI.updatePagedClouds()};FLYFI.onClick_playlistPaging_Prev=function(a){a.preventDefault();if(FLYFI.playlistsPaging.prev()){FLYFI.updatePagedPlaylists()}};FLYFI.onClick_playlistPaging_Next=function(a){a.preventDefault();if(FLYFI.playlistsPaging.next()){FLYFI.updatePagedPlaylists()}};FLYFI.onChange_playlistPaging_ListSelect=function(a){a.preventDefault();FLYFI.playlistsPaging.start=parseInt($(a.target).val(),10)-1;FLYFI.updatePagedPlaylists()};FLYFI.onClick_externalPlaylistPaging_Prev=function(a){a.preventDefault();if(FLYFI.externalPlaylistsPaging.prev()){FLYFI.updatePagedExternalPlaylists()}};FLYFI.onClick_externalPlaylistPaging_Next=function(a){a.preventDefault();if(FLYFI.externalPlaylistsPaging.next()){FLYFI.updatePagedExternalPlaylists()}};FLYFI.onClick_externalPlaylistPaging_ListSelect=function(a){a.preventDefault();FLYFI.externalPlaylistsPaging.start=parseInt($(a.target).val(),10)-1;FLYFI.updatePagedExternalPlaylists()};$(document).ready(function(){var a=window.location.hash.slice(1);if(a&&(a.charAt(a.length-1)=="/")){a=a.slice(0,-1)}FLYFI.initialLibraryFromURL=decodeURI(a);var c=$("#participant_clouds_paging");c.find(".prev").click(FLYFI.onClick_cloudPaging_Prev);c.find(".next").click(FLYFI.onClick_cloudPaging_Next);c.find(".list_select").change(FLYFI.onChange_cloudPaging_ListSelect);FLYFI.cloudsPaging.available=FLYFI.me_clouds?FLYFI.me_clouds.length:0;FLYFI.cloudsPaging.itemsToShow=1;FLYFI.updatePagedClouds();var b=$("#participant_playlists_paging");b.find(".prev").click(FLYFI.onClick_playlistPaging_Prev);b.find(".next").click(FLYFI.onClick_playlistPaging_Next);b.find(".list_select").change(FLYFI.onChange_playlistPaging_ListSelect);FLYFI.playlistsPaging.available=FLYFI.me_playlists?FLYFI.me_playlists.length:0;FLYFI.playlistsPaging.itemsToShow=1;FLYFI.updatePagedPlaylists();b=$("#participant_externalplaylists_paging");b.find(".prev").click(FLYFI.onClick_externalPlaylistPaging_Prev);b.find(".next").click(FLYFI.onClick_externalPlaylistPaging_Next);b.find(".list_select").change(FLYFI.onClick_externalPlaylistPaging_ListSelect);FLYFI.externalPlaylistsPaging.available=FLYFI.me_external_playlists?FLYFI.me_external_playlists.length:0;FLYFI.externalPlaylistsPaging.itemsToShow=1;FLYFI.updatePagedExternalPlaylists()});FLYFI.tracklists_people_sortable=true;FLYFI.reloadMe=function(){if(!FLYFI.current_user||!FLYFI.current_user.hasPassword){var a="/";if(window.level!="live"){a="/"+window.level+"/"}document.location=a;return}FLYFI.onLogin_reloadPage()};$(document).ready(function(){$(window).bind(FLYFI.MSG_LoginUpdated,FLYFI.reloadMe);FLYFI.ensureAtGoodPeopleTab(true)});FLYFI.ensureAtGoodPeopleTab=function(a){var c=false;if(window.location.hash&&(window.location.hash=="#playlist_tab")){var b=$("#playlist_tab_li a");if(b.length>0){b.click();c=true}}if(!c){setTimeout("FLYFI.gotoFirstGoodTab("+(a?"true":"")+")",300)}};FLYFI.gotoFirstGoodTab=function(b){var a=$(".usergenrelist .navtab a").eq(0);if(!a||!a.attr("href")){if(b){window.location="edit"}return}if(a.parents("#groove_tab_li").length===0){window.location=a.attr("href")}};FLYFI.TrackListCell_widgetCallback=function(f,b,c){var l=(b.approved)?" approved":"";var h=(b.vote===null)?"":(b.vote===0?" voteddown":" votedup");var j=b.free?" free":" nonfree";var k=[];k.push('<li class="tracklisting trackcell track-'+b.trackID);k.push(l);k.push(h);k.push(j);if(b.widget){if(b.widget.hasClass("playingtrack")&&FLYFI.playingTrack.playing&&FLYFI.playingTrack.trackDict.trackID==b.trackID){k.push(" playingtrack")}if(b.widget.hasClass("activetrack")){k.push(" activetrack")}}k.push('">');k.push("    <ul>");var e=f.length;for(var g=0;g<e;++g){switch(f[g]){case"add":k.push('        <li class="add_btn"><span class="add">Add</span></li>');break;case"albumname":k.push('        <li class="albumname">');k.push(FLYFI.textOrNbsp(b.album));k.push("</li>");break;case"artistname":k.push('        <li class="artistname">');k.push(FLYFI.textOrNbsp(b.artist));k.push("</li>");break;case"checkbox":k.push('        <li class="checkbox"><input type="checkbox"></input></li>');break;case"download":if(b.free){k.push('        <li class="download"><a class="download_btn" href="http://'+window.dev+"files.flyfi.com/tracks/download/"+b.trackID+'/">Download</a></li>')}else{k.push('        <li style="float:left; height:15px; margin:4px 10px 0 0; position:relative; width:14px;">&nbsp;</li>')}break;case"menu":k.push('        <li class="menu"><a class="more trackcell_menu_btn" href="">Menu</a>');k.push('            <ul class="trackcellmenu">');k.push('                <li class="textlink add_btn"><a href="">Add to Playlist</a></li>');k.push('                <li class="textlink buy_btn"><a class="logclick" href="">Buy</a></li>');k.push('                <li class="textlink"><a class="logclick" href="">More music like this</a></li>');k.push("            </ul>");k.push("        </li>");break;case"play":k.push('        <li class="play_btn"><span class="play">Play</span></li>');break;case"rating":k.push('        <li class="rating">6,732 thumbs up</li>');break;case"share":k.push('        <li class="share"><a class="more logclick" href="">Share This</a>');k.push("            <ul>");k.push('                <li class="textlink"><a onclick="showPopWin(\'share_popup.html\', 420, 310, null);">Share this track</a></li>');k.push("            </ul>");k.push("        </li>");break;case"trackname":k.push('        <li class="trackname">');k.push(FLYFI.textOrNbsp(b.title));k.push("</li>");break;case"tracknumber":k.push('        <li class="tracknumber">');k.push(FLYFI.textOrNbsp(c));k.push("</li>");break;case"tracktype":k.push('        <li class="tracktype"><img src="/static/dev/flyfi/images/');if(b.free){k.push('ff_bug_blue.png" class="ff_bug_bluebug" alt="Free Track"')}else{if(b.videoVetted){k.push('ff_bug_ytube_blue.png"')}else{if(b.videoYouTubeIDs){k.push('ff_bug_ytube_paleblue.png"')}else{k.push('ff_bug_ytube_pink.png"')}}}k.push(' align="middle"></li>');break;default:break}}k.push("    </ul>");k.push("</li>");return $(k.join("\n"))};FLYFI.TrackListCell=function(f,c,b,a){var e=this;e.columns=f;e.playerControls=a;e.trackDict=c;e.trackNumber=b;e.html=function(){var g=FLYFI.TrackListCell_widgetCallback(e.columns,e.trackDict,e.trackNumber);e.playerControls.addTrackDictAndWidget(e.trackDict,g);return g}};FLYFI.onClick_TrackList=function(b,a){var c=$(b.target);if(c.parents(".checkbox").length===0){FLYFI.playWidget_TrackList(c,a)}};FLYFI.playWidget_TrackList=function(f,b){var e=null;if(f.hasClass("trackcell")){e=f}else{e=f.parents(".trackcell").eq(0)}FLYFI.addTrackClassExclusive(e,"activetrack");var a=b.trackDictForID(parseInt(FLYFI.trackIDFromWidget(e),10));if(f.hasClass("add_btn")||f.parents(".add_btn").length>0){b.selectTrack(a,false);b.addButton.click()}else{if(f.hasClass("download_btn")||f.parents(".download_btn").length>0){b.selectTrack(a,false);var c=f.attr("href");window.location=c;b.downloadButton.click()}else{if(e.hasClass("playingtrack")){b.pause()}else{FLYFI.addTrackClassExclusive(e,"playingtrack");b.selectTrack(a,true)}}}};FLYFI.MAXTRACKLISTITEMS=100;FLYFI.setTrackList=function(k,h,c,f,e,b){if(!c){c=["tracknumber","tracktype","trackname","artistname","rating","play","download","share","menu"]}if(!f){f=1}var a=new FLYFI.Paging(FLYFI.MAXTRACKLISTITEMS);a.available=k.length;var j=b?$(b):null;if(j&&(j.length>0)){j.find(".total").text(a.available);j.find(".tracksword").text(a.available===1?"Track":"Tracks");if(a.available>FLYFI.MAXTRACKLISTITEMS){j.find(".gotostart").click(function(l){FLYFI.onClick_tracklistpaging_gotostart(l,k,h,c,e,a,j)});j.find(".gotoend").click(function(l){FLYFI.onClick_tracklistpaging_gotoend(l,k,h,c,e,a,j)});j.find(".next").click(function(l){FLYFI.onClick_tracklistpaging_next(l,k,h,c,e,a,j)});j.find(".prev").click(function(l){FLYFI.onClick_tracklistpaging_prev(l,k,h,c,e,a,j)});j.find(".tracklistpagingcounts").show();j.find(".tracklistpagingcontrols").show()}else{j.find(".tracklistpagingcounts").hide();j.find(".tracklistpagingcontrols").hide()}}else{a.itemsToShow=a.available}e.widgetPlayCallback=function(l){FLYFI.playWidget_TrackList(l,e)};FLYFI.setTrackList_Paged(k,h,c,e,a,j);var g=$(h);g.unbind("click");g.click(c=="static"?e.onClick_PlayerTrackList:function(l){FLYFI.onClick_TrackList(l,e)})};FLYFI.setTrackList_Paged=function(q,n,e,g,b,o){var l=$(n);var c=l.clone(true);c.empty();if(o){g.clearTrackDictsAndWidgets()}var j=0;var f=false;var p=null;for(var h=b.start;h<b.getPageEnd();++h){var a=q[h];if(g.newPlayer&&!a.approved&&(!p||p.approved)){c.append(FLYFI.RecDivider_widgetCallback(g.playlistDict));f=true}p=a;var k=e=="static"?new FLYFI.PlayerTrackCell(a,g.playlistDict&&g.playlistDict.writable,g):new FLYFI.TrackListCell(e,a,h+1,g);c.append(k.html());j+=1}if(g.newPlayer&&g.playlistDict.writable&&!f){c.append(FLYFI.RecDivider_widgetCallback(g.playlistDict))}var m=l.replaceWith(c);m=null;b.setItemsShown(j);FLYFI.update_tracklistpaging(b,o)};FLYFI.update_tracklistpaging=function(a,e){if(!e){return}var c=e.find(".start");c.text(a.start+1);var b=e.find(".end");b.text(a.end);e.show()};FLYFI.onClick_tracklistpaging_gotostart=function(f,b,g,e,a,c,h){f.preventDefault();c.start=0;FLYFI.setTrackList_Paged(b,g,e,a,c,h)};FLYFI.onClick_tracklistpaging_gotoend=function(f,b,g,e,a,c,h){f.preventDefault();c.start=Math.max(0,c.available-c.itemsToShow);FLYFI.setTrackList_Paged(b,g,e,a,c,h)};FLYFI.onClick_tracklistpaging_next=function(f,b,g,e,a,c,h){f.preventDefault();c.next();FLYFI.setTrackList_Paged(b,g,e,a,c,h)};FLYFI.onClick_tracklistpaging_prev=function(f,b,g,e,a,c,h){f.preventDefault();c.prev();FLYFI.setTrackList_Paged(b,g,e,a,c,h)};FLYFI.videoData=null;FLYFI.VideoCell=function(b,c){this.videoDict=c;this.widget=null;this.videoCellDivID="videocelldiv-"+b;this.videoPlayerID="videoplayer-"+b;this.width="100%";this.height="100%";var a=this;this.html=function(){if(!a.widget){a.widget=$(a._html(a.width,a.height,"",true));a.widget.find(".thick_video_link").click(function(e){e.preventDefault();var f="-mediumPlayer";$("#extracted").html(a._html("100%","100%",f,false));a._setVideo(350,0,f)})}return a.widget};this._html=function(e,o,j,l){var k=a.videoCellDivID;if(j){k+=j}var g=a.videoDict.videoURL;var m="";if(a.videoDict.title){m=a.videoDict.title}var h="";if(a.videoDict.author){h=a.videoDict.author}var f="";if(a.videoDict.pubdate){f=a.videoDict.pubdate}var n=[];n.push('    <ul class="inlinelist">');n.push('        <li class="videocontrols">');n.push("            <ul>");n.push('                <li class="video">');if(true){n.push('<div id="'+k+'">');n.push("    You need Flash player 8+ and JavaScript enabled to view this video.");n.push("</div>")}else{n.push('                    <object width="'+e+'" height="'+o+'">');n.push('                        <param name="movie" value="'+g+'"></param>');n.push('                        <param name="allowFullScreen" value="true"></param>');n.push('                        <param name="wmode" value="opaque"></param>');n.push('                        <embed src="'+g+'" type="application/x-shockwave-flash"');n.push('                            width="'+e+'" height="'+o+'" wmode="opaque"');n.push('                            allowfullscreen="true"></embed>');n.push("                    </object>")}n.push("                </li>");n.push("            </ul>");n.push("        </li>");n.push('        <li class="title">');if(l){n.push('            <a title="'+m+'" href="#TB_inline?height=320&width=400&inlineId=thickbox_youtube_medium_dialog" class="thick_video_link thickbox">')}if(m){n.push("                "+m)}if(l){n.push("            </a>")}n.push("                </li>");n.push('        <li class="author">');if(h){n.push("                "+h)}n.push('            <span class="pubdate">');if(f){n.push("                "+f)}n.push("            </span>");n.push("        </li>");n.push("    </ul>");return n.join("\n")};this.setVideo=function(){return a._setVideo(a.widget.width(),0)};this._setVideo=function(g,e,j){var f=a.videoPlayerID;var h=a.videoCellDivID;if(j){f+=j;h+=j}FLYFI.embedVideo(f,h,a.videoDict.videoURL,g,e)}};FLYFI.embedVideo=function(f,c,e,b,a){FLYFI._embedVideo(f,c,e+"&enablejsapi=1&playerapiid=ytplayer-"+f,b,a)};FLYFI.embedVideoChromeless=function(e,c,b,a){FLYFI._embedVideo(e,e,"http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+e,c,b);var f=new FLYFI.YouTubeVideoPlayer(e,a);return new FLYFI.VideoPlayer(f)};FLYFI._embedVideo=function(h,e,b,c,a){if(a===0){a=Math.round(c*3/4)}var f={allowScriptAccess:"always",wmode:"opaque"};var g={id:h};swfobject.embedSWF(b,e,c,a,"8",null,null,f,g)};FLYFI.initVideoCarousel=function(e,b){var f=$(e);if(f.is(":hidden")){return}var c=$(b);if(!FLYFI.videoData||(FLYFI.videoData.length===0)){c.hide();f.find(".novideoswarning").show()}else{f.find(".novideoswarning").hide();c.show();var a=FLYFI.videoData.length;c.jcarousel({size:a,initCallback:FLYFI.onInit_VideoCarousel,itemLoadCallback:{onBeforeAnimation:FLYFI.videos_carousel_itemLoadCallback},itemVisibleInCallback:FLYFI.carousel_itemVisibleInCallback,itemVisibleOutCallback:FLYFI.carousel_itemVisibleOutCallback,wrap:"last",scroll:3})}};FLYFI.carousel_itemVisibleInCallback=function(e,b,a,c){$(b).removeClass("clipped")};FLYFI.carousel_itemVisibleOutCallback=function(e,b,a,c){$(b).addClass("clipped")};FLYFI.videoCarousel=null;FLYFI.onInit_VideoCarousel=function(b,a){if(a=="init"){FLYFI.videoCarousel=b}};FLYFI.videos_carousel_itemLoadCallback=function(f,e){for(var c=f.first;c<=f.last;c++){if(c>FLYFI.videoData.length){break}var b=c;var a=new FLYFI.VideoCell(b,FLYFI.videoData[b-1]);f.add(b,a.html());a.setVideo();tb_init(".thick_video_link")}};FLYFI.resetVideoCarousel=function(){FLYFI.initVideoCarousel("#myvideos","#videos_carousel")};$(document).ready(function(){$(window).bind(FLYFI.MSG_TBC_Video_Updated,FLYFI.resetVideoCarousel)});FLYFI.server=function(){return{libraryTracks:function(c,j,h,b,g,e,f){var a=["/library/"];a.push(c.toString());a.push("/json/tracks/");if(j){a.push("orderby/");a.push(j);a.push("/")}if(b>0){a.push("start/");a.push(b.toString());a.push("/")}if(h>0){a.push("count/");a.push(h.toString());a.push("/")}FLYFI.getJSONWithSpinner(a.join(""),g,e,f)},contestCategoryTracks:function(b,f,c,e){var a=["/contests/category/"];a.push(b.toString());a.push("/tracks/json/");FLYFI.getJSONWithSpinner(a.join(""),f,c,e)},deleteLibrary:function(a,e,b,c){FLYFI.getJSONWithSpinner("/library/"+a+"/delete/",e,b,c)},deleteContestCategory:function(b,e,a,c){FLYFI.getJSONWithSpinner("/music/contest/category/"+b+"/delete/",e,a,c)},editContestCategory:function(c,a,f,b,e){FLYFI.postJSONWithSpinner("/music/contest/category/"+c+"/edit/",{name:a},f,b,e)},signupAd:function(h,o,e,f,n,q,b,l,c,a,g,j,k,m,p){FLYFI.postJSONWithSpinner("/json/signupad/",{nickname:h,password:o,password_2:e,partnerName:f,partnerPassword:n,partnerPassword_2:q,name:b,email:l,address1:c,address2:a,city:g,phone:j},k,m,p)},updateCampaign:function(a,b){FLYFI.postJSON("/json/campaign/update/",a,b)},checkActivateCampaign:function(e,c,a,b){FLYFI.postJSONWithSpinner("/json/campaign/checkactivate/",{campaignID:e},c,a,b)},activateCampaign:function(e,c,a,b){FLYFI.postJSONWithSpinner("/json/campaign/activate/",{campaignID:e},c,a,b)},suspendCampaign:function(e,c,a,b){FLYFI.postJSONWithSpinner("/json/campaign/suspend/",{campaignID:e},c,a,b)},updatePartnerCPMRule:function(j,e,a,h,b,g,c,f){FLYFI.postJSONWithSpinner("/json/partner/cpmrule/update/",{partnerID:j,partnerCPMRuleID:e,startDate:a,endDate:h,cpm:b},g,c,f)},deletePartnerCPMRule:function(f,b,e,a,c){FLYFI.postJSONWithSpinner("/json/partner/cpmrule/delete/",{partnerID:f,partnerCPMRuleID:b},e,a,c)},newCaptcha:function(a,b){FLYFI.getJSON("/json/captcha/new/",a,b)},submitCaptchaSolution:function(e,a,b,c){FLYFI.getJSON("/json/captcha/solution/url/"+e+"/"+a+"/",b,c)},voteUpContestEntry:function(a,e,b,c){FLYFI.getJSON("/entry/"+a+"/json/vote_up/url/"+e+"/",b,c)},setContestCategories:function(a,b,c){FLYFI.postJSON("/music/contest/categories/set/json/",{categories:a},b,c)},deletePartnerUserContact:function(b,a,f,c,e){FLYFI.postJSONWithSpinner("/json/partner/"+b+"/usercontact/delete/",{userContactID:a},f,c,e)},savePartnerUserContact:function(b,a,g,h,f,c,e){FLYFI.postJSONWithSpinner("/json/partner/"+b+"/usercontact/save/",{userContactID:a,reason:g,emails:h},f,c,e)},sortPartnerUserContact:function(a,f,e,b,c){FLYFI.postJSONWithSpinner("/json/partner/"+a+"/usercontact/sort/",{userContactIDs:f},e,b,c)},saveContestOptions:function(a,c,b,e,f,g,h,j,k){FLYFI.postJSONWithSpinner("/music/contest/options/save/json/",{contestID:a,startDate:c,startTime:b,endDate:e,endTime:f,randomizeEntries:g},h,j,k)},setContestCategoryType:function(a,f,e,b,c){FLYFI.postJSONWithSpinner("/music/contest/category/"+a+"/type/",{categoryType:f},e,b,c)},newPlaylist:function(a,e,b,c){FLYFI.postJSONWithSpinner("/library/json/new/playlist/",{name:a},e,b,c)},newContestCategory:function(b,a,f,c,e){FLYFI.postJSONWithSpinner("/music/contest/"+b+"/category/new/",{name:a},f,c,e)},deleteTrack:function(a,c,f,b,e){FLYFI.postJSONWithSpinner("/library/"+a+"/json/remove_tracks_by_ids/",{remove_tracks:c.toString()},f,b,e)},deleteContestEntry:function(a,e,b,c){FLYFI.getJSONWithSpinner("/music/contest/entry/"+a+"/delete/",e,b,c)}}}();FLYFI.server_updateTrackOrder=function(a,b){FLYFI.post_NoResponse("/library/"+a+"/json/update_track_order_from_ids/",{ordered_tracks:b.join(",")})};FLYFI.server_tinyURL=function(a,b){FLYFI.postText("/gettiny/"+a,{},function(c){FLYFI.onServer_tinyURL(c,b)},FLYFI.showJSONError)};FLYFI.onServer_tinyURL=function(a,b){if(b){b(a)}};FLYFI.server_logClick=function(g){g.preventDefault();var f=$(g.target);if(!f.hasClass("logclick")){f=f.parents(".logclick")}var h=f.attr("href");open(h,"linkwin");var c=["/log/click"];if(FLYFI.current_user){c.push("/participant/"+FLYFI.current_user.id)}var b=null;var e=$(f).parents(".broadcast");if(e.length>0){b=FLYFI.trim(e.find(".broadcast_id").text())}if(b){c.push("/broadcast/"+b)}c.push("/");FLYFI.post_NoResponse(c.join(""),{url:h})};FLYFI.server_logShareTrack=function(f,e,c){var b=["/log/share/"];if(FLYFI.current_user&&FLYFI.current_user.id){b.push("participant/");b.push(FLYFI.current_user.id);b.push("/")}if(e){b.push("playlist/");b.push(e);b.push("/")}if(f){b.push("track/");b.push(f);b.push("/")}if(c){b.push("site/");b.push(c);b.push("/")}FLYFI.post_NoResponse(b.join(""),{})};FLYFI.server_logSharePlaylist=function(e,c){var b=["/log/share/"];if(FLYFI.current_user&&FLYFI.current_user.id){b.push("participant/");b.push(FLYFI.current_user.id);b.push("/")}if(e){b.push("playlist/");b.push(e);b.push("/")}if(c){b.push("site/");b.push(c);b.push("/")}FLYFI.post_NoResponse(b.join(""),{})};FLYFI.server_logShareContestCategory=function(e,c){var b=["/log/share/"];if(FLYFI.current_user&&FLYFI.current_user.id){b.push("participant/");b.push(FLYFI.current_user.id);b.push("/")}if(e){b.push("contestcategory/");b.push(e);b.push("/")}if(c){b.push("site/");b.push(c);b.push("/")}FLYFI.post_NoResponse(b.join(""),{})};FLYFI.server_logShareContestEntry=function(e,c){var b=["/log/share/"];if(FLYFI.current_user&&FLYFI.current_user.id){b.push("participant/");b.push(FLYFI.current_user.id);b.push("/")}if(e){b.push("contestentry/");b.push(e);b.push("/")}if(c){b.push("site/");b.push(c);b.push("/")}FLYFI.post_NoResponse(b.join(""),{})};FLYFI.server_logSharePage=function(e,c){var b=["/log/share/"];if(FLYFI.current_user&&FLYFI.current_user.id){b.push("participant/");b.push(FLYFI.current_user.id);b.push("/")}if(e){b.push("page/");b.push(e);var f=""+e;if(f[f.length-1]!="/"){b.push("/")}}if(c){b.push("site/");b.push(c);b.push("/")}FLYFI.post_NoResponse(b.join(""),{})};$(document).ready(function(){$(".logclick").live("click",FLYFI.server_logClick)});