function actsAsAspect(_1){
_1.yield=null;
_1.rv={};
_1.before=function(_2,f){
var _4=eval("this."+_2);
this[_2]=function(){
f.apply(this,arguments);
return _4.apply(this,arguments);
};
};
_1.after=function(_5,f){
var _6=eval("this."+_5);
this[_5]=function(){
this.rv[_5]=_6.apply(this,arguments);
return f.apply(this,arguments);
};
};
_1.around=function(_7,f){
var _8=eval("this."+_7);
this[_7]=function(){
this.yield=_8;
return f.apply(this,arguments);
};
};
}
Lfm={};
Lfm.Adserver=function(_9){
this.oRequest=_9;
this.aTagWeightAssoc=[];
this.aPlacementTagAssoc=[];
};
Lfm.Adserver.prototype={aTagWeightAssoc:null,aPlacementTagAssoc:null,LAST_PLACEMENT_TOP_RIGHT:3,LAST_PLACEMENT_TOP:1,oRequest:null,selectTag:function(_10){
var _11=_10.substring(7);
if(!oPlacementTagAssoc[_10].length){
return false;
}
var _12=oPlacementTagAssoc[_10];
log(_10+" has "+_12.length+" tags");
this.aTagWeightAssoc=[];
var _13=0;
var _14=this;
$A(_12).each(function(_15){
_14.addTagWeightAssoc({"name":_15.name,"min":_13,"max":_13+parseInt(_15.weight),"code":_15.code});
_13+=parseInt(_15.weight);
});
var _16=Math.round(Math.random()*_13);
log("chosen weight "+_16);
var _17=$A(this.aTagWeightAssoc).find(function(_18){
return (_18.min<=_16&&_18.max>=_16);
});
if(_17){
log("chose "+_17.name+" in placement "+_10);
FastInit.addOnLoad(function(_19){
if($(_10)){
Element.show(_10);
}
});
if(_10=="LastAd_Top"&&!this.isDummyTag(_17.code)){
FastInit.addOnLoad(function(_20){
if($("catPage")){
Element.addClassName("catPage","underAds");
}
});
}
if(_10=="LastAd_TopRight"){
FastInit.addOnLoad(function(_21){
if($("userLastAd")){
Element.show("userLastAd");
}
});
if(typeof writeTop=="function"&&this.oRequest.controller.toLowerCase()!="user"&&!this.isDummyTag(this.aPlacementTagAssoc["Top"])){
return;
}
}
log(_11);
this.displayTag(_11,_17);
}else{
if(_10=="LastAd_TopRight"){
FastInit.addOnLoad(function(_22){
if($("userLastAd")){
Element.hide("userLastAd");
}
});
}
}
},addTagWeightAssoc:function(_23){
this.aTagWeightAssoc.push({"name":_23.name,"min":_23.min,"max":_23.max,"code":_23.code});
},isDummyTag:function(tag){
try{
return tag.indexOf("#LastAd_Top")!=-1;
}
catch(ex){
return false;
}
},setVisibility:function(_25){
},hasPlacement:function(_26){
try{
return oPlacementTagAssoc[_26].length;
}
catch(ex){
return false;
}
},displayTag:function(_27,_28){
this.aPlacementTagAssoc[_27]=_28.code;
document.write("<script type=\"text/javascript\">");
document.write("function write"+_27+"() {"+_28.code+"};");
document.write("</script>");
}};
var AjaxVote=Class.create();
AjaxVote.prototype={initialize:function(_29,url){
this.container=$(_29);
this.url=url;
this.inputs=document.getElementsByClassName("vote",this.container);
this.observers=new Object();
this.inputs.each(function(_31){
this.observers[_31.id]=this.vote.bindAsEventListener(this);
Event.observe(_31,"click",this.observers[_31.id]);
}.bind(this));
},vote:function(_32){
var _33=Event.findElement(_32,"INPUT");
var id=_33.id.substring(2);
var _35=_33.value.toLowerCase();
var _36="vote="+_35+"&itemid="+id;
Element.addClassName(this.container,"inProgress");
new Ajax.Request(this.url,{method:"post",parameters:_36,onFailure:this.somethingIsWrong.bind(this),onSuccess:this.evaluate.bind(this)});
},evaluate:function(_37){
var _38=_37.responseText.split(";");
switch(_38[0]){
case "MOD_VOTE_APPROVED":
case "MOD_VOTE_OK":
case "MOD_VOTE_UNCHANGED":
case "MOD_VOTE_CHANGED":
this.doneVoting(_38);
break;
case "MOD_VOTE_REJECTED":
default:
this.error(_38);
}
},somethingIsWrong:function(_39){
this.error(_39);
},error:function(_40){
Element.removeClassName(this.container,"inProgress");
Element.addClassName(this.container,"errorVoting");
},doneVoting:function(_41){
Element.removeClassName(this.container,"inProgress");
Element.addClassName(this.container,"successVoting");
this.inputs.each(function(_42){
_42.disabled="disabled";
Event.stopObserving(_42,"click",this.observers[_42.id]);
}.bind(this));
}};
var Browser=Class.create();
Browser.prototype={initialize:function(){
this.ua=navigator.userAgent.toLowerCase();
this.version=parseInt(navigator.appVersion);
},isSafari:function(){
return this.ua.indexOf("safari");
},isIE:function(){
return ((this.ua.indexOf("msie")!=-1)&&(this.ua.indexOf("opera")==-1)&&clientPC.indexOf("win")!=-1);
}};
var browser=new Browser();
function isSafari(){
return (navigator.userAgent.toLowerCase().indexOf("safari")!==-1);
}
function log(_43){
if(LFM&&LFM.get("config","DEVELOPMENT_SERVER")){
if((window.attachEvent&&!window.opera)){
alert(_43);
}else{
if(window.console){
window.console.log(_43+"");
}else{
if(window.opera){
window.opera.postError(_43);
}else{
if(console){
console.log(_43);
}
}
}
}
}
}
DropDown=Class.create();
DropDown.prototype={initialize:function(_44,_45,_46){
this.containerID=_44;
this.togglerID=_45;
this.bodyID=_46;
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);
DropDown.opened=this.bodyID;
Element.addClassName(this.containerID,"expanded");
Event.observe(document,"click",this.offBinding,true);
},toggle:function(_47){
if(Element.visible(this.bodyID)){
this.hide();
Event.stop(_47);
}else{
this.show();
Event.stop(_47);
}
Event.stop(_47);
},clickOff:function(_48){
var _49=Event.element(_48);
var _50=false;
while(_49.parentNode){
if(_49.id==this.bodyID){
return true;
}else{
if(_49.id==this.togglerID){
_50=true;
}
}
_49=_49.parentNode;
}
this.hide();
if(_50){
Event.stop(_48);
}
}};
var EventCalendar={calendars:null,currentMonth:null,lastRequested:null,next:function(url,_51,_52){
_51.blur();
Element.addClassName(_51,"busy");
var c=EventCalendar.getCurrentMonth();
var _54=_52?EventCalendar.getMonthForTable(c):EventCalendar.getNextMonthAfterTable(c);
var _55=null;
var _56=null;
if(!_52){
_56=document.getElementsByClassName("month-"+_54,$("calendar"));
_55=_56.length>0?_56[0]:false;
}else{
var m=EventCalendar.getPrevMonthAfterTable(c);
_56=document.getElementsByClassName("month-"+m,$("calendar"));
_55=_56.length>0?_56[0]:false;
}
if(_55){
c.style.display="none";
_55.style.display="table";
EventCalendar.currentMonth=_55;
Element.removeClassName(_51,"busy");
}else{
if(_55==-1){
Element.removeClassName(_51,"busy");
}else{
url=EventCalendar.convertURL(url);
EventCalendar.lastRequested=_54;
var _58=_52?"enddate":"startdate";
var _59=new Ajax.Request(url+"&"+_58+"="+_54+"-01",{onSuccess:EventCalendar.receiveMonth.bind(_51),onFailure:EventCalendar.receiveMonthFailed.bind(_51)});
}
}
},prev:function(url,_60){
EventCalendar.next(url,_60,true);
},convertURL:function(url){
var _61=url.indexOf("events/?");
if(_61!=-1){
return "/ajax/eventcalendar/"+url.substring(_61+7);
}
return "/ajax/eventcalendar"+url;
},receiveMonth:function(_62){
if(_62.responseText.indexOf("calendar")==-1){
var _63=EventCalendar.receiveMonthFailed.bind(this);
_63();
return;
}
Element.removeClassName(this,"busy");
new Insertion.Bottom("calendar",_62.responseText);
var _64=document.getElementsByClassName("calendar",$("calendar"));
if(_64.length>0){
EventCalendar.currentMonth.style.display="none";
_64[_64.length-1].style.display="table";
EventCalendar.currentMonth=_64[_64.length-1];
}
},receiveMonthFailed:function(){
Element.removeClassName(this,"busy");
},getNextMonthAfterTable:function(_65){
var _66=EventCalendar.getMonthForTable(_65);
var _67=_66.split("-");
if(_67[1]==12){
_67[0]++;
}
_67[1]++;
return _67[0]+"-"+(_67[1]<10?"0"+_67[1]:_67[1]);
},getPrevMonthAfterTable:function(_68){
var _69=EventCalendar.getMonthForTable(_68);
var _70=_69.split("-");
if(_70[1]=="01"){
_70[0]--;
}
_70[1]--;
return _70[0]+"-"+(_70[1]<10?"0"+_70[1]:_70[1]);
},getMonthForTable:function(_71){
if(_71.month){
return _71.month;
}
var _72=$A(_71.className.split(/\s+/));
var c=_72.find(function(c){
return c.substring(0,5)=="month";
});
_71.month=c.substring(6);
return _71.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(_73){
var _74="venue="+_73;
new Ajax.Request("/resourcewidgets/newevent",{method:"get",parameters:_74,onSuccess:function(req){
if(req.responseText.indexOf("newEvent")==-1){
showNewEventWidgetError();
return;
}
$("newEventWidgetPlaceholder").innerHTML=req.responseText;
req.responseText.evalScripts();
var _76=document.getElementsByClassName("artist","newEventForm");
_76.each(function(_77){
newEventBindArtistField(_77);
});
new Effect.BlindDown("newEventWidgetPlaceholder",{duration:0.5});
},onFailure:showNewEventWidgetError});
}
function showLocationForm(_78,_79){
Element.hide(_78.parentNode);
Element.hide("subhead");
$("locationForm").style.display="block";
Form.focusFirstElement("locationForm");
}
var newEventArtistMatches={};
var newEventArtistDispatch={};
function newEventBindArtistField(_80){
Event.observe(_80,"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(_80.parentNode,"support")){
Event.observe(_80,"keypress",function(e){
if(e.keyCode==Event.KEY_DELETE||e.keyCode==Event.KEY_BACKSPACE){
newEventHideStatusHolder(this);
if(this.value==""||this.value.length==1){
var _82=document.getElementsByClassName("support","artists");
var _83=_82[_82.length-1];
var _84=_83.getElementsByTagName("input")[0];
if(_84.getAttribute("id")==this.getAttribute("id")){
return;
}
if(_84.value==""&&this.getAttribute("id")!="support1"){
this.parentNode.parentNode.removeChild(this.parentNode);
_84.focus();
}
}
}else{
var ret=e.keyCode==Event.KEY_RETURN;
if(!ret){
newEventHideStatusHolder(this);
}
newEventCloneSupportField(ret);
}
});
}else{
Event.observe(_80,"keypress",function(e){
if(e.keyCode==Event.KEY_RETURN){
newEventCloneSupportField(true);
}else{
newEventHideStatusHolder(this);
}
});
}
}
function newEventSendArtistSearch(_86){
if(newEventArtistMatches[_86.value]){
newEventShowProgress(_86,"success");
return;
}
newEventShowProgress(_86,"progress");
var _87="name="+encodeURIComponent(_86.value);
new Ajax.Request("/ajax/artistcheck",{method:"get",parameters:_87,onSuccess:newEventEndSearchArtist.bind(_86),onFailure:newEventFailedSearchArtist.bind(_86)});
}
function newEventInsertResults(_88,_89){
var _90=document.createElement("div");
Element.hide(_90);
Element.addClassName(_90,"results");
var _91=document.createElement("ul");
var _92=document.createElement("li");
var _93=document.createElement("input");
_93.setAttribute("type","radio");
_92.appendChild(_93);
Element.addClassName(_92,"noneOfThe");
_92.appendChild(document.createTextNode(noneOfThe));
Event.observe(_93,"click",function(){
new Effect.BlindUp(_90,{duration:0.5});
newEventShowProgress(_88,"success");
});
_89.each(function(_94){
var _95=document.createElement("li");
var _96=document.createElement("input");
Event.observe(_96,"click",function(){
_88.value=_94.name;
new Effect.BlindUp(_90,{duration:0.5});
newEventShowProgress(_88,"success");
});
_96.setAttribute("type","radio");
_96.id=_94.id;
_95.appendChild(_96);
var _97=document.createElement("label");
_97.innerHTML=_94.name;
_97.setAttribute("for",_94.id);
var _98=document.createTextNode(" (");
var _99=document.createElement("a");
_99.setAttribute("href",_94.url);
_99.setAttribute("target","_blank");
_99.innerHTML=linkText;
var _100=document.createTextNode(")");
_95.appendChild(_97);
_95.appendChild(_98);
_95.appendChild(_99);
_95.appendChild(_100);
_91.appendChild(_95);
});
_91.appendChild(_92);
var _101=document.createElement("strong");
_101.innerHTML=artistText;
_90.appendChild(_101);
Element.addClassName(_101,"lfmlight");
_90.appendChild(_91);
var _102=$A(_88.parentNode.parentNode.childNodes);
var _103=false;
var done=false;
_102.each(function(node){
if(done||node.nodeName!="DIV"){
return;
}
if(_103){
_88.parentNode.parentNode.insertBefore(_90,node);
done=true;
new Effect.BlindDown(_90,{duration:0.5});
return;
}
if(node==_88.parentNode){
_103=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 root=x.childNodes[i];
var _109=$A(root.childNodes);
var _110=new Array();
_109.each(function(node){
if(node.nodeName!="resource"){
return;
}
var _111=$A(node.childNodes);
var a={};
_111.each(function(el){
if(el.nodeName!="#text"){
a[el.nodeName]=el.firstChild.nodeValue;
}
});
_110.push(a);
});
newEventInsertResults(this,_110);
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 root=x.childNodes[i];
newEventArtistMatches[this.value]=root.lastChild.firstChild.nodeValue;
this.value=root.lastChild.firstChild.nodeValue;
newEventShowProgress(this,"success");
}else{
if(req.responseText.indexOf("<results>")!=-1){
newEventShowProgress(this,"success");
}else{
var func=newEventFailedSearchArtist.bind(this);
func();
}
}
}
}
function newEventSendSearchVenue(){
var _115=$("previewButton");
_115.numRetrys=0;
newEventShowProgress(_115,"progress");
var _116=Form.serialize($("newEventForm"));
new Ajax.Request("/ajax/venuecheck",{method:"get",parameters:_116,onSuccess:newEventEndSearchVenue.bind(_115),onFailure:newEventPreviewError});
}
function newEventSetVenue(id,_117){
$("venueid").value=id;
if(!_117){
newEventPreview();
}
}
function newEventResetVenueID(){
$("venueid").value="";
Element.show($("previewButton").parentNode);
newEventHideStatusHolder($("venueName"));
}
function newEventInsertVenueResults(_118,_119){
var _120=$A(document.getElementsByClassName("venueResults"));
_120.each(function(a){
a.parentNode.removeChild(a);
});
var _121=document.createElement("div");
Element.hide(_121);
Element.addClassName(_121,"results");
Element.addClassName(_121,"venueResults");
var _122=document.createElement("ul");
var _123=document.createElement("li");
var _124=document.createElement("input");
_124.setAttribute("type","radio");
_123.appendChild(_124);
Element.addClassName(_123,"noneOfThe");
_123.appendChild(document.createTextNode(noneOfThe));
Event.observe(_124,"click",function(){
newEventSetVenue(0);
newEventShowProgress($("venueName"),"success");
new Effect.BlindUp(_121,{duration:0.5});
});
_119.each(function(_125){
var _126=document.createElement("li");
var _127=document.createElement("input");
Event.observe(_127,"click",function(){
newEventSetVenue(_125.id);
newEventShowProgress($("venueName"),"success");
new Effect.BlindUp(_121,{duration:0.5});
});
_127.setAttribute("type","radio");
_127.id=_125.id;
_126.appendChild(_127);
var _128=document.createElement("label");
_128.innerHTML=_125.name;
_128.setAttribute("for",_125.id);
var _129=document.createTextNode(" (");
var link=document.createElement("a");
link.setAttribute("href",_125.url);
link.setAttribute("target","_blank");
link.innerHTML=linkText;
var _131=document.createTextNode(")");
var _132=document.createElement("br");
var _133=document.createElement("small");
_133.innerHTML=_125.address;
_126.appendChild(_128);
_126.appendChild(_129);
_126.appendChild(link);
_126.appendChild(_131);
_126.appendChild(_132);
_126.appendChild(_133);
_122.appendChild(_126);
});
_122.appendChild(_123);
var _134=document.createElement("strong");
_134.innerHTML=venueText;
_121.appendChild(_134);
Element.addClassName(_134,"lfmlight");
_121.appendChild(_122);
$("venue").parentNode.insertBefore(_121,$("startdate"));
new Effect.BlindDown(_121,{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 root=x.childNodes[i];
var _135=$A(root.childNodes);
var _136=new Array();
_135.each(function(node){
if(node.nodeName!="resource"){
return;
}
var _137=$A(node.childNodes);
var a={};
_137.each(function(el){
if(el.nodeName!="#text"){
a[el.nodeName]=el.firstChild.nodeValue;
}
});
_136.push(a);
});
newEventInsertVenueResults(this,_136);
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 root=x.childNodes[i];
var _138=$A(root.childNodes);
var id=false;
_138.each(function(node){
if(node.nodeName=="id"){
id=node.firstChild.nodeValue;
}
});
if(id){
newEventSetVenue(id);
}else{
var func=newEventFailedSearchVenue.bind(this);
func();
}
}else{
if(req.responseText.indexOf("<results>")!=-1){
newEventSetVenue(0);
}else{
var func=newEventFailedSearchVenue.bind(this);
func();
}
}
}
}
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 func=function(){
newEventSendArtistSearch(a);
};
setTimeout(func,1000);
}
function newEventShowProgress(_139,_140){
if(!_140){
_140="progress";
}
var _141=document.getElementsByClassName("statusHolder",_139.parentNode);
if(_141.length>0){
_141[0].className="statusHolder "+_140;
Element.show(_141[0]);
}else{
new Insertion.Bottom(_139.parentNode,"<span class=\"statusHolder "+_140+"\">&nbsp;</span>");
}
}
function newEventHideProgress(_142){
var _143=document.getElementsByClassName("progress",_142.parentNode);
if(_143.length>0){
Element.hide(_143[0]);
}
}
function newEventHideStatusHolder(_144){
var _145=document.getElementsByClassName("statusHolder",_144.parentNode);
if(_145.length>0){
Element.hide(_145[0]);
}
}
function newEventCloneSupportField(_146){
var _147=document.getElementsByClassName("support",$("artists"));
var _148=_147[_147.length-1];
var _149=_148.getElementsByTagName("input")[0];
if(_149.value==""){
if(_146){
_149.focus();
}
return;
}
var _150=_149.cloneNode(true);
var _151=document.createElement("div");
Element.addClassName(_151,"support optional");
_150.value="";
var _152=_148.getElementsByTagName("label")[0].cloneNode(true);
var _153=1+parseInt(_150.getAttribute("id").substring(7));
_150.setAttribute("id","support"+_153);
_152.setAttribute("for","support"+_153);
_151.appendChild(_152);
_151.appendChild(_150);
$("artists").appendChild(_151);
newEventBindArtistField(_150);
if(_146){
_150.focus();
}
}
function newEventValidate(){
var ret=true;
var _154=$A(document.getElementsByClassName("artist"));
var one=false;
_154.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 _156=$("venueid").value=="";
if(_156){
if($("venueName").value.trim()==""){
Element.addClassName("venue","error");
ret=false;
}else{
Element.removeClassName("venue","error");
}
}
if(ret&&_156){
newEventSendSearchVenue();
ret=false;
}
return ret;
}
function newEventCommit(){
$("addButton").disabled=true;
$("editButton").disabled=true;
var _157=document.getElementsByClassName("progress",$("previewArea"));
if(_157.length>0){
Element.show(_157[0]);
}else{
new Insertion.After("addButton","<span class=\"progress\">&nbsp;</span>");
}
var _158=document.getElementsByClassName("eventAddedFailure",$("previewArea"));
if(_158.length==1){
Element.hide(_158[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 _159=document.getElementsByClassName("progress",$("previewArea"));
Element.hide(_159[0]);
var _160=document.getElementsByClassName("eventAddedFailure",$("previewArea"));
if(_160.length>0){
Element.show(_160[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 form=$("newEventForm");
var url="/event/preview";
var _162=Form.serialize(form);
new Ajax.Request(url,{method:"post",parameters:_162,onSuccess:function(req){
if(req.responseText.indexOf("vcalendar")==-1){
newEventPreviewError();
return;
}
var _163=req.responseText.indexOf("<!--venue:");
if(_163!=-1){
var _164=req.responseText.substring(_163+10,req.responseText.indexOf("-->"));
newEventSetVenue(_164,true);
}
newEventDoPreview(req.responseText);
},onFailure:newEventPreviewError});
}
function newEventDoPreview(code){
$("eventPreview").innerHTML="<br clear=\"all\" />";
new Insertion.Top("eventPreview",code);
Element.hide("newEventForm");
Element.hide("editH2");
$("previewH2").style.display="block";
$("previewArea").style.display="block";
}
function newEventChangeCategory(cat,_167){
if(cat==1){
cat=2;
_167=!_167;
}
if(_167){
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,_169){
_169.blur();
_169.disabled=true;
Element.addClassName(_169,"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(_169),onFailure:forgetEventFailure.bind(_169)});
}
function forgetEventResponse(resp){
if(resp.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(_172,_173,_174){
if(radioPopup==undefined||radioPopup.closed||(_173!=undefined&&_174!=undefined)){
radioPopup=window.open("/webclient/popup/?radioURL="+encodeURIComponent(_172)+"&resourceID="+_173+"&resourceType="+_174,"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(_172);
}else{
if(!radioPopup.closed){
radioPopup.tune(unescape(_172));
radioPopup.focus();
}
}
}
}
function createShufflePopup(_175){
var _176=window.open("/webclient/shuffle/?user="+encodeURIComponent(_175),"shuffleRadioPopup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=372, height=293");
}
function createHomepageRadioPopup(_177){
createRadioPopup(_177);
if(radioPopup){
stopRadio();
}
}
function getPlayerEl(_178){
if(window.document[_178]){
return window.document[_178];
}
if(navigator.appName.indexOf("Microsoft")!=-1){
return document.getElementById(_178);
}else{
return document[_178];
}
}
function stopRadio(){
var _179=getPlayerEl("lfmPlayer");
_179.TCallLabel("/","HandleJSStopPlayback");
}
function createRadioPrefPopup(_180){
if((radioPopup==undefined||radioPopup.closed)){
radioPrefPopup=window.open("/webclient/pref/?radioURL="+_180,"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(_180);
}
}
var currentTrack;
var currentTrackNum;
var newTrack;
var previewRequest=false;
function playPreview(_181){
currentTrackNum=parseInt(_181);
var _182=getPlayerEl("lfmPlayer");
_182.SetVariable("previewTrackNumber",parseInt(_181));
_182.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(_183){
tableRow=$("tltr"+_183.resourceID);
var _184=0;
row=tableRow;
while(row=row.previousSibling){
if(row.nodeType==1){
_184=_184+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;
_184=_184+paddingTop;
tableHead=el.getElementsByTagName("TABLE")[0].getElementsByTagName("TH")[0];
if(tableHead){
_184=_184+Element.getHeight(tableHead);
}
if(el.offsetHeight<_184||el.scrollTop>el.offsetHeight){
el.scrollTop=_184;
}
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(_185){
var _186=is_ie?decodeURIComponent(escape(_185)):_185;
$("radioTitle").innerHTML="Listening to "+_186;
}
function createLogPanel(){
if(!$("flashLog")){
var _187=document.createElement("div");
_187.id="flashLog";
$("flashContainer").appendChild(_187);
}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(_191){
if($(_191)&&Element.hasClassName(_191,"hint")){
Event.observe(_191,"focus",this.onFocus.bindAsEventListener(this));
Event.observe(_191,"blur",this.onBlur.bindAsEventListener(this));
}
},addID:function(_192){
if(!_192.id){
_192.id="i"+Math.floor(Math.random()*9999999999);
}
return _192;
},onFocus:function(_193){
input=Event.findElement(_193,"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(_194){
input=Event.findElement(_194,"INPUT");
if(input&&input.value.replace(/(\s*)/g,"")==""){
Element.addClassName(input,"hint");
input.value=LFM.Form.hintValues[input.id];
}
},initialize:function(_195){
if(_195&&_195.input){
_195.input=$(_195.input);
this.prime(_195.input);
}else{
if(_195&&_195.form&&$(_195.form)){
form=$(_195.form);
Form.getInputs(_195.form,"text").each(function(_196){
this.prime(this.addID(_196));
}.bind(this));
}else{
$A(document.getElementsByTagName("INPUT")).each(function(_197){
this.prime(this.addID(_197));
}.bind(this));
}
}
}};
function approveFriend(id,url,msg){
var todo=$("friendform"+id).todo;
var _199=document.getElementsByClassName("uContextualInfo","user"+id+"Displayed");
if(_199.length>0){
_199[0].oldInnerHTML=_199[0].innerHTML;
_199[0].innerHTML="";
var _200=document.createElement("img");
_200.setAttribute("src","http://static.last.fm/tageditor/progress_active.gif");
_199[0].appendChild(_200);
}
var _201=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 _203=text.indexOf("success");
var text=text.substr(_203+7);
var _204=text.indexOf("type");
var _205=text.indexOf("\"");
var id=text.substr(0,_204);
var type=text.substr(_204+4,_205-(_204+4));
var _207=$(type+"Title").innerHTML;
var _208=_207.indexOf("(");
var _209=_207.indexOf(")");
var diff=_209-_208;
if(_208>0&&_209>0&&diff>0){
var num=parseInt(_207.substr(_208+1,diff));
if(--num>=0){
$(type+"Title").innerHTML=_207.substr(0,_208)+"("+num+_207.substr(_209);
}
}
}
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";
}
}
}
HighlightEachOther=Class.create();
HighlightEachOther.prototype={initialize:function(_212,_213,_214,_215){
this.classyContainer=_212;
this.classyTagName=_213;
this.idContainer=_214;
this.idTagName=_215;
this.classyElements=$A($(_212).getElementsByTagName(_213));
this.idElements=$A($(_214).getElementsByTagName(_215));
this.classyElements.each(function(_216){
Event.observe(_216,"mouseover",this.highlightId.bindAsEventListener(this));
Event.observe(_216,"mouseout",this.downlightIds.bindAsEventListener(this));
}.bind(this));
this.idElements.each(function(_217){
Event.observe(_217,"mouseover",this.highlightClassNames.bindAsEventListener(this));
Event.observe(_217,"mouseout",this.downlightClassNames.bindAsEventListener(this));
}.bind(this));
},highlightId:function(_218){
var item=Event.findElement(_218,this.classyTagName);
if(!item.relatives){
this.getRelativeIds(item);
}
item.relatives.each(function(_220){
Element.addClassName(_220,"highlight");
});
},highlightClassNames:function(_221){
var item=Event.findElement(_221,this.idTagName);
if(!item.relatives){
this.getRelativeClassNames(item);
}
item.relatives.each(function(_222){
Element.addClassName(_222,"highlight");
});
},getRelativeIds:function(item){
item.relatives=new Array();
var _223=Element.classNames(item);
item.relatives=_223.grep(".0");
},getRelativeClassNames:function(item){
item.relatives=new Array();
var _224=item.id;
this.classyElements.each(function(_225){
if(Element.hasClassName(_225,_224)){
item.relatives.push(_225);
}
});
},downlightIds:function(_226){
var item=Event.findElement(_226,this.classyTagName);
if(!item.relatives){
this.getRelativeIds(item);
}
item.relatives.each(function(_227){
Element.removeClassName(_227,"highlight");
});
},downlightClassNames:function(_228){
var item=Event.findElement(_228,this.idTagName);
if(!item.relatives){
this.getRelativeClassNames(item);
}
item.relatives.each(function(_229){
Element.removeClassName(_229,"highlight");
});
}};
var wrappers=new Array();
var quilt=new Array();
var quiltsLoaded=false;
var fade=new Array("#BEBFC1","#BBB","#AAA","#999","#888","#777","#666","#555","#444","#333","#222","#111","#000");
var fadeDuration=40;
function loadQuilts(){
if(quiltsLoaded){
return false;
}
wrappers.each(function(id){
var _230=0;
Element.hide($("msg_"+id));
setTimeout("quiltFade('"+id+"',0)",1000);
elems=$A($("quilt_"+id).getElementsByTagName("a"));
elems.each(function(a){
if(quilt[id][_230]){
var i=document.createElement("img");
i.src=quilt[id][_230][0];
i.style.height="60px";
if(quilt[id][_230][3]>2){
i.style.height="90px";
}
i.style.width="auto";
a.appendChild(i);
a.href=quilt[id][_230][1];
a.title=quilt[id][_230][2];
a.onclick=function(){
return true;
};
}
_230++;
});
});
quiltsLoaded=true;
}
function quiltFade(id,_231){
if((_231)<fade.length){
$("quiltbg_"+id).style.background=fade[_231];
_231++;
setTimeout("quiltFade('"+id+"',"+_231+")",fadeDuration);
}
}
function dupeImages(_232,_233){
if(qimg==_232[0]){
_232[3]++;
return true;
}
return false;
}
function lameBlink(id){
if(Element.visible($("msg_"+id))){
Element.toggle($("blink_"+id));
setTimeout("lameBlink('"+id+"')",500);
}
}
var EventLineup=Class.create();
EventLineup.prototype={initialize:function(el){
},setHeadliner:function(url,_234,_235){
alert(1);
}};
EventLineup.setHeadliner=function(url,_236,_237,hide,show){
var _240=$A(document.getElementsByClassName(_237,_236));
_240.each(function(a){
var _241=a.getElementsByTagName("a");
Element.addClassName(_241[0],"selectingHeadliner");
_241[0].setAttribute("href",url+"?artist="+_241[0].innerHTML.unescapeHTML());
});
Element.hide(hide);
$(show).style.display="";
};
function listenLiveSwitch(_242,to,all,_245,_246){
$(_242).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=_246;
}
var cookieExpires=new Date();
cookieExpires.setYear(2036);
var panelimgs=new Array();
function setCookie(name,_248,_249,path,_251,_252){
var _253=name+"="+escape(_248)+((_249)?"; expires="+_249.toGMTString():"")+((path)?"; path="+path:"")+((_251)?"; domain="+_251:"")+((_252)?"; secure":"");
document.cookie=_253;
}
function getCookie(name){
var dc=document.cookie;
var _255=name+"=";
var _256=dc.indexOf("; "+_255);
if(_256==-1){
_256=dc.indexOf(_255);
if(_256!=0){
return null;
}
}else{
_256+=2;
}
var end=document.cookie.indexOf(";",_256);
if(end==-1){
end=dc.length;
}
return unescape(dc.substring(_256+_255.length,end));
}
function setPanelCookie(_258,_259){
var cook=getCookie("LastPanelsDC");
if(Element.hasClassName(_258,"nosave")){
return;
}
if(cook){
var _261=cook.indexOf(_258+":");
if(_261!=-1){
var _262=cook.substring(0,_261+_258.length+1);
var last=cook.substring(_261+_258.length+2,cook.length);
setCookie("LastPanelsDC",_262+_259+last,cookieExpires,"/");
}else{
setCookie("LastPanelsDC",cook+_258+":"+_259+",",cookieExpires,"/");
}
}else{
setCookie("LastPanelsDC",_258+":"+_259+",",cookieExpires,"/");
}
}
function collapseBox(id,link){
var box=$(id);
if(!box){
return;
}
var list=$("list_"+id);
var c=document.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(_267){
var _268=$(_267);
if(!Element.hasClassName(_268,"collapsed")){
Element.addClassName(_268,"collapsed");
$("rsToggleImages_"+_267).checked=true;
$("rsToggleDetails_"+_267).checked=false;
setPanelCookie(_267,1);
}
}
function toggleDetailView(_269){
var _270=$(_269);
if(Element.hasClassName(_270,"collapsed")){
Element.removeClassName(_270,"collapsed");
$("rsToggleImages_"+_269).checked=false;
$("rsToggleDetails_"+_269).checked=true;
setPanelCookie(_269,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;
}else{
$("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("logo.gif","logo_black.gif");
$("headerSearchbutton").src=$("headerSearchbutton").src.replace("nav.gif","nav_blk.gif");
setCookie("LastFm_Colour","black",cookieExpires,"/");
}else{
$("LastBody").className=$("LastBody").className.replace("black","red");
$("LogoImg").src=$("LogoImg").src.replace("logo_black.gif","logo.gif");
$("headerSearchbutton").src=$("headerSearchbutton").src.replace("nav_blk.gif","nav.gif");
setCookie("LastFm_Colour","red",cookieExpires,"/");
}
link.blur();
return false;
}
function colourToggle(link,_271,_272){
var _273=["LogoImg","dumbMailIcon","headerSearchbutton"];
var _274=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");
_273.each(_274);
link.innerHTML=_271;
setCookie("LastFm_Colour","black",cookieExpires,"/");
}else{
$("LastBody").className=$("LastBody").className.replace("black","red");
_273.each(_274);
link.innerHTML=_272;
setCookie("LastFm_Colour","red",cookieExpires,"/");
}
link.blur();
return false;
}
function toggleHiddenStations(_275,_276,_277,_278){
$(_277).parentNode.blur();
if(Element.hasClassName(_278,"expanded")){
$(_277).innerHTML=_275;
Element.removeClassName(_278,"expanded");
}else{
$(_277).innerHTML=_276;
Element.addClassName(_278,"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 sbpopup(_282){
var url="/user/"+_282+"/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");
}
function removeSampleText(item,_283){
if(item.value==_283){
item.value="";
Element.removeClassName(item,"withSampleText");
}
}
function incrementAttribute(_284,_285){
if(_284[_285]){
var _286=_284[_285].match(/\d+/);
if(_286&&!isNaN(_286[0])){
_286=_286[0]*1+1;
_286=_284[_285].replace(/(\D*)(\d*)(\D*)/,"$1"+_286+"$3");
}else{
_286=_284[_285]+"1";
}
return _286;
}else{
return "";
}
}
function CheckAll(name){
var _287=document.getElementById(name);
elLength=_287.elements.length;
for(i=0;i<elLength;i++){
_287.elements[i].checked=!_287.elements[i].checked;
}
}
function getSelectedCheckboxValue(_288){
var _289=new Array();
var _290=getSelectedCheckbox(_288);
if(_290.length!=0){
_289.length=_290.length;
for(var i=0;i<_290.length;i++){
if(_288[_290[i]]){
_289[i]=_288[_290[i]].value;
}else{
_289[i]=_288.value;
}
}
}
return _289;
}
function swapDisplay(that){
var _292;
if(_292=document.getElementById(that)){
if(_292.style.display=="none"){
if(arguments.length>1){
hideClass(arguments[1]);
}
_292.style.display="";
}else{
_292.style.display="none";
}
}
}
var hideClassList={};
function hideClass(_293){
if(hideClassList[_293]){
for(var key in hideClassList[_293]){
hideClassList[_293][key].style.display="none";
}
}else{
var _295=document.getElementById(_293);
if(_295){
hideClassList[_293]=new Array();
for(var key in _295.childNodes){
if(_295.childNodes[key].className&&_295.childNodes[key].className.match(new RegExp(_293))){
hideClassList[_293].push(_295.childNodes[key]);
}
}
hideClass(_293);
}
}
}
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(_296){
if(confirm(actionConf[_296].msg)){
if(actionConf[_296].urlpass==null){
if(arguments.length==1){
alert("ERROR:: There is no redirect URL");
}else{
window.location.href=arguments[1];
}
}else{
window.location.href=actionConf[_296].urlpass;
}
}else{
if(!actionConf[_296].urlfail){
}else{
window.location.href=actionConf[_296].urlfail;
}
}
}
function print_r(_297,_298){
if(typeof (_298)=="number"){
if(_298>2){
return "Too Far\n";
}
var _299="    ";
for(var j=0;j<_298;j++){
_299+=_299;
}
paren_indent-="  ";
_298++;
}else{
var _298=1;
var _299="    ";
var _301="";
}
switch(typeof (_297)){
case "boolean":
var _302=(_297?"true":"false")+"\n";
break;
case "object":
if(_297===null){
var _302="null\n";
break;
}
var _302=((_297.reverse)?"Array":"Object")+" (\n";
for(var i in _297){
try{
_302+=_299+"["+i+"] => "+print_r(_297[i],_298);
}
catch(ex){
}
}
_302+=_301+")\n";
break;
case "number":
case "string":
default:
var _302=""+_297+"\n";
}
return _302;
}
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(_303){
wh_clear(0);
var _304=$("whelp");
if(_304){
_304.appendChild(document.createTextNode(_303.title));
}
}
function wh_clear(_305){
var _306=$("whelp");
if(_306){
while(_306.firstChild){
_306.removeChild(_306.firstChild);
}
if(wh_default&&_305>0){
_306.appendChild(document.createTextNode(wh_default));
}
}
}
String.prototype.trim=function(){
a=this.replace(/^\s+/,"");
return a.replace(/\s+$/,"");
};
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(_307){
this.panel=_307;
var _308=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<_308.length;i++){
if(_308[i].nodeType==1&&_308[i].tagName.toLowerCase()=="div"){
switch(_308[i].className){
case "h":
this.header=_308[i];
break;
case "c":
this.content=_308[i];
var _309=this.content.childNodes;
for(var j=0;j<_309.length;j++){
if(_309[j].nodeType==1&&_309[j].tagName.toLowerCase()=="ul"){
this.list=_309[j];
var _310=this.list.childNodes;
for(var k=0;k<_310.length;k++){
if(_310[k].nodeType==1&&_310[k].tagName.toLowerCase()=="li"){
for(var l=0;l<_310[k].length;l++){
if(_310[k][l].nodeType==1&&_310[k][l].tagName.toLowerCase()=="a"&&_310[k][l].className=="it"){
var name=_310[k][l].childNodes[0].data;
var it=panelDefaultItems[this.panel.id].length;
panelDefaultItems[this.panel.id][it]={name:name,"element":_310[k]};
}
}
}
}
break;
}
}
break;
case "f":
this.footer=_308[i];
break;
}
}
}
this.itemcount=0;
}
function Panel_addItem(_314,_315){
var _316=document.getElementById("emptyConnectionsDiv");
if(_316){
_316.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(_314,"url"));
thea.target="_new";
var src=getElementText(_314,"smallimg");
if(src==" "){
}else{
var img=document.createElement("img");
img.setAttribute("width","50");
img.setAttribute("src",src);
}
var _321=document.createElement("strong");
var _322=document.createElement("span");
_321.appendChild(_322.appendChild(document.createTextNode(getElementText(_314,"name"))));
if(src==" "){
}else{
thea.appendChild(img);
}
thea.appendChild(_321);
li.appendChild(thea);
if(_315){
var _323=document.createElement("input");
_323.setAttribute("type","hidden");
_323.setAttribute("name",this.panel.id+this.itemcount.toString());
_323.setAttribute("value",getElementText(_314,"restype")+":"+getElementText(_314,"id"));
li.appendChild(_323);
}
var i=panelOtherItems[this.panel.id].length;
panelOtherItems[this.panel.id][i]={"name":getElementText(_314,"name"),"resname":getElementText(_314,"resname"),"element":li};
var _324;
if((_324=getElementText(_314,"artistname"))!=null){
panelOtherItems[this.panel.id][i].artist=getElementText(_314,"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 _326=document.getElementById(id);
var _327=false;
var _328=panelOtherItems[this.panel.id];
var tmp;
for(var i=0;i<_328.length;i++){
if(_328[i].element==_326){
tmp=_328[i];
_328.splice(i,1);
break;
}
}
panelRemovedItems[this.panel.id][panelRemovedItems[this.panel.id].length]=tmp;
try{
_326.parentNode.removeChild(_326);
this.listItems("removed");
this.listItems("other");
}
catch(e){
alert("Error[Panel.removeItem("+id+")]");
}
}
function Panel_checkForItem(tag,_330,_331){
var _332=[panelDefaultItems[this.panel.id],panelRemovedItems[this.panel.id],panelOtherItems[this.panel.id]];
var _333=/artist=([^\]]*)\]"/g;
try{
var _334=_331.match(_333)[1];
}
catch(e){
}
for(var i=0;i<_332.length;i++){
for(var j=0;j<_332[i].length;j++){
if(i==0){
}else{
if(_332[i][j].resname.toLowerCase()==tag.toLowerCase()&&_332[i][j].name.toLowerCase()==_330.toLowerCase()){
if(!_334||(_332[i][j].artistname.toLowerCase()&&_334==_332[i][j].artistname.toLowerCase())){
this.lastItemCheck=j;
return i;
}
}
}
}
}
return 3;
}
function Panel_removeAllItems(){
var _335=this.list;
for(var i=0;i<this.list.childNodes.length;i++){
this.removeItem(this.list.childNodes[i].getAttribute("ID"));
}
}
function Panel_listItems(list,_336){
var msg="";
switch(list){
case "removed":
msg="Removed Items\n";
list=panelRemovedItems;
break;
case "other":
msg="Other Items\n";
list=panelOtherItems;
break;
}
if(_336){
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(_337,_338){
var _339=document.getElementsByClassName("subject",_337);
var _340=[];
_339.each(function(_341){
_340[_340.length]=_341.innerHTML.stripTags().trim().unescapeHTML();
});
var _342=_340.join(", ");
var _343=$(_338).innerHTML;
$(_338).value=_342+_343;
$(_338).innerHTML=_342+_343;
}
var globalResourceCheck={};
var resourceCheckBusy=false;
var webhost=null;
function getElementText(_344,name){
if(_344.getElementsByTagName(name)){
try{
return _344.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 _346=false;
var msg="";
for(var key in this.parameters){
url+=(_346?"&":"")+key+"="+this.parameters[key];
msg+=(_346?"&\n":"")+key+"="+this.parameters[key];
_346=true;
}
this.req.open("GET",url,true);
var _347=this;
this.req.onreadystatechange=function(){
_347.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(_348,_349){
this.callback=_348;
this.callbackparams=_349;
}
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;
}
if(!Control){
var Control={};
}
Control.Slider=Class.create();
Control.Slider.prototype={initialize:function(_350,_351,_352){
var _353=this;
if(_350 instanceof Array){
this.handles=_350.collect(function(e){
return $(e);
});
}else{
this.handles=[$(_350)];
}
this.track=$(_351);
this.options=_352||{};
this.axis=this.options.axis||"horizontal";
this.increment=this.options.increment||1;
this.step=parseInt(this.options.step||"1");
this.range=this.options.range||$R(0,1);
this.value=0;
this.values=this.handles.map(function(){
return 0;
});
this.spans=this.options.spans?this.options.spans.map(function(s){
return $(s);
}):false;
this.options.startSpan=$(this.options.startSpan||null);
this.options.endSpan=$(this.options.endSpan||null);
this.restricted=this.options.restricted||false;
this.maximum=this.options.maximum||this.range.end;
this.minimum=this.options.minimum||this.range.start;
this.alignX=parseInt(this.options.alignX||"0");
this.alignY=parseInt(this.options.alignY||"0");
this.trackLength=this.maximumOffset()-this.minimumOffset();
this.handleLength=this.isVertical()?this.handles[0].offsetHeight:this.handles[0].offsetWidth;
this.active=false;
this.dragging=false;
this.disabled=false;
if(this.options.disabled){
this.setDisabled();
}
this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;
if(this.allowedValues){
this.minimum=this.allowedValues.min();
this.maximum=this.allowedValues.max();
}
this.eventMouseDown=this.startDrag.bindAsEventListener(this);
this.eventMouseUp=this.endDrag.bindAsEventListener(this);
this.eventMouseMove=this.update.bindAsEventListener(this);
this.handles.each(function(h,i){
i=_353.handles.length-1-i;
_353.setValue(parseFloat((_353.options.sliderValue instanceof Array?_353.options.sliderValue[i]:_353.options.sliderValue)||_353.range.start),i);
Element.makePositioned(h);
Event.observe(h,"mousedown",_353.eventMouseDown);
});
Event.observe(this.track,"mousedown",this.eventMouseDown);
Event.observe(document,"mouseup",this.eventMouseUp);
Event.observe(document,"mousemove",this.eventMouseMove);
this.initialized=true;
},dispose:function(){
var _356=this;
Event.stopObserving(this.track,"mousedown",this.eventMouseDown);
Event.stopObserving(document,"mouseup",this.eventMouseUp);
Event.stopObserving(document,"mousemove",this.eventMouseMove);
this.handles.each(function(h){
Event.stopObserving(h,"mousedown",_356.eventMouseDown);
});
},setDisabled:function(){
this.disabled=true;
},setEnabled:function(){
this.disabled=false;
},getNearestValue:function(_357){
if(this.allowedValues){
if(_357>=this.allowedValues.max()){
return (this.allowedValues.max());
}
if(_357<=this.allowedValues.min()){
return (this.allowedValues.min());
}
var _358=Math.abs(this.allowedValues[0]-_357);
var _359=this.allowedValues[0];
this.allowedValues.each(function(v){
var _361=Math.abs(v-_357);
if(_361<=_358){
_359=v;
_358=_361;
}
});
return _359;
}
if(_357>this.range.end){
return this.range.end;
}
if(_357<this.range.start){
return this.range.start;
}
return _357;
},setValue:function(_362,_363){
if(!this.active){
this.activeHandle=this.handles[_363];
this.activeHandleIdx=_363;
this.updateStyles();
}
_363=_363||this.activeHandleIdx||0;
if(this.initialized&&this.restricted){
if((_363>0)&&(_362<this.values[_363-1])){
_362=this.values[_363-1];
}
if((_363<(this.handles.length-1))&&(_362>this.values[_363+1])){
_362=this.values[_363+1];
}
}
_362=this.getNearestValue(_362);
this.values[_363]=_362;
this.value=this.values[0];
this.handles[_363].style[this.isVertical()?"top":"left"]=this.translateToPx(_362);
this.drawSpans();
if(!this.dragging||!this.event){
this.updateFinished();
}
},setValueBy:function(_364,_365){
this.setValue(this.values[_365||this.activeHandleIdx||0]+_364,_365||this.activeHandleIdx||0);
},translateToPx:function(_366){
return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(_366-this.range.start))+"px";
},translateToValue:function(_367){
return ((_367/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start);
},getRange:function(_368){
var v=this.values.sortBy(Prototype.K);
_368=_368||0;
return $R(v[_368],v[_368+1]);
},minimumOffset:function(){
return (this.isVertical()?this.alignY:this.alignX);
},maximumOffset:function(){
return (this.isVertical()?this.track.offsetHeight-this.alignY:this.track.offsetWidth-this.alignX);
},isVertical:function(){
return (this.axis=="vertical");
},drawSpans:function(){
var _369=this;
if(this.spans){
$R(0,this.spans.length-1).each(function(r){
_369.setSpan(_369.spans[r],_369.getRange(r));
});
}
if(this.options.startSpan){
this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value));
}
if(this.options.endSpan){
this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum));
}
},setSpan:function(span,_372){
if(this.isVertical()){
span.style.top=this.translateToPx(_372.start);
span.style.height=this.translateToPx(_372.end-_372.start);
}else{
span.style.left=this.translateToPx(_372.start);
span.style.width=this.translateToPx(_372.end-_372.start);
}
},updateStyles:function(){
this.handles.each(function(h){
Element.removeClassName(h,"selected");
});
Element.addClassName(this.activeHandle,"selected");
},startDrag:function(_373){
if(Event.isLeftClick(_373)){
if(!this.disabled){
this.active=true;
var _374=Event.element(_373);
var _375=[Event.pointerX(_373),Event.pointerY(_373)];
if(_374==this.track){
var _376=Position.cumulativeOffset(this.track);
this.event=_373;
this.setValue(this.translateToValue((this.isVertical()?_375[1]-_376[1]:_375[0]-_376[0])-(this.handleLength/2)));
var _376=Position.cumulativeOffset(this.activeHandle);
this.offsetX=(_375[0]-_376[0]);
this.offsetY=(_375[1]-_376[1]);
}else{
while((this.handles.indexOf(_374)==-1)&&_374.parentNode){
_374=_374.parentNode;
}
this.activeHandle=_374;
this.activeHandleIdx=this.handles.indexOf(this.activeHandle);
this.updateStyles();
var _376=Position.cumulativeOffset(this.activeHandle);
this.offsetX=(_375[0]-_376[0]);
this.offsetY=(_375[1]-_376[1]);
}
}
Event.stop(_373);
}
},update:function(_377){
if(this.active){
if(!this.dragging){
this.dragging=true;
}
this.draw(_377);
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
Event.stop(_377);
}
},draw:function(_378){
var _379=[Event.pointerX(_378),Event.pointerY(_378)];
var _380=Position.cumulativeOffset(this.track);
_379[0]-=this.offsetX+_380[0];
_379[1]-=this.offsetY+_380[1];
this.event=_378;
this.setValue(this.translateToValue(this.isVertical()?_379[1]:_379[0]));
if(this.initialized&&this.options.onSlide){
this.options.onSlide(this.values.length>1?this.values:this.value,this);
}
},endDrag:function(_381){
if(this.active&&this.dragging){
this.finishDrag(_381,true);
Event.stop(_381);
}
this.active=false;
this.dragging=false;
},finishDrag:function(_382,_383){
this.active=false;
this.dragging=false;
this.updateFinished();
},updateFinished:function(){
if(this.initialized&&this.options.onChange){
this.options.onChange(this.values.length>1?this.values:this.value,this);
}
this.event=null;
}};
function searchboxClick(){
if(!$("searchInput").beenclicked){
$("searchInput").beenclicked=true;
$("searchInput").value="";
$("searchInput").style.color="#252525";
}
}
var LiveSwitch=Class.create();
LiveSwitch.prototype={initialize:function(_384,_385){
this.element=$(_384);
this.options=_385;
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(_386){
Event.stop(_386);
var a=Event.element(_386);
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(_390,_391){
var _h=document.getElementsByTagName("head")[0];
var _s=UFO.createElement("style");
if(!UFO.uaHas("ieWin")){
_s.appendChild(document.createTextNode(_390+" {"+_391+"}"));
}
_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(_390,_391);
}
}
},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,_396,_397){
var _p=UFO.createElement("param");
_p.setAttribute("name",_396);
_p.setAttribute("value",_397);
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(_406,_407){
return (UFO.fv[0]>_406||(UFO.fv[0]==_406&&UFO.fv[1]>=_407))?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 _412="";
var _l=UFO.optAtt.length;
for(var i=0;i<_l;i++){
if(typeof _fo[UFO.optAtt[i]]!="undefined"){
_412+=" "+UFO.optAtt[i]+"=\""+_fo[UFO.optAtt[i]]+"\"";
}
}
var _413="";
var _l=UFO.opt.length;
for(var i=0;i<_l;i++){
if(typeof _fo[UFO.opt[i]]!="undefined"){
_413+="<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\""+_412+" 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+"\" />"+_413+"</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(_421,cb,_423){
this.form=_421;
this.callback=cb;
this.session=UploadTracker._generateSession();
this.stopped=false;
this.uploadID=_423;
var _424=this.form.action;
if(_424.match(/\bclient_up_sess=(\w+)/)){
_424=_424.replace(/\bclient_up_sess=(\w+)/,"client_up_sess="+this.session);
}else{
_424+=(_424.match(/\?/)?"&":"?");
_424+="client_up_sess="+this.session;
}
this.form.action=_424;
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 _426=this;
if(_426.stopped){
return true;
}
var url="/__upload_status";
var _427="client_up_sess="+_426.session+"&rand="+Math.random();
var _428=new Ajax.Request(url,{method:"get",parameters:_427,onComplete:function(_429){
if(_426.stopped){
return true;
}
var _430;
eval("retVal = "+_429.responseText+";");
if(!_430){
return;
}
if(_426.lastdone!=undefined&&_426.lasttime!=undefined){
var _431=(_430.done-_426.lastdone)/(_430.nowtime-_426.lasttime);
var _432=(_430.total-_430.done)/_431;
}else{
var _431=0;
var _432=0;
}
_426.lastdone=_430.done;
_426.lasttime=_430.nowtime;
_430.transferrate=_431;
_430.timeremaining=_432;
_426.callback(_430,_426.uploadID);
setTimeout(function(){
_426._startCheckStatus();
},1000);
}});
};
function videoSearch(pane,url,page,_435){
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(_435){
params+="&perpage="+_435;
}
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 _436=440;
var _437=screen.height-100;
if((!type||type=="artist")&&_437>700){
_437=700;
}else{
if(type=="track"&&_437>600){
_437=600;
}
}
var name="uploadvideo"+Math.round(Math.random()*100);
var _438="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width="+_436+", height="+_437;
window.open(url,name,_438);
}
var holderVisible=false;
var frameLoaded=false;
var current;
var curSrc;
var widgSize;
function $(){
var _439=new Array();
for(var i=0;i<arguments.length;i++){
var _440=arguments[i];
if(typeof _440=="string"){
_440=document.getElementById(_440);
}
if(arguments.length==1){
return _440;
}
_439.push(_440);
}
return _439;
}
function resourcewidget(name,size){
return widget(name,size,true);
}
function widget(name,size,_442){
var box=$("widgetHolder");
var _443=$("widget");
var _444=$("widgetLoading");
widgSize=size;
if(!holderVisible){
Element.addClassName(name+"_w","on");
_444.style.display="block";
_443.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="/"+(_442?"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");
_443.style.display="none";
new Effect.BlindUp(box,{duration:0.5});
_443.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 _445=document.getElementById("tagInput");
if(_445.value.length>1){
_445.value=_445.value+", ";
}
_445.value=_445.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");
}
var WinLoad={loadfuncs:new Array(),addFunc:function(ref){
if(arguments.length>1){
WinLoad.loadfuncs.unshift(ref);
}else{
WinLoad.loadfuncs.push(ref);
}
},exFuncs:function(){
for(var i=0;i<WinLoad.loadfuncs.length;i++){
WinLoad.loadfuncs[i]();
}
}};
try{
window.addEventListener("load",function(){
WinLoad.exFuncs();
},true);
}
catch(e){
window.onload=function(){
WinLoad.exFuncs();
};
}

