var Scroller=Class.create();
Scroller.prototype={initialize:function(_1){
this.scroller=$(_1);
this.imageTrackContainer=$(document).getElementsByClassName("imageTrackContainer",this.scroller)[0];
this.imageTrack=this.imageTrackContainer.getElementsByTagName("UL")[0];
this.isScrolling=false;
this.makeScrollingWork();
this.centerSelectedImage();
},makeScrollingWork:function(){
Element.addClassName(this.scroller,"scrollerJS");
if(this.getWidth()<=this.getVisibleWidth()){
if(window.attachEvent&&!window.opera){
Element.setStyle(this.scroller,{width:this.getWidth()+"px"});
}
}else{
Element.setStyle(this.scroller,{padding:"0 10px",marginLeft:0,marginRight:0,overflow:"hidden"});
this.leftScrollButton=document.createElement("a");
this.leftScrollButton.innerHTML="scroll left";
this.leftScrollButton.href="#";
Element.addClassName(this.leftScrollButton,"scrollLeft");
this.scroller.insertBefore(this.leftScrollButton,this.imageTrackContainer);
Event.observe(this.leftScrollButton,"click",this.scrollLeft.bindAsEventListener(this));
this.rightScrollButton=document.createElement("a");
this.rightScrollButton.innerHTML="scroll right";
this.rightScrollButton.href="#";
Element.addClassName(this.rightScrollButton,"scrollRight");
this.scroller.insertBefore(this.rightScrollButton,this.imageTrackContainer);
Event.observe(this.rightScrollButton,"click",this.scrollRight.bindAsEventListener(this));
Event.observe(window,"resize",this.onResize.bindAsEventListener(this));
this.setWidth();
}
},setWidth:function(){
if(!this.imageWidth){
this.imageWidth=this.getImageWidth();
}
Element.setStyle(this.scroller,{maxWidth:this.getWidth()+"px"});
var _2=this.getVisibleWidth();
modulo=_2%this.imageWidth;
_2=_2-modulo;
if(_2>this.getWidth()){
_2=this.getWidth();
}
Element.setStyle(this.scroller,{maxWidth:_2+"px"});
var _3=this.getWidth()*-1+Math.abs(this.getOffset())+this.getVisibleWidth();
var _4=(this.getWidth()-this.getVisibleWidth())*-1;
this.setOffset(_4);
this.refreshButtonStates();
},onResize:function(_5){
this.setWidth();
},getImageWidth:function(){
if(this.imageWidth){
return this.imageWidth;
}else{
sampleImage=this.imageTrack.getElementsByTagName("LI")[0];
if(sampleImage){
this.imageWidth=sampleImage.offsetWidth;
this.imageWidth=this.imageWidth+Element.getStyle(sampleImage,"padding-left").replace("px","")*1;
this.imageWidth=this.imageWidth+Element.getStyle(sampleImage,"padding-right").replace("px","")*1;
this.imageWidth=this.imageWidth+Element.getStyle(sampleImage,"margin-left").replace("px","")*1;
this.imageWidth=this.imageWidth+Element.getStyle(sampleImage,"margin-right").replace("px","")*1;
var _6=Element.getStyle(sampleImage,"border-left-width").replace("px","")*1;
if(!isNaN(_6)){
this.imageWidth=this.imageWidth+_6;
}
var _7=Element.getStyle(sampleImage,"border-right-width").replace("px","")*1;
if(!isNaN(_7)){
this.imageWidth=this.imageWidth+_7;
}
return this.imageWidth;
}else{
return false;
}
}
},getMiddle:function(){
return Math.ceil(this.imageTrackContainer.offsetWidth/2);
},getWidth:function(){
return this.imageTrack.offsetWidth;
},getVisibleWidth:function(){
return this.imageTrackContainer.offsetWidth;
},getNumberOfVisibleImages:function(){
return Math.floor(this.getVisibleWidth()/this.getImageWidth());
},getNumberOfImages:function(){
return Math.floor(this.imageTrack.getElementsByTagName("LI").length);
},getOffset:function(){
offset=Element.getStyle(this.imageTrack,"left");
if(offset){
offset=offset.replace("px","")*1;
if(!isNaN(offset)){
return offset;
}else{
return 0;
}
}else{
return 0;
}
},setOffset:function(_8){
var _9=this.getWidth()-this.getVisibleWidth();
Element.setStyle(this.imageTrack,{left:_8+"px"});
},scrollLeft:function(_a){
if(!this.isScrolling&&this.getOffset()<0){
var _b=Math.abs(this.getOffset());
var _c=this.getVisibleWidth();
if(_c>_b){
_c=_b;
}
this.scroll(_c);
}
this.refreshButtonStates();
this.leftScrollButton.blur();
Event.stop(_a);
},scrollRight:function(_d){
if(!this.isScrolling&&(Math.abs(this.getOffset())+this.getVisibleWidth())<this.getWidth()){
var _e=this.getWidth()-(Math.abs(this.getOffset())+this.getVisibleWidth());
var _f=this.getVisibleWidth();
if(_f>_e){
_f=_e;
}
_f=_f*-1;
this.scroll(_f);
}
this.refreshButtonStates();
this.rightScrollButton.blur();
Event.stop(_d);
},scroll:function(_10,_11){
if(!this.isScrolling||_11){
new Effect.Move(this.imageTrack,{x:_10,y:0,mode:"relative",duration:0.5,afterFinish:this.afterScrolling.bind(this),beforeStart:this.beforeScrolling.bind(this),queue:{position:"end",scope:"scroller"}});
}
},beforeScrolling:function(_12){
this.isScrolling=true;
this.totalDelta=this.totalDelta+_12.options.x;
},afterScrolling:function(_13){
this.isScrolling=false;
this.totalDelta=this.totalDelta-_13.options.x;
this.refreshButtonStates();
},refreshButtonStates:function(){
if(this.rightScrollButton&&this.leftScrollButton){
if((Math.abs(this.getOffset())+this.getVisibleWidth())<this.getWidth()){
this.rightScrollButton.className="scrollRight";
}else{
this.rightScrollButton.className="scrollRight disabled";
}
if(this.getOffset()<0){
this.leftScrollButton.className="scrollLeft";
}else{
this.leftScrollButton.className="scrollLeft disabled";
}
}
},getSelectedImage:function(){
selectedImage=$(document).getElementsByClassName("selected",this.imageTrack)[0];
if(selectedImage){
return $(selectedImage);
}else{
return false;
}
},centerSelectedImage:function(){
if(this.getVisibleWidth()!=this.getWidth()){
var _14=this.getSelectedImage().id;
if(_14&&this.getImageWidth()){
_14=(_14.substring(5)*1)-1;
var _15=_14*this.getImageWidth();
_15=_15-this.getMiddle()+this.getImageWidth()/2;
if(_15>(this.getWidth()-this.getVisibleWidth())){
_15=this.getWidth()-this.getVisibleWidth();
}
_15=_15*-1;
if(_15>0){
_15=0;
}
Element.setStyle(this.imageTrack,{left:_15+"px"});
this.refreshButtonStates();
}
}
}};
LFM.set("Resource",{Shoutbox:Class.create()});
LFM.Resource.Shoutbox.prototype={initialize:function(_16){
this.shoutbox=_16;
this.shoutbox.container=$(this.shoutbox.container);
this.textarea=$("shoutmsg");
Event.observe($("shoutPost"),"submit",this.submit.bindAsEventListener(this));
this.deleteButtons=$A(document.getElementsByClassName("delete",this.shoutbox.container));
this.deleteButtons.each(function(_17){
Event.observe(_17,"click",this.bin.bindAsEventListener(this));
}.bind(this));
Event.observe(this.textarea,"keyup",this.calculateCharCount.bindAsEventListener(this));
if($("shoutboxPopup")){
Event.observe("shoutboxPopup","click",this.popup.bindAsEventListener(this));
}
if($("shoutPostToggler")){
Event.observe($("shoutPostToggler").getElementsByTagName("A")[0],"click",this.toggleInput.bindAsEventListener(this));
}
Event.observe($("shoutPostAgain").getElementsByTagName("A")[0],"click",this.toggleInput.bindAsEventListener(this));
},submit:function(_18){
Event.stop(_18);
this.toggleInput(_18);
Element.show("shoutPostWait");
var url="/shoutbox/";
var msg=this.textarea.value;
var _1b=$("sbmode").value;
var _1c="message="+encodeURIComponent(msg)+"&restype="+this.shoutbox.restype+"&resid="+this.shoutbox.resid+"&lang="+this.shoutbox.lang+"&mode="+_1b;
var _1d=new Ajax.Request(url,{method:"post",parameters:_1c,onSuccess:this.addShout.bind(this)});
},addShout:function(_1e){
$("shoutList").innerHTML=_1e.responseText+$("shoutList").innerHTML;
newShout=$("shoutList").firstChild;
if(newShout.nodeType!=1){
newShout=newShout.nextSibling;
}
newDeleteButton=document.getElementsByClassName("delete",newShout)[0];
Event.observe(newDeleteButton,"click",this.bin.bindAsEventListener(this));
this.textarea.value="";
Element.hide("shoutPostWait");
if($("noShouts")){
Element.remove("noShouts");
}
if($("shoutPostToggler")){
Element.hide("shoutPostToggler");
}
Element.show("shoutPostAgain");
this.updateCharCountDisplay(0);
},bin:function(_1f){
shoutItem=Event.findElement(_1f,"LI");
shoutID=shoutItem.id;
shoutID=shoutID.match(/\d+/);
Event.stop(_1f);
var _20="deleteShout="+shoutID+"&restype="+this.shoutbox.restype+"&resid="+this.shoutbox.resid;
var _21=new Ajax.Request("/shoutbox/",{method:"post",parameters:_20,onSuccess:function(req){
if(req.responseText=="OK"){
new Effect.Fade(shoutItem,{duration:0.2});
}
}});
},toggleInput:function(_23){
if(Element.visible("shoutPost")){
Element.hide("shoutPost");
}else{
Element.hide("shoutPostAgain");
Element.show("shoutPost");
this.textarea.focus();
}
Event.stop(_23);
},calculateCharCount:function(){
charcount=this.textarea.value.length;
this.updateCharCountDisplay(charcount);
},updateCharCountDisplay:function(_24){
charCounter=$("sbCharCount");
var _25=this.shoutbox.charlimitMessage;
_25=_25.replace(/CURRENTCHARS/,_24);
_25=_25.replace(/MAXCHARS/,this.shoutbox.charlimit);
charCounter.innerHTML=_25;
},popup:function(_26){
if(this.shoutbox.username){
var url="/user/"+this.shoutbox.username+"/shoutbox/";
var faq=window.open(url,"shoutbox","toolbar=no, location=no, directories=no, status=no,menubar=no, scrollbars=yes, resizable=yes, width=225, height=450");
}
Event.stop(_26);
}};
function actsAsAspect(_29){
_29.yield=null;
_29.rv={};
_29.before=function(_2a,f){
var _2c=eval("this."+_2a);
this[_2a]=function(){
f.apply(this,arguments);
return _2c.apply(this,arguments);
};
};
_29.after=function(_2d,f){
var _2f=eval("this."+_2d);
this[_2d]=function(){
this.rv[_2d]=_2f.apply(this,arguments);
return f.apply(this,arguments);
};
};
_29.around=function(_30,f){
var _32=eval("this."+_30);
this[_30]=function(){
this.yield=_32;
return f.apply(this,arguments);
};
};
}
Lfm={};
Lfm.Adserver=function(_33){
this.oRequest=_33;
this.aTagWeightAssoc=[];
this.aPlacementTagAssoc=[];
};
Lfm.Adserver.prototype={aTagWeightAssoc:null,aPlacementTagAssoc:null,LAST_PLACEMENT_TOP_RIGHT:3,LAST_PLACEMENT_TOP:1,oRequest:null,selectTag:function(_34){
var _35=_34.substring(7);
if(!oPlacementTagAssoc[_34].length){
return false;
}
var _36=oPlacementTagAssoc[_34];
log(_34+" has "+_36.length+" tags");
this.aTagWeightAssoc=[];
var _37=0;
var _38=this;
$A(_36).each(function(_39){
_38.addTagWeightAssoc({"name":_39.name,"min":_37,"max":_37+parseInt(_39.weight),"code":_39.code});
_37+=parseInt(_39.weight);
});
var _3a=Math.round(Math.random()*_37);
log("chosen weight "+_3a);
var _3b=$A(this.aTagWeightAssoc).find(function(_3c){
return (_3c.min<=_3a&&_3c.max>=_3a);
});
if(_3b){
log("chose "+_3b.name+" in placement "+_34);
FastInit.addOnLoad(function(_3d){
if($(_34)){
Element.show(_34);
}
});
if(_34=="LastAd_Top"&&!this.isDummyTag(_3b.code)){
FastInit.addOnLoad(function(_3e){
if($("catPage")){
Element.addClassName("catPage","underAds");
}
});
}
if(_34=="LastAd_TopRight"){
FastInit.addOnLoad(function(_3f){
if($("userLastAd")){
Element.show("userLastAd");
}
});
if(typeof writeTop=="function"&&this.oRequest.controller.toLowerCase()!="user"&&!this.isDummyTag(this.aPlacementTagAssoc["Top"])){
return;
}
}
log(_35);
this.displayTag(_35,_3b);
}else{
if(_34=="LastAd_TopRight"){
FastInit.addOnLoad(function(_40){
if($("userLastAd")){
Element.hide("userLastAd");
}
});
}
}
},addTagWeightAssoc:function(_41){
this.aTagWeightAssoc.push({"name":_41.name,"min":_41.min,"max":_41.max,"code":_41.code});
},isDummyTag:function(tag){
try{
return tag.indexOf("#LastAd_Top")!=-1;
}
catch(ex){
return false;
}
},setVisibility:function(_43){
},hasPlacement:function(_44){
try{
return oPlacementTagAssoc[_44].length;
}
catch(ex){
return false;
}
},displayTag:function(_45,_46){
this.aPlacementTagAssoc[_45]=_46.code;
document.write("<script type=\"text/javascript\">");
document.write("function write"+_45+"() {"+_46.code+"};");
document.write("</script>");
}};
DropDown=Class.create();
DropDown.prototype={initialize:function(_47,_48,_49){
this.containerID=_47;
this.togglerID=_48;
this.bodyID=_49;
Element.hide(this.bodyID);
Element.addClassName(this.containerID,"toggle");
this.offBinding=this.clickOff.bindAsEventListener(this);
Event.observe(this.togglerID,"click",this.toggle.bindAsEventListener(this));
},hide:function(){
Element.hide(this.bodyID);
Element.removeClassName(this.containerID,"expanded");
Event.stopObserving(document,"click",this.offBinding,true);
},show:function(){
if($(DropDown.opened)){
Element.hide(DropDown.opened);
}
Element.show(this.bodyID);
if($(this.bodyID).offsetWidth<$(this.togglerID).offsetWidth){
Element.setStyle(this.bodyID,{width:$(this.togglerID).offsetWidth-2+"px"});
}
DropDown.opened=this.bodyID;
Element.addClassName(this.containerID,"expanded");
Event.observe(document,"click",this.offBinding,true);
},toggle:function(_4a){
if(Element.visible(this.bodyID)){
this.hide();
Event.stop(_4a);
}else{
this.show();
Event.stop(_4a);
}
Event.findElement(_4a,"A").blur();
Event.stop(_4a);
},clickOff:function(_4b){
var _4c=Event.element(_4b);
var _4d=false;
while(_4c.parentNode){
if(_4c.id==this.bodyID){
return true;
}else{
if(_4c.id==this.togglerID){
_4d=true;
}
}
_4c=_4c.parentNode;
}
this.hide();
if(_4d){
Event.stop(_4b);
}
}};
var EventCalendar={calendars:null,currentMonth:null,lastRequested:null,next:function(url,_4f,_50){
_4f.blur();
Element.addClassName(_4f,"busy");
var c=EventCalendar.getCurrentMonth();
var _52=_50?EventCalendar.getMonthForTable(c):EventCalendar.getNextMonthAfterTable(c);
var _53=null;
var _54=null;
if(!_50){
_54=document.getElementsByClassName("month-"+_52,$("calendar"));
_53=_54.length>0?_54[0]:false;
}else{
var m=EventCalendar.getPrevMonthAfterTable(c);
_54=document.getElementsByClassName("month-"+m,$("calendar"));
_53=_54.length>0?_54[0]:false;
}
if(_53){
c.style.display="none";
_53.style.display="table";
EventCalendar.currentMonth=_53;
Element.removeClassName(_4f,"busy");
}else{
if(_53==-1){
Element.removeClassName(_4f,"busy");
}else{
url=EventCalendar.convertURL(url);
EventCalendar.lastRequested=_52;
var _56=_50?"enddate":"startdate";
var _57=new Ajax.Request(url+"&"+_56+"="+_52+"-01",{onSuccess:EventCalendar.receiveMonth.bind(_4f),onFailure:EventCalendar.receiveMonthFailed.bind(_4f)});
}
}
},prev:function(url,_59){
EventCalendar.next(url,_59,true);
},convertURL:function(url){
var _5b=url.indexOf("events/?");
if(_5b!=-1){
return "/ajax/eventcalendar/"+url.substring(_5b+7);
}
return "/ajax/eventcalendar"+url;
},receiveMonth:function(_5c){
if(_5c.responseText.indexOf("calendar")==-1){
var _5d=EventCalendar.receiveMonthFailed.bind(this);
_5d();
return;
}
Element.removeClassName(this,"busy");
new Insertion.Bottom("calendar",_5c.responseText);
var _5e=document.getElementsByClassName("calendar",$("calendar"));
if(_5e.length>0){
EventCalendar.currentMonth.style.display="none";
_5e[_5e.length-1].style.display="table";
EventCalendar.currentMonth=_5e[_5e.length-1];
}
},receiveMonthFailed:function(){
Element.removeClassName(this,"busy");
},getNextMonthAfterTable:function(_5f){
var _60=EventCalendar.getMonthForTable(_5f);
var _61=_60.split("-");
if(_61[1]==12){
_61[0]++;
}
_61[1]++;
return _61[0]+"-"+(_61[1]<10?"0"+_61[1]:_61[1]);
},getPrevMonthAfterTable:function(_62){
var _63=EventCalendar.getMonthForTable(_62);
var _64=_63.split("-");
if(_64[1]=="01"){
_64[0]--;
}
_64[1]--;
return _64[0]+"-"+(_64[1]<10?"0"+_64[1]:_64[1]);
},getMonthForTable:function(_65){
if(_65.month){
return _65.month;
}
var _66=$A(_65.className.split(/\s+/));
var c=_66.find(function(c){
return c.substring(0,5)=="month";
});
_65.month=c.substring(6);
return _65.month;
},getCurrentMonth:function(){
if(EventCalendar.currentMonth){
return EventCalendar.currentMonth;
}
EventCalendar.calendars=$A(document.getElementsByClassName("calendar",$("calendar")));
EventCalendar.currentMonth=EventCalendar.calendars.find(function(c){
return Element.hasClassName(c,"first");
});
EventCalendar.lastRequested=EventCalendar.getMonthForTable(EventCalendar.currentMonth);
return EventCalendar.currentMonth;
}};
function showNewEventWidgetError(){
alert("there was a problem this the request, please try again");
}
function showNewEventWidget(_6a){
var _6b="venue="+_6a;
new Ajax.Request("/resourcewidgets/newevent",{method:"get",parameters:_6b,onSuccess:function(req){
if(req.responseText.indexOf("newEvent")==-1){
showNewEventWidgetError();
return;
}
$("newEventWidgetPlaceholder").innerHTML=req.responseText;
req.responseText.evalScripts();
var _6d=document.getElementsByClassName("artist","newEventForm");
_6d.each(function(_6e){
newEventBindArtistField(_6e);
});
new Effect.BlindDown("newEventWidgetPlaceholder",{duration:0.5});
},onFailure:showNewEventWidgetError});
}
function showLocationForm(_6f,_70){
Element.hide(_6f.parentNode);
Element.hide("subhead");
$("locationForm").style.display="block";
Form.focusFirstElement("locationForm");
}
var newEventArtistMatches={};
var newEventArtistDispatch={};
function newEventBindArtistField(_71){
Event.observe(_71,"blur",function(){
if(!this.value||this.value.trim()==""||newEventArtistDispatch[this.value]){
if(this.value&&this.value.trim()!=""){
newEventShowProgress(this,"success");
}
return;
}
this.numRetrys=0;
newEventSendArtistSearch(this);
newEventArtistDispatch[this.value]=true;
});
if(Element.hasClassName(_71.parentNode,"support")){
Event.observe(_71,"keypress",function(e){
if(e.keyCode==Event.KEY_DELETE||e.keyCode==Event.KEY_BACKSPACE){
newEventHideStatusHolder(this);
if(this.value==""||this.value.length==1){
var _73=document.getElementsByClassName("support","artists");
var _74=_73[_73.length-1];
var _75=_74.getElementsByTagName("input")[0];
if(_75.getAttribute("id")==this.getAttribute("id")){
return;
}
if(_75.value==""&&this.getAttribute("id")!="support1"){
this.parentNode.parentNode.removeChild(this.parentNode);
_75.focus();
}
}
}else{
var ret=e.keyCode==Event.KEY_RETURN;
if(!ret){
newEventHideStatusHolder(this);
}
newEventCloneSupportField(ret);
}
});
}else{
Event.observe(_71,"keypress",function(e){
if(e.keyCode==Event.KEY_RETURN){
newEventCloneSupportField(true);
}else{
newEventHideStatusHolder(this);
}
});
}
}
function newEventSendArtistSearch(_78){
if(newEventArtistMatches[_78.value]){
newEventShowProgress(_78,"success");
return;
}
newEventShowProgress(_78,"progress");
var _79="name="+encodeURIComponent(_78.value);
new Ajax.Request("/ajax/artistcheck",{method:"get",parameters:_79,onSuccess:newEventEndSearchArtist.bind(_78),onFailure:newEventFailedSearchArtist.bind(_78)});
}
function newEventInsertResults(_7a,_7b){
var _7c=document.createElement("div");
Element.hide(_7c);
Element.addClassName(_7c,"results");
var _7d=document.createElement("ul");
var _7e=document.createElement("li");
var _7f=document.createElement("input");
_7f.setAttribute("type","radio");
_7e.appendChild(_7f);
Element.addClassName(_7e,"noneOfThe");
_7e.appendChild(document.createTextNode(noneOfThe));
Event.observe(_7f,"click",function(){
new Effect.BlindUp(_7c,{duration:0.5});
newEventShowProgress(_7a,"success");
});
_7b.each(function(_80){
var _81=document.createElement("li");
var _82=document.createElement("input");
Event.observe(_82,"click",function(){
_7a.value=_80.name;
new Effect.BlindUp(_7c,{duration:0.5});
newEventShowProgress(_7a,"success");
});
_82.setAttribute("type","radio");
_82.id=_80.id;
_81.appendChild(_82);
var _83=document.createElement("label");
_83.innerHTML=_80.name;
_83.setAttribute("for",_80.id);
var _84=document.createTextNode(" (");
var _85=document.createElement("a");
_85.setAttribute("href",_80.url);
_85.setAttribute("target","_blank");
_85.innerHTML=linkText;
var _86=document.createTextNode(")");
_81.appendChild(_83);
_81.appendChild(_84);
_81.appendChild(_85);
_81.appendChild(_86);
_7d.appendChild(_81);
});
_7d.appendChild(_7e);
var _87=document.createElement("strong");
_87.innerHTML=artistText;
_7c.appendChild(_87);
Element.addClassName(_87,"lfmlight");
_7c.appendChild(_7d);
var _88=$A(_7a.parentNode.parentNode.childNodes);
var _89=false;
var _8a=false;
_88.each(function(_8b){
if(_8a||_8b.nodeName!="DIV"){
return;
}
if(_89){
_7a.parentNode.parentNode.insertBefore(_7c,_8b);
_8a=true;
new Effect.BlindDown(_7c,{duration:0.5});
return;
}
if(_8b==_7a.parentNode){
_89=true;
}
});
}
function newEventEndSearchArtist(req){
if(req.responseText.indexOf("<results>")!=-1&&req.responseText.indexOf("<resource>")!=-1){
var x=req.responseXML;
var i=0;
while(x.childNodes[i].nodeName!="results"&&i<x.childNodes.length){
i++;
}
var _8f=x.childNodes[i];
var _90=$A(_8f.childNodes);
var _91=new Array();
_90.each(function(_92){
if(_92.nodeName!="resource"){
return;
}
var _93=$A(_92.childNodes);
var a={};
_93.each(function(el){
if(el.nodeName!="#text"){
a[el.nodeName]=el.firstChild.nodeValue;
}
});
_91.push(a);
});
newEventInsertResults(this,_91);
newEventShowProgress(this,"failure");
}else{
if(req.responseText.indexOf("<resource>")!=-1){
var x=req.responseXML;
var i=0;
while(x.childNodes[i].nodeName!="resource"&&i<x.childNodes.length){
i++;
}
var _8f=x.childNodes[i];
newEventArtistMatches[this.value]=_8f.lastChild.firstChild.nodeValue;
this.value=_8f.lastChild.firstChild.nodeValue;
newEventShowProgress(this,"success");
}else{
if(req.responseText.indexOf("<results>")!=-1){
newEventShowProgress(this,"success");
}else{
var _96=newEventFailedSearchArtist.bind(this);
_96();
}
}
}
}
function newEventSendSearchVenue(){
var _97=$("previewButton");
_97.numRetrys=0;
newEventShowProgress(_97,"progress");
var _98=Form.serialize($("newEventForm"));
new Ajax.Request("/ajax/venuecheck",{method:"get",parameters:_98,onSuccess:newEventEndSearchVenue.bind(_97),onFailure:newEventPreviewError});
}
function newEventSetVenue(id,_9a){
$("venueid").value=id;
if(!_9a){
newEventPreview();
}
}
function newEventResetVenueID(){
$("venueid").value="";
Element.show($("previewButton").parentNode);
newEventHideStatusHolder($("venueName"));
}
function newEventInsertVenueResults(_9b,_9c){
var _9d=$A(document.getElementsByClassName("venueResults"));
_9d.each(function(a){
a.parentNode.removeChild(a);
});
var _9f=document.createElement("div");
Element.hide(_9f);
Element.addClassName(_9f,"results");
Element.addClassName(_9f,"venueResults");
var _a0=document.createElement("ul");
var _a1=document.createElement("li");
var _a2=document.createElement("input");
_a2.setAttribute("type","radio");
_a1.appendChild(_a2);
Element.addClassName(_a1,"noneOfThe");
_a1.appendChild(document.createTextNode(noneOfThe));
Event.observe(_a2,"click",function(){
newEventSetVenue(0);
newEventShowProgress($("venueName"),"success");
new Effect.BlindUp(_9f,{duration:0.5});
});
_9c.each(function(_a3){
var _a4=document.createElement("li");
var _a5=document.createElement("input");
Event.observe(_a5,"click",function(){
newEventSetVenue(_a3.id);
newEventShowProgress($("venueName"),"success");
new Effect.BlindUp(_9f,{duration:0.5});
});
_a5.setAttribute("type","radio");
_a5.id=_a3.id;
_a4.appendChild(_a5);
var _a6=document.createElement("label");
_a6.innerHTML=_a3.name;
_a6.setAttribute("for",_a3.id);
var _a7=document.createTextNode(" (");
var _a8=document.createElement("a");
_a8.setAttribute("href",_a3.url);
_a8.setAttribute("target","_blank");
_a8.innerHTML=linkText;
var _a9=document.createTextNode(")");
var _aa=document.createElement("br");
var _ab=document.createElement("small");
_ab.innerHTML=_a3.address;
_a4.appendChild(_a6);
_a4.appendChild(_a7);
_a4.appendChild(_a8);
_a4.appendChild(_a9);
_a4.appendChild(_aa);
_a4.appendChild(_ab);
_a0.appendChild(_a4);
});
_a0.appendChild(_a1);
var _ac=document.createElement("strong");
_ac.innerHTML=venueText;
_9f.appendChild(_ac);
Element.addClassName(_ac,"lfmlight");
_9f.appendChild(_a0);
$("venue").parentNode.insertBefore(_9f,$("startdate"));
new Effect.BlindDown(_9f,{duration:0.5});
}
function newEventEndSearchVenue(req){
if(req.responseText.indexOf("<results>")!=-1&&req.responseText.indexOf("<resource>")!=-1){
var x=req.responseXML;
var i=0;
while(x.childNodes[i].nodeName!="results"&&i<x.childNodes.length){
i++;
}
var _b0=x.childNodes[i];
var _b1=$A(_b0.childNodes);
var _b2=new Array();
_b1.each(function(_b3){
if(_b3.nodeName!="resource"){
return;
}
var _b4=$A(_b3.childNodes);
var a={};
_b4.each(function(el){
if(el.nodeName!="#text"){
a[el.nodeName]=el.firstChild.nodeValue;
}
});
_b2.push(a);
});
newEventInsertVenueResults(this,_b2);
newEventHideProgress(this);
}else{
if(req.responseText.indexOf("<resource>")!=-1){
var x=req.responseXML;
var i=0;
while(x.childNodes[i].nodeName!="resource"&&i<x.childNodes.length){
i++;
}
var _b0=x.childNodes[i];
var _b7=$A(_b0.childNodes);
var id=false;
_b7.each(function(_b9){
if(_b9.nodeName=="id"){
id=_b9.firstChild.nodeValue;
}
});
if(id){
newEventSetVenue(id);
}else{
var _ba=newEventFailedSearchVenue.bind(this);
_ba();
}
}else{
if(req.responseText.indexOf("<results>")!=-1){
newEventSetVenue(0);
}else{
var _ba=newEventFailedSearchVenue.bind(this);
_ba();
}
}
}
}
function newEventFailedSearchVenue(req){
if(this.numRetrys++>=5){
newEventHideProgress(this);
return;
}
setTimeout(newEventSendSearchVenue.bind(),1000);
}
function newEventFailedSearchArtist(req){
if(this.numRetrys++>=5){
newEventHideProgress(this);
return;
}
var a=this;
var _be=function(){
newEventSendArtistSearch(a);
};
setTimeout(_be,1000);
}
function newEventShowProgress(_bf,_c0){
if(!_c0){
_c0="progress";
}
var _c1=document.getElementsByClassName("statusHolder",_bf.parentNode);
if(_c1.length>0){
_c1[0].className="statusHolder "+_c0;
Element.show(_c1[0]);
}else{
new Insertion.Bottom(_bf.parentNode,"<span class=\"statusHolder "+_c0+"\">&nbsp;</span>");
}
}
function newEventHideProgress(_c2){
var _c3=document.getElementsByClassName("progress",_c2.parentNode);
if(_c3.length>0){
Element.hide(_c3[0]);
}
}
function newEventHideStatusHolder(_c4){
var _c5=document.getElementsByClassName("statusHolder",_c4.parentNode);
if(_c5.length>0){
Element.hide(_c5[0]);
}
}
function newEventCloneSupportField(_c6){
var _c7=document.getElementsByClassName("support",$("artists"));
var _c8=_c7[_c7.length-1];
var _c9=_c8.getElementsByTagName("input")[0];
if(_c9.value==""){
if(_c6){
_c9.focus();
}
return;
}
var _ca=_c9.cloneNode(true);
var _cb=document.createElement("div");
Element.addClassName(_cb,"support optional");
_ca.value="";
var _cc=_c8.getElementsByTagName("label")[0].cloneNode(true);
var _cd=1+parseInt(_ca.getAttribute("id").substring(7));
_ca.setAttribute("id","support"+_cd);
_cc.setAttribute("for","support"+_cd);
_cb.appendChild(_cc);
_cb.appendChild(_ca);
$("artists").appendChild(_cb);
newEventBindArtistField(_ca);
if(_c6){
_ca.focus();
}
}
function newEventValidate(){
var ret=true;
var _cf=$A(document.getElementsByClassName("artist"));
var one=false;
_cf.each(function(a){
if(a.value.trim()!=""){
one=true;
}
});
if(!one){
Element.addClassName("headlinerField","error");
Event.observe("headliner","focus",function(){
Element.removeClassName("headlinerField","error");
});
ret=false;
}else{
Element.removeClassName("headlinerField","error");
}
if($("startday").value==""||$("startmonth").value==""||$("startyear").value==""){
Element.addClassName("startdate","error");
ret=false;
}else{
Element.removeClassName("startdate","error");
}
if(!ret){
$("fieldErrors").style.display="block";
}else{
Element.hide("fieldErrors");
}
var _d2=$("venueid").value=="";
if(_d2){
if($("venueName").value.trim()==""){
Element.addClassName("venue","error");
ret=false;
}else{
Element.removeClassName("venue","error");
}
}
if(ret&&_d2){
newEventSendSearchVenue();
ret=false;
}
return ret;
}
function newEventCommit(){
$("addButton").disabled=true;
$("editButton").disabled=true;
var _d3=document.getElementsByClassName("progress",$("previewArea"));
if(_d3.length>0){
Element.show(_d3[0]);
}else{
new Insertion.After("addButton","<span class=\"progress\">&nbsp;</span>");
}
var _d4=document.getElementsByClassName("eventAddedFailure",$("previewArea"));
if(_d4.length==1){
Element.hide(_d4[0]);
}
new Ajax.Request("/event/commit",{method:"post",parameters:Form.serialize($("newEventForm")),onSuccess:function(req){
if(req.responseText.indexOf("gotoEventButton")==-1){
newEventCommitFailure(req);
return;
}
Element.hide("addButton","editButton");
$("addButton").disabled=false;
$("editButton").disabled=false;
$("theWidget").innerHTML=req.responseText;
},onFailure:newEventCommitFailure});
}
function newEventCommitFailure(req){
$("addButton").disabled=false;
$("editButton").disabled=false;
var _d7=document.getElementsByClassName("progress",$("previewArea"));
Element.hide(_d7[0]);
var _d8=document.getElementsByClassName("eventAddedFailure",$("previewArea"));
if(_d8.length>0){
Element.show(_d8[0]);
}else{
if(req.responseText.indexOf("eventAddedFailure")!=-1){
new Insertion.After("addButton",req.responseText);
}
}
}
function newEventPreview(){
if(!newEventValidate()){
return;
}
new Insertion.Bottom("eventPreview","<span class=\"progress\">&nbsp;</span>");
var _d9=$("newEventForm");
var url="/event/preview";
var _db=Form.serialize(_d9);
new Ajax.Request(url,{method:"post",parameters:_db,onSuccess:function(req){
if(req.responseText.indexOf("vcalendar")==-1){
newEventPreviewError();
return;
}
var _dd=req.responseText.indexOf("<!--venue:");
if(_dd!=-1){
var _de=req.responseText.substring(_dd+10,req.responseText.indexOf("-->"));
newEventSetVenue(_de,true);
}
newEventDoPreview(req.responseText);
},onFailure:newEventPreviewError});
}
function newEventDoPreview(_df){
$("eventPreview").innerHTML="<br clear=\"all\" />";
new Insertion.Top("eventPreview",_df);
Element.hide("newEventForm");
Element.hide("editH2");
$("previewH2").style.display="block";
$("previewArea").style.display="block";
}
function newEventChangeCategory(cat,_e1){
if(cat==1){
cat=2;
_e1=!_e1;
}
if(_e1){
Element.removeClassName("nameField","optional");
Element.addClassName("newEventForm","festival");
}else{
Element.addClassName("nameField","optional");
Element.removeClassName("newEventForm","festival");
}
}
function newEventEdit(){
Element.show("newEventForm");
Element.show("editH2");
Element.hide("previewH2");
Element.hide("previewArea");
Element.show($("previewButton").parentNode);
}
function newEventPreviewError(req){
$("previewError").style.display="block";
}
function forgetEvent(eid,_e4){
_e4.blur();
_e4.disabled=true;
Element.addClassName(_e4,"progress");
var a=document.getElementsByClassName("error",this.parentNode);
if(a.length>0){
a[0].style.display="none";
}
new Ajax.Request("/ajax/forgetevent",{method:"post",parameters:"e="+eid,onSuccess:forgetEventResponse.bind(_e4),onFailure:forgetEventFailure.bind(_e4)});
}
function forgetEventResponse(_e6){
if(_e6.responseText.indexOf("<success>")==-1){
func=forgetEventFailure.bind(this);
func();
return;
}
var p=this.parentNode;
while(p.nodeName!="body"&&!Element.hasClassName(p,"vevent")){
p=p.parentNode;
}
if(Element.hasClassName(p,"vevent")){
Element.addClassName(p,"deleted");
}
this.parentNode.removeChild(this);
}
function forgetEventFailure(){
Element.removeClassName(this,"progress");
this.disabled=false;
var a=document.getElementsByClassName("error",this.parentNode);
if(a.length>0){
a[0].style.display="block";
}
}
var radioPopup=null;
var radioPrefPopup=null;
function createRadioPopup(_e9,_ea,_eb){
if(radioPopup==undefined||radioPopup.closed||(_ea!=undefined&&_eb!=undefined)){
radioPopup=window.open("/webclient/popup/?radioURL="+encodeURIComponent(_e9)+"&resourceID="+_ea+"&resourceType="+_eb,"flashRadioPopup","toolbar=no, location=no, directories=no, status=no,menubar=no, scrollbars=no, resizable=no, width=360, height= 190");
radioPopup.moveTo(200,200);
radioPopup.focus();
}else{
if(navigator.appName.indexOf("Microsoft")!=-1){
radioPopup.close();
radioPopup=undefined;
createRadioPopup(_e9);
}else{
if(!radioPopup.closed){
radioPopup.tune(unescape(_e9));
radioPopup.focus();
}
}
}
}
function createShufflePopup(_ec){
var _ed=window.open("/webclient/shuffle/?user="+encodeURIComponent(_ec),"shuffleRadioPopup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=372, height=293");
}
function createHomepageRadioPopup(_ee){
createRadioPopup(_ee);
if(radioPopup){
stopRadio();
}
}
function getPlayerEl(_ef){
if(window.document[_ef]){
return window.document[_ef];
}
if(navigator.appName.indexOf("Microsoft")!=-1){
return document.getElementById(_ef);
}else{
return document[_ef];
}
}
function stopRadio(){
var _f0=getPlayerEl("lfmPlayer");
_f0.TCallLabel("/","HandleJSStopPlayback");
}
function createRadioPrefPopup(_f1){
if((radioPopup==undefined||radioPopup.closed)){
radioPrefPopup=window.open("/webclient/pref/?radioURL="+_f1,"radioPrefPopup","toolbar=no, location=no, directories=no, status=no,menubar=no, scrollbars=no, resizable=no, width=360, height= 165");
radioPrefPopup.moveTo(200,200);
radioPrefPopup.focus();
}else{
createRadioPopup(_f1);
}
}
var currentTrack;
var currentTrackNum;
var newTrack;
var previewRequest=false;
function playPreview(_f2){
currentTrackNum=parseInt(_f2);
var _f3=getPlayerEl("lfmPlayer");
_f3.SetVariable("previewTrackNumber",parseInt(_f2));
_f3.TCallLabel("/","HandleJSPreviewSkip");
if(currentTrack){
currentTrack.onend();
}
currentTrack=getCurrentTrack();
if(currentTrack){
currentTrack.onstart();
}
}
function getCurrentTrack(){
return Lastfm.resources[currentTrackNum-1];
}
var is_ie;
function highlightTrack(id){
if(currentTrack){
currentTrack.onend();
}
currentTrackNum=Lastfm.getResourceIndexById(id)+1;
flashLogger("TRACK SENT TO JS "+currentTrackNum);
currentTrack=getCurrentTrack();
if(currentTrack){
currentTrack.onstart();
}
scrollToCurrentTrack(currentTrack);
}
function scrollToCurrentTrack(_f5){
tableRow=$("tltr"+_f5.resourceID);
var _f6=0;
row=tableRow;
while(row=row.previousSibling){
if(row.nodeType==1){
_f6=_f6+Element.getHeight(row.getElementsByTagName("TD")[0]);
}
}
el=tableRow.parentNode;
while(el){
if(el.tagName=="DIV"){
paddingTop=Element.getStyle(el,"padding-top");
paddingTop=paddingTop.replace("px","")*1;
_f6=_f6+paddingTop;
tableHead=el.getElementsByTagName("TABLE")[0].getElementsByTagName("TH")[0];
if(tableHead){
_f6=_f6+Element.getHeight(tableHead);
}
if(el.offsetHeight<_f6||el.scrollTop>el.offsetHeight){
el.scrollTop=_f6;
}
return true;
}
el=el.parentNode;
}
return false;
}
function onFlashPlayerNextTrack(){
onFlashPlayerNextTrackHighlight();
}
function onFlashPlayerNextTrackHighlight(){
if(currentTrack){
currentTrack.onend();
}
if(currentTrackNum==undefined){
currentTrackNum=1;
}else{
if(currentTrack){
currentTrackNum++;
}
}
if(currentTrackNum>Lastfm.resources.length){
currentTrackNum=1;
}
currentTrack=getCurrentTrack();
if(currentTrack){
currentTrack.onstart();
}
}
function onFlashPlayerStopTrack(){
onFlashPlayerStopTrackHighlight();
}
function onFlashPlayerStopTrackHighlight(){
if(currentTrack){
currentTrack.onend();
}
}
function setPopupTitle(_f7){
var _f8=is_ie?decodeURIComponent(escape(_f7)):_f7;
$("radioTitle").innerHTML="Listening to "+_f8;
}
function createLogPanel(){
if(!$("flashLog")){
var _f9=document.createElement("div");
_f9.id="flashLog";
$("flashContainer").appendChild(_f9);
}else{
$("flashContainer").removeChild($("flashLog"));
}
}
function flashLogger(msg){
if($("flashLog")){
$("flashLog").innerHTML=$("flashLog").innerHTML.slice(-400)+msg+"<br />";
}
}
function inlineFlashPreview(el,res,flp){
new Insertion.Before(el,"<span class=\"inlineFlash\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"13\" height=\"13\" allowNetworking=\"internal\"> <param name=\"wmode\" value=\"transparent\"> <param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"FlashVars\" value=\"autostart=true&resourceID="+res+"&flp="+(flp?"true":"false")+"\" />  <param name=\"movie\" value=\"http://static.last.fm/webclient/inline/1/inlinePlayer.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed wmode=\"transparent\" src=\"http://static.last.fm/webclient/inline/1/inlinePlayer.swf\" quality=\"high\" FlashVars=\"autostart=true&resourceID="+res+"&flp="+(flp?"true":"false")+"\" bgcolor=\"#ffffff\" width=\"13\" height=\"13\" name=\"inlinePlayer\" allowNetworking=\"internal\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> </object></span>");
el.parentNode.removeChild(el);
}
LFM.set("Form",{hint:Class.create(),hintValues:{}});
LFM.Form.hint.prototype={prime:function(_fe){
if($(_fe)&&Element.hasClassName(_fe,"hint")){
Event.observe(_fe,"focus",this.onFocus.bindAsEventListener(this));
Event.observe(_fe,"blur",this.onBlur.bindAsEventListener(this));
}
},addID:function(_ff){
if(!_ff.id){
_ff.id="i"+Math.floor(Math.random()*9999999999);
}
return _ff;
},onFocus:function(_100){
input=Event.findElement(_100,"INPUT");
if(input){
if(!LFM.Form.hintValues[input.id]){
LFM.Form.hintValues[input.id]=input.value;
}
if(input.value==LFM.Form.hintValues[input.id]){
Element.removeClassName(input,"hint");
input.value="";
}
}
},onBlur:function(_101){
input=Event.findElement(_101,"INPUT");
if(input&&input.value.replace(/(\s*)/g,"")==""){
Element.addClassName(input,"hint");
input.value=LFM.Form.hintValues[input.id];
}
},initialize:function(_102){
if(_102&&_102.input){
_102.input=$(_102.input);
this.prime(_102.input);
}else{
if(_102&&_102.form&&$(_102.form)){
form=$(_102.form);
Form.getInputs(_102.form,"text").each(function(_103){
this.prime(this.addID(_103));
}.bind(this));
}else{
$A(document.getElementsByTagName("INPUT")).each(function(_104){
this.prime(this.addID(_104));
}.bind(this));
}
}
}};
LFM.set("Form",{focusToRange:0,focusTo:function(_105,_106){
if(typeof _106=="undefined"){
_106=_105.value.length;
}
if(_105.createTextRange){
if(LFM.Form.focusToRange==0){
LFM.Form.focusToRange=_105.createTextRange();
}
LFM.Form.focusToRange.moveEnd("character",_105.value.length);
LFM.Form.focusToRange.moveStart("character",_106);
setTimeout("LFM.Form.focusToRange.select()",10);
}else{
if(_105.setSelectionRange){
_105.focus();
_105.select();
_105.setSelectionRange(_106,_105.value.length);
}else{
_105.focus();
}
}
}});
function approveFriend(id,url,msg){
var todo=$("friendform"+id).todo;
var _10b=document.getElementsByClassName("uContextualInfo","user"+id+"Displayed");
if(_10b.length>0){
_10b[0].oldInnerHTML=_10b[0].innerHTML;
_10b[0].innerHTML="";
var _10c=document.createElement("img");
_10c.setAttribute("src","http://static.last.fm/tageditor/progress_active.gif");
_10b[0].appendChild(_10c);
}
var _10d=new Ajax.Updater("user"+id+"Info",url,{method:"post",parameters:todo+"=1&friendid="+id+"&msg="+escape(msg)+"&ajax=1",onComplete:approveFriendSuccess});
}
function approveFriendSuccess(req){
var text=req.responseText;
var _110=text.indexOf("success");
var text=text.substr(_110+7);
var _111=text.indexOf("type");
var _112=text.indexOf("\"");
var id=text.substr(0,_111);
var type=text.substr(_111+4,_112-(_111+4));
var _115=$(type+"Title").innerHTML;
var _116=_115.indexOf("(");
var _117=_115.indexOf(")");
var diff=_117-_116;
if(_116>0&&_117>0&&diff>0){
var num=parseInt(_115.substr(_116+1,diff));
if(--num>=0){
$(type+"Title").innerHTML=_115.substr(0,_116)+"("+num+_115.substr(_117);
}
}
}
function approveFriendTimeout(id,num,type){
$("user"+id+"Displayed").style.display="none";
if(num==0){
$(type+"Title").style.display="none";
if(type=="pending"){
$("togglelist1").style.display="none";
}else{
$("togglelist2").style.display="none";
}
}
}
function log(_11d){
if(LFM&&LFM.get("config","DEVELOPMENT_SERVER")){
if((window.attachEvent&&!window.opera)){
alert(_11d);
}else{
if(window.console){
window.console.log(_11d+"");
}else{
if(window.opera){
window.opera.postError(_11d);
}else{
if(console){
console.log(_11d);
}
}
}
}
}
}
function is_array(obj){
if(obj.constructor.toString().indexOf("Array")==-1){
return false;
}else{
return true;
}
}
function isset(obj){
return obj!==undefined;
}
String.prototype.pad=function(_120,_121,_122){
if(_120){
_120=_120-this.length;
}else{
return this;
}
var _123=this;
if(_121){
_121=_121+"";
}else{
_121=" ";
}
if(!isset(_122)){
_122="STR_PAD_LEFT";
}
if(_122=="STR_PAD_BOTH"){
var odd=_120%2;
var side=_120/2;
side=Math.round(side);
var left=_121.times(side);
var _127=_121.times(side-odd);
_123=left+_123+_127;
}else{
var _121=_121.times(_120);
if(_122=="PAD_STR_RIGHT"){
_123=_123+_121;
}else{
_123=_121+_123;
}
}
return _123;
};
HighlightEachOther=Class.create();
HighlightEachOther.prototype={initialize:function(_128,_129,_12a,_12b){
this.classyContainer=_128;
this.classyTagName=_129;
this.idContainer=_12a;
this.idTagName=_12b;
this.classyElements=$A($(_128).getElementsByTagName(_129));
this.idElements=$A($(_12a).getElementsByTagName(_12b));
this.classyElements.each(function(_12c){
Event.observe(_12c,"mouseover",this.highlightId.bindAsEventListener(this));
Event.observe(_12c,"mouseout",this.downlightIds.bindAsEventListener(this));
}.bind(this));
this.idElements.each(function(_12d){
Event.observe(_12d,"mouseover",this.highlightClassNames.bindAsEventListener(this));
Event.observe(_12d,"mouseout",this.downlightClassNames.bindAsEventListener(this));
}.bind(this));
},highlightId:function(_12e){
var item=Event.findElement(_12e,this.classyTagName);
if(!item.relatives){
this.getRelativeIds(item);
}
item.relatives.each(function(_130){
Element.addClassName(_130,"highlight");
});
},highlightClassNames:function(_131){
var item=Event.findElement(_131,this.idTagName);
if(!item.relatives){
this.getRelativeClassNames(item);
}
item.relatives.each(function(_133){
Element.addClassName(_133,"highlight");
});
},getRelativeIds:function(item){
item.relatives=new Array();
var _135=Element.classNames(item);
item.relatives=_135.grep(".0");
},getRelativeClassNames:function(item){
item.relatives=new Array();
var _137=item.id;
this.classyElements.each(function(_138){
if(Element.hasClassName(_138,_137)){
item.relatives.push(_138);
}
});
},downlightIds:function(_139){
var item=Event.findElement(_139,this.classyTagName);
if(!item.relatives){
this.getRelativeIds(item);
}
item.relatives.each(function(_13b){
Element.removeClassName(_13b,"highlight");
});
},downlightClassNames:function(_13c){
var item=Event.findElement(_13c,this.idTagName);
if(!item.relatives){
this.getRelativeClassNames(item);
}
item.relatives.each(function(_13e){
Element.removeClassName(_13e,"highlight");
});
}};
var EventLineup=Class.create();
EventLineup.prototype={initialize:function(el){
},setHeadliner:function(url,_141,_142){
alert(1);
}};
EventLineup.setHeadliner=function(url,_144,_145,hide,show){
var _148=$A(document.getElementsByClassName(_145,_144));
_148.each(function(a){
var _14a=a.getElementsByTagName("a");
Element.addClassName(_14a[0],"selectingHeadliner");
_14a[0].setAttribute("href",url+"?artist="+_14a[0].innerHTML.unescapeHTML());
});
Element.hide(hide);
$(show).style.display="";
};
function listenLiveSwitch(_14b,to,all,_14e,_14f){
$(_14b).value=to;
for(var i=0;i<all.length;i++){
var id=all[i]+"LiveSwitch";
if(all[i]==to){
Element.addClassName(id,"current");
}else{
Element.removeClassName(id,"current");
}
}
$("userInput").value=_14f;
}
var cookieExpires=new Date();
cookieExpires.setYear(2036);
var panelimgs=new Array();
function setCookie(name,_153,_154,path,_156,_157){
var _158=name+"="+escape(_153)+((_154)?"; expires="+_154.toGMTString():"")+((path)?"; path="+path:"")+((_156)?"; domain="+_156:"")+((_157)?"; secure":"");
document.cookie=_158;
}
function getCookie(name){
var dc=document.cookie;
var _15b=name+"=";
var _15c=dc.indexOf("; "+_15b);
if(_15c==-1){
_15c=dc.indexOf(_15b);
if(_15c!=0){
return null;
}
}else{
_15c+=2;
}
var end=document.cookie.indexOf(";",_15c);
if(end==-1){
end=dc.length;
}
return unescape(dc.substring(_15c+_15b.length,end));
}
function setPanelCookie(_15e,_15f){
var cook=getCookie("LastPanelsDC");
if(Element.hasClassName(_15e,"nosave")){
return;
}
if(cook){
var _161=cook.indexOf(_15e+":");
if(_161!=-1){
var _162=cook.substring(0,_161+_15e.length+1);
var last=cook.substring(_161+_15e.length+2,cook.length);
setCookie("LastPanelsDC",_162+_15f+last,cookieExpires,"/");
}else{
setCookie("LastPanelsDC",cook+_15e+":"+_15f+",",cookieExpires,"/");
}
}else{
setCookie("LastPanelsDC",_15e+":"+_15f+",",cookieExpires,"/");
}
}
function collapseBox(id,link){
var box=$(id);
if(!box){
return;
}
var list=$("list_"+id);
var c=document.getElementById(id).getElementsByClassName("c",box);
if(c.length>0&&!c[0].blinding){
c[0].blinding=true;
if(c[0].style.display=="none"){
setPanelCookie(id,list&&Element.hasClassName(c[0],"collapsed")?1:3);
if(list&&!Element.hasClassName(c[0],"collapsed")){
panelShowImages(id);
}
Effect.BlindDown(c[0],{afterFinish:function(){
c[0].blinding=false;
},duration:0.25});
if(link){
link.className="tog collapseTog";
}
}else{
setPanelCookie(id,list&&Element.hasClassName(c[0],"collapsed")?2:4);
Effect.BlindUp(c[0],{afterFinish:function(){
c[0].blinding=false;
},duration:0.25});
if(link){
link.className="tog expandTog";
}
}
}
return false;
}
function toggleBoxImages(id,link){
var box=$(id);
if(!box){
return;
}
var c=document.getElementsByClassName("c",box);
if(c.length<1){
return;
}
if(Element.hasClassName(c[0],"collapsed")){
setPanelCookie(id,c[0].style.display=="none"?4:3);
if(c[0].style.display!="none"){
panelShowImages(id);
}
Element.removeClassName(c[0],"collapsed");
if(link){
link.className="tog textTog";
}
}else{
if(c.length>0){
setPanelCookie(id,c[0].style.display=="none"?2:1);
}
Element.addClassName(c[0],"collapsed");
if(link){
link.className="tog imgTog";
}
}
return false;
}
function panelShowImages(id){
var box=$(id);
if(!box){
return;
}
var list=$("list_"+id);
if(!list){
return;
}
if(panelimgs[id]&&panelimgs[id][0]){
var img=list.getElementsByTagName("img");
for(var i=0;i<img.length;i++){
img[i].src=panelimgs[id][i];
}
}
}
function toggleImageView(_172){
var _173=$(_172);
if(!Element.hasClassName(_173,"collapsed")){
Element.addClassName(_173,"collapsed");
$("rsToggleImages_"+_172).checked=true;
$("rsToggleDetails_"+_172).checked=false;
setPanelCookie(_172,1);
}
}
function toggleDetailView(_174){
var _175=$(_174);
if(Element.hasClassName(_175,"collapsed")){
Element.removeClassName(_175,"collapsed");
$("rsToggleImages_"+_174).checked=false;
$("rsToggleDetails_"+_174).checked=true;
setPanelCookie(_174,3);
}
}
var radioOn=false;
function radioToggle(){
if(radioOn){
$("radiobits").style.display="none";
$("radioInputView").src="http://static.last.fm/depth/sidebars/vw_view.gif";
radioOn=false;
$("radiobits").style.display="block";
$("radioInputView").src="http://static.last.fm/depth/sidebars/vw_view_on.gif";
radioOn=true;
}
}
function colourSwitch(link){
if($("LastBody").className.indexOf("red")!=-1){
$("LastBody").className=$("LastBody").className.replace("red","black");
$("LogoImg").src=$("LogoImg").src.replace("red_logo.jpg","black_logo.jpg");
setCookie("LastFm_Colour","black",cookieExpires,"/");
}else{
$("LastBody").className=$("LastBody").className.replace("black","red");
$("LogoImg").src=$("LogoImg").src.replace("black_logo.jpg","red_logo.jpg");
setCookie("LastFm_Colour","red",cookieExpires,"/");
}
link.blur();
return false;
}
function colourToggle(link,_178,_179){
var _17a=["LogoImg","dumbMailIcon","headerSearchbutton"];
var _17b=function switchCol(img){
if($(img)){
if($("LastBody").className.indexOf("red")!=-1){
$(img).src=$(img).src.replace("black_","red_");
}else{
$(img).src=$(img).src.replace("red_","black_");
}
}
};
if($("LastBody").className.indexOf("red")!=-1){
$("LastBody").className=$("LastBody").className.replace("red","black");
_17a.each(_17b);
link.innerHTML=_178;
setCookie("LastFm_Colour","black",cookieExpires,"/");
}else{
$("LastBody").className=$("LastBody").className.replace("black","red");
_17a.each(_17b);
link.innerHTML=_179;
setCookie("LastFm_Colour","red",cookieExpires,"/");
}
link.blur();
return false;
}
function toggleHiddenStations(_17d,_17e,_17f,_180){
$(_17f).parentNode.blur();
if(Element.hasClassName(_180,"expanded")){
$(_17f).innerHTML=_17d;
Element.removeClassName(_180,"expanded");
}else{
$(_17f).innerHTML=_17e;
Element.addClassName(_180,"expanded");
}
}
function toggleStations(_207,_208){
if($("stationBlurb")){
Element.toggle("stationBlurb");
}
if($("mainStationShare")){
Element.toggle("mainStationShare");
}
if(!Element.visible("otherStations")){
if($("profileStation")){
Element.removeClassName("profileStation","withBlurb");
}
$("stationToggle").innerHTML=_208;
}else{
if($("profileStation")){
Element.addClassName("profileStation","withBlurb");
}
$("stationToggle").innerHTML=_207;
}
Element.toggle("otherStations");
return false;
}
function togglePlaylist(){
if(Element.visible($("plFlash"))){
$("plHolder").style.height="auto";
Element.removeClassName("plHolder","plScroll");
Element.hide("plFlash");
new Effect.BlindUp("plFlashHolder",{duration:0.3});
Element.addClassName("plHolder","collapsedTable");
$("plTogText").innerHTML=plShowText;
}else{
$("plHolder").style.height=plHeight;
Element.addClassName("plHolder","plScroll");
new Effect.BlindDown("plFlashHolder",{duration:0.3,afterFinish:function(){
Element.show("plFlash");
}});
Element.removeClassName("plHolder","collapsedTable");
$("plTogText").innerHTML=plHideText;
}
return false;
}
function faqpopup(id){
var url="/popups/faq/?id="+id;
var faq=window.open(url,"faq","toolbar=no, location=no, directories=no, status=no,menubar=no, scrollbars=yes, resizable=yes, width=350, height=400");
}
function removeSampleText(item,_187){
if(item.value==_187){
item.value="";
Element.removeClassName(item,"withSampleText");
}
}
Element.addMethods({wrap:function(_188,_189){
_188=$(_188);
var _18a=document.createElement(_189);
_188.parentNode.replaceChild(_18a,_188);
_18a.appendChild(_188);
return Element.extend(_18a);
}});
function incrementAttribute(_18b,_18c){
if(_18b[_18c]){
var _18d=_18b[_18c].match(/\d+/);
if(_18d&&!isNaN(_18d[0])){
_18d=_18d[0]*1+1;
_18d=_18b[_18c].replace(/(\D*)(\d*)(\D*)/,"$1"+_18d+"$3");
}else{
_18d=_18b[_18c]+"1";
}
return _18d;
}else{
return "";
}
}
function CheckAll(name){
var _18f=document.getElementById(name);
elLength=_18f.elements.length;
for(i=0;i<elLength;i++){
_18f.elements[i].checked=!_18f.elements[i].checked;
}
}
function getSelectedCheckboxValue(_190){
var _191=new Array();
var _192=getSelectedCheckbox(_190);
if(_192.length!=0){
_191.length=_192.length;
for(var i=0;i<_192.length;i++){
if(_190[_192[i]]){
_191[i]=_190[_192[i]].value;
}else{
_191[i]=_190.value;
}
}
}
return _191;
}
function swapDisplay(that){
var _195;
if(_195=document.getElementById(that)){
if(_195.style.display=="none"){
if(arguments.length>1){
hideClass(arguments[1]);
}
_195.style.display="";
}else{
_195.style.display="none";
}
}
}
var hideClassList={};
function hideClass(_196){
if(hideClassList[_196]){
for(var key in hideClassList[_196]){
hideClassList[_196][key].style.display="none";
}
}else{
var _198=document.getElementById(_196);
if(_198){
hideClassList[_196]=new Array();
for(var key in _198.childNodes){
if(_198.childNodes[key].className&&_198.childNodes[key].className.match(new RegExp(_196))){
hideClassList[_196].push(_198.childNodes[key]);
}
}
hideClass(_196);
}
}
}
var actionConf={jcommentdelete:{msg:"Are you sure you would like to delete this comment?",urlpass:null},journaldelete:{msg:"Are you sure you would like to delete this journal entry?",urlpass:null}};
function confirmAction(_199){
if(confirm(actionConf[_199].msg)){
if(actionConf[_199].urlpass==null){
if(arguments.length==1){
alert("ERROR:: There is no redirect URL");
}else{
window.location.href=arguments[1];
}
}else{
window.location.href=actionConf[_199].urlpass;
}
}else{
if(!actionConf[_199].urlfail){
}else{
window.location.href=actionConf[_199].urlfail;
}
}
}
function print_r(_19a,_19b){
if(typeof (_19b)=="number"){
if(_19b>2){
return "Too Far\n";
}
var _19c="    ";
for(var j=0;j<_19b;j++){
_19c+=_19c;
}
_19e-="  ";
_19b++;
}else{
var _19b=1;
var _19c="    ";
var _19e="";
}
switch(typeof (_19a)){
case "boolean":
var _19f=(_19a?"true":"false")+"\n";
break;
case "object":
if(_19a===null){
var _19f="null\n";
break;
}
var _19f=((_19a.reverse)?"Array":"Object")+" (\n";
for(var i in _19a){
try{
_19f+=_19c+"["+i+"] => "+print_r(_19a[i],_19b);
}
catch(ex){
}
}
_19f+=_19e+")\n";
break;
case "number":
case "string":
default:
var _19f=""+_19a+"\n";
}
return _19f;
}
function setFocus(id){
element=document.getElementById(id);
setTimeout("element.focus();",500);
}
function confirmAndGo(msg,url){
if(confirm(msg)){
self.location=url;
}else{
return false;
}
}
function whelp(_1a4){
wh_clear(0);
var _1a5=$("whelp");
if(_1a5){
_1a5.appendChild(document.createTextNode(_1a4.title));
}
}
function wh_clear(_1a6){
var _1a7=$("whelp");
if(_1a7){
while(_1a7.firstChild){
_1a7.removeChild(_1a7.firstChild);
}
if(wh_default&&_1a6>0){
_1a7.appendChild(document.createTextNode(wh_default));
}
}
}
String.prototype.trim=function(){
a=this.replace(/^\s+/,"");
return a.replace(/\s+$/,"");
};
LFM.set("Display",{Toggle:Class.create()});
LFM.Display.Toggle.prototype={initialize:function(_1a8,_1a9){
this.toggle=$(_1a8);
this.elementToToggle=_1a9;
Event.observe(this.toggle,"click",function(_1aa){
Event.stop(_1aa);
Element.toggle(this.elementToToggle);
this.toggle.className=Element.visible(this.elementToToggle)?"togglerExpanded":"togglerCollapsed";
this.toggle.blur();
}.bindAsEventListener(this));
}};
var panelDefaultItems=new Array();
var panelRemovedItems=new Array();
var panelOtherItems=new Array();
Panel.prototype.addItem=Panel_addItem;
Panel.prototype.getItem=Panel_getItem;
Panel.prototype.removeItem=Panel_removeItem;
Panel.prototype.checkForItem=Panel_checkForItem;
Panel.prototype.removeAllItems=Panel_removeAllItems;
Panel.prototype.listItems=Panel_listItems;
function Panel(_1ab){
this.panel=_1ab;
var _1ac=this.panel.childNodes;
panelDefaultItems[this.panel.id]=new Array();
panelRemovedItems[this.panel.id]=new Array();
panelOtherItems[this.panel.id]=new Array();
for(var i=0;i<_1ac.length;i++){
if(_1ac[i].nodeType==1&&_1ac[i].tagName.toLowerCase()=="div"){
switch(_1ac[i].className){
case "h":
this.header=_1ac[i];
break;
case "c":
this.content=_1ac[i];
var _1ae=this.content.childNodes;
for(var j=0;j<_1ae.length;j++){
if(_1ae[j].nodeType==1&&_1ae[j].tagName.toLowerCase()=="ul"){
this.list=_1ae[j];
var _1b0=this.list.childNodes;
for(var k=0;k<_1b0.length;k++){
if(_1b0[k].nodeType==1&&_1b0[k].tagName.toLowerCase()=="li"){
for(var l=0;l<_1b0[k].length;l++){
if(_1b0[k][l].nodeType==1&&_1b0[k][l].tagName.toLowerCase()=="a"&&_1b0[k][l].className=="it"){
var name=_1b0[k][l].childNodes[0].data;
var it=panelDefaultItems[this.panel.id].length;
panelDefaultItems[this.panel.id][it]={name:name,"element":_1b0[k]};
}
}
}
}
break;
}
}
break;
case "f":
this.footer=_1ac[i];
break;
}
}
}
this.itemcount=0;
}
function Panel_addItem(_1b5,_1b6){
var _1b7=document.getElementById("emptyConnectionsDiv");
if(_1b7){
_1b7.style.display="none";
}
var li=document.createElement("li");
var liid=this.panel.id+"_li"+this.itemcount;
li.id=liid;
var thea=document.createElement("a");
thea.setAttribute("title","");
thea.setAttribute("href",getElementText(_1b5,"url"));
thea.target="_new";
var src=getElementText(_1b5,"smallimg");
if(src==" "){
}else{
var img=document.createElement("img");
img.setAttribute("width","50");
img.setAttribute("src",src);
}
var _1bd=document.createElement("strong");
var _1be=document.createElement("span");
_1bd.appendChild(_1be.appendChild(document.createTextNode(getElementText(_1b5,"name"))));
if(src==" "){
}else{
thea.appendChild(img);
}
thea.appendChild(_1bd);
li.appendChild(thea);
if(_1b6){
var _1bf=document.createElement("input");
_1bf.setAttribute("type","hidden");
_1bf.setAttribute("name",this.panel.id+this.itemcount.toString());
_1bf.setAttribute("value",getElementText(_1b5,"restype")+":"+getElementText(_1b5,"id"));
li.appendChild(_1bf);
}
var i=panelOtherItems[this.panel.id].length;
panelOtherItems[this.panel.id][i]={"name":getElementText(_1b5,"name"),"resname":getElementText(_1b5,"resname"),"element":li};
var _1c1;
if((_1c1=getElementText(_1b5,"artistname"))!=null){
panelOtherItems[this.panel.id][i].artist=getElementText(_1b5,"artistname");
}
this.list.appendChild(li);
this.itemcount++;
return liid;
}
function Panel_getItem(loc,id){
switch(loc){
case 1:
return panelRemovedItems[this.panel.id][id];
break;
default:
return null;
}
}
function Panel_removeItem(id){
var _1c5=document.getElementById(id);
var _1c6=false;
var _1c7=panelOtherItems[this.panel.id];
var tmp;
for(var i=0;i<_1c7.length;i++){
if(_1c7[i].element==_1c5){
tmp=_1c7[i];
_1c7.splice(i,1);
break;
}
}
panelRemovedItems[this.panel.id][panelRemovedItems[this.panel.id].length]=tmp;
try{
_1c5.parentNode.removeChild(_1c5);
this.listItems("removed");
this.listItems("other");
}
catch(e){
alert("Error[Panel.removeItem("+id+")]");
}
}
function Panel_checkForItem(tag,_1cb,_1cc){
var _1cd=[panelDefaultItems[this.panel.id],panelRemovedItems[this.panel.id],panelOtherItems[this.panel.id]];
var _1ce=/artist=([^\]]*)\]"/g;
try{
var _1cf=_1cc.match(_1ce)[1];
}
catch(e){
}
for(var i=0;i<_1cd.length;i++){
for(var j=0;j<_1cd[i].length;j++){
if(i==0){
}else{
if(_1cd[i][j].resname.toLowerCase()==tag.toLowerCase()&&_1cd[i][j].name.toLowerCase()==_1cb.toLowerCase()){
if(!_1cf||(_1cd[i][j].artistname.toLowerCase()&&_1cf==_1cd[i][j].artistname.toLowerCase())){
this.lastItemCheck=j;
return i;
}
}
}
}
}
return 3;
}
function Panel_removeAllItems(){
var _1d2=this.list;
for(var i=0;i<this.list.childNodes.length;i++){
this.removeItem(this.list.childNodes[i].getAttribute("ID"));
}
}
function Panel_listItems(list,_1d5){
var msg="";
switch(list){
case "removed":
msg="Removed Items\n";
list=panelRemovedItems;
break;
case "other":
msg="Other Items\n";
list=panelOtherItems;
break;
}
if(_1d5){
for(var i=0;i<list[this.panel.id].length;i++){
msg+="{name:"+list[this.panel.id][i].name+",resname:"+list[this.panel.id][i].resname+"}\n";
}
}else{
return list[this.panel.id];
}
}
function pasteTaste(_1d8,_1d9){
var _1da=document.getElementsByClassName("subject",_1d8);
var _1db=[];
_1da.each(function(_1dc){
_1db[_1db.length]=_1dc.innerHTML.stripTags().trim().unescapeHTML();
});
var _1dd=_1db.join(", ");
var _1de=$(_1d9).innerHTML;
$(_1d9).value=_1dd+_1de;
$(_1d9).innerHTML=_1dd+_1de;
}
function resizeImage(_1df,max){
var _1df=$(_1df);
var _1e1=_1df.parentNode;
var _1e2=document.createElement("IMG");
_1e2.src=_1df.src;
Element.setStyle(_1e2,{width:"auto",heigth:"auto",position:"absolute",top:0,left:0,visibility:"hidden"});
_1e1.appendChild(_1e2);
if(_1e2.offsetWidth>max||_1e2.offsetHeight>max){
if(_1e2.offsetWidth>_1e2.offsetHeight){
Element.setStyle(_1df,{width:max+"px",height:"auto"});
}else{
Element.setStyle(_1df,{height:max+"px",width:"auto"});
}
}else{
Element.setStyle(_1df,{height:"auto",width:"auto"});
}
_1e1.removeChild(_1e2);
return _1df;
}
var globalResourceCheck={};
var resourceCheckBusy=false;
var webhost=null;
function getElementText(_1e3,name){
if(_1e3.getElementsByTagName(name)){
try{
return _1e3.getElementsByTagName(name)[0].childNodes[0].data;
}
catch(e){
return null;
}
}else{
return false;
}
}
ResourceCheck.prototype.getAjax=ResourceCheck_getAjax;
ResourceCheck.prototype.setParam=ResourceCheck_setParam;
ResourceCheck.prototype.getParam=ResourceCheck_getParam;
ResourceCheck.prototype.send=ResourceCheck_send;
ResourceCheck.prototype.response=ResourceCheck_response;
ResourceCheck.prototype.setCallback=ResourceCheck_setCallback;
ResourceCheck.prototype.writeToGlobal=ResourceCheck_writeToGlobal;
function ResourceCheck(){
this.getAjax();
this.parameters={"gettype":"check"};
}
function ResourceCheck_getAjax(){
if(window.XMLHttpRequest){
this.req=new XMLHttpRequest();
}else{
if(window.ActiveXObject){
this.req=new ActiveXObject("Microsoft.XMLHTTP");
}else{
this.req=null;
}
}
}
function ResourceCheck_setParam(key,val){
this.parameters[key]=encodeURIComponent(val);
}
function ResourceCheck_getParam(key){
try{
var val=this.parameters[key];
return val;
}
catch(e){
return null;
}
}
function ResourceCheck_send(){
if(this.resourceCheckBusy){
throw ("ResourceCheck busy");
}
this.resourceCheckBusy=true;
if(!webhost){
alert("No Webhost");
return false;
}
var url="http://"+webhost+"/ajax/resourcecheck/?";
var _1ea=false;
var msg="";
for(var key in this.parameters){
url+=(_1ea?"&":"")+key+"="+this.parameters[key];
msg+=(_1ea?"&\n":"")+key+"="+this.parameters[key];
_1ea=true;
}
this.req.open("GET",url,true);
var _1ed=this;
this.req.onreadystatechange=function(){
_1ed.response();
};
this.req.send(null);
}
function ResourceCheck_response(){
if(this.req.readyState==4){
if(this.req.responseText.match(/true/i)){
this.callback(true,this.callbackparams);
}else{
if(globalResourceCheck.req.responseText=="true"){
this.callback(true,this.callbackparams);
}else{
this.callback(false,this.callbackparams);
}
}
this.resourceCheckBusy=false;
}
}
function ResourceCheck_setCallback(_1ee,_1ef){
this.callback=_1ee;
this.callbackparams=_1ef;
}
function ResourceCheck_writeToGlobal(){
for(var key in this){
globalResourceCheck[key]=this[key];
}
}
ResourceGet.prototype=new ResourceCheck;
ResourceGet.prototype.contructor=ResourceGet;
ResourceGet.prototype.response=ResourceGet_response;
function ResourceGet(){
this.getAjax();
this.parameters={"gettype":"object"};
}
function ResourceGet_response(){
if(this.req.readyState==4){
if(this.req.responseText.match(/false/i)){
this.callback(false,this.callbackparams);
}else{
if(this.req.responseXML){
this.callback(this.req.responseXML,this.callbackparams);
}
}
this.resourceCheckBusy=false;
}
}
ResourceList.prototype=new ResourceCheck;
ResourceList.prototype.constructor=ResourceList;
ResourceList.prototype.response=ResourceList_response;
function ResourceList(){
this.getAjax();
this.parameters={"gettype":"list"};
}
function ResourceList_response(){
if(this.req.readyState==4){
if(this.req.responseText.match(/false/i)){
alert("Not found ["+this.req.responseText+"]");
this.callback(false,this.callbackparams);
}else{
if(this.req.responseXML){
this.callback(this.req.responseXML.childNodes,this.callbackparams);
}
}
}
this.resourceCheckBusy=false;
}
function searchboxClick(){
if(!$("searchInput").beenclicked){
$("searchInput").beenclicked=true;
$("searchInput").value="";
$("searchInput").style.color="#252525";
}
}
var LiveSwitch=Class.create();
LiveSwitch.prototype={initialize:function(_1f1,_1f2){
this.element=$(_1f1);
this.options=_1f2;
var i=0;
this.items=$A(this.element.getElementsByTagName("li"));
this.items.each(function(li){
var a=$A(li.getElementsByTagName("a")).shift();
Event.observe(a,"click",this.dispatchOnChange.bindAsEventListener(this));
}.bind(this));
},dispatchOnChange:function(_1f6){
Event.stop(_1f6);
var a=Event.element(_1f6);
a.blur();
this.items.each(function(l){
Element.removeClassName(l,this.options.selectedClass);
}.bind(this));
Element.addClassName(a.parentNode,this.options.selectedClass);
this.options.onChange(a.parentNode);
}};
var UFO={req:["movie","width","height","majorversion","build"],opt:["play","loop","menu","quality","scale","salign","wmode","bgcolor","base","flashvars","devicefont","allowscriptaccess","seamlesstabbing","allowfullscreen"],optAtt:["id","name","align"],optExc:["swliveconnect"],ximovie:"ufo.swf",xiwidth:"215",xiheight:"138",ua:navigator.userAgent.toLowerCase(),pluginType:"",fv:[0,0],foList:[],create:function(FO,id){
if(!UFO.uaHas("w3cdom")||UFO.uaHas("ieMac")){
return;
}
UFO.getFlashVersion();
UFO.foList[id]=UFO.updateFO(FO);
UFO.createCSS("#"+id,"visibility:hidden;");
UFO.domLoad(id);
},updateFO:function(FO){
if(typeof FO.xi!="undefined"&&FO.xi=="true"){
if(typeof FO.ximovie=="undefined"){
FO.ximovie=UFO.ximovie;
}
if(typeof FO.xiwidth=="undefined"){
FO.xiwidth=UFO.xiwidth;
}
if(typeof FO.xiheight=="undefined"){
FO.xiheight=UFO.xiheight;
}
}
FO.mainCalled=false;
return FO;
},domLoad:function(id){
var _t=setInterval(function(){
if((document.getElementsByTagName("body")[0]!=null||document.body!=null)&&document.getElementById(id)!=null){
UFO.main(id);
clearInterval(_t);
}
},250);
if(typeof document.addEventListener!="undefined"){
document.addEventListener("DOMContentLoaded",function(){
UFO.main(id);
clearInterval(_t);
},null);
}
},main:function(id){
var _fo=UFO.foList[id];
if(_fo.mainCalled){
return;
}
UFO.foList[id].mainCalled=true;
document.getElementById(id).style.visibility="hidden";
if(UFO.hasRequired(id)){
if(UFO.hasFlashVersion(parseInt(_fo.majorversion,10),parseInt(_fo.build,10))){
if(typeof _fo.setcontainercss!="undefined"&&_fo.setcontainercss=="true"){
UFO.setContainerCSS(id);
}
UFO.writeSWF(id);
}else{
if(_fo.xi=="true"&&UFO.hasFlashVersion(6,65)){
UFO.createDialog(id);
}
}
}
document.getElementById(id).style.visibility="visible";
},createCSS:function(_200,_201){
var _h=document.getElementsByTagName("head")[0];
var _s=UFO.createElement("style");
if(!UFO.uaHas("ieWin")){
_s.appendChild(document.createTextNode(_200+" {"+_201+"}"));
}
_s.setAttribute("type","text/css");
_s.setAttribute("media","screen");
_h.appendChild(_s);
if(UFO.uaHas("ieWin")&&document.styleSheets&&document.styleSheets.length>0){
var _ls=document.styleSheets[document.styleSheets.length-1];
if(typeof _ls.addRule=="object"){
_ls.addRule(_200,_201);
}
}
},setContainerCSS:function(id){
var _fo=UFO.foList[id];
var _w=/%/.test(_fo.width)?"":"px";
var _h=/%/.test(_fo.height)?"":"px";
UFO.createCSS("#"+id,"width:"+_fo.width+_w+"; height:"+_fo.height+_h+";");
if(_fo.width=="100%"){
UFO.createCSS("body","margin-left:0; margin-right:0; padding-left:0; padding-right:0;");
}
if(_fo.height=="100%"){
UFO.createCSS("html","height:100%; overflow:hidden;");
UFO.createCSS("body","margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");
}
},createElement:function(el){
return (UFO.uaHas("xml")&&typeof document.createElementNS!="undefined")?document.createElementNS("http://www.w3.org/1999/xhtml",el):document.createElement(el);
},createObjParam:function(el,_20b,_20c){
var _p=UFO.createElement("param");
_p.setAttribute("name",_20b);
_p.setAttribute("value",_20c);
el.appendChild(_p);
},uaHas:function(ft){
var _u=UFO.ua;
switch(ft){
case "w3cdom":
return (typeof document.getElementById!="undefined"&&typeof document.getElementsByTagName!="undefined"&&(typeof document.createElement!="undefined"||typeof document.createElementNS!="undefined"));
case "xml":
var _m=document.getElementsByTagName("meta");
var _l=_m.length;
for(var i=0;i<_l;i++){
if(/content-type/i.test(_m[i].getAttribute("http-equiv"))&&/xml/i.test(_m[i].getAttribute("content"))){
return true;
}
}
return false;
case "ieMac":
return /msie/.test(_u)&&!/opera/.test(_u)&&/mac/.test(_u);
case "ieWin":
return /msie/.test(_u)&&!/opera/.test(_u)&&/win/.test(_u);
case "gecko":
return /gecko/.test(_u)&&!/applewebkit/.test(_u);
case "opera":
return /opera/.test(_u);
case "safari":
return /applewebkit/.test(_u);
default:
return false;
}
},getFlashVersion:function(){
if(UFO.fv[0]!=0){
return;
}
if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){
UFO.pluginType="npapi";
var _d=navigator.plugins["Shockwave Flash"].description;
if(typeof _d!="undefined"){
_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);
var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;
UFO.fv=[_m,_r];
}
}else{
if(window.ActiveXObject){
UFO.pluginType="ax";
try{
var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
UFO.fv=[6,0];
_a.AllowScriptAccess="always";
}
catch(e){
if(UFO.fv[0]==6){
return;
}
}
try{
var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(typeof _a=="object"){
var _d=_a.GetVariable("$version");
if(typeof _d!="undefined"){
_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");
UFO.fv=[parseInt(_d[0],10),parseInt(_d[2],10)];
}
}
}
}
},hasRequired:function(id){
var _l=UFO.req.length;
for(var i=0;i<_l;i++){
if(typeof UFO.foList[id][UFO.req[i]]=="undefined"){
return false;
}
}
return true;
},hasFlashVersion:function(_21a,_21b){
return (UFO.fv[0]>_21a||(UFO.fv[0]==_21a&&UFO.fv[1]>=_21b))?true:false;
},writeSWF:function(id){
var _fo=UFO.foList[id];
var _e=document.getElementById(id);
if(UFO.pluginType=="npapi"){
if(UFO.uaHas("gecko")||UFO.uaHas("xml")){
while(_e.hasChildNodes()){
_e.removeChild(_e.firstChild);
}
var _obj=UFO.createElement("object");
_obj.setAttribute("type","application/x-shockwave-flash");
_obj.setAttribute("data",_fo.movie);
_obj.setAttribute("width",_fo.width);
_obj.setAttribute("height",_fo.height);
var _l=UFO.optAtt.length;
for(var i=0;i<_l;i++){
if(typeof _fo[UFO.optAtt[i]]!="undefined"){
_obj.setAttribute(UFO.optAtt[i],_fo[UFO.optAtt[i]]);
}
}
var _o=UFO.opt.concat(UFO.optExc);
var _l=_o.length;
for(var i=0;i<_l;i++){
if(typeof _fo[_o[i]]!="undefined"){
UFO.createObjParam(_obj,_o[i],_fo[_o[i]]);
}
}
_e.appendChild(_obj);
}else{
var _emb="";
var _o=UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);
var _l=_o.length;
for(var i=0;i<_l;i++){
if(typeof _fo[_o[i]]!="undefined"){
_emb+=" "+_o[i]+"=\""+_fo[_o[i]]+"\"";
}
}
_e.innerHTML="<embed type=\"application/x-shockwave-flash\" src=\""+_fo.movie+"\" width=\""+_fo.width+"\" height=\""+_fo.height+"\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\""+_emb+"></embed>";
}
}else{
if(UFO.pluginType=="ax"){
var _224="";
var _l=UFO.optAtt.length;
for(var i=0;i<_l;i++){
if(typeof _fo[UFO.optAtt[i]]!="undefined"){
_224+=" "+UFO.optAtt[i]+"=\""+_fo[UFO.optAtt[i]]+"\"";
}
}
var _225="";
var _l=UFO.opt.length;
for(var i=0;i<_l;i++){
if(typeof _fo[UFO.opt[i]]!="undefined"){
_225+="<param name=\""+UFO.opt[i]+"\" value=\""+_fo[UFO.opt[i]]+"\" />";
}
}
var _p=window.location.protocol=="https:"?"https:":"http:";
_e.innerHTML="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\""+_224+" width=\""+_fo.width+"\" height=\""+_fo.height+"\" codebase=\""+_p+"//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+_fo.majorversion+",0,"+_fo.build+",0\"><param name=\"movie\" value=\""+_fo.movie+"\" />"+_225+"</object>";
}
}
},createDialog:function(id){
var _fo=UFO.foList[id];
UFO.createCSS("html","height:100%; overflow:hidden;");
UFO.createCSS("body","height:100%; overflow:hidden;");
UFO.createCSS("#xi-con","position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");
UFO.createCSS("#xi-dia","position:absolute; left:50%; top:50%; margin-left: -"+Math.round(parseInt(_fo.xiwidth,10)/2)+"px; margin-top: -"+Math.round(parseInt(_fo.xiheight,10)/2)+"px; width:"+_fo.xiwidth+"px; height:"+_fo.xiheight+"px;");
var _b=document.getElementsByTagName("body")[0];
var _c=UFO.createElement("div");
_c.setAttribute("id","xi-con");
var _d=UFO.createElement("div");
_d.setAttribute("id","xi-dia");
_c.appendChild(_d);
_b.appendChild(_c);
var _mmu=window.location;
if(UFO.uaHas("xml")&&UFO.uaHas("safari")){
var _mmd=document.getElementsByTagName("title")[0].firstChild.nodeValue=document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0,47)+" - Flash Player Installation";
}else{
var _mmd=document.title=document.title.slice(0,47)+" - Flash Player Installation";
}
var _mmp=UFO.pluginType=="ax"?"ActiveX":"PlugIn";
var _uc=typeof _fo.xiurlcancel!="undefined"?"&xiUrlCancel="+_fo.xiurlcancel:"";
var _uf=typeof _fo.xiurlfailed!="undefined"?"&xiUrlFailed="+_fo.xiurlfailed:"";
UFO.foList["xi-dia"]={movie:_fo.ximovie,width:_fo.xiwidth,height:_fo.xiheight,majorversion:"6",build:"65",flashvars:"MMredirectURL="+_mmu+"&MMplayerType="+_mmp+"&MMdoctitle="+_mmd+_uc+_uf};
UFO.writeSWF("xi-dia");
},expressInstallCallback:function(){
var _b=document.getElementsByTagName("body")[0];
var _c=document.getElementById("xi-con");
_b.removeChild(_c);
UFO.createCSS("body","height:auto; overflow:auto;");
UFO.createCSS("html","height:auto; overflow:auto;");
},cleanupIELeaks:function(){
var _o=document.getElementsByTagName("object");
var _l=_o.length;
for(var i=0;i<_l;i++){
_o[i].style.display="none";
for(var x in _o[i]){
if(typeof _o[i][x]=="function"){
_o[i][x]=null;
}
}
}
}};
if(typeof window.attachEvent!="undefined"&&UFO.uaHas("ieWin")){
window.attachEvent("onunload",UFO.cleanupIELeaks);
}
function UploadTracker(_237,cb,_239){
this.form=_237;
this.callback=cb;
this.session=UploadTracker._generateSession();
this.stopped=false;
this.uploadID=_239;
var _23a=this.form.action;
if(_23a.match(/\bclient_up_sess=(\w+)/)){
_23a=_23a.replace(/\bclient_up_sess=(\w+)/,"client_up_sess="+this.session);
}else{
_23a+=(_23a.match(/\?/)?"&":"?");
_23a+="client_up_sess="+this.session;
}
this.form.action=_23a;
this._startCheckStatus();
}
UploadTracker.prototype.stopTracking=function(){
this.stopped=true;
};
UploadTracker._generateSession=function(){
var str=Math.random()+"";
return curSession=str.replace(/[^\d]/,"");
};
UploadTracker.prototype._startCheckStatus=function(){
var _23c=this;
if(_23c.stopped){
return true;
}
var url="/__upload_status";
var _23e="client_up_sess="+_23c.session+"&rand="+Math.random();
var _23f=new Ajax.Request(url,{method:"get",parameters:_23e,onComplete:function(_240){
if(_23c.stopped){
return true;
}
var _241;
eval("retVal = "+_240.responseText+";");
if(!_241){
return;
}
if(_23c.lastdone!=undefined&&_23c.lasttime!=undefined){
var _242=(_241.done-_23c.lastdone)/(_241.nowtime-_23c.lasttime);
var _243=(_241.total-_241.done)/_242;
}else{
var _242=0;
var _243=0;
}
_23c.lastdone=_241.done;
_23c.lasttime=_241.nowtime;
_241.transferrate=_242;
_241.timeremaining=_243;
_23c.callback(_241,_23c.uploadID);
setTimeout(function(){
_23c._startCheckStatus();
},1000);
}});
};
function videoSearch(pane,url,page,_247){
if($("videoSearchProgress")){
Element.show($("videoSearchProgress"));
}
if($("searchVideoButton")){
Element.hide($("searchVideoButton"));
}
if($(pane).id=="incomingVideos"){
new Effect.BlindDown(pane,{duration:0.3});
}
params="";
if(page){
params+="&page="+page;
}
if(_247){
params+="&perpage="+_247;
}
new Ajax.Updater(pane,url,{method:"get",parameters:params,onComplete:hideProgress});
}
function hideProgress(){
if($("videoSearchProgress")){
Element.hide($("videoSearchProgress"));
}
if($("incomingVideos")){
$("incomingVideos").style.height="auto";
}
}
var artistVideoSearchCount=4;
function videoArtistSearch(pane,url){
if($("searchVideoButton")){
Element.hide($("searchVideoButton"));
}
if($("videoSearchProgress")){
Element.show($("videoSearchProgress"));
}
new Effect.BlindDown(pane,{duration:0.3});
doOneArtistVideoSearch(pane,url);
}
var videoSearchPane;
var videoSearchURL;
var videosAdded=0;
function doOneArtistVideoSearch(pane,url){
if(pane){
videoSearchPane=pane;
videoSearchURL=url;
}
new Ajax.Request(videoSearchURL,{method:"get",parameters:"offset="+(4-artistVideoSearchCount),onSuccess:doneOneArtistVideoSearch,onFailure:videoSearchError});
}
function videoSearchError(){
hideProgress();
Element.show("videoSearchError");
}
function doneOneArtistVideoSearch(req){
if(req.responseText.match(/<!--/)){
}else{
videosAdded++;
new Insertion.Bottom(videoSearchPane,req.responseText);
}
if(--artistVideoSearchCount<=0){
hideProgress();
if(videosAdded==0){
videoSearchError();
}
if($("incomingVideos")){
$("incomingVideos").style.height="auto";
}
return;
}else{
setTimeout("doOneArtistVideoSearch()",1500);
}
}
function uploadVideoPopup(url,type){
var _24f=440;
var _250=screen.height-100;
if((!type||type=="artist")&&_250>700){
_250=700;
}else{
if(type=="track"&&_250>600){
_250=600;
}
}
var name="uploadvideo"+Math.round(Math.random()*100);
var _252="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width="+_24f+", height="+_250;
window.open(url,name,_252);
}
var holderVisible=false;
var frameLoaded=false;
var current;
var curSrc;
var widgSize;
function resourcewidget(name,size){
return widget(name,size,true);
}
function widget(name,size,_257){
var box=$("widgetHolder");
var _259=$("widget");
var _25a=$("widgetLoading");
widgSize=size;
if(!holderVisible){
Element.addClassName(name+"_w","on");
_25a.style.display="block";
_259.style.display="block";
if(size=="widgetMini"){
box.style.height="240px";
}else{
if(size=="widgetNormal"){
box.style.height="370px";
}
}
new Effect.BlindDown(box,{duration:0.5});
holderVisible=true;
$("widgetFrame").style.display="block";
curSrc="/"+(_257?"resource":"")+"widgets/"+name+"/?&res_type="+res_type+"&res_id="+res_id;
if(arguments.length>2){
for(var i=2;i<arguments.length;i++){
curSrc+="&"+arguments[i];
}
}
$("safariIsWank").value=curSrc;
$("widgetFrame").src=curSrc;
current=name;
}else{
Element.removeClassName(name+"_w","on");
_259.style.display="none";
new Effect.BlindUp(box,{duration:0.5});
_259.className="";
holderVisible=false;
$("widgetFrame").style.display="none";
$("widgetFrame").src="";
if(name!=current){
$(current+"_w").className="widget";
setTimeout("widget('"+name+"', '"+size+"');",1);
}
}
}
function addTag(tag){
var _25d=document.getElementById("tagInput");
if(_25d.value.length>1){
_25d.value=_25d.value+", ";
}
_25d.value=_25d.value+tag;
}
function delTag(tag){
confirm("Really remove your tag \""+tag+"\" from this item?");
}
function setFocus(id){
element=document.getElementById(id);
setTimeout("element.focus();",500);
}
function faqpopup(id){
var url="/popups/faq/?id="+id;
faq=window.open(url,"faq","toolbar=no, location=no, directories=no, status=no,menubar=no, scrollbars=yes, resizable=yes, width=350, height=400");
}


