LFM.set("Activityfeed",{DeleteListener:Class.create({initialize:function(){
document.observe("click",this.bin.bindAsEventListener(this));
},bin:function(_1){
var _2=_1.findElement("a.removeActivity");
if(!_2){
return;
}
_1.stop();
var _3=_2.up("li");
new Ajax.Request("/ajax/deleteActivity",{parameters:{ajax:1,activities:_3.id,formtoken:LFM.Session.formtoken},onComplete:function(_4){
var _5=new LFM.Ajax.Response(_4);
if(_5.isSuccess()){
_3.remove();
}
}});
}})});
LFM.set("Activity",{buildFeedItem:function(_6){
var _7=new Element("ul",{"class":"minifeedSmall"});
var li=new Element("li",{"class":_6.action});
if(_6.icon){
li.insert(_6.icon);
}
li.insert(_6.message);
_7.update(li);
return _7;
}});
LFM.set("Util",{AdblockDetector:Class.create({initialize:function(){
},isBlocking:function(){
if(LFM.Session.language!="en"){
return false;
}
return this.isABP();
},isABP:function(){
return this.isEasyList();
},isEasyList:function(){
if($("footer_ads")&&$("footer_ads").visible()&&$("footer_ads").getStyle("-moz-binding")){
return $("footer_ads").getStyle("-moz-binding").include("abp-elemhidehit");
}
}})});
LFM.set("Library",{AddListener:Class.create({options:{},initialize:function(_9,_a){
this.bindTo=$(_9);
this.bindTo.observe("click",this._onClick.bindAsEventListener(this));
Object.extend(this.options,_a||{});
},_onClick:function(e){
var _c=e.element();
if(!_c||!_c.hasClassName("lfmAddButton")){
return true;
}
e.stop();
this._showDialog(this.options.resource||{url:_c.getAttribute("href")});
},_showDialog:function(_d){
var _e="/ajax/dialog/add";
var _f={resource:_d,onConfirm:this._onConfirmDialog.bindAsEventListener(this)};
this._dialog=new LFM.Dialog(_f);
this._dialog.show(_e);
},_onConfirmDialog:function(e){
}})});
LFM.set("Adserver",{getSponsoredByBranding:function(_11,_12,_13,_14){
var _15=new Element("div",{"class":"brand"});
if(!_14){
var _16=new Element("img",{"class":"sponsored",src:LFM.Session.staticHost+"/promotions/notifications_presented_grey.gif",width:88,height:5}).setStyle({padding:"2px 0"});
}
var _17=new Element("img",{src:_11,width:1,height:1}).setStyle({position:"absolute",top:0,left:0,visibility:"hidden"});
if(_12){
var _18=new Element("img",{src:_12,width:88,height:31});
if(_13){
_18=_18.wrap(new Element("a",{href:_13,target:"_blank"}));
}
if(_16){
_15.insert(_16);
}
_15.insert(_18);
}
_15.insert(_17);
return _15;
}});
LFM.set("Library",{AlbumStrip:Class.create({initialize:function(_19){
this._albumstrip=$(_19);
this._albumstrip.addClassName("js");
this._wrapper=this._albumstrip.down("div.wrapper");
this._wrapper.setStyle({overflow:"hidden"});
this._list=this._wrapper.down("ul");
if(this._list){
this._listItems=this._list.childElements();
}
this._currentFilterName=false;
this._leftButton=new Element("a",{"class":"leftButton",href:"#"});
this._rightButton=new Element("a",{"class":"rightButton",href:"#"});
this._albumstrip.insert(this._leftButton);
this._albumstrip.insert(this._rightButton);
this._offset=0;
this._itemcount=this._listItems?this._listItems.length:0;
var _1a=Prototype.Browser.WebKit?window:document;
var _1b=Prototype.Browser.WebKit?"load":"dom:loaded";
Event.observe(_1a,_1b,function(){
this._itemwidth=this._list.down("li").getWidth();
this._reflow();
Event.observe(window,"resize",this._reflow.bindAsEventListener(this));
this._leftButton.observe("click",this.scrollLeft.bindAsEventListener(this));
this._rightButton.observe("click",this.scrollRight.bindAsEventListener(this));
}.bind(this));
},setUpFilter:function(_1c){
this._filteredTable=$(_1c);
startTimer("setUpFilter");
this._filterDataTable={};
this._filterDataTable.albums=[];
this._filterDataTable.everything=this._filteredTable.select("tbody tr");
this._filterDataTable.everything.each(function(row){
var _1e=row.className.split(" ");
_1e.each(function(_1f){
if(_1f.substring(0,5)=="album"){
if(!this._filterDataTable.albums[_1f]){
this._filterDataTable.albums[_1f]=[];
}
this._filterDataTable.albums[_1f].push(row);
}
}.bind(this));
}.bind(this));
stopTimer("setUpFilter");
this._albumstrip.observe("click",this._filter.bindAsEventListener(this));
},_filter:function(_20){
if(!this._maxHeight){
this._maxHeight=this._filteredTable.up().getHeight();
this._filteredTable.up().setStyle({height:this._maxHeight+"px"});
var _21=this._filterDataTable.everything.first().select("td");
var _22=this._filteredTable.down("thead tr").select("th");
for(var i=_22.length-1;i>=0;i--){
var _24=_21[i].getWidth();
var _24=_24-20;
_22[i].setStyle({width:_24+"px"});
}
}
var _25=_20.findElement("a");
if(!_25){
return;
}
_20.stop();
if(_25.up("h3")){
_25.up("h3").addClassName("current");
this._listItems.invoke("removeClassName","selected");
if(!this._currentFilterName){
return;
}else{
this._currentFilterName=false;
this._filteredTable.show();
$("noTracksMessage").hide();
this._filterDataTable.everything.invoke("show");
LFM.Display.candyStripe(this._filteredTable);
}
}else{
var _26=_25.up("li").className.split(" ");
var _27="";
_26.each(function(_28){
if(_28.substring(0,5)=="album"){
_27=_28;
}
}.bind(this));
if(_27){
this._albumstrip.down("h3").removeClassName("current");
this._listItems.invoke("removeClassName","selected");
_25.up("li").addClassName("selected");
this._currentFilterName=_27;
this._filterDataTable.everything.invoke("hide");
if(this._filterDataTable.albums[_27]){
this._filterDataTable.albums[_27].invoke("show");
LFM.Display.candyStripe(this._filterDataTable.albums[_27]);
this._filteredTable.show();
$("noTracksMessage").hide();
}else{
this._filteredTable.hide();
$("noTracksMessage").show();
}
}else{
return;
}
}
},scrollRight:function(_29){
if(_29){
_29.stop();
}
var _2a=this._offset-this._itemwidth;
if(_2a*-1>this._list.getWidth()-this._wrapper.getWidth()){
_2a=this._wrapper.getWidth()-this._list.getWidth();
}
this._offset=_2a;
new Effect.Morph(this._list,{style:{left:_2a+"px"},duration:0.3,queue:{position:"end",scope:"scrollscope"}});
},scrollLeft:function(_2b){
if(_2b){
_2b.stop();
}
var _2c=this._offset+this._itemwidth;
if(_2c>0){
_2c=0;
}
this._offset=_2c;
new Effect.Morph(this._list,{style:{left:_2c+"px"},duration:0.3,queue:{position:"end",scope:"scrollscope"}});
},_reflow:function(){
var _2d=true;
var _2e=this._albumstrip.getWidth()-this._leftButton.getWidth()-this._rightButton.getWidth();
log(_2e);
var _2f=Math.floor(_2e/this._itemwidth);
if(_2f>=this._itemcount){
_2d=false;
_2f=this._itemcount;
}
var _30=_2f*this._itemwidth;
this._wrapper.setStyle({width:_30+"px"});
if(_2d){
this._leftButton.show();
this._rightButton.show();
}else{
this._leftButton.hide();
this._rightButton.hide();
}
}})});
LFM.set("Form",{Attachbutton:Class.create({initialize:function(_31,_32){
this.button=$(_31);
if(!_32){
_32={};
}
this.options=_32;
this._bindToButton();
},_bindToButton:function(){
Event.observe(this.button,"click",function(e){
Event.stop(e);
var _34=new LFM.Form.ResourcePicker({onSelect:this._onSelect.bind(this)});
_34.show();
}.bindAsEventListener(this));
},_onSelect:function(res){
if(res){
this._appendAttachment(res.type,res.id);
}
},_appendAttachment:function(_36,id){
if(!this.itemcontainer&&this.options.itemcontainer){
this.itemcontainer=$(this.options.itemcontainer);
}
if(this.itemcontainer){
this.itemcontainer.show();
this.itemcontainer.down("img.progress").show();
new Ajax.Request("/ajax/attachment",{method:"get",parameters:"type="+_36+"&id="+id,onComplete:this._appendAttachmentCallback.bind(this)});
}
var _38=this.button.up("form");
if(_38){
var _39=_38.down("input[name=attachmenttype]");
var _3a=_38.down("input[name=attachmentid]");
if(!_39){
var _39=document.createElement("input");
_39.setAttribute("type","hidden");
_39.setAttribute("name","attachmenttype");
var _3a=document.createElement("input");
_3a.setAttribute("type","hidden");
_3a.setAttribute("name","attachmentid");
_39.setAttribute("value",_36);
_3a.setAttribute("value",id);
_38.appendChild(_39);
_38.appendChild(_3a);
}else{
_39.setAttribute("value",_36);
_3a.setAttribute("value",id);
}
}
},_appendAttachmentCallback:function(req){
var _3c=req.responseText.evalJSON();
if(this.itemcontainer){
this.itemcontainer.insert({top:_3c.attachment});
this.itemcontainer.down("img.progress").hide();
}
}})});
LFM.set("Button",{MultiButton:{setup:function(){
this.activeButton=false;
this.menu=$("multiButtonMenu");
this.loadedInfo=$H();
this.menu.observe("click",this.observeMenu.bindAsEventListener(this));
$("page").observe("click",this.observeDocument.bindAsEventListener(this));
this.clickOffObserver=this.clickOff.bindAsEventListener(this);
this.parentIsUser=LFM.ParentResource&&LFM.ParentResource.type==4;
this.parentIsLoggedInUser=LFM.Session.loggedIn&&this.parentIsUser&&LFM.ParentResource.name==LFM.Session.userName;
},observeDocument:function(e){
var _3e=e.findElement("a.lfmMultiButton");
if(!_3e){
return false;
}
e.stop();
if(this.activeButton&&this.activeButton!=_3e){
this.clickOff();
}else{
if(this.activeButton&&this.activeButton==_3e){
this.clickOff();
return;
}
}
this.activeButton=_3e;
if(this.activeButton.hasClassName("lfmSmallButton")){
this.activeButton.addClassName("lfmSmallActiveMultiButton");
}else{
this.activeButton.addClassName("lfmBigActiveMultiButton");
}
if(this.activeButton.hasClassName("mBuy")){
this.updatePriceFromAjax();
}
if(LFM.Session.loggedIn&&!this.parentIsLoggedInUser&&_3e.hasClassName("lfmButtonFortrack")){
this.updateMenuFromAjax(this.activeButton);
}else{
this.showMenu(this.activeButton);
}
document.observe("click",this.clickOffObserver);
},clickOff:function(){
this.hideMenu(this.activeButton);
this.activeButton.removeClassName("lfmSmallActiveMultiButton");
this.activeButton.removeClassName("lfmBigActiveMultiButton");
this.activeButton=false;
var _3f=this.menu.down("li.mBuy a span");
if(_3f){
_3f.remove();
}
document.stopObserving("click",this.clickOffObserver);
},updatePriceFromAjax:function(){
this.menu.down("li.mBuy a").insert(" <img class=\"loading\" src=\""+LFM.Session.staticHost+"/flatness/spinner_13x13.gif\" height=\"7\" />");
var _40=new Ajax.Request("/ajax/affiliableprice",{parameters:{url:this.activeButton.href,cachebuster:Math.round(Math.random()*100)},method:"get",onComplete:function(_41){
this.menu.down("li.mBuy a img").remove();
if(_41.responseText){
this.menu.down("li.mBuy a").insert(" "+_41.responseText);
}
}.bind(this)});
},updateMenuFromAjax:function(_42){
var _42=_42;
if(this.loadedInfo.get(_42.href)){
_42.className=this.loadedInfo.get(_42.href);
this.sortOutClassNames(_42);
this.showMenu(_42);
}else{
var _43=new Ajax.Request("/ajax/library/gettrackinfo",{parameters:{url:_42.href,cachebuster:Math.round(Math.random()*100)},method:"get",onComplete:function(_44){
var _45=new LFM.Ajax.Response(_44);
if(_45.isSuccess()){
if(_45.get("loved")){
_42.removeClassName("mLove");
_42.addClassName("mUnlove");
}else{
_42.addClassName("mLove");
_42.removeClassName("mUnlove");
}
if(_45.get("banned")){
_42.removeClassName("mBan");
_42.addClassName("mUnban");
}else{
if(_42.hasClassName("lfmMultiButtonAllowBan")){
_42.addClassName("mBan");
}
_42.removeClassName("mUnban");
}
if(_42.hasClassName("lfmMultiButtonFull")){
if(_45.get("playcount")!==null){
_42.addClassName("mRemoveFromLibrary");
_42.removeClassName("mAddToLibrary");
}else{
_42.removeClassName("mRemoveFromLibrary");
_42.addClassName("mAddToLibrary");
}
}
this.loadedInfo.set(_42.href,_42.className);
}
if(_42==this.activeButton&&!_43.shown){
this.sortOutClassNames(_42);
this.showMenu(_42);
}
}.bind(this)});
(function checkTimeout(){
if(!(_43&&_43.getStatus()==200)&&_42==this.activeButton){
_43.shown=true;
this.sortOutClassNames(_42);
this.showMenu(_42);
}
}).bind(this).delay(0.5);
}
},showMenu:function(_46,_47){
var _47=_47||{};
var _48=_46.cumulativeOffset();
var _49=$("page").cumulativeOffset();
_48.left=_48.left-7-_49.left;
_48.top=_48.top+_46.getHeight()-_49.top;
var _4a=this.activeButton.getWidth();
if(Prototype.Browser.IE){
if(window.external&&typeof window.XMLHttpRequest=="undefined"){
_48.left=_48.left-35;
}else{
if(_46.hasClassName("lfmSmallMultiButton")&&_46.up("div.module")){
_48.left=_48.left-15;
}
}
}
this.menu.setStyle({top:_48.top+"px",left:_48.left+"px"});
var _4b=this.menu.down("ul");
_4a=_4a-_4b.getStyle("border-left-width").toPixels()-_4b.getStyle("border-right-width").toPixels()-_4b.getStyle("padding-left").toPixels()-_4b.getStyle("padding-right").toPixels();
_4b.setStyle({minWidth:_4a+"px"});
$w("tr li").each(function(_4c){
var _4d=_46.up(_4c);
if(_4d){
_4d.addClassName("open");
}
});
var _4e=_47.showLoadingState?"mLoading":false;
this.sortOutClassNames(_46,_4e);
this.menu.show();
},hideMenu:function(_4f){
$w("tr li").each(function(_50){
var _51=_4f.up(_50);
if(_51){
_51.removeClassName("open");
}
});
this.menu.down("ul").setStyle({minWidth:"0px"});
this.menu.hide();
},sortOutClassNames:function(_52,_53){
if(_53){
this.menu.className=_53;
this.menu.down("div").className=_53;
}else{
var _54=_52.className.match(/\blfmButtonFor([a-z]*)\b/)[1];
_54+="MultiMenu";
this.menu.className=_54;
var _55=_52.className;
this.menu.down("div").className=_55;
}
},observeMenu:function(e){
e.stop();
var _57=this.activeButton.hasClassName("lfmBigMultiButton")?"moreBtn":"multiBtn";
LFM.Omniture.prepareEvar("ClickSource",_57);
var _58=e.findElement("li").className;
if(Prototype.Browser.IE){
_58=_58.replace(/\b\w*hover_/gi,"").strip();
}
switch(_58){
case "mSave":
LFM.Save({url:this.activeButton.href});
break;
case "mObsess":
LFM.Obsess({url:this.activeButton.href});
break;
case "mAddToPlaylist":
LFM.Playlist({url:this.activeButton.href});
break;
case "mAddTags":
LFM.Tag({url:this.activeButton.href});
break;
case "mAddToFriends":
case "mAddToLibrary":
LFM.Add({url:this.activeButton.href});
break;
case "mRemoveFromLibrary":
LFM.RemoveFromLibrary({url:this.activeButton.href},{onDone:function(_59){
var _5a=LFM.get("Page","LibraryDeleteListener");
var _5b=LFM.get("Page","LibraryRemoveTagFromItemListener");
if(_5a){
_5a.onDone(_59);
}
if(_5b){
_5b.onSuccess(_59);
}
}});
break;
case "mSend":
LFM.Send({url:this.activeButton.href});
break;
case "mEditDetails":
location.href=LFM.ParentResource.url+"/settings";
break;
case "mMessageAll":
location.href=LFM.ParentResource.url+"/messageall";
break;
case "mEditPermissions":
location.href=LFM.ParentResource.url+"/permissions";
break;
case "mAbdicate":
location.href=LFM.ParentResource.url+"/abdicate";
break;
case "mLeave":
LFM.Leave({url:this.activeButton.href},{parameters:{leave:1}});
break;
case "mLove":
this.love.bind(this)(this.activeButton,true);
break;
case "mUnlove":
this.love.bind(this)(this.activeButton,false);
break;
case "mBan":
this.ban.bind(this)(this.activeButton,true);
break;
case "mUnban":
this.ban.bind(this)(this.activeButton,false);
break;
case "mBuy":
LFM.BuyDialog({url:this.activeButton.href});
break;
default:
LFM.Omniture.setEvar("ClickSource","");
break;
}
this.clickOff();
},love:function(_5c,_5d){
var _5e=this.activeButton;
new Ajax.Request("/ajax/library/love",{parameters:{ajax:true,url:_5e.href,loved:_5d,formtoken:LFM.Session.formtoken},onSuccess:function(_5f){
var _60=new LFM.Ajax.Response(_5f);
if(_60.isSuccess()){
var _61=_5e.up("tr");
var _62=_5e.up("li");
if(_61){
if(_61.hasClassName("odd")&&_61.up("table").hasClassName("chart")){
var _63="#f4f4f4";
}else{
var _63="#ffffff";
}
}
if((!this.parentIsUser||this.parentIsLoggedInUser)&&_61){
var _64=_61.down("td.lovedCell");
}else{
if(LFM.ParentResource&&LFM.ParentResource.type==9&&$("lovedIndicator")){
if(_5d){
if(LFM.Page.onAddToLibrary){
LFM.Page.onAddToLibrary(_60);
}
$("lovedIndicator").show();
}else{
$("lovedIndicator").hide();
}
}
}
this.loadedInfo.unset(_5e.href);
if(_5d){
LFM.Omniture.trackEvents("LoveTrack");
_5e.removeClassName("mLove");
_5e.addClassName("mUnlove");
if(_64){
_64.insert({top:LFM.Element.icon_loved_indicator});
}
if(_62){
_62.addClassName("loved");
}
var _65=_60.get("activity");
if(_65){
var _66=LFM.Activity.buildFeedItem(_65);
if(LFM.Adserver.showAds&&LFM.Session.location=="us"){
var _67=LFM.Adserver.getATTNotificationBranding();
}
var _68=new Element("div");
_68.insert(_67);
_68.insert(_66);
LFM.Notification.send(_68);
}
}else{
_5e.addClassName("mLove");
_5e.removeClassName("mUnlove");
if(_64){
var _69=_64.down("img.loved_indicator_icon");
if(_69){
_69.remove();
}
}
if(_62){
_62.removeClassName("loved");
}
}
if(_64){
new Effect.Highlight(_61,{endcolor:_63,afterFinish:function(_6a){
_6a.element.removeAttribute("style");
}});
}
}
}.bind(this)});
},ban:function(_6b,_6c){
var _6d=this.activeButton;
new Ajax.Request("/ajax/library/ban",{parameters:{ajax:true,url:_6d.href,banned:_6c,formtoken:LFM.Session.formtoken},onSuccess:function(_6e){
var _6f=new LFM.Ajax.Response(_6e);
if(_6f.isSuccess()){
var _70=_6d.up("tr");
if(_70){
if(_70.hasClassName("odd")&&_70.up("table").hasClassName("chart")){
var _71="#f4f4f4";
}else{
var _71="#ffffff";
}
}
if(LFM.ParentResource){
if(this.parentIsLoggedInUser&&_70){
var _72=_70.down("td.bannedCell");
}else{
if(LFM.ParentResource.type==9&&$("bannedIndicator")){
if(_6c){
$("bannedIndicator").show();
}else{
$("bannedIndicator").hide();
}
}
}
}
this.loadedInfo.unset(_6d.href);
if(_6c){
if(_72){
_72.insert({top:LFM.Element.icon_banned_indicator});
}
}else{
if(_72){
var _73=_72.down("img.banned_indicator_icon");
if(_73){
_73.remove();
}
}
}
if(_70){
new Effect.Fade(_70,{duration:0.5});
}
}
}.bind(this)});
}},affiliations:{"suppliers[]":[],"restypes[]":[],"resids[]":[]},pushAffiliation:function(_74,_75,_76){
LFM.Button.affiliations["suppliers[]"].push(_74);
LFM.Button.affiliations["restypes[]"].push(_75);
LFM.Button.affiliations["resids[]"].push(_76);
}});
LFM.set("Charts",{Switch:Class.create({initialize:function(_77,_78){
this.container=$(_77);
this.parameters=_78;
this.morelink=this.container.select("span.moduleOptions a")[0]||false;
this.cachedcharts=new Hash();
this.container.down("div.horizontalOptions").observe("click",this.switchChartEvent.bindAsEventListener(this));
this.container.select("div.chart").each(function(_79){
var _7a=this.getRangeTypeFromClassName(_79.className);
if(_7a){
this.cachedcharts.set(_7a,_79);
}
}.bind(this));
},switchChartEvent:function(_7b){
var _7c=_7b.element();
if(!_7c.match("a")){
return;
}
_7b.stop();
var _7d=_7c.up("li");
if(_7d.hasClassName("current")){
return;
}
this.container.down("div.horizontalOptions ul").childElements().invoke("removeClassName","current");
_7d.addClassName("current");
var _7e=this.getRangeTypeFromClassName(_7d.className);
this.switchChart(_7e);
},refresh:function(){
this.cachedcharts=new Hash();
this.switchChart();
},switchChart:function(_7f){
if(_7f&&this.cachedcharts.get(_7f)){
this.cachedcharts.each(function(_80){
_80.value.hide();
});
this.cachedcharts.get(_7f).show();
if(this.morelink){
this.morelink.href=this.container.down("ul li.chart"+_7f+" a").href;
}
}else{
var _81=Object.extend(this.parameters,{rangetype:_7f,ajax:1,cachebuster:Math.round(Math.random()*100)});
new Ajax.Request("/module",{method:"get",parameters:_81,onComplete:function(t){
var _83=new LFM.Ajax.Response(t);
if(_83.isSuccess()){
this.container.insert({bottom:_83.get("content").strip()});
var _84=!_7f;
var _85=this.container.childElements().last();
ieHover.add(_85);
if(!_7f){
_7f=this.getRangeTypeFromClassName(_85.className);
this.container.down("div.horizontalOptions ul").childElements().invoke("removeClassName","current");
this.container.down("div.horizontalOptions ul li.chart"+_7f).addClassName("current");
}
this.cachedcharts.set(_7f,_85);
if(this.morelink){
this.morelink.up().insert({before:this.cachedcharts.get(_7f)});
}
if(_84){
this.container.select("div.chart").each(function(_86){
if(_86!=_85){
_86.remove();
}
}.bind(this));
}
this.cachedcharts.each(function(_87){
if(_87.key!=_7f){
_87.value.hide();
}
});
this.cachedcharts.get(_7f).show();
if(this.morelink){
this.morelink.href=this.container.down("ul li.chart"+_7f+" a").href;
}
this.container.removeClassName("loading");
}
}.bind(this),onCreate:function(){
this.container.addClassName("loading");
}.bind(this),onFailure:function(){
this.container.removeClassName("loading");
}.bind(this)});
}
},getRangeTypeFromClassName:function(_88){
var _89=_88.match(/chart[^ ]+/)[0];
return _89.substr(5);
}})});
CopyProtection=Class.create({initialize:function(){
document.observe("keydown",this.cancelKeyDown);
document.observe("contextmenu",this.cancelContextMenu);
document.observe("mousedown",this.disableSelect);
document.observe("mouseup",this.enableSelect);
},cancelKeyDown:function(key){
var _8b=new Array("a","u","c","x","v","j");
if(key.ctrlKey||key.metaKey){
for(i=0;i<_8b.length;i++){
var _8c=key.keyCode;
if(_8b[i].toLowerCase()==String.fromCharCode(_8c).toLowerCase()){
key.stop();
return false;
}
}
}
},cancelContextMenu:function(e){
e.stop();
return false;
},disableSelect:function(e){
var _8f=new Array("input","select","textarea","radio","checkbox");
var _90=false;
for(var i=0;i<_8f.length;i++){
if(e.target.tagName.toLowerCase()==_8f[i]){
_90=true;
}
}
if(!_90){
e.stop();
return false;
}
},enableSelect:function(e){
return true;
}});
LFM.set("Display",{candyStripe:function(_93,_94){
var _94=_94||false;
if(is_array(_93)){
var _95=_93;
}else{
_93=$(_93);
if(_94.selector){
var _95=_93.select(_94.selector);
}else{
if(_93.tagName=="TABLE"){
_93=_93.down("tbody");
}
var _95=_93.childElements();
}
}
if(_95.length>0){
_95[0].up("table").addClassName("candyStriped");
_95.each(function(row,i){
if(i%2){
row.removeClassName("odd");
}else{
row.addClassName("odd");
}
row.removeClassName("first");
row.removeClassName("last");
if(_94.renumber){
var _98=row.down("td.position");
if(_98){
_98.update(i+1);
}
}
});
_95.first().addClassName("first");
_95.last().addClassName("last");
}
},toggleSelector:function(_99){
var els=$$(_99);
if(els){
els.each(function(e){
e.toggle();
});
}
}});
document.observe("dom:loaded",function(_9c){
$$(".downloadDriver").each(function(_9d){
_9d.observe("click",function(e){
var el=e.findElement("a");
if(el&&el.match("a")){
var _a0=LFM.get("Page","hasManualAdded");
var _a1="New user download CTA ("+(_a0?"after":"before")+" library add)";
LFM.Omniture.setLink(el,_a1);
LFM.Omniture.prepareEvar("ClickSource",_a0?"downloadAfterManualAdd":"downloadBeforeManualAdd");
LFM.Omniture.trackEvents();
}
});
});
});
LFM.set("Display",{DropDown:Class.create({initialize:function(_a2,_a3,_a4,_a5){
this.container=$(_a2);
this.toggler=$(_a3);
this.ddbody=$(_a4);
this.ddbody.hide();
this.ddbody.setStyle({position:"absolute",zIndex:999999});
this.use_iframe=/Linux/.test(navigator.platform);
if(this.use_iframe){
this.iframe=new Element("iframe",{"src":"javascript: false","frameborder":0,"scrolling":"no","allowtransparency":"true"}).setStyle({position:"absolute",zIndex:999998,border:0});
}
this.shownOnce=false;
this.options=_a5||{};
this.container.addClassName("toggle");
this.offBinding=this.clickOff.bindAsEventListener(this);
this.toggler.observe("click",this.toggle.bindAsEventListener(this));
if(this.options.trackItemClick){
this.ddbody.observe("click",this.trackItemClick.bindAsEventListener(this));
}
},hide:function(){
if(this.options.onHide){
this.options.onHide(this);
}
if(this.use_iframe){
this.iframe.setStyle({"display":"none"});
}
this.ddbody.hide();
this.container.removeClassName("expanded");
Event.stopObserving(document,"click",this.offBinding,true);
if(LFM.Display.openDropDown&&LFM.Display.openDropDown==this){
LFM.Display.openDropDown=false;
}
},show:function(){
if(LFM.Display.openDropDown){
LFM.Display.openDropDown.hide(this);
}
if(!this.shownOnce){
if(this.use_iframe){
$("page").insert(this.iframe);
}
$("page").insert(this.ddbody);
this.shownOnce=true;
}
var _a6=this.container.cumulativeOffset();
var _a7=$("page").cumulativeOffset();
_a6.left=_a6.left-_a7.left;
_a6.top=_a6.top+this.container.getHeight()-_a7.top;
if(Prototype.Browser.IE&&this.container.getStyle("display")=="inline-block"){
var _a8=this.toggler.getWidth();
}else{
var _a8=this.container.getWidth();
}
var _a9=$("page").getWidth();
if((this.options.align&&this.options.align=="right")||((_a6.left+this.ddbody.getWidth())>_a9)){
var _aa=(_a9-_a8-_a6.left)+"px";
var _ab="auto";
}else{
var _ab=_a6.left+"px";
var _aa="auto";
if(Prototype.Browser.IE){
if(window.external&&typeof window.XMLHttpRequest=="undefined"){
_ab=(_a6.left-35)+"px";
}
}
}
if(!this.options.autoWidth){
_a8=_a8-this.ddbody.getStyle("border-left-width").toPixels()-this.ddbody.getStyle("border-right-width").toPixels()-this.ddbody.getStyle("padding-left").toPixels()-this.ddbody.getStyle("padding-right").toPixels();
this.ddbody.setStyle({minWidth:_a8+"px"});
if(this.use_iframe){
this.iframe.setStyle({minWidth:_a8+"px"});
}
}
this.ddbody.setStyle({top:_a6.top+"px",left:_ab,right:_aa}).show();
var _ac=this.ddbody.cumulativeOffset();
if(this.use_iframe){
this.iframe.clonePosition(this.ddbody);
this.iframe.show();
}
if(this.options.onShow){
this.options.onShow(this);
}
var tr=this.container.up("tr");
if(tr){
tr.addClassName("open");
}
LFM.Display.openDropDown=this;
this.container.addClassName("expanded");
Event.observe(document,"click",this.offBinding,true);
},toggle:function(_ae){
if(this.ddbody.visible()){
this.hide();
}else{
if(this.options.trackToggle){
LFM.Omniture.prepareEvar("ClickSource",this.options.clickSource||this.container.identify());
LFM.Omniture.trackEvents("DropDown");
}
this.show();
}
if(_ae.findElement("A")){
_ae.findElement("A").blur();
}
_ae.stop();
},clickOff:function(_af){
var _b0=Event.element(_af);
var _b1=false;
while(_b0.parentNode){
if(_b0==this.ddbody){
return true;
}else{
if(_b0==this.toggler){
_b1=true;
}
}
_b0=_b0.parentNode;
}
this.hide();
if(_b1){
_af.stop();
}
},trackItemClick:function(e){
var _b3=e.findElement("a");
if(_b3){
var _b4=_b3.className;
var _b5=this.container.identify();
var _b6=_b3.up("li");
if(_b6){
_b4=_b6.className;
}
LFM.Omniture.setLink(_b3,_b5+":"+_b4);
LFM.Omniture.prepareEvar("ClickSource",_b5);
LFM.Omniture.trackEvents("Click");
}
}})});
var EventCalendar={calendars:null,currentMonth:null,lastRequested:null,next:function(url,_b8,_b9){
_b8.blur();
Element.addClassName(_b8,"busy");
var c=EventCalendar.getCurrentMonth();
var _bb=_b9?EventCalendar.getPrevMonthAfterTable(c):EventCalendar.getNextMonthAfterTable(c);
var _bc=null;
var _bd=null;
if(!_b9){
_bd=document.getElementsByClassName("month-"+_bb,$("calendar"));
_bc=_bd.length>0?_bd[0]:false;
}else{
var m=EventCalendar.getPrevMonthAfterTable(c);
_bd=document.getElementsByClassName("month-"+m,$("calendar"));
_bc=_bd.length>0?_bd[0]:false;
}
if(_bc){
c.style.display="none";
_bc.style.display="table";
EventCalendar.currentMonth=_bc;
Element.removeClassName(_b8,"busy");
}else{
if(_bc==-1){
Element.removeClassName(_b8,"busy");
}else{
url=EventCalendar.convertURL(url);
EventCalendar.lastRequested=_bb;
var _bf=new Ajax.Request(url+"&startdate="+_bb+"-01",{onSuccess:EventCalendar.receiveMonth.bind(_b8),onFailure:EventCalendar.receiveMonthFailed.bind(_b8)});
}
}
},prev:function(url,_c1){
EventCalendar.next(url,_c1,true);
},convertURL:function(url){
url=url.replace(/^\/events/,"");
return "/events/calendar"+url;
},receiveMonth:function(_c3){
if(_c3.responseText.indexOf("calendar")==-1){
var _c4=EventCalendar.receiveMonthFailed.bind(this);
_c4();
return;
}
Element.removeClassName(this,"busy");
new Insertion.Bottom("calendar",_c3.responseText);
var _c5=document.getElementsByClassName("calendar",$("calendar"));
if(_c5.length>0){
EventCalendar.currentMonth.style.display="none";
_c5[_c5.length-1].style.display="table";
EventCalendar.currentMonth=_c5[_c5.length-1];
}
},receiveMonthFailed:function(){
Element.removeClassName(this,"busy");
},getNextMonthAfterTable:function(_c6){
var _c7=EventCalendar.getMonthForTable(_c6);
var _c8=_c7.split("-");
var _c9=_c8[0];
var _ca=_c8[1];
if(_ca==12){
_ca=1;
_c9++;
}else{
_ca++;
}
if(_ca<10){
_ca="0"+_ca;
}
return _c9+"-"+_ca;
},getPrevMonthAfterTable:function(_cb){
var _cc=EventCalendar.getMonthForTable(_cb);
var _cd=_cc.split("-");
var _ce=_cd[0];
var _cf=_cd[1];
if(_cf=="01"){
_cf=12;
_ce--;
}else{
_cf--;
}
if(_cf<10){
_cf="0"+_cf;
}
return _ce+"-"+_cf;
},getMonthForTable:function(_d0){
if(_d0.month){
return _d0.month;
}
var _d1=$A(_d0.className.split(/\s+/));
var c=_d1.find(function(c){
return c.substring(0,5)=="month";
});
_d0.month=c.substring(6);
return _d0.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;
}};
LFM.set("Adserver",{"ExpandingAd":Class.create({inner_id:"",outer_id:"",embed_id:"",adExpandedHeight:0,adExpandedWidth:0,adCollapsedHeight:0,adCollapsedWidth:0,isCollapsing:false,toggleState:false,initialize:function(_d5,_d6,_d7){
this.inner_id=_d6;
this.outer_id=_d5;
this.embed_id=_d7;
this.getDimensions();
this.setStyles();
this.bindEventListeners();
},getDimensions:function(){
this.adExpandedHeight=$(this.embed_id).getHeight();
this.adExpandedWidth=$(this.embed_id).getWidth();
this.adCollapsedHeight=$(this.outer_id).getHeight();
this.adCollapsedWidth=$(this.outer_id).getWidth();
},setStyles:function(){
$(this.outer_id).setStyle({"zIndex":0,"overflow":"visible","position":"relative"});
$(this.inner_id).setStyle({"zIndex":0,"position":"relative","top":0,"text-align":"center"});
},bindEventListeners:function(){
var _d8=this;
$(document).observe("click",function(e){
_d8.collapse();
});
$(this.inner_id).observe("click",function(e){
e.stop();
});
$(this.inner_id).observe("mouseover",function(e){
_d8.isCollapsing=false;
if(_d8.toggleState){
_d8.expand();
}
});
$(this.inner_id).observe("mouseout",function(e){
if(!_d8.isCollapsing){
_d8.isCollapsing=true;
setTimeout(function(){
if(_d8.isCollapsing){
_d8.collapse();
_d8.isCollapsing=false;
}
},2000);
}
});
$(this.embed_id).observe("focus",function(e){
_d8.expand();
_d8.toggleState=true;
});
$(this.embed_id).observe("blur",function(e){
_d8.toggleState=false;
});
},collapse:function(){
$(this.outer_id).setStyle({"zIndex":0});
$(this.inner_id).setStyle({"zIndex":0,"width":this.adCollapsedWidth+"px","height":this.adCollapsedHeight+"px"});
this.isCollapsing=false;
},expand:function(){
$(this.outer_id).setStyle({"zIndex":99999});
$(this.inner_id).setStyle({"zIndex":99999,"width":this.adExpandedWidth+"px","height":this.adExpandedHeight+"px"});
}})});
LFM.set("Form",{Placeholder:Class.create({nativeSupport:Prototype.Browser.WebKit?true:false,required:true,initialize:function(_df,_e0){
if(typeof _e0!="undefined"){
this.required=_e0;
}
if(_df){
this.element=$(_df);
}
if(this.element){
if(this.element.match("input")||this.element.match("textarea")){
this.setUp(this.element);
}else{
this.element.select("input[placeholder]").each(function(_e1){
this.setUp(_e1);
}.bind(this));
}
}else{
if(!this.element){
$$("input[placeholder]").each(function(_e2){
this.setUp(_e2);
}.bind(this));
}
}
},setText:function(_e3,_e4){
_e3.setAttribute("placeholder",_e4);
if(!this.nativeSupport||_e3.match("textarea")){
if($F(_e3)==""||_e3.hasClassName("hint")){
_e3.addClassName("hint");
_e3.value=_e4;
}
}
},clearPlaceholder:function(_e5,_e6){
if($F(_e5)==_e5.getAttribute("placeholder")){
_e5.removeClassName("hint");
_e5.value="";
}
_e6.disabled=true;
},resetPlaceholder:function(_e7,_e8){
if(!$F(_e7).strip()){
_e7.addClassName("hint");
_e7.value=_e7.getAttribute("placeholder");
_e8.disabled=false;
}
},setUp:function(_e9){
this.setText(_e9,_e9.getAttribute("placeholder"));
if(!this.nativeSupport||_e9.match("textarea")){
var _ea=new Element("input",{"type":"hidden","name":"placeholder","value":1});
_e9.insert({after:_ea});
_e9.observe("focus",function(e){
this.clearPlaceholder(_e9,_ea);
}.bind(this));
_e9.observe("blur",function(e){
this.resetPlaceholder(_e9,_ea);
}.bind(this));
if(this.required){
var _ed=_e9.up("form");
_ed.observe("submit",function(e){
this.clearPlaceholder(_e9,_ea);
}.bind(this));
}
}
}})});
LFM.set("Form",{focusToRange:0,focusTo:function(_ef,_f0){
if(typeof _f0=="undefined"){
_f0=_ef.value.length;
}
if(_ef.createTextRange){
if(LFM.Form.focusToRange==0){
LFM.Form.focusToRange=_ef.createTextRange();
}
LFM.Form.focusToRange.moveEnd("character",_ef.value.length);
LFM.Form.focusToRange.moveStart("character",_f0);
setTimeout("LFM.Form.focusToRange.select()",10);
}else{
if(_ef.setSelectionRange){
_ef.focus();
_ef.select();
_ef.setSelectionRange(_f0,_ef.value.length);
}else{
_ef.focus();
}
}
}});
LFM.set("Display",{setupHeader:function(){
if(LFM.Session.loggedIn){
$("idBadger").addClassName("withDropDown");
LFM.set("Page",{navDropDown:new LFM.Display.DropDown("idBadger","idBadgerDropper","idBadgerDropDown",{align:"right",trackToggle:true,trackItemClick:true})});
}
new LFM.Form.Placeholder("siteSearchBox");
},colourToggle:function(_f1){
_f1=$(_f1);
$(document.body).toggleClassName("lfmBlack");
_f1.blur();
var _f2,_f3;
if($(document.body).hasClassName("lfmBlack")){
_f2="red";
_f3="black";
_f1.update(LFM.String.toRedStr);
}else{
_f2="black";
_f3="red";
_f1.update(LFM.String.toBlackStr);
}
LFM.setCookie("LFM_Colour",_f3);
LFM.Omniture.prepareEvar("ClickSource","colorToggle:"+_f3);
LFM.Omniture.trackEvents("Click");
return false;
}});
if((Math.round(Math.random()*100)>98)&&(LFM.get("Button","affiliations"))&&(LFM.Button.affiliations["suppliers[]"].length)){
document.observe("dom:loaded",function(_f4){
var url="/ajax/affiliableLookup?";
new Ajax.Request(url,{method:"post",parameters:LFM.Button.affiliations});
});
}
function log(){
if(typeof console!=="undefined"&&LFM&&LFM.get("config","DEVELOPMENT_SERVER")){
if(console.log.apply){
console.log.apply(console,arguments);
}else{
console.log(arguments[0]);
}
}
}
LFM.set("Display",{setMinHeight:function(){
document.observe("dom:loaded",function(){
var _f6=$("secondaryNavigation");
if(_f6){
var _f7=_f6.getHeight()-2;
var _f8=$("content");
if(_f8&&_f8.getHeight()<_f7){
var _f9=$$("#content > .rightCol");
_f9=_f9[0]||_f8;
if(_f9.match(".rightCol")){
_f8.setStyle("min-height: 0");
}
_f7-=_f9.getStyle("padding-top").toPixels(_f9);
_f7-=_f9.getStyle("padding-bottom").toPixels(_f9);
_f9.setStyle({minHeight:(_f7>300?_f7:300)+"px"});
}
}
});
}});
if(LFM&&LFM.get("config","DEVELOPMENT_SERVER")){
LFM.set("Timers",{});
}
function startTimer(_fa){
if(LFM&&LFM.get("config","DEVELOPMENT_SERVER")){
LFM.Timers[_fa]={};
LFM.Timers[_fa].startTime=new Date();
LFM.Timers[_fa].startTime=LFM.Timers[_fa].startTime.getTime();
}
}
function stopTimer(_fb){
if(LFM&&LFM.get("config","DEVELOPMENT_SERVER")){
if(LFM.Timers[_fb]){
LFM.Timers[_fb].endTime=new Date();
LFM.Timers[_fb].endTime=LFM.Timers[_fb].endTime.getTime();
log(LFM.Timers[_fb].endTime-LFM.Timers[_fb].startTime);
}else{
log("Timer "+_fb+" doesn\u2019t exist.");
}
}
}
function loadStyleSheet(_fc){
if(isset(document.createStyleSheet)){
document.createStyleSheet(_fc);
}else{
var _fd=document.createElement("link");
_fd.setAttribute("rel","stylesheet");
_fd.setAttribute("type","text/css");
_fd.setAttribute("href",_fc);
document.getElementsByTagName("head")[0].appendChild(_fd);
}
}
function is_array(obj){
return obj.constructor==Array;
}
function isset(obj){
return typeof obj!=="undefined";
}
String.prototype.pad=function(_100,_101,_102){
if(_100){
_100=_100-this.length;
}else{
return this;
}
var _103=this;
if(_101){
_101=_101+"";
}else{
_101=" ";
}
if(!isset(_102)){
_102="STR_PAD_LEFT";
}
if(_102=="STR_PAD_BOTH"){
var odd=_100%2;
var side=_100/2;
side=Math.round(side);
var left=_101.times(side);
var _107=_101.times(side-odd);
_103=left+_103+_107;
}else{
var _101=_101.times(_100);
if(_102=="PAD_STR_RIGHT"){
_103=_103+_101;
}else{
_103=_101+_103;
}
}
return _103;
};
Number.prototype.toPixels=function(){
return this;
};
String.prototype.toPixels=function(_108){
var size=this.match(/^(-?)(\d+(?:.\d+)?)(px|pt|em|)$/i);
var _10a=size[1]?-1:1;
var _10b=size[2];
var unit=size[3].toLowerCase();
function rule(_10d,unit){
var _10f=document.getElementById(unit+"Ruler");
if(!_10f){
_10f=document.createElement("div");
document.getElementsByTagName("BODY")[0].appendChild(_10f);
_10f.id=unit+"Ruler";
}
_10f.style.width=_10d+unit;
return _10f.clientWidth*_10a;
}
switch(unit){
case "px":
return _10b*_10a;
case "pt":
return rule(_10b,unit);
case "em":
if(!_108){
log("It\u2019s better to give a reference element when calculating pixels from ems");
return rule(_10b,unit);
}else{
var _110=document.createElement(_108.tagName);
_110.style.display="block";
_110.style.position="absolute";
_110.style.left="-9999px";
_110.style.top="-9999px";
_110.style.height="0";
_110.style.padding="0";
_110.style.border="0";
_110.style.width=_10b+unit;
_108.parentNode.appendChild(_110);
returnValue=_110.clientWidth;
_108.parentNode.removeChild(_110);
return returnValue*_10a;
}
default:
return _10b*_10a;
}
};
var CSSUtils={getCSSRule:function(_111,_112){
_111=_111.toLowerCase();
if(document.styleSheets){
for(var i=0;i<document.styleSheets.length;i++){
var _114=document.styleSheets[i];
var ii=0;
var _116=false;
do{
if(_114.cssRules){
_116=_114.cssRules[ii];
}else{
_116=_114.rules[ii];
}
if(_116){
if(_116.selectorText.toLowerCase()==_111){
if(_112=="delete"){
if(_114.cssRules){
_114.deleteRule(ii);
}else{
_114.removeRule(ii);
}
return true;
}else{
return _116;
}
}
}
ii++;
}while(_116);
}
}
return false;
},killCSSRule:function(_117){
return CSSUtils.getCSSRule(_117,"delete");
},addCSSRule:function(_118){
if(document.styleSheets){
if(!CSSUtils.getCSSRule(_118)){
if(document.styleSheets[0].addRule){
document.styleSheets[0].addRule(_118,null,0);
}else{
document.styleSheets[0].insertRule(_118+" { }",0);
}
}
}
return CSSUtils.getCSSRule(_118);
}};
function actsAsAspect(_119){
_119.yield=null;
_119.rv={};
_119.before=function(_11a,f){
var _11c=eval("this."+_11a);
this[_11a]=function(){
f.apply(this,arguments);
return _11c.apply(this,arguments);
};
};
_119.after=function(_11d,f){
var _11f=eval("this."+_11d);
this[_11d]=function(){
this.rv[_11d]=_11f.apply(this,arguments);
return f.apply(this,arguments);
};
};
_119.around=function(_120,f){
var _122=eval("this."+_120);
this[_120]=function(){
this.yield=_122;
return f.apply(this,arguments);
};
};
}
var ieHover={selector:"tr, li",add:function(_123){
if(!(/MSIE (5|6|8)/).test(navigator.userAgent)){
return;
}
var _123=_123||false;
if(Object.isString(_123)&&$(_123)){
$(_123).select(ieHover.selector).each(function(item){
ieHover.prepareItem(item);
});
}else{
if(Object.isElement(_123)){
_123=$(_123);
if(_123.match("tr, li")){
ieHover.prepareItem(_123);
}else{
_123.select(ieHover.selector).each(function(item){
ieHover.prepareItem(item);
});
}
}else{
if(Object.isArray(_123)){
_123.each(function(item){
ieHover.prepareItem(item);
});
}
}
}
},prepareItem:function(item){
item.observe("mouseenter",ieHover.mouseOver);
item.observe("mouseleave",ieHover.mouseOut);
},mouseOver:function(_128){
this.className=this.className.replace(/(\w+[^_\s]{2})\b/ig,"$1 $1hover_")+" hover_";
},mouseOut:function(_129){
this.className=this.className.replace(/\w+_\b/ig,"").replace(/\s+/ig," ");
},setUp:function(){
if(!(/MSIE (5|6|8)/).test(navigator.userAgent)){
return;
}
var _12a=document.createStyleSheet();
var _12b=[];
var _12c;
var _12d=document.styleSheets,l=_12d.length;
for(var i=0;i<l;i++){
parseStylesheet(_12d[i]);
}
function parseStylesheet(_130){
if(_130.imports){
try{
var _131=_130.imports,l=_131.length;
for(var i=0;i<l;i++){
parseStylesheet(_130.imports[i]);
}
}
catch(securityException){
}
}
try{
var _133=(_12c=_130).rules;
var l=_133.length;
var _135=false;
var _136=false;
for(var j=0;j<l;j++){
_135=_133[j].selectorText;
_136=_133[j].style.cssText;
if(_135.match(/(tr|li)(\.(\w*))*:hover/ig)&&_136){
_12b.push([_135.replace(/(tr|li)(\.(\w*))*:hover/ig,"$1.$3hover_"),_136]);
}
}
}
catch(securityException){
}
}
var _138="";
for(var i=_12b.length-1;i>=0;i--){
_138+=_12b[i][0]+"\n{ "+_12b[i][1]+"}\n";
}
_12a.cssText=_138;
var _139=[];
var page=$("page");
ieHover.selector.split(",").each(function(weee){
_139.push($A(page.getElementsByTagName(weee.strip())));
});
_139=_139.flatten();
var i=_139.length-1;
for(i;i>=0;i--){
Event.observe(_139[i],"mouseenter",ieHover.mouseOver);
Event.observe(_139[i],"mouseleave",ieHover.mouseOut);
}
}};
LFM.set("Help",{popup:function(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");
return false;
}});
HighlightEachOther=Class.create({initialize:function(el1,tag1,el2,tag2){
this.els=[$(el1).select(tag1),$(el2).select(tag2)].flatten();
this.els.each(function(el){
el.observe("mouseover",function(e){
this.highlight(el);
}.bindAsEventListener(this));
el.observe("mouseout",function(e){
this.highlight(el);
}.bindAsEventListener(this));
}.bind(this));
},highlight:function(el){
var el=el;
if(!el.relatives){
this.getRelatives(el);
}
el.relatives.each(function(_1b4){
Element.toggleClassName(_1b4,"highlight");
});
},getRelatives:function(el){
el.relatives=new Array();
var rel=el.readAttribute("class");
this.els.each(function(item){
if(item.readAttribute("class")==rel){
el.relatives.push(item);
}
});
}});
LFM.set("LiveSwitch",Class.create({initialize:function(_14a,_14b){
this.element=$(_14a);
this.options={selectedClass:"selected"};
Object.extend(this.options,_14b);
this.items=this.element.select("li");
this.items.each(function(li){
var a=li.down("a");
a.observe("click",this.dispatchOnChange.bindAsEventListener(this));
}.bind(this));
},dispatchOnChange:function(_14e){
_14e.stop();
_14e.element().blur();
var li=_14e.findElement("li");
this.items.invoke("removeClassName",this.options.selectedClass);
li.addClassName(this.options.selectedClass);
this.options.onChange(li);
}}));
LFM.set("Module",{Buttons:Class.create({initialize:function(_150,_151){
this.container=$(_150);
if(_151){
Object.extend(this,_151);
}
if(!this.onComplete){
this.onComplete=this._defaultOnComplete;
}
if(!this.resource){
this.resource=LFM.ParentResource;
}
this.container.observe("click",this.observeMenu.bindAsEventListener(this));
},observeMenu:function(_152){
var link=_152.findElement("a");
if(!link){
return;
}
if(link.hasClassName("mEdit")){
_152.stop();
var url="/ajax/dialog/moduleedit?module="+this.moduleName;
this._dialog=new LFM.Dialog({action:url,classname:"modulePreferences",onConfirm:this._onConfirmDialog.bindAsEventListener(this)});
this._dialog.show(url);
}else{
if(link.hasClassName("mFeeds")){
_152.stop();
var _155={module:this.moduleName,type:this.resource.type,id:this.resource.id};
var url="/ajax/dialog/feeds?"+Object.toQueryString(_155);
this._dialog=new LFM.Dialog({classname:"feedDialog",onConfirm:function(_156){
_156.stop();
this.hide();
}});
this._dialog.show(url);
}else{
if(link.hasClassName("mPaste")){
_152.stop();
var _157=$$(".modulechartsartists li.current a")[0].getAttribute("href");
var _158=/rangetype=([^&]*)/;
var _159=_157.match(_158)[1];
var _155={module:this.moduleName,type:this.resource.type,id:this.resource.id,period:_159};
var url="/ajax/dialog/pasteyourtaste?"+Object.toQueryString(_155);
this._dialog=new LFM.Dialog({classname:"pasteDialog",onConfirm:function(_15a){
_15a.stop();
this.hide();
}});
this._dialog.show(url);
}
}
}
},_defaultOnComplete:function(){
if(this.container.down(".module-body")){
var url="/module";
var _15c={method:"get",parameters:{name:this.moduleName,ajax:1},onComplete:this._defaultRefreshCallback.bind(this),onCreate:function(){
this.container.addClassName("loading");
}.bind(this),onFailure:function(){
this.container.removeClassName("loading");
}.bind(this)};
new Ajax.Request(url,_15c);
}
},_onConfirmDialog:function(_15d,form){
_15d.stop();
if(form){
form.action="/ajax/dialog/moduleedit?module="+this.moduleName;
form.request({onComplete:this.onComplete.bind(this)});
}else{
this._dialog.hide();
this._dialog.overlayForm.request({onComplete:this.onComplete.bind(this)});
}
},_defaultRefreshCallback:function(_15f){
var _160=new LFM.Ajax.Response(_15f);
if(_160.isSuccess()){
this.container.down(".module-body").replace(_160.get("content"));
}else{
this.container.removeClassName("loading");
}
}}),onRefresh:function(_161,_162){
if(!LFM.Module.refreshers){
LFM.Module.refreshers={};
}
LFM.Module.refreshers[_161]=_162;
}});
LFM.set("Display",{MultiTuner:Class.create({initialize:function(form,_164){
this.uuid=Math.round(Math.random()*100000);
this.form=$(form);
this.restype=_164.restype;
this.sampleContent=$(_164.sampleContent);
this.slotID=_164.slotID||"slot"+this.uuid;
this.slotClass=_164.slotClass||"";
this.choices=$(_164.choices);
this.autocomplete=$(_164.autocomplete);
this.length=_164.length||3;
this.itemClass=_164.itemClass||"";
this.onSelect=_164.onSelect;
this.onDeselect=_164.onDeselect;
this.onResourceJSON=_164.onResourceJSON;
this.slots=this.setupSlots(this.length);
this.selections=$H();
this.matching_choices=$H();
this.filled=0;
this.setupListeners();
},setupListeners:function(){
if(!LFM.get("Session","prefersClient")&&!this.form.down("input[name=ajax]")){
this.form.insert(new Element("input",{"type":"hidden","name":"ajax","value":1}));
}
if(this.choices){
this.choices.observe("click",function(e){
e.stop();
var item=e.findElement("li");
this.select(item.down("a").innerHTML.unescapeHTML());
}.bind(this));
}
if(this.autocomplete){
this.autocomplete.observe("submit",function(e){
e.stop();
var _168=this.autocomplete.serialize(true);
if(!_168.placeholder&&_168.name){
this.select(_168.name.unescapeHTML());
this.autocomplete.down("input[name=name]").value="";
}
}.bind(this));
}
},setupSlots:function(_169){
var that=this;
var _16b=$A($R(1,_169));
_16b.reverse(false).each(function(i){
if(!$(that.slotID+i)){
var slot=new Element("div",{"id":that.slotID+i,"class":that.slotClass});
that.form.insert({top:slot});
}
});
return _16b.inject($H(),function(hash,i){
hash.set(i,false);
return hash;
});
},generate_item_id:function(_170){
return "item"+this.uuid+"_"+_170.toLowerCase().replace(/_/g,"__").replace(/ /g,"_");
},updateSampleContent:function(){
if(this.sampleContent&&this.restype){
var _171=this.sampleContent.up("p");
if(!this.filled){
_171.hide();
_171.next("p.noSampleContent").hide();
this.sampleContent.update();
}else{
var that=this;
new Ajax.Request("/listen/tune",{parameters:Object.extend({"ajax":1},this.form.serialize(true)),onComplete:function(_173){
var _174=new LFM.Ajax.Response(_173);
if(_174.isError()){
var _175=that.sampleContent.up("p");
that.sampleContent.update();
_175.hide();
_175.next("p.noSampleContent").hide();
_175.next("p.sampleContentError").show();
}else{
var _176=_174.get("sampleContent");
var _175=that.sampleContent.up("p");
if(_176&&_176.items&&_176.items.length){
var _177=_176.items.inGroupsOf(3)[0].collect(function(item){
if(!item){
throw $break;
}
return item.res.name;
}).join(", ");
that.sampleContent.update(_177);
_175.next("p.noSampleContent").hide();
_175.next("p.sampleContentError").hide();
_175.show();
}else{
that.sampleContent.update();
_175.hide();
_175.next("p.sampleContentError").hide();
_175.next("p.noSampleContent").show();
}
}
}});
}
}
},fetchResourceJSON:function(_179,_17a){
var that=this;
new Ajax.Request("/ajax/getResource",{method:"get",parameters:{"type":this.restype,"name":_179},onComplete:function(_17c){
var _17d=new LFM.Ajax.Response(_17c);
that.onResourceJSON(_17d,_17a);
}});
},deselect:function(_17e){
var slot=this.selections.unset(_17e);
this.slots.set(slot,false);
var _180=$(_17e);
_180.remove();
$(_17e+"_input").remove();
this.filled--;
var _181=this.matching_choices.get(_17e);
if(_181){
_181.removeClassName("disabled");
}
this.updateSampleContent();
if(this.onDeselect){
this.onDeselect(_180);
}
},select:function(_182){
var _183=this.generate_item_id(_182);
if(this.selections.get(_183)){
this.deselect(_183);
return false;
}
if(this.filled>=this.length){
return false;
}
if(this.choices){
var _184=this.choices.select("li").find(function(item){
return (item.down("a").innerHTML==_182);
});
this.matching_choices.set(_183,_184);
}
this.form.insert(new Element("input",{"type":"hidden","name":"names[]","value":_182,"id":_183+"_input"}));
var _186=new Element("a",{"href":"#","class":this.itemClass,"id":_183}).observe("click",function(e){
e.stop();
this.deselect(_183);
}.bind(this));
_186.insert(new Element("span").update(_182));
var _188=this.slots.find(function(item){
return (item.value===false);
}).key;
var _18a=$(this.slotID+_188);
_18a.insert(_186);
this.selections.set(_183,_188);
this.slots.set(_188,true);
this.filled++;
if(_184){
_184.addClassName("disabled");
}
this.updateSampleContent();
if(this.onResourceJSON){
this.fetchResourceJSON(_182,_186);
}
if(this.onSelect){
this.onSelect(_182,_186);
}
}})});
document.observe("dom:loaded",function(_18b){
if($("noobStrapSubmit")){
new LFM.Form.Placeholder("noobStrapTextarea");
$("noobStrapSubmit").observe("click",function(e){
if($F("noobStrapTextarea")&&$F("noobStrapTextarea")!=$F("noobStrapPlaceholder")){
LFM.Omniture.setLink(e.element(),"Textarea add to Library");
LFM.Omniture.prepareEvar("ClickSource",LFM.get("Page","manualAddLocation"));
LFM.Omniture.trackEvents("AddtoLibrary");
}else{
e.stop();
}
});
}
});
var s,s_gi;
if(LFM.get("config","DEVELOPMENT_SERVER")){
LFM.OmnitureAccount="cbslastfmtest";
}else{
LFM.OmnitureAccount="cbslastfm";
}
(function(){
var _18d=Class.create({blocked:false,initialize:function(){
this.resetTracker();
},resetTracker:function(){
if(s_gi){
this.tracker=s_gi(LFM.OmnitureAccount);
return this.tracker;
}
this.blocked=true;
return false;
},isBlocked:function(){
return this.blocked;
},event:function(name){
return _18f.events[name];
},prop:function(name){
return _18f.props[name];
},evar:function(name){
return _18f.evars[name];
},setProp:function(name,_193){
if(this.isBlocked()){
return false;
}
this.tracker[this.prop(name)]=_193;
},getProp:function(name){
if(this.isBlocked()){
return false;
}
return this.tracker[this.prop(name)];
},setEvar:function(name,_196){
if(this.isBlocked()){
return false;
}
this.tracker[this.evar(name)]=_196;
},getEvar:function(name){
if(this.isBlocked()){
return false;
}
return this.tracker[this.evar(name)];
},currentEvars:[],prepareEvar:function(name,_199){
if(this.isBlocked()){
return false;
}
this.setEvar(name,_199);
this.currentEvars.push(name);
},clearEvars:function(){
if(this.isBlocked()){
return false;
}
this.currentEvars.each(function(name){
this.setEvar(name,"");
}.bind(this));
this.currentEvars.clear();
},linkElement:null,linkTitle:null,setLink:function(_19b,_19c){
if(this.isBlocked()){
return false;
}
this.linkElement=_19b;
this.linkTitle=_19c;
},clearLink:function(){
if(this.isBlocked()){
return false;
}
this.linkElement=null;
this.linkTitle=null;
},setLinkTrackEvars:function(){
if(this.isBlocked()){
return false;
}
var _19d=["events"];
var _19e={};
this.currentEvars.each(function(name){
var _1a0=this.evar(name);
_19d.push(_1a0);
_19e[name+"/"+_1a0]=this.getEvar(name);
}.bind(this));
this.tracker.linkTrackVars=_19d.join(",");
return _19e;
},setLinkTrackEvents:function(){
if(this.isBlocked()){
return false;
}
var _1a1=[];
var _1a2=Array.prototype.join.call(arguments,",");
for(var i=0;i<arguments.length;i++){
_1a1.push(this.event(arguments[i]));
}
var _1a4=_1a1.join(",");
this.tracker.events=_1a4;
this.tracker.linkTrackEvents=_1a4;
return _1a2;
},track:function(_1a5){
if(this.isBlocked()){
return false;
}
this.tracker.tl(this.linkElement||true,"o",this.linkTitle||_1a5);
},trackEvents:function(){
if(this.isBlocked()){
return false;
}
this.resetTracker();
var _1a6=this.setLinkTrackEvents.apply(this,arguments);
var _1a7=this.setLinkTrackEvars();
var _1a8="TRACK: "+_1a6;
if(this.linkTitle){
_1a8+=" ("+this.linkTitle+") ";
}
LFM.log(_1a8);
LFM.info(this.linkElement);
LFM.dir(_1a7);
this.track(_1a6);
this.clearEvars();
this.clearLink();
}});
var _18f={events:{Registration:"event1",ClientDownload:"event2",EventAttendance:"event3",RadioPaneSwitch:"event4",ContentStart:"event5",StopPlayer:"event6",MusicPlay:"event7",Share:"event8",AddtoLibrary:"event9",BanTrack:"event10",LoveTrack:"event11",PageView:"event12",SkipTrack:"event13",ShoutPost:"event14",JoinGroup:"event15",CommentPost:"event16",AddFriend:"event17",SendMessage:"event18",Buy:"event19",AddTags:"event20",AddToPlaylist:"event21",DeleteFriend:"event22",LeaveGroup:"event23",DeletePlaylist:"event24",ArtistDisambiguation:"event25",RadioLaunch:"event26",Click:"event27",PageScroll:"event28",WindowFocus:"event29",RadioError:"event30",Dialog:"event31",DropDown:"event32",HeaderSearch:"event33",HeaderSearchFocus:"event34"},props:{SiteSectionLevel1:"prop1",SiteSectionLevel2:"prop2",SiteSectionLevel3:"prop3",ArtistNameAH:"prop4",ArtistNameIP:"prop5",ArtistNameQZ:"prop6",GroupNameAH:"prop7",GroupNameIP:"prop8",GroupNameQZ:"prop9",LoggedIn:"prop10",AlbumName:"prop11",URLExtension:"prop12",ChartSubtype:"prop17",Hour:"prop18",Day:"prop19",TagNameAM:"prop20",TagNameNZ:"prop21",ArtistID:"prop22",GroupID:"prop23",TagID:"prop24",DiscussionTitle:"prop25",DiscussionID:"prop26",ChartTypeYear:"prop27",ChartTypeMonth:"prop28",ChartTypeTimeFrame:"prop29",StationName:"prop30",StationID:"prop31",UserLanguage:"prop33",EventNameAM:"prop36",EventNameNZ:"prop37",EventID:"prop38",CorrectArtistName:"prop47",TestGroupID:"prop49"},evars:{Country:"eVar1",PageName:"eVar2",Channel:"eVar3",ArtistNameAH:"eVar4",ArtistNameIP:"eVar5",ArtistNameQZ:"eVar6",GroupNameAH:"eVar7",GroupNameIP:"eVar8",GroupNameQZ:"eVar9",LoggedIn:"eVar10",AlbumNameAH:"eVar11",AlbumNameIP:"eVar12",AlbumNameQZ:"eVar13",TitleAH:"eVar14",TitleIP:"eVar15",TitleQZ:"eVar16",StationNameAH:"eVar17",StationNameIP:"eVar18",StationNameQZ:"eVar19",ArtistID:"eVar20",GroupID:"eVar21",TagID:"eVar22",StationID:"eVar23",TagNameAM:"eVar24",TagNameNZ:"eVar25",ClickSource:"eVar26",DownloadPlatform:"eVar27",BuyDestination:"eVar28",FirstVisit:"eVar29",URLExtension:"eVar30",NewOrRepeatVisitors:"eVar31",DaysSinceLastVisit:"eVar32",AdSource:"eVar33",AdID:"eVar34",AdSize:"eVar35",MemberUserID:"eVar36",UserLanguage:"eVar37",UserScrobbles:"eVar38",LFMIABBrand:"eVar39",EventNameAM:"eVar40",EventNameNZ:"eVar41",EventID:"eVar42",ErrorCode:"eVar43",DialogType:"eVar44",HeaderSearchAction:"eVar45",SearchLength:"eVar46",SearchType:"eVar47",HeaderSearchRestype:"eVar48",TestGroupID:"eVar49"}};
document.observe("omniture:load",function(e){
LFM.set("Omniture",new _18d());
});
})();
LFM.set("Page",{Extract:{trackIds:function(_1aa){
_1aa=$(_1aa)||document.body;
return _1aa.select("*[data-track-id]").collect(function(elem){
return elem.getAttribute("data-track-id");
});
}}});
LFM.set("Input",{RichText:Class.create({hasFocus:false,busy:false,wordSeparators:" \t\n,.()!?|=-\\",initialize:function(div,_1ad){
this.div=$(div);
this.options=_1ad?_1ad:{};
this.caret=this.div.down("span.caret");
this.caret.style.color="white";
this.caret.style.borderLeft="1px solid white";
this.textarea=this.div.next("textarea");
Event.observe(this.textarea,"keypress",this.keyPress.bindAsEventListener(this));
Event.observe(this.textarea,"keydown",this.keyDown.bindAsEventListener(this));
Event.observe(window,"keydown",this.keyDown.bindAsEventListener(this));
Event.observe(this.div,"click",this.focus.bindAsEventListener(this));
Event.observe(window,"blur",this.blur.bindAsEventListener(this));
new Ajax.Request("/ajax/getArtists",{onComplete:function(resp){
var out=resp.responseText.evalJSON();
this.artists=out.items;
}.bind(this)});
},keyDown:function(e){
e=window.event||e;
var _1b1=e.charCode||e.keyCode||e.which;
var s=String.fromCharCode(_1b1);
this.cancelOnDown=false;
if(this.specialKeyDown(_1b1,e)){
Event.stop(e);
this.cancelOnDown=true;
return false;
}
if(e.ctrlKey){
s=s.toLowerCase();
if(s=="a"||s=="m"){
Event.stop(e);
var sel=this.getSelection();
var name=this.getSelectedText(sel);
var _1b5;
if(s=="a"){
_1b5="<lfm:artist>"+name.strip().escapeHTML()+"</lfm:artist>";
}else{
if(s=="m"){
_1b5="<lfm:artist name=\""+name.strip().escapeHTML()+"\"><lfm:image size=\"small\" /></lfm:artist>";
}
}
this.replaceSelection(_1b5,sel);
}
}
},getSelection:function(){
var sel;
if(window.getSelection){
sel=window.getSelection();
}else{
if(document.selection){
sel=document.selection.createRange();
}
}
return sel;
},getSelectedText:function(sel){
var name="";
var next=sel.anchorNode;
while(next){
if(next.nodeValue){
name+=next.nodeValue;
}
if(next==sel.focusNode){
break;
}
next=next.nextSibling;
}
return name;
},replaceSelection:function(_1ba,sel){
new Ajax.Request("/ajax/richtextrenderer",{method:"post",parameters:{richtext:_1ba},onComplete:function(resp){
var out=resp.responseText.evalJSON();
var _1be=sel.getRangeAt(0);
$(document.body).insert({bottom:out.rendered});
var node=$(document.body).lastChild;
node.remove();
_1be.deleteContents();
_1be.insertNode(node);
this.textarea.value+=out.richtext;
}});
},keyPress:function(e){
e=window.event||e;
var _1c1=e.charCode||e.keyCode||e.which;
var s=String.fromCharCode(_1c1);
if(this.specialKeyPress(_1c1,e)){
Event.stop(e);
return false;
}
if(e.altKey){
Event.stop(e);
return false;
}
if(!this.hasFocus||e.element()==window){
return;
}
var prev=this.caret.previousSibling;
if(prev&&prev.nodeType==3&&prev.nodeValue.strip().empty()&&prev.nodeValue!="\n"){
var _1c4=prev.parentNode;
var _1c5=prev.ownerDocument.createRange();
_1c5.setStartBefore(prev);
var _1c6=_1c5.createContextualFragment(s);
var n=_1c4.replaceChild(_1c6,prev);
var _1c5=this.caret.ownerDocument.createRange();
_1c5.setStartBefore(this.caret.previousSibling);
var _1c8=_1c5.createContextualFragment(" ");
_1c4.insertBefore(_1c8,this.caret.previousSibling);
}else{
this.caret.insert({before:s});
}
},_delete:function(prev){
var _1ca=false;
var _1cb=prev.previousSibling;
if(prev.nodeType==1){
if(prev.nodeName=="A"){
var _1cc=prev.firstChild;
prev.parentNode.replaceChild(_1cc,prev);
_1cc.unlinked=true;
var _1cd=this.textarea.selectionStart;
var tag="";
var i=_1cd-2;
while(i>=0&&(this.textarea.value.charAt(i)!="/")){
tag=this.textarea.value.charAt(i)+tag;
i--;
}
var _1d0=i;
var _1d1="<"+tag+">";
var _1d2=_1d1.length;
while(i>=0&&(this.textarea.value.substr(i,_1d2)!=_1d1)){
i--;
}
var _1d3=this.textarea.value.substr(0,i);
var _1d4=i+_1d2;
_1d3+=this.textarea.value.substr(_1d4,_1d0-_1d4-1);
_1d3+=this.textarea.value.substr(_1cd);
this.textarea.value=_1d3;
return;
}
}
if(prev.nodeValue=="\n"){
_1ca=true;
}
var _1d5=prev.parentNode;
if(prev.nodeType==3){
var _1cd=this.textarea.selectionStart;
var _1d3=this.textarea.value.substr(0,_1cd-1);
if(_1cd<this.textarea.value.length){
_1d3+=""+this.textarea.value.substr(_1cd);
}
this.textarea.value=_1d3;
if(this.textarea.createTextRange){
var _1d6=this.textarea.createTextRange();
_1d6.moveStart("character",_1cd-1);
_1d6.moveEnd("character",_1cd-1);
_1d6.select();
}else{
if(this.textarea.setSelectionRange){
this.textarea.setSelectionRange(_1cd-1,_1cd-1);
}
}
if(prev.nodeValue.length>1){
prev.nodeValue=prev.nodeValue.substr(0,prev.nodeValue.length-1);
return;
}
}else{
if(prev.nodeName=="BR"){
this.textarea.value=this.textarea.value.substr(0,this.textarea.value.length-6);
}
}
_1d5.removeChild(prev);
if(_1cb&&_1cb.nodeType==3&&_1cb.nodeValue.strip().empty()&&_1cb.nodeValue!="\n"){
var _1d7=_1cb.ownerDocument.createRange();
_1d7.setStartAfter(_1cb);
var nbsp=_1d7.createContextualFragment("&nbsp;");
_1d5.replaceChild(nbsp,_1cb);
_1cb=nbsp;
}
if(_1ca){
var _1cb=prev.previousSibling;
_1d5.removeChild(prev);
this.caret.previousSibling=_1cb;
this.caret.remove();
}
if(_1cb){
_1d5.insertBefore(this.caret,_1cb.nextSibling);
}
},specialKeyDown:function(_1d9,e){
if(_1d9>=37&&_1d9<=40&&!(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)){
var prev=this.caret.previousSibling;
var next=this.caret.nextSibling;
var _1dd=this.caret.parentNode;
if(_1d9==37&&prev){
this.caret.remove();
_1dd.insertBefore(this.caret,prev);
var _1de=this.textarea.selectionStart;
if(this.textarea.createTextRange){
var _1df=this.textarea.createTextRange();
_1df.moveStart("character",_1de-1);
_1df.moveEnd("character",_1de-1);
_1df.select();
}else{
if(this.textarea.setSelectionRange){
this.textarea.setSelectionRange(_1de-1,_1de-1);
}
}
}else{
if(_1d9==39&&next){
this.caret.remove();
_1dd.insertBefore(this.caret,next.nextSibling);
var _1de=this.textarea.selectionStart;
if(this.textarea.createTextRange){
var _1df=this.textarea.createTextRange();
_1df.moveStart("character",_1de+1);
_1df.moveEnd("character",_1de+1);
_1df.select();
}else{
if(this.textarea.setSelectionRange){
this.textarea.setSelectionRange(_1de+1,_1de+1);
}
}
}
}
this.textarea.focus();
return true;
}else{
if(_1d9==46){
if(this.caret.nextSibling){
this.moveTextAreaCursorBy(1);
var next=this.caret.nextSibling;
this.caret.remove();
next.parentNode.insertBefore(this.caret,next.nextSibling);
this._delete(next);
}
return true;
}else{
if(_1d9==8){
if(this.caret.previousSibling){
this._delete(this.caret.previousSibling);
}
return true;
}else{
if(_1d9==13){
this.caret.insert({before:"<br />"});
this.textarea.value+="<br />";
return true;
}
}
}
}
},specialKeyPress:function(_1e0,e){
var s=String.fromCharCode(_1e0);
if(this.cancelOnDown){
return true;
}
if(this.wordSeparators.indexOf(s)>=0){
var _1e3=this.caret;
if(_1e3.previousSibling&&_1e3.previousSibling.nodeType==3&&!_1e3.previousSibling.unlinked){
var back=0;
var name="";
var _1e6;
while((_1e3=_1e3.previousSibling)&&_1e3.nodeType==3&&_1e3.nodeValue.unescapeHTML().strip()!=""){
name=_1e3.nodeValue+name;
back++;
}
_1e6=_1e3;
var _1e7=false;
name=name.strip();
if(s!="."&&name.match(/^((ht|f)tp(s?)\:\/\/|~\/|\/)?([\w]+:\w+@)?([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((\/?\w+\/)+|\/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?/)){
_1e7="<a href=\""+name.escapeHTML()+"\">"+name.escapeHTML()+"</a>";
}else{
var _1e8=name.toUpperCase();
var _1e9=this.artists.find(function(a){
return a.toUpperCase()==_1e8;
});
if(_1e9){
_1e7="<lfm:artist>"+name.escapeHTML()+"</lfm:artist>";
}
}
if(_1e7){
var _1eb=this.textarea.selectionStart;
new Ajax.Request("/ajax/richtextrenderer",{method:"post",parameters:{richtext:_1e7},onComplete:function(resp){
var out=resp.responseText.evalJSON();
var _1ee=_1e6.nextSibling;
for(;back>0;back--){
var tmp=_1ee.nextSibling;
_1ee.parentNode.removeChild(_1ee);
_1ee=tmp;
}
if(_1e6){
var _1f0=_1e6.ownerDocument.createRange();
_1f0.setStartAfter(_1e6);
var _1f1=_1f0.createContextualFragment(out.rendered);
_1e6.parentNode.insertBefore(_1f1,_1e6.nextSibling);
}else{
this.div.insert({top:out.rendered});
}
var _1f2=this.textarea.value.substr(0,_1eb-name.length);
_1f2+=out.richtext;
_1f2+=""+this.textarea.value.substr(_1eb);
this.textarea.value=_1f2;
}.bind(this)});
}
}
}else{
if(s=="/"){
var _1e3=this.caret.previousSibling;
if(!_1e3||_1e3.nodeValue!="["){
return false;
}
var _1f3=_1e3;
var _1f4="";
var tag="";
var back=2;
while((_1e3=_1e3.previousSibling)&&_1e3.nodeType==3&&_1e3.nodeValue!="]"){
_1f4=_1e3.nodeValue+_1f4;
back++;
}
while((_1e3=_1e3.previousSibling)&&_1e3.nodeType==3&&_1e3.nodeValue!="["){
tag=_1e3.nodeValue+tag;
back++;
}
if(tag=="artist"){
_1f4=_1f4.strip();
var _1eb=this.textarea.selectionStart;
var _1e7="<lfm:artist>"+_1f4.escapeHTML()+"</lfm:artist>";
new Ajax.Request("/ajax/richtextrenderer",{method:"post",parameters:{richtext:_1e7},onComplete:function(resp){
var out=resp.responseText.evalJSON();
_1e3=_1f3;
for(var i=back;i>0;i--){
var tmp=_1e3.previousSibling;
_1e3.parentNode.removeChild(_1e3);
_1e3=tmp;
}
if(this.caret.previousSibling){
var rm=this.caret.previousSibling;
rm.parentNode.removeChild(rm);
}
this.caret.insert({before:out.rendered});
var _1fb=this.textarea.value.substr(0,_1eb-back-1);
_1fb+=""+out.richtext;
_1fb+=""+this.textarea.value.substr(_1eb);
this.textarea.value=_1fb;
}.bind(this)});
return true;
}
}
}
if(s==" "){
this.caret.insert({before:"&nbsp;"});
this.textarea.value+=" ";
return true;
}
},moveTextAreaCursorBy:function(n){
var _1fd=this.textarea.selectionStart;
if(this.textarea.createTextRange){
var _1fe=this.textarea.createTextRange();
_1fe.moveStart("character",_1fd+n);
_1fe.moveEnd("character",_1fd+n);
_1fe.select();
}else{
if(this.textarea.setSelectionRange){
this.textarea.setSelectionRange(_1fd+n,_1fd+n);
}
}
},focus:function(e){
Event.stop(e);
var _200=e.rangeParent;
if(this.caret.parentNode){
this.caret.remove();
}
if(_200!=this.caret&&_200!=this.div){
_200.parentNode.insertBefore(this.caret,_200.nextSibling);
}else{
this.div.appendChild(this.caret);
}
this.hasFocus=true;
this.textarea.focus();
this.startBlinkingCaret();
},blur:function(){
this.hasFocus=false;
this.stopBlinkingCaret();
},startBlinkingCaret:function(){
this.caret.style.borderLeft="1px solid black";
},stopBlinkingCaret:function(){
this.blinkCaret();
},blinkCaret:function(){
this.caret.style.borderLeft=this.caret.style.borderLeft=="1px solid black"?"1px solid white":"1px solid black";
}})});
var Scroller=Class.create({initialize:function(_201){
this.scroller=$(_201);
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 _202=this.getVisibleWidth();
modulo=_202%this.imageWidth;
_202=_202-modulo;
if(_202>this.getWidth()){
_202=this.getWidth();
}
Element.setStyle(this.scroller,{maxWidth:_202+"px"});
var _203=this.getWidth()*-1+Math.abs(this.getOffset())+this.getVisibleWidth();
var _204=(this.getWidth()-this.getVisibleWidth())*-1;
this.setOffset(_204);
this.refreshButtonStates();
},onResize:function(_205){
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 _206=Element.getStyle(sampleImage,"border-left-width").replace("px","")*1;
if(!isNaN(_206)){
this.imageWidth=this.imageWidth+_206;
}
var _207=Element.getStyle(sampleImage,"border-right-width").replace("px","")*1;
if(!isNaN(_207)){
this.imageWidth=this.imageWidth+_207;
}
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(_208){
var blah=this.getWidth()-this.getVisibleWidth();
this.imageTrack.setStyle({left:_208+"px"});
},scrollLeft:function(_20a){
if(!this.isScrolling&&this.getOffset()<0){
var _20b=Math.abs(this.getOffset());
var _20c=this.getVisibleWidth();
if(_20c>_20b){
_20c=_20b;
}
this.scroll(_20c);
}
this.refreshButtonStates();
this.leftScrollButton.blur();
Event.stop(_20a);
},scrollRight:function(_20d){
if(!this.isScrolling&&(Math.abs(this.getOffset())+this.getVisibleWidth())<this.getWidth()){
var _20e=this.getWidth()-(Math.abs(this.getOffset())+this.getVisibleWidth());
var _20f=this.getVisibleWidth();
if(_20f>_20e){
_20f=_20e;
}
_20f=_20f*-1;
this.scroll(_20f);
}
this.refreshButtonStates();
this.rightScrollButton.blur();
Event.stop(_20d);
},scroll:function(_210,_211){
if(!this.isScrolling||_211){
new Effect.Move(this.imageTrack,{x:_210,y:0,mode:"relative",duration:0.5,afterFinish:this.afterScrolling.bind(this),beforeStart:this.beforeScrolling.bind(this),queue:{position:"end",scope:"scroller"}});
}
},beforeScrolling:function(_212){
this.isScrolling=true;
this.totalDelta=this.totalDelta+_212.options.x;
},afterScrolling:function(_213){
this.isScrolling=false;
this.totalDelta=this.totalDelta-_213.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 _214=this.getSelectedImage().id;
if(_214&&this.getImageWidth()){
_214=(_214.substring(5)*1)-1;
var _215=_214*this.getImageWidth();
_215=_215-this.getMiddle()+this.getImageWidth()/2;
if(_215>(this.getWidth()-this.getVisibleWidth())){
_215=this.getWidth()-this.getVisibleWidth();
}
_215=_215*-1;
if(_215>0){
_215=0;
}
Element.setStyle(this.imageTrack,{left:_215+"px"});
this.refreshButtonStates();
}
}
}});
LFM.set("Resource",{Shoutbox:Class.create({initialize:function(_216){
this.shoutbox=_216;
this.shoutbox.container=$(this.shoutbox.container);
this.textarea=$("shoutmsg");
this.overCharLimit=false;
if($("shoutPost")){
$("shoutPost").observe("submit",this.submit.bindAsEventListener(this));
this.textarea.observe("keyup",this.calculateCharCount.bindAsEventListener(this));
}
this.deleteButtons=this.shoutbox.container.select(".delete");
this.deleteButtons.each(function(_217){
_217.observe("click",this.bin.bindAsEventListener(this));
}.bind(this));
if($("shoutboxPopup")){
$("shoutboxPopup").observe("click",this.popup.bindAsEventListener(this));
}
if($("shoutPostToggler")&&$("shoutPostToggler").down("a")){
$("shoutPostToggler").down("a").observe("click",this.toggleInput.bindAsEventListener(this));
}
if($("shoutPostAgain")){
$("shoutPostAgain").observe("click",this.toggleInput.bindAsEventListener(this));
}
},submit:function(e){
e.stop();
if($F(this.textarea)==""){
return;
}
this.toggleInput(e);
$("shoutPostWait").show();
var url=this.shoutbox.destination;
if(url.substr(-1)!="/"){
url+="/";
}
url+="add";
var pars=$("shoutPost").serialize()+"&restype="+this.shoutbox.restype+"&resid="+this.shoutbox.resid+"&lang="+this.shoutbox.lang+"&ajax=1";
var _21b=new Ajax.Request(url,{method:"post",parameters:pars,onSuccess:this.addShout.bind(this)});
},addShout:function(_21c){
if(this.shoutbox.restype==20){
LFM.Omniture.trackEvents("CommentPost");
}else{
LFM.Omniture.trackEvents("ShoutPost");
}
var _21d=$("shoutList");
$("shoutList").insert({before:_21c.responseText});
if(this.shoutbox.order=="asc"){
_21d.innerHTML=_21d.innerHTML+$("newShoutList").innerHTML;
}else{
_21d.innerHTML=$("newShoutList").innerHTML+_21d.innerHTML;
}
$("newShoutList").remove();
$("shoutList").select("li").each(function(li){
var _21f=li.down(".delete");
if(_21f){
_21f.observe("click",this.bin.bindAsEventListener(this));
}
}.bind(this));
this.textarea.value="";
$("shoutPostWait").hide();
if($("noShouts")){
$("noShouts").remove();
}
if($("shoutPostToggler")){
$("shoutPostToggler").hide();
}
$("shoutPostAgain").show();
this.updateCharCountDisplay(0);
},bin:function(_220){
_220.stop();
var _221=_220.findElement("li");
var form=_221.down("form");
var _223=this.shoutbox.destination;
if(_223.substr(-1)!="/"){
_223+="/";
}
_223+="delete";
form.action=_223;
var _224=this.shoutbox.restype;
var _225=this.shoutbox.resid;
var _226=new LFM.Dialog({content:LFM.String.deleteMessagePrompt,confirmText:LFM.String.deleteButtonText,action:_223,onConfirm:function(e){
e.stop();
this.hide();
form.request({parameters:{restype:_224,resid:_225,ajax:1},onSuccess:function(req){
if(req.responseText=="OK"){
new Effect.Fade(_221,{duration:0.2});
}
}});
}});
_226.show();
},toggleInput:function(e){
if($("shoutPost").visible()){
$("shoutPost").hide();
}else{
$("shoutPostAgain").hide();
$("shoutPost").show();
this.textarea.focus();
}
e.stop();
},calculateCharCount:function(){
var _22a=this.textarea.value.length;
this.updateCharLimit(_22a);
this.updateCharCountDisplay(_22a);
},updateCharCountDisplay:function(_22b){
charCounter=$("sbCharCount");
var _22c=this.shoutbox.charlimitMessage;
if(charCounter){
_22c=_22c.replace(/CURRENTCHARS/,_22b);
_22c=_22c.replace(/MAXCHARS/,this.shoutbox.charlimit);
charCounter.innerHTML=_22c;
}
},updateCharLimit:function(_22d){
var _22e=(_22d>this.shoutbox.charlimit);
if(!this.overCharLimit&&_22e){
$("sbCharCount").up().addClassName("overCharLimit");
$("sbPost").disable();
this.textarea.focus();
}
if(this.overCharLimit&&!_22e){
$("sbCharCount").up().removeClassName("overCharLimit");
$("sbPost").enable();
}
this.overCharLimit=_22e;
}})});
LFM.set("Display",{TableDragDrop:Class.create({initialize:function(_22f,_230){
this.draggedRow=null;
this.rowWithBorderAndShit=null;
this.mouseOffset=null;
this.oldY=0;
this.dragged=false;
if(_230&&_230.dragHandle){
this.dragHandle=_230.dragHandle;
}else{
this.dragHandle=false;
}
this.table=$(_22f);
this.table.addClassName("draggable");
this.table.observe("mousedown",this.onMouseDown.bindAsEventListener(this));
if(this.dragHandle){
this.table.addClassName("withDragHandles");
}else{
this.table.addClassName("allDraggable");
}
this.table.down("tbody").observe("click",this.onClick.bindAsEventListener(this));
},onClick:function(_231){
if(this.dragged){
_231.stop();
this.dragged=false;
}
},getMouseOffset:function(_232,_233){
var _234=_232.cumulativeOffset();
return {x:_233.pointerX()-_234.left,y:_233.pointerY()-_234.top};
},onMouseDown:function(_235){
if(!_235.isLeftClick()){
return;
}
if(this.dragHandle&&!_235.element().hasClassName(this.dragHandle)){
return;
}
if((tag_name=_235.element().tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){
return;
}
this.draggedRow=_235.findElement("tr");
if(this.draggedRow.previous("tr")){
this.rowWithBorderAndShit=this.draggedRow.previous("tr");
this.rowWithBorderAndShit.addClassName("beforeDraggedRow");
}else{
if(this.draggedRow.next("tr")){
this.rowWithBorderAndShit=this.draggedRow.next("tr");
this.rowWithBorderAndShit.addClassName("afterDraggedRow");
}
}
this.mouseOffset=this.getMouseOffset(this.draggedRow,_235);
_235.stop();
this.draggedRow.addClassName("dragging");
this.documentOnMouseMove=this.onMouseMove.bindAsEventListener(this);
this.documentOnMouseUp=this.onMouseUp.bindAsEventListener(this);
document.observe("mousemove",this.documentOnMouseMove);
document.observe("mouseup",this.documentOnMouseUp);
this.rows=this.table.down("tbody").select("tr");
},onMouseMove:function(_236){
var y=_236.pointerY()-this.mouseOffset.y;
_236.stop();
if(y!=this.oldY){
var _238=y>this.oldY;
this.oldY=y;
var _239=this.findDropTargetRow(y);
if(_239){
this.dragged=true;
if(_238&&this.draggedRow!=_239){
this.draggedRow.parentNode.insertBefore(this.draggedRow,_239.nextSibling);
}else{
if(!_238&&this.draggedRow!=_239){
this.draggedRow.parentNode.insertBefore(this.draggedRow,_239);
}
}
}
}
},onMouseUp:function(_23a){
_23a.stop();
this.draggedRow.removeClassName("dragging");
this.rowWithBorderAndShit.removeClassName("beforeDraggedRow");
this.rowWithBorderAndShit.removeClassName("afterDraggedRow");
if(this.onDrop){
this.onDrop(this.table,this.draggedRow);
}
this.draggedRow=null;
document.stopObserving("mousemove",this.documentOnMouseMove);
document.stopObserving("mouseup",this.documentOnMouseUp);
},findDropTargetRow:function(y){
return this.rows.find(function(row){
var rowY=row.cumulativeOffset().top;
var _23e=row.getHeight()/2;
if((y>rowY-_23e)&&(y<(rowY+_23e))){
return true;
}else{
return false;
}
});
return null;
}})});
LFM.set("Resource",{Users:Class.create({initialize:function(_23f){
this.container=$("users");
this.container.observe("click",function(_240){
log("clicked container");
var _241=_240.element();
if(_241.match("a.delete img")){
_240.stop();
var _242=_241.up("li");
if(_242){
this.bin(_242);
}
}
}.bind(this));
},bin:function(_243){
var _244=new LFM.Dialog({resource:_243.getResource(),content:LFM.String.deleteFriendPrompt,confirmText:LFM.String.deleteButtonText,action:"friends/delete",onDone:function(_245){
var _246=_245.getResourceElement();
new Effect.Fade(_246,{duration:0.5});
},showDone:false});
_244.show();
}})});
LFM.Ajax.LazyRequest=Class.create({options:{laziness:2,beforeSend:false},_defaultAjaxOptions:{method:"post",parameters:{ajax:true,formtoken:LFM.get("Session","formtoken")}},_timeoutId:false,_ajaxUrl:false,_ajaxOptions:{},_lastTime:0,initialize:function(url,_248){
Object.extend(this.options,_248);
this._ajaxUrl=url;
if(this.options.lazyness){
this.options.laziness=this.options.lazyness;
}
},send:function(_249){
if(this._intervalId){
clearTimeout(this._intervalId);
}
var now=new Date();
this._lastTime=now.getTime()/1000;
this._ajaxOptions=this._defaultAjaxOptions;
if(_249){
if(_249.parameters){
Object.extend(this._ajaxOptions.parameters,_249.parameters);
_249.paramaters=this._ajaxOptions.parameters;
}
Object.extend(this._ajaxOptions,_249);
}
this._ajaxOptions.parameters.time=this._lastTime;
this._intervalId=setTimeout(this._performSend.bind(this),this.options.laziness*1000);
},_beforeSend:function(){
if(!this.options.beforeSend){
return;
}
Object.extend(this._ajaxOptions.parameters,this.options.beforeSend());
},_performSend:function(){
this._beforeSend();
new Ajax.Request(this._ajaxUrl,this._ajaxOptions);
}});
LFM.Ajax.Response=Class.create({initialize:function(_24b){
try{
if(typeof _24b=="string"){
this.ajaxResponse=_24b.evalJSON();
}else{
if(_24b.responseText){
this.ajaxResponse=_24b.responseText.evalJSON();
}else{
this.ajaxResponse=_24b;
}
}
}
catch(err){
this.ajaxResponse={errormessage:"Invalid JSON response"};
}
this.data=$H(this.ajaxResponse.data);
if(this.isError()){
this.printError();
}
},get:function(key){
return this.data.get(key);
},set:function(key,_24e){
return this.data.set(key,_24e);
},toObject:function(){
return this.data.toObject();
},isError:function(){
return !this.ajaxResponse.success;
},isSuccess:function(){
return !this.isError();
},getErrorCode:function(){
return this.ajaxResponse.errorcode?this.ajaxResponse.errorcode:null;
},getErrorMessage:function(){
return this.ajaxResponse.errormessage?this.ajaxResponse.errormessage:null;
},errorIs:function(code){
return this.getErrorCode()===code;
},isUnauthorised:function(){
return this.errorIs(LFM.Ajax.Response.Errors.UNAUTHORISED);
},printError:function(){
if(LFM.get("config","DEVELOPMENT_SERVER")){
if(!this.ajaxResponse){
LFM.warn("Error [No response]");
}else{
LFM.warn("Error ["+this.getErrorCode()+"]: "+this.getErrorMessage());
}
}
},getResource:function(){
return this.ajaxResponse.resource?this.ajaxResponse.resource:null;
},getResourceElement:function(){
return LFM.getResourceElement(this.getResource());
},buildResourceLink:function(){
var _250=this.getResource();
if(_250){
var link=new Element("a",{"href":_250.url});
if(_250.name){
link.update(_250.name);
}
return link;
}
return false;
},followRedirect:function(){
if(this.ajaxResponse.redirect){
window.location.href=this.ajaxResponse.redirect;
return true;
}else{
return false;
}
}});
LFM.Ajax.Response.Errors={UNAUTHORISED:401};
LFM.Ajax.setUserPref=function(pref,_253,_254){
new Ajax.Request("/ajax/setUserPref",{parameters:{formtoken:LFM.Session.formtoken,pref:pref,value:_253},onComplete:function(_255){
var _256=new LFM.Ajax.Response(_255);
if(_254){
_254(_256);
}
}});
};
LFM.Ajax.StatusHolder=Class.create({initialize:function(_257,_258){
this.status="idle";
this.element=$(_257);
this.options={position:"after"};
Object.extend(this.options,_258);
this.indicator=$(this.element.identify()+"_statusHolder");
if(this.indicator){
if(this.indicator.hasClassName("success")){
this.status="success";
}else{
if(this.indicator.hasClassName("failure")){
this.status="failure";
}else{
if(this.indicator.hasClassName("progress")){
this.status="busy";
}
}
}
}else{
this.indicator=document.createElement("img");
this.indicator=Element.extend(this.indicator);
this.indicator.src=LFM.Session.staticHost+"/tablestyles/pixel.gif";
this.indicator.height=16;
this.indicator.width=16;
if(this.options.position=="after"){
this.element.parentNode.insertBefore(this.indicator,this.element.nextSibling);
}else{
if(this.options.position=="before"){
this.element.parentNode.insertBefore(this.indicator,this.element);
}else{
if(this.options.position=="top"){
this.element.insertBefore(this.indicator,this.element.firstChild);
}else{
if(this.options.position=="bottom"){
this.element.appendChild(this.indicator);
}
}
}
}
this.indicator=this.indicator.wrap("SPAN");
this.indicator.addClassName("statusHolder");
this.indicator.id=this.element.identify()+"_statusHolder";
}
},remove:function(){
this.indicator.remove();
},busy:function(){
this.idle();
this.status="busy";
this.indicator.addClassName("progress");
this.indicator.down("img").src=LFM.Session.staticHost+"/depth/global/progress_new.gif";
},isBusy:function(){
return this.status=="busy";
},success:function(){
this.idle();
this.status="success";
this.indicator.addClassName("success");
this.indicator.down("img").src=LFM.Session.staticHost+"/depth/forms/correct_new.gif";
},isSuccess:function(){
return this.status=="success";
},failure:function(){
this.idle();
this.status="failure";
this.indicator.addClassName("failure");
this.indicator.down("img").src=LFM.Session.staticHost+"/depth/forms/incorrect_new.gif";
},isFailure:function(){
return this.status=="failure";
},idle:function(){
this.status="idle";
this.indicator.removeClassName("progress");
this.indicator.removeClassName("success");
this.indicator.removeClassName("failure");
this.indicator.down("img").src=LFM.Session.staticHost+"/tablestyles/pixel.gif";
},isIdle:function(){
return this.status=="idle";
}});
LFM.set("Ajax",{Autocompleter:Class.create(Ajax.Autocompleter,{setOptions:function(_259){
this.options=Object.extend({method:"get"},_259||{});
},buildItem:function(name){
return new Element("a",{href:"#"}).update(name).wrap(new Element("li"));
},onComplete:function(_25b){
try{
var _25c=_25b.responseText.evalJSON();
}
catch(err){
return false;
}
if(_25c&&_25c.response.docs){
var list=new Element("ul");
var _25e=this.getToken();
list.insert(this.buildItem(_25e));
_25c.response.docs.each(function(_25f){
if(_25f.name.toLowerCase()!=_25e.toLowerCase()){
list.insert(this.buildItem(_25f.name));
}
}.bind(this));
this.updateChoices(new Element("div").update(list).innerHTML);
}
}})});
LFM.set("Ajax",{Multicompleter:Class.create(LFM.Ajax.Autocompleter,{initialize:function(_260,_261,url,_263){
this.baseInitialize(_260,_261,_263);
this.url=url;
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.onHide=function(_264,_265){
window.status="";
new Effect.Fade(_265,{duration:0.15});
};
this.form=this.element.up("form");
this.submit=this.form.down("input[type=submit]");
var _266={};
if(this.options.enabled){
_266["force"]=1;
}else{
this.show=function(){
return false;
};
this.startIndicator=function(){
return false;
};
}
if(LFM.Session.userName){
_266["username"]=LFM.Session.userName;
}
if(this.options.parameters){
_266=Object.extend(_266,this.options.parameters);
}
this.options.defaultParams=_266;
this.element.observe("keyup",this.onKeyUp.bindAsEventListener(this));
this.form.observe("submit",this.onSubmit.bindAsEventListener(this));
this.update.observe("mouseup",this.onClick.bindAsEventListener(this));
this.update.observe("mouseover",this.onHover.bindAsEventListener(this));
this.element.observe("focus",this.onFocus.bindAsEventListener(this));
this.init();
},init:function(){
},getUpdatedChoices:function(){
this.startIndicator();
var _267=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters={};
this.options.parameters[this.options.paramName]=this.getToken();
if(this.options.defaultParams){
Object.extend(this.options.parameters,this.options.defaultParams);
}
this.search();
},search:function(){
new Ajax.Request(this.url,this.options);
this.personalMatches=this.matchPersonalData(this.getToken());
},matchPersonalData:function(_268){
if(!_268.length||!this.personalData){
return false;
}
var _269=new RegExp(_268.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"),"i");
var _26a=[];
var _26b=this.personalData.get("friends");
if(_26b){
_26b.each(function(_26c,i){
var _26e=_26c.name.match(_269)||(_26c.realname&&_26c.realname.match(_269));
if(_26e){
_26a.push(_26c);
}
});
}
var _26f=this.personalData.get("groups");
if(_26f){
_26f.each(function(_270,i){
var _272=_270.name.match(_269);
if(_272){
_26a.push(_270);
}
});
}
var _273=this.personalData.get("labels");
if(_273){
_273.each(function(_274,i){
var _276=_274.name.match(_269)&&_274.single_artist!="t";
if(_276){
_26a.push(_274);
}
});
}
return _26a;
},buildEvent:function(_277){
var _278=_277.date.split("T");
var _279=_278[0].split("-");
var _27a=_277.event||_277.artist;
var _27b="<span class=\"calSheet calSheetSmall\">"+"<span title=\""+_277.date+"\">"+"<span class=\"month\">"+LFM.String.shortMonths[_279[1]-0]+"</span>"+"<span class=\"day\">"+(_279[2]-0)+"</span>"+"</span>"+"</span>";
var _27c=_277["country_"+LFM.Session.language]||_277["country_en"];
return _27b+"<strong>"+_27a.truncate(25)+"</strong><br>"+_277.city.truncate(25)+", "+_27c.truncate(25);
},buildEventTitle:function(_27d){
var _27e=_27d.event||_27d.artist;
var _27f=_27d["country_"+LFM.Session.language]||_27d["country_en"];
return _27e+", "+_27d.venue+", "+_27d.city+", "+_27f;
},buildEventURL:function(_280){
return "/event/"+encodeURIComponent(encodeURIComponent(_280.resid));
},buildArtist:function(_281){
var _282=this.buildArtistImageURL(_281);
var _283="<img src=\""+_282+"\" width=\"34\" height=\"34\">";
return _283+this.buildName(_281.artist);
},buildArtistTitle:function(_284){
return _284.artist;
},buildArtistURL:function(_285){
return "/music/"+encodeURIComponent(encodeURIComponent(_285.artist));
},buildArtistImageURL:function(_286){
if(_286.image){
return LFM.Session.userserveHost+"/serve/34s/"+_286.image;
}else{
var _287={api_key:LFM.Session.wsKey,artist:_286.artist,method:"artist.getImageRedirect",size:"smallsquare"};
return "http://"+LFM.Session.wsHost+"/2.0/?"+Object.toQueryString(_287);
}
},buildAlbum:function(_288){
var _289=this.buildAlbumImageURL(_288);
var _28a="<span class=\"albumCover coverSmall\" />"+"<span class=\"art\"><img src=\""+_289+"\" width=\"34\" height=\"34\"></span>"+"<span class=\"jewelcase\"></span>"+"</span>";
return _28a+this.buildName(_288.album)+"<br>"+_288.artist.truncate(25);
},buildAlbumTitle:function(_28b){
return _28b.album+" - "+_28b.artist;
},buildAlbumURL:function(_28c){
return "/music/"+encodeURIComponent(encodeURIComponent(_28c.artist))+"/"+encodeURIComponent(encodeURIComponent(_28c.album));
},buildAlbumImageURL:function(_28d){
if(_28d.image){
return LFM.Session.userserveHost+"/serve/34s/"+_28d.image;
}else{
var _28e={api_key:LFM.Session.wsKey,artist:_28d.artist,album:_28d.album,method:"album.getImageRedirect",size:"smallsquare"};
return "http://"+LFM.Session.wsHost+"/2.0/?"+Object.toQueryString(_28e);
}
},buildTrack:function(_28f){
var _290=this.buildArtistImageURL(_28f);
var _291="<img src=\""+_290+"\" width=\"34\" height=\"34\">";
var _292=_28f.duration?" <small> ("+LFM.timeFormat(_28f.duration)+")</small>":"";
return _291+this.buildName(_28f.track)+_292+"<br>"+_28f.artist.truncate(25);
},buildTrackTitle:function(_293){
return _293.track+" - "+_293.artist;
},buildTrackURL:function(_294){
return "/music/"+encodeURIComponent(encodeURIComponent(_294.artist))+"/_/"+encodeURIComponent(encodeURIComponent(_294.track));
},buildTag:function(_295){
var icon="<img width=\"30\" height=\"30\" src=\""+LFM.Session.staticHost+"/flatness/icons/tag/1/tag_30.png\">";
return icon+this.buildName(_295.tag);
},buildTagTitle:function(_297){
return _297.tag;
},buildTagURL:function(_298){
return "/tag/"+encodeURIComponent(encodeURIComponent(_298.tag));
},buildUser:function(_299){
var _29a=this.buildResImage(_299,"/flatness/catalogue/noimage/2/default_user_small.png");
var user=_29a+this.buildName(_299.name);
if(_299.realname){
user+="<br>"+_299.realname.truncate(25);
}
return user;
},buildUserTitle:function(_29c){
var _29d=_29c.name;
if(_29c.realname){
_29d+=" - "+_29c.realname;
}
return _29d;
},buildUserURL:function(_29e){
return "/user/"+encodeURIComponent(encodeURIComponent(_29e.name));
},buildGroup:function(_29f){
var _2a0=this.buildResImage(_29f,"/flatness/catalogue/noimage/2/default_group_small.png");
var name;
if(_29f.group){
name=this.buildName(_29f.group);
}else{
name=this.buildName(_29f.name);
}
return _2a0+name;
},buildGroupTitle:function(_2a2){
return _2a2.name||_2a2.group;
},buildGroupURL:function(_2a3){
var name=_2a3.name||_2a3.group;
return "/group/"+encodeURIComponent(encodeURIComponent(name));
},buildLabel:function(_2a5){
var _2a6=this.buildResImage(_2a5,"/flatness/catalogue/noimage/2/default_label_small.png");
var name;
if(_2a5.label){
name=this.buildName(_2a5.label);
}else{
name=this.buildName(_2a5.name);
}
return _2a6+name;
},buildLabelTitle:function(_2a8){
return _2a8.name||_2a8.label;
},buildLabelURL:function(_2a9){
var root;
var name=_2a9.name||_2a9.label;
if(_2a9.single_artist=="t"){
root="/artist/";
}else{
root="/label/";
}
return root+encodeURIComponent(encodeURIComponent(name));
},buildName:function(name){
return "<strong>"+name.truncate(25)+"</strong>";
},buildResTitle:function(_2ad){
return _2ad.name;
},buildResImage:function(_2ae,_2af){
var _2b0=LFM.Session.staticHost+_2af;
if(_2ae.image_id){
_2b0=LFM.Session.userserveHost+"/serve/34s/"+_2ae.image_id+".jpg";
}else{
if(_2ae.image){
_2b0=LFM.Session.userserveHost+"/serve/34s/"+_2ae.image;
}
}
var _2b1="<img src=\""+_2b0+"\" width=\"34\" height=\"34\">";
return _2b1;
},buildItemLink:function(_2b2){
var _2b3=_2b2.res?_2b2.res.type:_2b2.restype;
var _2b4=LFM.resTypeLookup[_2b3];
if(!_2b4){
LFM.warn("no restype found: "+_2b3);
}else{
try{
var url=this["build"+_2b4+"URL"](_2b2);
if(!this.urls[url]){
this.urls[url]=_2b4;
var item=this["build"+_2b4](_2b2);
var _2b7=this["build"+_2b4+"Title"](_2b2);
var link=new Element("a",{href:url+"?ac="+encodeURIComponent(this.getToken()),title:_2b7}).addClassName(_2b4.toLowerCase()+"Item").update(item);
return link;
}
}
catch(e){
LFM.warn(_2b4,e);
}
}
},buildSearchLink:function(_2b9){
var _2ba=this.form.action+"?"+this.form.serialize();
var link=new Element("a",{href:_2ba}).addClassName("viewAll");
return new Element("span").addClassName("moduleOptions").update(_2b9).wrap(link);
},setOptions:function(_2bc){
_2bc=_2bc||{};
this.options=Object.extend({method:"get",onShow:function(_2bd,_2be){
if(!_2be.style.position||_2be.style.position=="absolute"){
_2be.style.position="absolute";
Position.clone(_2bd,_2be,{setHeight:false,setWidth:false,offsetTop:_2bd.offsetHeight});
}
Effect.Appear(_2be,{duration:0.15});
}},_2bc);
},markNext:function(){
if(this.index===null){
this.index=0;
}else{
if(this.index<this.entryCount-1){
this.index++;
}
}
var _2bf=this.getCurrentEntry();
if(_2bf){
window.status=_2bf.down("a").href;
}else{
window.status="";
}
},markPrevious:function(){
if(this.index>0){
this.index--;
}else{
this.index=null;
}
var _2c0=this.getCurrentEntry();
if(_2c0){
window.status=_2c0.down("a").href;
}else{
window.status="";
}
},getEntry:function(_2c1){
if(_2c1!==null){
return this.update.down("li.item",_2c1);
}
},updateElement:function(item){
if(item){
var link=item.down("a");
if(link){
if(link.hasClassName("viewAll")){
LFM.Omniture.prepareEvar("HeaderSearchAction","ViewAllReturn");
}else{
LFM.Omniture.prepareEvar("HeaderSearchAction","Return");
if(this.urls[link.pathname]){
LFM.Omniture.prepareEvar("HeaderSearchRestype",this.urls[link.pathname]);
}
}
LFM.Omniture.setLink(link);
LFM.Omniture.trackEvents("HeaderSearch");
LFM.redirect(link.href);
return true;
}
}
},addLinkedItem:function(_2c4,list){
var link;
var _2c7=_2c4.res?_2c4.res.type:_2c4.restype;
if(_2c7){
link=this.buildItemLink(_2c4);
}else{
link=this.buildSearchLink(_2c4);
}
if(link){
var item=link.wrap(new Element("li").addClassName("item"));
list.insert(item);
return item;
}
return false;
},onBlur:function(e){
this.blurTimeout=setTimeout(function(){
this.hide();
this.hasFocus=false;
this.active=false;
}.bind(this),250);
},onFocus:function(e){
LFM.Omniture.trackEvents("HeaderSearchFocus");
if(this.options.enabled){
this.loadPersonalData();
}
},loadPersonalData:function(){
if(this.personalData||!LFM.Session.loggedIn||!LFM.Session.userURL||this.unauthorised){
return false;
}
LFM.info("AC: Load personal data");
new Ajax.Request(LFM.Session.userURL+"/acdata",{method:"get",parameters:{ajax:1},onSuccess:function(_2cb){
response=new LFM.Ajax.Response(_2cb);
if(response.isSuccess()){
LFM.info("AC: Personal data loaded");
this.personalData=response;
}else{
if(response.isUnauthorised()){
this.unauthorised=true;
}
}
}.bind(this)});
},onHover:function(e){
var link=e.findElement("a");
if(link){
if(this.index!=link.autocompleteIndex){
this.index=link.autocompleteIndex;
this.render();
}
}
},onClick:function(e){
this.element.focus();
clearTimeout(this.blurTimeout);
var link=e.findElement("a");
if(link){
if(link.hasClassName("viewAll")){
LFM.Omniture.prepareEvar("HeaderSearchAction","ViewAllClick");
}else{
LFM.Omniture.prepareEvar("HeaderSearchAction","Click");
if(this.urls[link.pathname]){
LFM.Omniture.prepareEvar("HeaderSearchRestype",this.urls[link.pathname]);
}
}
LFM.Omniture.setLink(link);
LFM.Omniture.trackEvents("HeaderSearch");
}
},onKeyPress:function(e){
if(this.active){
switch(e.keyCode){
case Event.KEY_TAB:
case Event.KEY_RETURN:
if(this.options.enabled&&this.getCurrentEntry()){
this.selectEntry();
e.stop();
}
break;
case Event.KEY_ESC:
if(this.options.enabled){
this.hide();
this.active=false;
e.stop();
}
return;
case Event.KEY_LEFT:
case Event.KEY_RIGHT:
return;
case Event.KEY_UP:
if(this.options.enabled){
this.markPrevious();
this.render();
e.stop();
}
return;
case Event.KEY_DOWN:
if(this.options.enabled){
this.markNext();
this.render();
e.stop();
}
return;
}
}else{
if(e.keyCode==Event.KEY_TAB||e.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&e.keyCode==0)){
return;
}
}
this.changed=true;
this.hasFocus=true;
if(this.observer){
clearTimeout(this.observer);
}
this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);
},onKeyUp:function(e){
this.changed=false;
var _2d2=this.getToken();
if(_2d2.length>=this.options.minChars&&_2d2!=this.lastToken){
this.startIndicator();
}
},onSubmit:function(e){
var _2d4=this.form.serialize().toQueryParams();
var _2d5=this.getToken();
LFM.Omniture.prepareEvar("SearchLength",_2d5.length);
if(this.options.enabled){
LFM.Omniture.prepareEvar("SearchType","multicomplete");
}else{
if(_2d4.m){
LFM.Omniture.prepareEvar("SearchType",_2d4.m);
}
}
LFM.Omniture.prepareEvar("HeaderSearchAction","Search");
LFM.Omniture.trackEvents("HeaderSearch");
},onObserverEvent:function(){
this.changed=false;
var _2d6=this.getToken();
if(_2d6.length>=this.options.minChars){
if(_2d6!=this.lastToken&&_2d6!=this.element.getAttribute("placeholder")){
this.getUpdatedChoices();
}else{
this.render();
}
}else{
this.active=false;
this.hide();
}
this.lastToken=_2d6;
this.oldElementValue=this.element.value;
},getToken:function(){
return $F(this.element);
},processResults:function(_2d7){
var list=new Element("ul");
if(_2d7){
this.urls={};
_2d7.each(function(_2d9,_2da){
this.addLinkedItem(_2d9,list);
},this);
}
this.addViewAll(list,_2d7.length);
return list;
},addViewAll:function(list,_2dc){
this.addLinkedItem(LFM.String.siteSearchViewAll.replace("QUERY",this.getToken().escapeHTML()),list);
this.entryCount=_2dc+1;
},onComplete:function(_2dd){
if(this.changed||!this.hasFocus){
return false;
}
var _2de=new Array,_2df=0;
try{
var _2e0=_2dd.responseText.evalJSON();
_2de=_2e0.response.docs;
}
catch(err){
LFM.warn("JSON error: "+_2dd.responseText);
}
if(this.personalMatches&&this.personalMatches.length){
var _2e1=Math.min(this.personalMatches.length,3);
_2de=this.personalMatches.slice(0,_2e1).concat(_2de.slice(0,10-_2e1));
}
_2df=_2de.length;
var list=this.processResults(_2de);
this.updateChoices(list,_2df);
},updateChoices:function(list,_2e4){
this.update.update(list);
var _2e5=new Element("p",{"class":"header"});
if(_2e4){
_2e5.update(LFM.String.siteSearchSuggestions);
}else{
_2e5.update(LFM.String.siteSearchNoSuggestions).addClassName("empty");
}
this.update.insert({"top":_2e5});
if(LFM.Session.loggedIn&&!this.personalData){
var _2e6=new Element("div").addClassName("message messageWarn").update(LFM.String.autocompletePersonalDataDown);
this.update.insert({"bottom":_2e6});
}
this.update.select("li.item a").each(function(link,_2e8){
link.autocompleteIndex=_2e8;
},this);
this.stopIndicator();
this.index=null;
this.render();
}})});
LFM.set("Ajax",{GroupedMulticompleter:Class.create(LFM.Ajax.Multicompleter,{resTypeGroups:[LFM.resTypes.ARTIST,LFM.resTypes.ALBUM,LFM.resTypes.TRACK,LFM.resTypes.EVENT,LFM.resTypes.TAG,LFM.resTypes.USER,LFM.resTypes.GROUP,LFM.resTypes.LABEL],init:function(){
this.update.addClassName("grouped");
},buildArtist:function(_2e9){
var _2ea=this.buildArtistImageURL(_2e9);
var _2eb="<span class=\"img\"><span><img src=\""+_2ea+"\" width=\"34\" height=\"34\" /></span></span>";
return _2eb+"<strong class=\"artist\">"+_2e9.artist.truncate(25)+"</strong>";
},buildTrack:function(_2ec){
var _2ed=this.buildArtistImageURL(_2ec);
var _2ee="<span class=\"img\"><span><img src=\""+_2ed+"\" width=\"34\" height=\"34\" /></span></span>";
var _2ef=_2ec.duration?" <small class=\"time\"> ("+LFM.timeFormat(_2ec.duration)+")</small>":"";
return _2ee+"<strong class=\"track\">"+_2ec.track.truncate(20)+"</strong>"+_2ef+"<br>"+_2ec.artist.truncate(25);
},buildTag:function(_2f0){
var icon="<img width=\"20\" height=\"20\" src=\""+LFM.Session.staticHost+"/flatness/icons/activity/tagged.png\">";
return icon+"<strong class=\"tag\">"+_2f0.tag.truncate(25)+"</strong>";
},processResults:function(_2f2,list){
var list=new Element("ul");
if(_2f2){
this.urls={};
var _2f4=this.groupResults(_2f2);
var _2f5,_2f6,_2f7,_2f8;
this.resTypeGroups.each(function(_2f9,_2fa){
if(_2f4[_2f9]){
_2f5=new Element("li");
_2f8=(_2f9==LFM.resTypes.USER)?LFM.String.resTypePlural["friends"]:LFM.String.resTypePlural[_2f9];
_2f6=new Element("h3").update(_2f8).addClassName(LFM.resTypeLookup[_2f9].toLowerCase());
_2f7=new Element("ul");
_2f4[_2f9].each(function(_2fb,_2fc){
this.addLinkedItem(_2fb,_2f7);
},this);
_2f5.insert(_2f6);
_2f5.insert(_2f7);
list.insert(_2f5);
}
},this);
}
this.addViewAll(list,_2f2.length);
return list;
},groupResults:function(_2fd){
var _2fe={},_2ff;
_2fd.each(function(_300,_301){
_2ff=_300.res?_300.res.type:_300.restype;
if(!_2fe[_2ff]){
_2fe[_2ff]=[];
}
_2fe[_2ff].push(_300);
},this);
return _2fe;
}})});
LFM.set("Ajax",{SideGroupedMulticompleter:Class.create(LFM.Ajax.GroupedMulticompleter,{init:function(){
this.update.addClassName("grouped sidegrouped");
},processResults:function(_302,list){
var _304=new Element("table",{cellspacing:0,cellpadding:0,border:0});
var _305=new Element("tbody");
var _306=0;
if(_302){
this.urls={};
var _307=this.groupResults(_302);
var _308,_309,_30a,_30b;
this.resTypeGroups.each(function(_30c,_30d){
if(_307[_30c]){
_306++;
_308=new Element("tr");
if(_306%2==0){
_308.addClassName("alt");
}
_30b=(_30c==LFM.resTypes.USER)?LFM.String.resTypePlural["friends"]:LFM.String.resTypePlural[_30c];
_309=new Element("h3").update(_30b).addClassName(LFM.resTypeLookup[_30c].toLowerCase());
_30a=new Element("ul");
_307[_30c].each(function(_30e,_30f){
this.addLinkedItem(_30e,_30a);
},this);
_308.insert(new Element("th").update(_309));
var _310=new Element("td").update(_30a);
if(_306==1){
_310.addClassName("first");
}
_308.insert(_310);
_305.insert(_308);
}
},this);
}
var _311=new Element("tr");
if(_306%2==0){
_311.addClassName("alt");
}
var _312=new Element("ul");
this.addViewAll(_312,_302.length);
_311.insert(new Element("th"));
_311.insert(new Element("td",{"class":"viewAll"}).update(_312));
_305.insert(_311);
_304.update(_305);
return _304;
}})});


