var $=jQuery;function loginModal(){$(".modal-container .login-options").modal({containerCss:{height:335,width:530},persist:true})}jQuery(".button-shout-at-mate, .get-mates").live("click",function(b){b.preventDefault();var a=jQuery(this).attr("rel");if($("#simplemodal-container").length<1){jQuery("#shout-at-mates").remove();jQuery("#site-footer").append("<div id='shout-at-mates'></div>");jQuery("#shout-at-mates").modal({containerCss:{height:380,width:400}})}jQuery(this).webService({type:"POST",url:"/services/gateway/?service[module]=User&service[action]=getUserBuddies&service[format]=html&service[templateName]=GetUserBuddiesSideBlock&params[userId]="+document.loggedinUserId+"&params[isMe]=true&params[page]="+a+"&params[offset]=18&user[token]="+document.userToken,dataType:"html",loading:true,loadingLocation:"#shout-at-mates",success:function(c){jQuery("#shout-at-mates").html(c)}})});jQuery(".do-shout").live("click",function(c){c.preventDefault();var b=jQuery(this).attr("rel");jQuery.modal.close();if($("#simplemodal-container").length<1){jQuery("#shout-reply").remove();jQuery("#site-footer").append("<div id='shout-reply'></div>");jQuery("#shout-reply").modal({containerCss:{height:235,width:400}})}var a="/services/gateway?service[module]=User&service[action]=UserDetails&service[format]=html&params[userId]="+b;$(this).webService({type:"post",url:a,dataType:"html",success:function(d){$("#shout-reply").html(jQuery(d).find("#shout-at-mates-reply"));$("#shout-at-mates-reply").fadeIn("fast")}})});jQuery("#reply-shout-box-button").live("click",function(){var a=$("#reply-shout-box-userid").val();var b=$("#reply-shout-box-textarea").val();jQuery().webService({type:"POST",url:"/services/gateway/?service[module]=Expressions&service[action]=AddTag&service[format]=JSON&params[userId]="+document.loggedinUserId+"&params[objectType]=User&params[objectId]="+a+"&params[tagValue]="+b+"&params[tagType]=shoutBox&user[token]="+document.userToken,dataType:"html",success:function(c){jQuery("#reply-shout-box-textarea").val("");jQuery.modal.close()},loading:true,loadingLocation:"#shout-reply"});return false});jQuery(".expressionRemove").live("click",function(){var a=jQuery(this).find("span").html();removeShouts(a)});function addShouts(){var a=jQuery("#shoutBox_CommentArea").val();jQuery("#shoutBox_ResultArea").expressionWebService({expAction:"AddTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"shoutBox",extraParam:"tagValue",dataType:"json",extraParamValue:a,loading:true,loadingLocation:"#shoutBox_ResultArea",success:function(b){jQuery("#shoutBox_CommentArea").val("");retrieveShouts()}})}function retrieveShouts(){jQuery("#shoutBox_ResultArea").expressionWebService({expAction:"retrieveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"shoutBox",extraParam:"tagValue",extraParamValue:"",dataType:"html",loading:true,loadingLocation:"#shoutBox_ResultArea",success:function(a){jQuery("#shoutBox_ResultArea").html(a)}})}function removeShouts(a){jQuery("#shoutBox_ResultArea").expressionWebService({expAction:"RemoveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"shoutBox",extraParam:"unId",extraParamValue:a,dataType:"json",loading:true,loadingLocation:"#shoutBox_ResultArea",success:function(b){retrieveShouts()}})}function removeComment(a){jQuery("#comment_AddArea").expressionWebService({expAction:"RemoveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"comment",extraParam:"unId",extraParamValue:a,dataType:"json",loading:true,loadingLocation:"#comment_AddArea",success:function(b){retrieveComments()}})}function retrieveComments(){var a=document.jsItemID;var b=document.jsItemType;jQuery("#comment_ResultArea").expressionWebService({expAction:"retrieveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"comment",extraParam:"tagValue",extraParamValue:"",dataType:"html",loading:true,loadingLocation:"#comment_ResultArea",success:function(c){jQuery("#comment_ResultArea").html(c)}})}function addComment(){var a=jQuery("#comment_UserComment").val();if(a!=""){jQuery("#comment_AddArea").expressionWebService({expAction:"AddTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"comment",extraParam:"tagValue",dataType:"json",extraParamValue:a,loading:true,loadingLocation:"#comment_AddArea",success:function(b){jQuery("#comment_UserComment").val("");retrieveComments()}})}}$(".button-iheart").live("click",function(a){a.preventDefault();addBookmark()});$(".heartthis-button").live("click",function(c){c.preventDefault();if(document.userToken){var d="";var b=$(".heartthis-count").html();var a=parseFloat(b)+1;$(this).expressionWebService({expAction:"AddTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"bookmark",extraParam:"tagValue",dataType:"json",extraParamValue:d,success:function(e){$(".heartthis-count").html(a);$(".heartthis-button").removeClass("heartthis-button").addClass("heartthis-button-disable")}})}else{loginModal()}});function addBookmark(){if(document.userToken){var a="";$(this).expressionWebService({expAction:"AddTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"bookmark",extraParam:"tagValue",dataType:"json",extraParamValue:a,loading:true,loadingLocation:"#iheartthis",success:function(b){retrieveBookmark()}})}else{loginModal()}}function retrieveBookmark(){var a="";jQuery("#iheartthis").expressionWebService({expAction:"retrieveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"bookmark",extraParam:"tagValue",extraParamValue:a,dataType:"html",loading:true,loadingLocation:"#section-i-heart-this .section-content",success:function(b){jQuery("#section-i-heart-this .section-content").html(b)}})}function removeBookmark(a){jQuery("#comment_AddArea").expressionWebService({expAction:"RemoveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"bookmark",extraParam:"unId",extraParamValue:a,dataType:"json",loading:true,loadingLocation:"#HeartThis",success:function(b){retrieveBookmark()}})}$("#service-link-view-all").live("click",function(a){a.preventDefault();var b="/services/gateway/?service[module]=Content&service[action]=GetContentBookmarkBlock&service[format]=html&user[token]="+document.userToken+"&params[itemId]="+document.jsItemID+"&params[itemType]="+document.jsItemType;$(this).webService({type:"GET",url:b,dataType:"html",success:function(c){$("#section-i-heart-this .section-content").html(c)},loading:true,loadingLocation:"#section-i-heart-this"})});$(".heartthis-who").live("click",function(a){a.preventDefault();var b="/services/gateway/?service[module]=Content&service[action]=GetContentBookmarkBlock&service[format]=html&user[token]="+document.userToken+"&params[itemId]="+document.jsItemID+"&params[serviceTemplate]=heartedList.tpl&params[itemType]="+document.jsItemType;$(this).webService({type:"GET",url:b,dataType:"html",success:function(c){$(".hearted-list").html($(c)).slideDown("slow")},loading:true,loadingLocation:"#section-social"})});$(".heartthis-close").live("click",function(a){a.preventDefault();$(".hearted-list").slideUp("slow")});jQuery.fn.slideFadeToggle=function(a,c,b){return this.animate({opacity:"toggle",height:"toggle"},a,c,b)};jQuery.fn.fadeToggle=function(a,c,b){return this.animate({opacity:"toggle"},a,c,b)};function playerReady(b){if(b.id){var a=audioPlayerTracker.getPlayerInstance(b.id);audioPlayerTracker.JWaddListeners(a)}}audioPlayerTracker=function(){var c=new Array();var a=new Array();var d=new Array();var b=new Array();return{playerLoadFile:function(g,e){var f=audioPlayerTracker.getPlayerInstance(e);currentItem=-1;previousItem=-1;f.sendEvent("LOAD",{file:g,provider:"rtmp"});f.sendEvent("PLAY")},getPlayerInstance:function(e){var f=document.getElementById(e);return f},JWaddListeners:function(e){if(e){e.addModelListener("STATE","audioPlayerTracker.JWstateAnalyticsListener");e.addModelListener("TIME","audioPlayerTracker.JWtimeListener");e.addModelListener("ITEM","audioPlayerTracker.JWitemListener")}else{setTimeout("audioPlayerTracker.JWaddListeners(obj)",100)}},JWstateAnalyticsListener:function(g){var e=g.oldstate;var f=g.newstate;if(e=="IDLE"&&f!="COMPLETED"){if(streamAnalyticsPrefix){jQuery.trackEvent("stream","plays",audioPlayerTracker.JWbuildAnalyticsReference(streamAnalyticsPrefix,g.id),null);b[playerId]=""}}currentState=g.newstate;if(currentState=="COMPLETED"){}if(currentState=="PLAYING"){}if(currentState=="PAUSED"){}},JWbuildAnalyticsReference:function(j,g){var h=audioPlayerTracker.getPlayerInstance(g);var i=d[g];if(h){playlist=h.getPlaylist();var e=h.getConfig()["item"];var f=playlist[e]["file"];return j+"|"+f}},JWtimeListener:function(i){var h=i.duration;var f=i.position;var g=i.id;var e=(f/h)*100;c[g]=Math.round(e);audioPlayerTracker.JWrecordDurationEvent(g,c[g])},JWrecordDurationEvent:function(e,f){if(f%25==0&&b[e]!=f&&f>0){b[e]=f;jQuery.trackEvent("stream","percent_played",audioPlayerTracker.JWbuildAnalyticsReference(streamAnalyticsPrefix,e),f)}},JWitemListener:function(f){var e=f.id;if(f.index!=d[e]){d[e]=f.index}}}}();audioPlayer=function(i){var k=i.playerDiv;var h=i.playerLocation;var f=i.playerSkin;var a=i.playerWidth;var l=i.playerHeight;var c=i.playerScheme;var b=i.playerProvider;var e=i.playerStreamer;var j=i.playerFile;var g=i.playerId;if(g==null){g="defaultMediaPlayer"}var d=new SWFObject(h,g,a,l,"9");d.addParam("allowfullscreen","true");d.addParam("allowscriptaccess","always");d.addParam("wmode","opaque");d.addVariable("skin",f);if(c=="rtmp"){d.addVariable("provider","rtmp");d.addVariable("streamer",e);d.addVariable("file",j)}else{d.addVariable("file",j)}d.addVariable("playerready","playerReady()");d.write(k)};function arrValueExists(b,c){for(var a=0;a<c.length;a++){if(c[a]==b){return true}}return false}function setCustomTheme(a,e,g,f,c){var d=jQuery.cookie(f);if(typeof c=="undefined"){var c=0}if(typeof f!="undefined"&&(!d||!arrValueExists(d,e))){d=e[Math.floor(Math.random()*e.length)];if(c>0){var b=new Date();b.setTime(b.getTime()+c)}else{var b=-1}jQuery.cookie(f,d,{path:"/",expires:b})}jQuery(a).addClass("theme-"+d);if(typeof g!="undefined"&&g){g(a,d,f)}}function updateCustomTheme(b,c,a){if(b==a){jQuery.cookie(c,null,{path:"/",expires:-1})}else{jQuery.cookie(c,b,{path:"/",expires:9999})}location.reload()}function iFrameAutoHeight(b,a){a=(typeof a=="undefined")?1:a;var c=jQuery(b,top.document).contents().find("#iframe-inner").height();if(a<4){if(c!==null&&typeof c=="number"&&c>0){jQuery(b,top.document).css("height",c+"px")}else{setTimeout(function(){iFrameAutoHeight(b,++a)},2500)}}};