/* ======== /static/js/config.js ======== */

var AWF_CONFIG = {
   "base_url" : "http://amiestreet.com",
   "base_url_secure" : "https://amiestreet.com",
   "build_type" : "production",
   "fb_api_key" : "34362669133f7325de27c332bd1712fe"
};/* ======== /static/js/amie/main.js ======== */

(function ($) {
/**
* Initialize the global Amie namespace
*/

// Register Amie namespace
window.Amie = {};
var Amie = window.Amie;
window.Amie.UI = {};
var UI = window.Amie.UI;
window.Amie.AS = {};
var AS = window.Amie.AS;

Amie.FlashMessenger = {
	close: function(){
		$('#flash-message-box').hide();
	}
}

Amie.selectNewTab = function(acfIds){
    var id = (acfIds.indexOf(',')>-1) ? acfIds.split(',')[0] : acfIds;
    var maps = {'home':'home','browse-tab':'browse_music','newreleases-tab':'new_releases','deals-tab':'special_deals','amietop-tab':'amie_top','recommendations-tab':'recommendations','playlists-tab':'playlists'};
    var tab = $('#navigation').find('li.'+maps[id]);
    tab.siblings('li').removeClass('selected');
    tab.addClass('selected');
}

Amie.updateCartItemCount = function(n){
    $('a.cart-link').html('Your Cart ('+n+')');
}
})(jQuery);


$.fbconnect = {};
$.fbconnect.loaded = (typeof FB == "object");
$.fbconnect.loadInProgress = false;
$.requireFacebook = function(f){
	$.console.log('FBCONNECT: requireFacebook called');
	$.console.log('FBCONNECT: Loaded? '+$.fbconnect.loaded);
	$.console.log('FBCONNECT: Load in progress? '+$.fbconnect.loadInProgress);
    if($.fbconnect.loaded){
    	 f();
    	 return;
    }
    $(document).one('fbconnect.ready', f);
    if($.fbconnect.loadInProgress){
    	$.console.log('FBCONNECT: Its already loading.  Just chillax! Your closure has been queued');
        return;
    }
    
    $.fbconnect.loadInProgress = true;
    $('#fb_loader').show();
    $('body').append('<div id="FB_HiddenContainer" style="position:absolute; top:-10000px; left:-10000px; width:0px; height:0px;"></div>');
    var useSecure = ("https" == document.location.protocol);
    var xdReceiver = (useSecure ? AWF_CONFIG.base_url_secure : AWF_CONFIG.base_url)+"/static/html/xd_receiver.html";
    var s = document.createElement('script');
    s.src = (useSecure ? 
             "https://www.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" :
             "http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php");
    s.type = 'text/javascript';
    s.onload = s.onreadystatechange = function(){
        FB.init(AWF_CONFIG.fb_api_key, xdReceiver);
        FB.ensureInit(function(){
            $.fbconnect.loaded = true;
            $.fbconnect.loadInProgress = false;
            $('#fb_loader').hide();
            $(document).trigger('fbconnect.ready');
        });
        $.console.log('FBCONNECT: Everything loaded and ready to go!');
    };
    $.console.log('FBCONNECT: Appending featureloader');
    document.getElementsByTagName('head')[0].appendChild(s);
}

$(document).bind('amie.ready', function(){
	var f = 0;
    $.each(
        ["name","profile-pic","login-button","multi-friend-selector","request-form","serverfbml"],
        function(){
        	f += document.getElementsByTagName('fb:'+this).length;
        }
    );
    if(f > 0){$.requireFacebook(function(){FB.XFBML.Host.parseDomTree();});}
    // this has to be suspended like this because FB is not defined until it's loaded
});
/************************
Crazy jQuery.bind rewriting
************************/
/*
jQuery.aop.around( {target: jQuery, method: 'bind'}, function (invocation) {
    $.log('Arguments are ', invocation.arguments);
    return invocation.proceed();
});
*/

/*****************
Mini jQuery Helpers
******************/

jQuery.log = function () {
    try{
        console.log.apply(console, arguments);
    } catch (e) {}
};
jQuery.fn.log = function () {
    jQuery.log.apply(jQuery, arguments);
    return this;
}

jQuery.info = function () {
    try {
        console.info.apply(console, arguments);
    } catch (e) {}
};
jQuery.fn.info = function () {
    jQuery.info.apply(jQuery, arguments);
    return this;
}

jQuery.debug = function () {
    try {
        console.debug.apply(console, arguments);
    } catch (e) {}
};
jQuery.fn.debug = function () {
    jQuery.debug.apply(jQuery, arguments);
    return this;
}




/**************************************
Helpful functions that should be in javascript!
***************************************/

if (!window.isEmpty) {
    window.isEmpty = function (obj) {
        for (var nil in obj)
            return false;
        return true;
    };
}

if (!Array.prototype.some) {
  Array.prototype.some = function(fun /*, thisp*/) {
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();

    var thisp = arguments[1];
    for (var i = 0; i < len; i++) {
      if (i in this &&
          fun.call(thisp, this[i], i, this))
        return true;
    }

    return false;
  };
}

/**
 * Triggered by SWFObject when you dont have the required version or at all.
 */
$(document).bind('amie.bad_flash', function(){
	$(document).data('badFlash', true);
});
$(document).ready(function(){
	$('a.open-window').live('click',function(e){
	    var t = false;
        try{
            t = (e.button == 2);
        }
        catch(except){}
        if(!t){
		    window.open(this.href);
		    return false;
        }
	});
	$('.artist-pic').live('mouseover', function(e){
	    if(!$('.hi-res').is(':visible')){
	       $('.hi-res').show();
	    }
	});
	$('.artist-pic').live('mouseout', function(e){
	    if($('.hi-res').is(':visible')){
            $('.hi-res').hide();
	    }
    });
    // Note: doing the find is much much faster as sizzle and querySelectorAll are right to left
    $('.share > .social_icon_list > li.email').find('a').live('click', function(){
         var url='mailto:';
         var body='';
         var subject='';
         body='body='+encodeURIComponent($(this).attr('title') + ' '+$(this).attr('href'));
         subject='subject='+encodeURIComponent($(this).attr('title')+' on AmieStreet.com');
         url+='?'+body+'&'+subject;
         $(this).attr('href',url);
    });
    
    var openShareWindow = function(url,name,height,width){
        var left = parseInt((screen.availWidth/2) - (width/2));
        var top = parseInt((screen.availHeight/2) - (height/2));
        if(window.open(url, name,'height='+height+',width='+width+',top='+top+',left='+left)){
            return false;
        }
    };
    
    $('.share > .social_icon_list > li.facebook').find('a').live('click', function(){
        return openShareWindow($(this).attr('href'),'sharef',350,600);
    });
    $('.share > .social_icon_list > li.twitter').find('a').live('click', function(){
        return openShareWindow($(this).attr('href'),'twitter',350,600);
    });
    $('.share > .social_icon_list > li.gmail').find('a').live('click', function(){
        return openShareWindow($(this).attr('href'),'gmail',350,600);
    });
    
    $('a[rel*=ui-button-download]').live('click', function() {
        $.pageTracker._trackPageview($(this).attr('href'));
    });
    
    var showTooltip = function(e) {
        $(this).children().show();
    };
    
    var hideTooltip = function(e) {
        $(this).children().hide();
    };
    
    $('.ui-contextual-help').live('mouseover',showTooltip);
    $('.ui-contextual-help').live('mouseout',hideTooltip);
    
    $('.search-input').each(function() {
    var default_value = this.value;
        $(this).css('color', '#666'); // this could be in the style sheet instead
        $(this).focus(function() {
            if(this.value == default_value) {
                this.value = '';
                $(this).css('color', '#0b1925');
            }
        });
        $(this).blur(function() {
            if(this.value == '') {
                $(this).css('color', '#566d80');
                this.value = default_value;
            }
        });
    });
    
    $('.big_search_input').each(function() {
        var default_value = this.value;
        $(this).css('color', '#666'); // this could be in the style sheet instead
        $(this).focus(function() {
            if(this.value == default_value) {
                this.value = '';
                $(this).css('color', '#0b1925');
            }
        });
        $(this).blur(function() {
            if(this.value == '') {
                $(this).css('color', '#566d80');
                this.value = default_value;
            }
        });
    });
    
});/* ======== /static/js/amie/util.min.js ======== */

window.Amie.Util={};var Util=Amie.Util;Util.ajaxifyCheckbox=function(c,a,b){if(!b){b=function(){}}$("#"+c).bind("click",function(g,f){var d=$("#"+c+":checked").val()?1:0;$.post(a,{checked:d},b)})};Util.observep=function(a,b){a.href=Util.getObservepUrl(a.href,b);return true};Util.getObservepUrl=function(a,b){return(a+"&dp="+b)};Util.isOsx=function(){return(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)};Util.isWindows=function(){return(navigator.userAgent.toLowerCase().indexOf("windows")!=-1)};/* ======== /static/js/amie/player.min.js ======== */

PLAYER_WINDOW_NAME="AmiePopoutPlayer";DETACHED_COOKIE="PlayerDetached";DETACHED_COOKIE_OPTS={path:"/"};USE_WINDOW_OPEN_TRICK=!$.browser.safari;PlayerBase=function(){};PlayerBase.prototype={in_popout_window:false,broadcastEvent:function(a,b,c){if(!c){c=window}$.log("broadcasting event: "+a);switch(a){case"song_start":$(document).trigger("player.song_start",[b]);$(document).trigger("player.visible",[b]);break;case"ready":$.log("player ready");$.player.loaded(c);$(document).trigger("player.ready",[b]);break;default:$(document).trigger("player."+a,[b]);break}},getSwfFromDom:function(b){$.log("getting swf object");var a="RazrPlayer";if(b.document[a]){return b.document[a]}else{if((navigator.appName.indexOf("Microsoft Internet")==-1)&&(b.document.embeds&&b.document.embeds[a])){return b.document.embeds[a]}else{return b.$("#"+a).get(0)}}},openPage:function(a,b){if(b){$.history_manager.loadUrl(a)}else{document.location=a}},shouldPersistentPlay:function(){return false}};if(window.name==PLAYER_WINDOW_NAME){$.extend(PlayerBase.prototype,{in_popout_window:true,broadcastEvent:function(a,b){if(opener==window){$.log("opener is self! no good!");return}$.log("Forwarding event: "+[a,b]);opener.$.player.broadcastEvent(a,b,window)},openPage:function(a,b){if(window.opener&&!window.opener.closed){window.opener.document.location=a;window.opener.focus()}else{window.open(a)}}})}LoadingPlayer=function(){};LoadingPlayer.prototype=$.extend(new PlayerBase(),{queue:[],getLoadedType:function(){return false},getLoadedCollectionId:function(){return false},getCurrentSong:function(){return false},isVisible:function(){return false},hide:function(){},loaded:function(d){if(!d){d=window}$.log("LoadingPlayer.loaded in "+d);var c=this.getSwfFromDom(d);$.log("LoadingPlayer got swf: "+c+", queue is "+this.queue);$.player=new Player(c);var b;var a;$(this.queue).each(function(e){var f=this;$.log("calling #"+e+": "+f[0]);$.player[f[0]].apply($.player,f[1]);$.log("call done")})},badFlash:function(){$.player=new BadPlayer()},getCurrentState:function(){return""}});$(["playSong","playCollection","popoutWin","show","playOrPause","nextTrack","prevTrack","setHasPopout"]).each(function(){var a=this;LoadingPlayer.prototype[a]=function(){$.log("loading player delaying invocation of "+a);this.queue.push([a,arguments])}});WaitingForPopoutPlayer=function(){};WaitingForPopoutPlayer.prototype=$.extend(new LoadingPlayer(),{waitingForPopout:true,contactTimeout:0,loaded:function(b,c){if(!c&&b==window){$.log("Internal SWF has loaded but we're waiting for a popup window.");var a=this;this.contactTimeout=setTimeout(function(){$.log("We never got contacted by popout. clearing cookie and loading internal");$.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% REMOVING COOKING");$.cookie(DETACHED_COOKIE,null,DETACHED_COOKIE_OPTS);a.loaded(b,true)},3000)}else{if(!c){$.log("Main window got contacted by player window.")}if(this.contactTimeout){clearTimeout(this.contactTimeout)}this.setHasPopout(!c);return LoadingPlayer.prototype.loaded.apply(this,[b])}}});Player=function(a){this.swf=a};Player.prototype=$.extend(new PlayerBase(),{hasPopout:false,getSwf:function(){return this.swf},hide:function(){if(!this.swf.getVisibility()){return}$("#player-box-wrapper").addClass("player-hidden");this.swf.setVisibility(false);$("body").removeClass("playing");if($(document).data("isIe6")){$("#player-box-wrapper").css({position:"relative"})}},show:function(){if(this.swf.getVisibility()){return}$("#player-box-wrapper").removeClass("player-hidden");$("body").addClass("playing");if($(document).data("isIe6")){$("#player-box-wrapper").css({position:"absolute",bottom:0});var a=(parseInt(($(window).height()+$(window).scrollTop()))-70);if(a<$("body").height()){$("#player-box-wrapper").css({top:a+"px"})}}this.swf.setVisibility(true)},isVisible:function(){return this.swf.getVisibility()},shouldPersistentPlay:function(){return this.isVisible()&&!this.hasPopout},setHasPopout:function(a){this.hasPopout=a;return this},hasBadFlash:function(){return false},playSong:function(a){if(!a){var a=arguments.data[0]}this.show();this.swf.playSong(a)},playCollection:function(b,c,a){if(!b&&!c&&!a){var b=arguments.data[0];var c=arguments.data[1];var a=arguments.data[2]}this.show();$.player.lastSeenCollectionType=b;$.player.lastSeenCollectionId=c;this.swf.playCollection(b,c,a)},openPopout:function(){try{var b="status=no,toolbar=no,resizable=yes,location=no,menubar=no,directories=no,scrollbars=no,height=350,width=468";var a="/player/popout";$.log("popout!");this.popoutWin=window.open(a,PLAYER_WINDOW_NAME,b);if(!this.popoutWin){$.log("POPOUT BLOCKED!");$.pageTracker._trackEvent("listen","open popout blocked","bottom player");throw ("blocked")}else{$.log("POPUP SUCCESSFUL");$.player=new LoadingPlayer(this.popoutWin);$.cookie(DETACHED_COOKIE,1,DETACHED_COOKIE_OPTS);$.log("cookie is: "+$.cookie(DETACHED_COOKIE));$.player.setHasPopout(true);if(this.getLoadedType()=="single"){$.log("queueing playsong!");$.player.playSong(this.getCurrentSong().id)}else{$.log("queueing play collection!");$.player.playCollection(this.getLoadedType(),this.getLoadedCollectionId(),this.getCurrentSong().id)}$.pageTracker._trackEvent("listen","open popout success","bottom player")}}catch(c){$.log("CAUGHT EXCEPTION: "+c);$.uiLightbox('<div style="padding: 20px; background-color: white;"><h1>Popup Blocked</h1><p>If seems that your browser blocked the popup for the popout player.</p><p>To access the popout player please <a href="'+a+'" rel="no-history" onclick="$.player.playOrPause();$.player.hide();$.unblockUI();window.open(url, PLAYER_WINDOW_NAME, opts); event.preventDefault(); event.stopPropogation(); return false;" target="_blank">click here</a>.</p><div class="footer"><a href="javascript: void(0);" onclick="$.unblockUI();" class="close"><img src="/static/acf/ui-lightbox/closelabel.gif" alt="Close Lightbox" class="close_image" /></a></div></div>');$.pageTracker._trackEvent("listen","open popout showed blocked message","bottom player");return}this.closePlayer()},popoutClosed:function(a){$.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% REMOVING COOKIE");$.cookie(DETACHED_COOKIE,null,DETACHED_COOKIE_OPTS);a.$.log("Popout closed! unset cookie");a.$.player=new Player(this.getSwfFromDom(a));if(this.getCurrentState()=="PLAYING"){a.$.player.playCollection(this.getLoadedType(),this.getLoadedCollectionId(),this.getCurrentSong().id);a.$.player.playOrPause()}},closePlayer:function(){if(this.getCurrentState()=="PLAYING"){this.playOrPause()}this.hide()},getMoreInfoDiv:function(){return $("#player-now-playing-info")},toggleMoreInfo:function(){var a=$.player.getMoreInfoDiv();if(a.hasClass("hide")){return $.player.showMoreInfo()}else{return $.player.hideMoreInfo()}},showMoreInfo:function(){var a=$.player.getMoreInfoDiv();a.fadeIn();a.removeClass("hide");return false},hideMoreInfo:function(){var a=$.player.getMoreInfoDiv();a.fadeOut();a.addClass("hide");return false},playOrPause:function(){this.getSwf().playOrPause();return this.getCurrentState()},closePlayer:function(){if(this.getCurrentState()=="PLAYING"){this.playOrPause()}this.hide()},playEmbeddedCollection:function(b,c,a){this.show();if(b!=$.player.lastSeenCollectionType&&c!=$.player.lastSeenCollectionId){$(a).each(function(d){var e=$(this).attr("class").match(/(?:song-)[\w.-]{11}x/)[0].replace("song-","");if(d==0){$.player.playSong(e)}else{$.player.addSong(e)}});$.player.lastSeenCollectionType=b;$.player.lastSeenCollectionId=c}else{this.playOrPause()}}});$(["nextTrack","hasNextTrack","hasPrevTrack","prevTrack","getLoadedType","getLoadedCollectionId","getCurrentState","getCurrentSong","getCurrentIndex","addSong"]).each(function(){var a=this;Player.prototype[a]=function(){if(arguments.length===0){return this.swf[a]()}else{if(arguments.length==1){return this.swf[a](arguments[0])}else{if(arguments.length==2){return this.swf[a](arguments[0],arguments[1])}else{alert("unexpected argument length on swf call");return this.swf[a].apply(this.swf,arguments)}}}}});BadPlayer=function(){};BadPlayer.prototype={hide:function(){$("#player-box").css("height","1px")},show:function(){this.resizeForBadFlash()},hasBadFlash:function(){return true},isVisible:function(){return false},resizeForBadFlash:function(){$("#player-box-wrapper").removeClass("player-hidden");$("#player-box, #player-box > div, #player-box > div > div").css("height","75px").show();$(document).data("badFlash",true)}};$(["getCurrentState","getCurrentSong","getLoadedCollectionId","getLoadedType"]).each(function(){BadPlayer.prototype[this]=function(){return undefined}});$(["playSong","playCollection","nextTrack","prevTrack","addSong"]).each(function(){BadPlayer.prototype[this]=function(){this.resizeForBadFlash()}});$.player=(function(){$.log("getting player");if((window.name!=PLAYER_WINDOW_NAME)&&$.cookie(DETACHED_COOKIE)){if(USE_WINDOW_OPEN_TRICK){$.log("USING WINDOW_OPEN_TRICK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");var a=window.open("",PLAYER_WINDOW_NAME);if(a.$){$.log("detached player seems valid");return new Player(PlayerBase.prototype.getSwfFromDom(a)).setHasPopout(true)}else{$.log("detached player was broke (no $!) so cleaning up");try{a.close()}catch(b){}$.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% REMOVING COOKING");$.cookie(DETACHED_COOKIE,null,DETACHED_COOKIE_OPTS)}}else{$.log("Not using WINDOW_OPEN_TRICK - waiting for popout player to contact us");return new WaitingForPopoutPlayer()}}$.log("no detached player, loading player on page");return new LoadingPlayer()})();$(document).bind("amie.bad_flash",function(){$.log("amie.badflash");$.player.badFlash()});$(document).ready(function(){$(document).bind("player.hidden",function(){h();i()});$(document).bind("player.visible",function(){$.player.show()});$(document).bind("player.song_start",function(j,k){$.player.lastSeenSong=k.song;$("#player-now-playing-info .player-more-info").load("/player/now-playing-bottom-album?songId="+k.song.id)});$(document).bind("player.playlist_complete",function(){$.player.hideMoreInfo();$.player.closePlayer();if(!$.player.in_popout_window&&$.player.lastSeenCollectionType=="album"){window.openLightbox("/player/playlist-complete?songId="+$.player.lastSeenSong.id,"close-on-click")}});$(document).bind("player.song_complete",c);$(document).bind("player.song_start",function(j,k){i();a(j,k)});$(document).bind("player.song_paused",d);$(document).bind("player.song_resumed",e);$(document).bind("amie.ready",function(){$.log("amie.ready");h();i();var j=$.player.getCurrentSong();if(j){f(j);if($.player.getCurrentState()=="PAUSED"){g(j)}}});$("#bottom-player-close-button").click(function(){$.pageTracker._trackEvent("listen","bottom player","close clicked")});$("#bottom-player-detach-button").click(function(){$.pageTracker._trackEvent("listen","bottom player","open popout clicked")});function h(){$(".highlight-item-playing").removeClass("highlight-item-playing")}function f(j){$(".song-"+j.id).addClass("highlight-item-playing");$(b()).addClass("highlight-item-playing")}function a(j,k){h();f(k.song)}function g(j){$(".song-"+j.id).addClass("song-paused");$(b()).addClass("song-paused")}function d(j,k){g(k.song)}function i(){$(".song-paused").removeClass("song-paused")}function e(j,k){f(k.song);i()}function c(j,k){h();i()}function b(){return"."+$.player.getLoadedType()+"-"+$.player.getLoadedCollectionId()}});/* ======== /static/js/amie/history.min.js ======== */

(function(){var d="/history/manager";var q="/history/request";var g=function(s){return s.replace(AWF_CONFIG.base_url,"")};var b=function(s){return s.replace(/#.*/,"").replace(/\/$/,"")};var r=function(s){return(s.match(/#\/.*/)||[""])[0].substr(1)};var e=function(s){return(s.match(/#[^\/][^#]*$/)||[""])[0].substr(1)};var j=function(s){return s.match(/^\//)};var c=function(t,s){return s.match(/^#/)||b(t)==b(s)};var h=function(){return(jQuery.browser.msie&&jQuery.browser.version!="8.0")};var p=function(){return location.pathname+location.search};$.history_manager={};if((/^#\//).test(window.location.hash)){window.location.replace(window.location.hash.replace(/^#/,""));$.history_manager.dont_load=true}$(function(){if($.history_manager.dont_load){return}$("body").prepend('<iframe name="request_iframe" id="request_iframe" style="display:none;"></iframe>');$(window).bind("amie:location_change",o);if(h()){$("body").append('<iframe name="history_iframe" id="history_iframe" style="display:none;" src="'+d+'"></iframe>');a(g(location.href))}$("a").live("click",n);k()});$.history_manager.getRealHash=function(){return e(location.href)};$.history_manager.setRealHash=function(s){location.replace(p()+location.hash.replace(/#[^\/#][^#]*$/,"")+"#"+s)};$.history_manager.fakeLinkClick=function(s){var s=$(s)[0];if(n.call(s)){window.location=s.href}};$.history_manager.go=function(t){var s=$.history_manager.loadUrl(t);if(s){window.location=t}};$.history_manager.loadUrl=function(t){var s=g(t);if($.player.shouldPersistentPlay()&&j(s)){m(s);return false}return true};$.history_manager.load_inner_ajax=function(u,t){var s=u.success;u.success=function(v){$.history_manager.old_href=t;m(t);s(v)};return $.ajax(u)};$.history_manager.update_hash_for_state=function(s){$.history_manager.old_href=s;m(s)};$.history_manager.getPathName=function(){if($.history_manager.current_url){return $.history_manager.current_url.replace(/\?.+$/,"")}else{return location.pathname}};$.history_manager.getLocation=function(){if($.history_manager.current_url){return $.history_manager.current_url}else{return location.href}};var n=function(s){if($(this).attr("rel").indexOf("no-history")==-1&&$(this).attr("rel").indexOf("ui-lightbox")==-1&&this.href.indexOf("/")>-1&&!f(s)&&!l(s)&&!$(this).hasClass("as-playbutton")){return $.history_manager.loadUrl(this.href)}};var f=function(t){var u=false;try{u=t.ctrlKey}catch(s){}return u};var l=function(v){var s=false;try{s=(v.button==2)}catch(u){}return s};var m=(function(){return h()?function(s){a(s)}:function(s){location.href=p()+"#"+s}})();var i=(function(){$.history_manager.old_href=g(location.href);return h()?function(){try{var s=history_iframe.document.getElementById("state").firstChild.nodeValue;if(!c($.history_manager.old_href,s)){$.history_manager.location_change(s);$.history_manager.old_href=s}}catch(t){}}:function(){var s=r(location.href)||g(location.href);if(!c($.history_manager.old_href,s)){$.log("url changed to "+s);$.history_manager.location_change(s);$.history_manager.old_href=s}}})();var k=function(){setInterval(i,50)};$.history_manager.location_change=function(s){$(window).trigger("amie:location_change",[s]);$.history_manager.current_url=s};var o=function(t,s){$.history_manager.navigate(s,"$.history_manager.render")};$.history_manager.navigate=function(s,y,u,w){u=u||0;var t=b(s);var v={url:t,ssl:u,jsonOnly:u};if(!u){v.callback=escape(y)}var z=(u>0)?AWF_CONFIG.base_url_secure:AWF_CONFIG.base_url;var x=z+q+"?";if(u){x+="callback=?&"}x+=$.param(v);if(u){var A={url:x,dataType:"jsonp",error:function(C,E,D){var B=this;if($.isFunction(w)){w.call(s,B,C,E,D)}},success:function(B){y.call(this,B.url,B.content)},timeout:500};$.ajax(A)}else{request_iframe.location.replace(x)}};$.history_manager.render=function(t,s){if(h()){location.href=c(p(),t)?t:location.href=p()+"#"+t}$('html head style[title="inline-stylesheet"]').remove();$("#as-page-inner-content, #main").html(s);scroll(0,0);$(window).trigger("amie:inner_page_reload",[t])};var a=function(w){clearTimeout(this.timeout);var s='<html><body><div id="state">'+w+"</div></body></html>";try{var v=history_iframe.document;v.open();v.write(s);v.close();return true}catch(u){var t=arguments.callee;this.timeout=setTimeout(function(){t(w)},25)}}})();/* ======== /static/js/amie/recommendations.js ======== */

window.Amie.Recommendations = {};
var Recommendations = Amie.Recommendations;

Recommendations.artistHoverHighlight = function() {
   $(this).parents('.span-8').children('.artist-name').css('background-color', '#fffbcc');
};

Recommendations.artistHoverHighlightRemove = function() {
    $(this).parents('.span-8').children('.artist-name').css('background-color', '');
};