﻿var Microgroove=Microgroove||{};Microgroove.helpers={loadFile:function(a){if(a.indexOf("js")!=-1){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",a)}else{if(a.indexOf("css")!=-1){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",a)}}if(typeof b!="undefined"){document.getElementsByTagName("head")[0].appendChild(b)}},urlEncode:function(e){var g="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";var b="0123456789ABCDEF";var f="";for(var c=0;c<e.length;c++){var d=e.charAt(c);if(d==" "){f+="+"}else{if(g.indexOf(d)!=-1){f+=d}else{var a=d.charCodeAt(0);if(a>255){alert("Unicode Character '"+d+"' cannot be encoded using standard URL encoding.\n(URL encoding only supports 8-bit characters.)\nA space (+) will be substituted.");f+="+"}else{f+="%";f+=b.charAt((a>>4)&15);f+=b.charAt(a&15)}}}}return f},setCookie:function(b,c,a,d){document.cookie=b+"="+escape(c)+((a==null)?"":("; expires="+a.toGMTString()))+((d)?"; path="+d:"")},getCookie:function(a){var b=a+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(b);if(offset!=-1){offset+=b.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}return unescape(document.cookie.substring(offset,end))}}},killCookie:function(a,b){theValue=Microgroove.helpers.getCookie(a);if(theValue){document.cookie=a+"="+theValue+"; expires=Fri, 13-Apr-1970 00:00:00 GMT"+((b)?"; path="+b:"")}},setMultiValueCookie:function(d,f,c,b,h){if(f.length!=c.length){return}var g=d+" = ";var a="";for(var e=0;e<c.length;e++){if(a.length>0){a+="&"}a+=f[e]+"="+escape(c[e])}g+=a;g+=b==null?"":"; expires="+b.toUTCString();g+=(h)?"; path="+h:"";document.cookie=g},getMultiValueCookie:function(c,b){var a=Microgroove.helpers.getCookie(c);if(a==""){return""}return Microgroove.helpers.paramaterFrom(b,a)},paramaterFrom:function(b,a){a="="+a+"&";if(a.indexOf(b)!=-1){locStart=a.indexOf(b)+b.length+1;locEnd=a.indexOf("&",locStart);if(locEnd<locStart){locEnd=a.length}return a.substring(locStart,locEnd)}else{return null}},replaceString:function(d,a,b){for(var c=0;c<d.length;c++){if(d.substring(c,c+a.length)==a){d=d.substring(0,c)+b+d.substring(c+a.length,d.length)}}return d},unPackUrl:function(a){return Microgroove.helpers.replaceString(Microgroove.helpers.replaceString(Microgroove.helpers.replaceString(Microgroove.helpers.replaceString(a,"!","?"),"^","&"),"|","="),"$","/")},changeSortOrder:function(c,a,b){Microgroove.helpers.setCookie(c,a,null,"/");Microgroove.helpers.redirectLocation(b)},redirectLocation:function(a){if(a){var b=a.replace(/#[^&.]*/,"");window.location.href=b}},getRef:function(a){if(!document.getElementById){return document[a]}else{return document.getElementById(a)}}};var setCookie=Microgroove.helpers.setCookie;var getCookie=Microgroove.helpers.getCookie;Microgroove.viewTracking={trackView:function(d,g,f,m,e,h){function l(q){var p=document.cookie.split(";");for(var o=0;o<p.length;o++){var n=p[o].split("=");if(n.length==2&&n[0].replace(" ","")==q){return n[1]}}return null}function k(o,n){document.cookie=o+"="+n+";path=/;"}function b(s,t,r){var p=t+"_"+r;var q=s.split("|");for(var o=0;o<q.length;o++){var n=q[o].split(":");if(n.length==2&&n[0]==p){return n[1]}}return 0}function j(u,o,r,s){var p=o+"_"+r;var n=u.split("|");var v=false;u="";for(var q=0;q<n.length;q++){var t=n[q].split(":");if(t.length==2){if(t[0]==p){u+=p+":"+s+"|";v=true}else{u+=t[0]+":"+t[1]+"|"}}}if(!v){u+=p+":"+s+"|"}return u}if(!h){var c=new Image();c.src="/aspnet_client/microgroove/tracking/tracking.ashx?contentTypeID="+d+"&contentID="+g+"&ttl="+m+"&h="+e+"&t="+(new Date()).getTime()}var a=l("TrackViewCount");if(a==null){a=j("",d,g,f)}var i=b(a,d,g);if(i!=0){f=i}if(!h){f++}a=j(a,d,g,f);k("TrackViewCount",a);return f}};Microgroove.pageTracking=function(){var c=function(d){};var b=function(d){};var a=function(d,e){return"/"+d+"/"+e};return{trackPage:c,trackModal:b,getTrackingPath:a}}();Microgroove.toolTips=function(){var h;var g;var c=false;var i=function(m){if(m!=0){$.getJSON("/webservices/v4.0/int/memberservice.aspx/GetMember",{memberID:m},function(n){if(n){a("<div style='margin:10px;'><img src='"+n.ImageUrl+"'></div><div style='margin-top:10px;margin-left:10px;'><strong>User: </strong>"+n.Username+"</div><div style='margin-left:10px;'><strong>Location: </strong>"+n.Location+"</div><div style='margin-left:10px;margin-bottom:10px;'><strong>Joined: </strong>"+n.ConfirmedDate+"</div>")}})}};var k=function(){$("body").prepend("<div id='ToolTip' style='position:absolute; width:100px; top:0px; left:0px; z-index:4; visibility:hidden;'></div>");if(!$.browser.msie){document.captureEvents(Event.MOUSEMOVE)}document.onmousemove=d};var b=function(){if($.browser.msie){return document.body.offsetHeight}else{return window.innerHeight}};var f=function(){if($.browser.msie){return document.body.offsetWidth}else{return window.innerWidth}};var e=function(){if(!document.getElementById||!document.getElementById("ToolTip")||!h||!g){return}var m=(h+20)+"px";if((h+270)>f()){m=(h-240)+"px"}document.getElementById("ToolTip").style.left=m;document.getElementById("ToolTip").style.top=(g)+"px"};var d=function(n){if(!document.getElementById||!document.getElementById("ToolTip")){return}if($.browser.msie){var m=(document.documentElement&&document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop;h=event.clientX+document.body.scrollLeft;g=event.clientY+m}else{h=n.pageX;g=n.pageY}if(h<0){h=0}if(g<0){g=0}if(c){e()}};var j=function(m){i(m);return"<div style='margin:10px;'>Loading...</div>"};var l=function(n,m){if(!document.getElementById||!document.getElementById("ToolTip")){return}if(n){e();c=true;document.getElementById("ToolTip").style.visibility="visible";a(m)}else{c=false;document.getElementById("ToolTip").style.visibility="hidden";a("")}};var a=function(m){if(!document.getElementById||!document.getElementById("ToolTip")){return}document.getElementById("ToolTip").innerHTML="<div style='width:220px;border:1px solid black;background-color:white;font-family:verdana, arial, sans-serif;font-size:8pt;color:black;'>"+m+"</div>"};$(document).ready(function(){k()});return{getMember:j,showHideTooltip:l}}();var ShowHideTooltip=Microgroove.toolTips.showHideTooltip;var GetMember=Microgroove.toolTips.getMember;Microgroove.forms={clearMemberImage:function(c,a,b){$("#"+c).val("true");$("#"+a).hide();$("#"+b).hide()},validateDropdowns:function(b,a){if(a.Value==="null"){a.IsValid=false}else{a.IsValid=true}},removeArtistFan:function(a,b){if(!confirm("Removing yourself as a fan will also remove you from that artist's email list. Do you want to continue?")){return}Microgroove.forms.clearArtistFanCheckbox(a);Microgroove.forms.hideArtistFanRow(a)},hideArtistFanRow:function(a){$("span[artistfanof*='"+a+"']").slideUp()},clearArtistFanCheckbox:function(a){$("input[artistfanof*='"+a+"']").attr("checked",false)}};var GetMail=function(a,b){window.document.location.href=b+$("#"+a).val()};Microgroove.webIM=function(){var c=10000;var h=0;var b=0;var i=function(){if(!k()){$.getJSON("/webservices/v4.0/int/messagingservice.aspx/IsMessageWaiting",{memberID:b},function(o){if(b!=0&&!k()&&o&&o.SenderID&&o.SenderID!=0&&!j(o.SenderID)){Microgroove.windowManager.open("/aspnet_client/microgroove/windows/chat/intro.aspx?t="+o.SenderID+"&ta="+Microgroove.helpers.urlEncode(o.Author)+"&tl="+Microgroove.helpers.urlEncode(o.AuthorLocation)+"&ti="+Microgroove.helpers.urlEncode(o.ImageUrl)+"&m="+Microgroove.helpers.urlEncode(o.MessageBody),"IntroWindow");setChatting(o.SenderID,true)}d()})}else{d()}};var k=function(){return(Microgroove.helpers.getCookie("Chatting")!=null&&Microgroove.helpers.getCookie("Chatting")=="Disabled")};var g=function(){Microgroove.helpers.setCookie("Chatting","Enabled",null,"/")};var l=function(){Microgroove.helpers.setCookie("Chatting","Disabled",null,"/")};var f=function(r,q){var t="";if(Microgroove.helpers.getCookie("ChattingRecipients")!=null){t=Microgroove.helpers.getCookie("ChattingRecipients")}var o=t.split("|");var s=false;t="";for(var p=0;p<o.length;p++){if(o[p]==r&&q){t+=r+"|";s=true;continue}if(o[p]==r&&!q){s=true;continue}t+=o[p]+"|"}if(!s&&q){t+=r+"|"}Microgroove.helpers.setCookie("ChattingRecipients",t,null,"/")};var j=function(q){var r="";if(Microgroove.helpers.getCookie("ChattingRecipients")!=null){r=Microgroove.helpers.getCookie("ChattingRecipients")}else{return false}var o=r.split("|");for(var p=0;p<o.length;p++){if(o[p]==q){return true}}return false};var n=function(t){if(b==t){alert("When you click this icon next to another member that is currently online, \ryou can start an Instant Messaging conversation with that member, \rfrom right within this site.");return}if(t==0){return}var r="/aspnet_client/microgroove/windows/chat/default.aspx?t="+t;var q=screen.availWidth;var o=screen.availHeight;var p=327;var s=390;wHandle=null;wHandle=window.open(r,"ChatWindow_"+t,"width="+p+",height="+s+",left="+((q-p-10)*0.5)+",top="+((o-s-30)*0.5)+",scrollbars=no");if(wHandle.blur){wHandle.focus()}};var d=function(){h=setTimeout("Microgroove.webIM.callService()",c)};var m=function(){alert("You need to be a logged in member to WebIM other members. Please log in or register.")};var e=function(){alert("You need to be a logged in member to WebIM other members. Please log in or register.")};var a=function(){alert("The person you are trying to WebIM is currently offline.")};return{init:function(o){if(o!=0){b=o;d()}},callService:i,isChattingDisabled:k,enableChatting:g,disableChatting:l,setChatting:f,getChatting:j,openChatWindow:n}}();var OpenChatWindow=Microgroove.webIM.openChatWindow;var shadowboxWindowManager=function(){var o={};var n=false;var e,i;var g=function(r){var s=Microgroove.helpers.paramaterFrom("vpl",r);return r.replace(s,"false")};var h=function(r){return"javascript:"+r};var p=function(){var r="*[href^='OpenModalWindow'], *[href^='RedirectLocation'], *[href^='Microgroove.windowManager.open'], *[href^='Microgroove.helpers.redirectLocation']";$(r).each(function(){var s=$(this).attr("href");$(this).attr("href",h(s))})};var m=function(s){for(var r=0;r<o.length;r++){if(o[r].id==s){return o[r]}}return null};var q=function(){if(n){Microgroove.helpers.redirectLocation(document.location.href);return}n=false};var l=function(r){e=r};var k=function(r){i=r};var j=function(s){o=s;for(var r=0;r<o.length;r++){o[r].content=o[r].url;o[r].player="iframe"}};var b=function(s,u){if(arguments.length>2){var r=m(u);if(!r){return}if(s){r.content=s}n=r.reloadOnClose;Shadowbox.open(r);return}if((typeof i!="undefined")&&(typeof i=="function")){var t=i(function(){b(s,u,true)});if(t){return}}b(s,u,true)};var a=function(){n=false;if(arguments.length>0){return c(arguments[0])}return f()};var d=function(){$("#sb-container").hide()};var c=function(r){if(arguments.length>1){var r=g(r);Microgroove.helpers.redirectLocation(r);return}if((typeof e!="undefined")&&(typeof e=="function")){d();var s=e(function(){c(r,true)});if(s){return}}c(r,true)};var f=function(){if(arguments.length>0){Shadowbox.close();return}if((typeof e!="undefined")&&(typeof e=="function")){d();var r=e(function(){f(true)});if(r){return}}f(true)};Microgroove.helpers.loadFile("/aspnet_client/microgroove/shadowbox/shadowbox.css");Shadowbox.init({showOverlay:false,language:"en",skipSetup:true,modal:false,overlayOpacity:0,useSizzle:false,onClose:q,players:["iframe"]});$(document).ready(function(){p()});return{init:j,open:b,close:a,hide:d,onCloseWindow:l,onOpenWindow:k}};Microgroove.windowManager=shadowboxWindowManager();var OpenModalWindow=Microgroove.windowManager.open;var OpenDeleteWindow=Microgroove.windowManager.open;Microgroove.facebookHelper=function(){var e=false;var j;var h,f,b,k;var a=function(){if((typeof j!="undefined")&&(typeof j=="function")){j()}};var g=function(){FB.ensureInit(function(){if(e){return}e=true;try{FB.Connect.showFeedDialog(f,b,null,null,null,FB.RequireConnect.promptConnect,a)}catch(l){a()}})};var c=function(){var l={ifUserConnected:g,xdChannelUrl:k};FB.init(h,null,l);return true};var d=function(l){j=l;c();return true};var i=function(l,m,o,n){h=l;f=m;b=o;k=n;Microgroove.windowManager.onCloseWindow(d)};return{init:i}}();Microgroove.memberPlaylists=function(){var a=function(){if($("#MemberPlaylist").sortable){$("#MemberPlaylist").sortable({handle:$(".positioner"),stop:function(c,b){$.get("/webservices/v4.0/pub/memberplaylistservice.aspx/UpdateMemberPlaylist",{trackIDs:$("#MemberPlaylist").sortable("toArray").toString(),memberID:$("#MemberPlaylist").attr("MemberID"),affinityID:$("#MemberPlaylist").attr("AffinityID")})}})}};$(document).ready(function(){a()});return{deleteMemberTrack:function(c,d,b){$.get("/webservices/v4.0/pub/memberplaylistservice.aspx/DeleteTrackFromMemberPlaylist",{trackID:c,memberID:d,affinityID:b});$("#"+c).slideUp("slow",function(){$("#"+c).remove()})},addMemberTrack:function(c,d,b){$.get("/webservices/v4.0/pub/memberplaylistservice.aspx/AddTrackToMemberPlaylist",{trackID:c,memberID:d,affinityID:b})},onAjaxResponseEnd:function(c,b){a()}}}();function onloadsOn(){window.onload=onloadsGo}function onloadsGo(){for(var i=0;i<_onloads.length;i++){eval(_onloads[i])}}function onloadsAdd(a){_onloads[_onloads.length]=a}var _onloads=new Array();onloadsOn();