/* Generated 2012-01-29 15:35:44*/var $=jQuery;function setEqualHeights(b){var a=0;b.each(function(){currentHeight=$(this).height();if(currentHeight>a){a=currentHeight}});b.height(a)}function preloadImages(a){if(a&&$(".thumb-carousel-wrapper").length){var b=0;var c=new Array();c=a.split(",");var d=new Image();for(b=0;b<=c.length-1;b++){$("body").append('<img style="display:none;" width="1" height="1" src="'+c[b]+'" />')}}}function reloadAds(){var a=imagesViewed%showAdEveryXPhoto;if(!a){document.cacheBuster=Math.round(Math.random()*100000000);$("#advert-leaderboard-1 iframe").attr("src",advertTop1+"&ord="+document.cacheBuster);$("#advert-island-1 iframe").attr("src",advertSide1+"&ord="+document.cacheBuster);if($("#advert-island-2 iframe").length){$("#advert-island-2 iframe").attr("src",advertIslandBottom+"&ord="+document.cacheBuster)}if($("#advert-leaderboard-2 iframe").length){$("#advert-leaderboard-2 iframe").attr("src",advertLeaderBottom+"&ord="+document.cacheBuster)}}imagesViewed++;return false}function netRatingsPageEvent(a){trac.pageEvent(a);return false}function netRatingsSlideEvent(a){trac.slideEvent(a);return false}function recordPageVisit(a,b){jQuery.post("/tasks/stats/record.php",{app_id:a,unique_id:b,statmanReferer:document.referrer})}function loginModal(){$(".modal-container .login-options").modal({containerCss:{height:347,width:540},persist:true})}$(document).ready(function(){jQuery(".button-shout-at-mate, .get-mates").live("click",function(b){b.preventDefault();$(".subpanel").hide();$("#footpanel li a").removeClass("active");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(b){b.preventDefault();var a=jQuery(this).attr("rel");shoutModal(a)})});function shoutModal(b){jQuery.modal.close();if($("#simplemodal-container").length<1){jQuery("#shout-reply").remove();jQuery("#site-footer").append("<div id='shout-reply'></div>");window.setTimeout(shoutReply,500)}var a="/services/gateway?service[module]=User&service[action]=UserDetails&service[format]=html&params[userId]="+b;$(this).webService({type:"post",url:a,dataType:"html",overlayClose:true,success:function(c){$("#shout-reply").html(jQuery(c).find("#shout-at-mates-reply"));$("#shout-at-mates-reply").fadeIn("fast")}})}function shoutReply(){jQuery("#shout-reply").modal({containerCss:{height:235,width:400}})}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 isHelperActiveForName(a){for(var b=0;b<helperValues.length;b++){helperItem=helperValues[b];if(helperItem.name==a){if(helperItem.count<helperMaxDisplayCount){return true}else{return false}}}return true}function updateHelper(a){var c=helperValues.length;for(var b=0;b<c;b++){helperItem=helperValues[b];if(helperItem.name==a){helperItem.count=helperItem.count+1;helperValues[b]=helperItem;updateHelperCookie(helperValues);return true}}helperValues.push(new helperValue(a,0));updateHelperCookie(helperValues)}function updateHelperCookie(a){a=$.toJSON(a);$.cookie("helper",a)}function helperValue(a,b){this.name=a;this.count=b}jQuery(".button-post-expression").live("click",function(){siteComments.addComment()});jQuery(".button-post-forum").live("click",function(){siteComments.addForumComment()});jQuery(".comment-add-another").live("click",function(a){a.preventDefault();$("#comments-message").slideUp("fast");$("#comments-reply").slideDown("fast")});siteComments=function(){return{init:function(){},removeComment:function(a){$(this).expressionWebService({expAction:"RemoveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"comment",extraParam:"unId",extraParamValue:a,dataType:"json",loading:true,loadingLocation:"#comments-posts",success:function(b){siteComments.retrieveComments()}})},retrieveComments:function(){var a=document.jsItemID;var b=document.jsItemType;$(this).expressionWebService({expAction:"retrieveTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"comment",extraParam:"tagValue",extraParamValue:"",dataType:"html",loading:true,loadingLocation:"#comments-posts",success:function(d){$("#comments-posts").html(d);if($(".viewPhoto, .snap").length){var c=parseInt(jQuery("#picIndex").html())-1;updateImageJSON(albumId,document.jsItemID,c)}}})},addComment:function(){var a=escape($("#comment-textarea").val());if(a!=""){$(".button-post-expression").removeClass("button-post-expression").addClass("button-post-inactive");$(this).expressionWebService({expAction:"AddTag",objectId:document.jsItemID,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"comment",extraParam:"tagValue",dataType:"json",extraParamValue:a,success:function(b){$("#comment-textarea").val("");siteComments.retrieveComments();$(".button-post-inactive").removeClass("button-post-inactive").addClass("button-post-expression");$("#comments-reply").slideUp("fast");$("#comments-message").fadeIn("slow")},loading:true,loadingLocation:".button-post-inactive"})}},addForumComment:function(){var c=$("#forum-thread-id").html();var b=escape($("#comment-textarea").val());if(b!=""){$(".button-post-forum").removeClass("button-post-forum").addClass("button-post-inactive");var a="/services/gateway/?service[module]=VBulletin&service[action]=CreateArticleComment&service[format]=json&params[itemType]="+document.jsItemType+"&params[article_id]="+document.jsItemID+"&params[thread_id]="+c+"&params[comment_text]="+b+"&user[token]="+document.userToken;$(this).webService({type:"POST",url:a,dataType:"json",success:function(d){$("#comment-textarea").val("");siteComments.retrieveForumComments(d.threadId);$(".button-post-inactive").removeClass("button-post-inactive").addClass("button-post-forum");$("#comments-reply").slideUp("fast");$("#comments-message .comment-post-result").html(d.message);$("#comments-message").fadeIn("slow")},loading:true,loadingLocation:".button-post-inactive"})}},retrieveForumComments:function(b){var a="/services/gateway/?service[module]=VBulletin&service[action]=ForumThreadData&service[format]=html&params[itemType]="+document.jsItemType+"&params[article_id]="+document.jsItemID+"&params[thread_id]="+b+"&params[order]=ASC&params[max_results]="+document.articleCommentCount+"&user[token]="+document.userToken;$(this).webService({type:"GET",url:a,dataType:"html",success:function(c){$("#comments-posts").html(c)},loading:true,loadingLocation:"#comments-posts"})},updateCommentBox:function(){var b=document.getElementById("comment_UserComment");var a=document.getElementById("comment_AddArea");if(!b.name){a.innerHTML="<div class='commentThreads first'><p><strong>Your comment has been added</strong></p></div>"}}}}();imageEmbedCode=function(a){var a=a;var b=jQuery("input[name=image-size]:checked").val();var d=jQuery("input[name=image-position]:checked").val();var c="";return{init:function(e){jQuery("input[name=image-size]").change(function(){imageEmbedCode.buildEmbedCode(e,b,d,c)});jQuery("input[name=image-position]").change(function(){imageEmbedCode.buildEmbedCode(e,b,d,c)});jQuery("input[name=image-alt]").change(function(){if(jQuery("#image-alt").val()==""){c=""}else{c="|"+jQuery("#image-alt").val()}imageEmbedCode.buildEmbedCode(e,b,d,c)});imageEmbedCode.buildEmbedCode(e,b,d,c);jQuery("#image-embed-code").click(function(){this.select()})},buildEmbedCode:function(e,f,h,g){var f=jQuery("input[name=image-size]:checked").val();var h=jQuery("input[name=image-position]:checked").val();jQuery("#image-embed-code").val("[img:"+e+"{"+f+"|"+h+g+"}]")}}}();$(".button-iheart").live("click",function(a){a.preventDefault();addBookmark()});$(".heartthis-close").live("click",function(a){a.preventDefault();$(".hearted-list").slideToggle("slow",function(){var b=".heartthis-close";if($(b).html()=="+ Hide"){$(b).html("+ Show")}else{$(b).html("+ Hide")}})});$(".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-wide"})});$(".heartthis-button").live("click",function(d){d.preventDefault();if(document.userToken){var e="";if($(this).hasClass("inbrief-heart-this")){$(this).css("background-position","130px -78px");var b=$(this).attr("rel")}else{if($(this).attr("topshotitem")){var b=$(this).attr("topshotitem")}else{var b=document.jsItemID}}var c=$(".heartthis-count").html();var a=parseFloat(c)+1;$(this).expressionWebService({expAction:"AddTag",objectId:b,objectType:document.jsItemType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"bookmark",extraParam:"tagValue",dataType:"json",extraParamValue:e,success:function(g){if($(".hearted-list").length){retrieveBookmarks(".hearted-list");$(".heartthis-count").html(a);$(".heartthis-button").removeClass("heartthis-button").addClass("heartthis-button-disable")}if($(".viewPhoto, .snap").length){var f=parseInt(jQuery("#picIndex").html())-1;updateImageJSON(albumId,document.jsItemID,f)}if($(".large .heartthis-button").length){$(".large .heartthis-button").addClass("hearted");$(".large .hearted").removeClass("heartthis-button")}}})}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",type:"get",loading:true,loadingLocation:"#section-i-heart-this .section-content",success:function(b){jQuery("#section-i-heart-this .section-content").html(b)}})}function retrieveBookmarks(b){var a="/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:a,dataType:"html",success:function(c){$(".hearted-list").html(c)},loading:true,loadingLocation:b})}function removeBookmark(a){jQuery("#comment_AddArea").expressionWebService({expAction:"RemoveTag",type:"POST",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){retrieveBookmarks()}})}$("#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"})});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 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(c,a){a=(typeof a=="undefined")?1:a;var d=jQuery(c,top.document).contents().find("#iframe-inner").height();var b=jQuery(c,top.document).parents().find(".advert").attr("id");if(a<4){if(d!==null&&typeof d=="number"&&d>0){jQuery(c,top.document).css("height",d+"px");if((d<=1)&&jQuery("#"+b).hasClass("advert-sponsor")){jQuery("#"+b).addClass("advert-empty")}else{jQuery("#"+b).css("display","block");jQuery("#"+b).removeClass("advert-empty")}}else{setTimeout(function(){iFrameAutoHeight(c,++a)},2500)}}}eventAddInvite=function(){return{init:function(){eventAddInvite.moduleType="WhatsOn";eventAddInvite.eventId=document.jsItemID;jQuery(".event-add-me").click(function(){if(document.loggedinUserName){if(jQuery(".event-add-me").length&&jQuery(this).attr("id")!=""){eventAddInvite.eventId=jQuery(this).attr("id")}eventAddInvite.inviteFriendsModal();eventAddInvite.addCalendar()}else{loginModal()}});jQuery(".event-invite-mates").live("click",function(){eventAddInvite.inviteFriendsModal()});jQuery(".event-invite-accept").live("click",function(){eventAddInvite.inviteFriendsModal();eventAddInvite.addCalendar();jQuery("#section-invite-mate").fadeOut();setTimeout(function(){jQuery("#section-invite-mate").remove()},1500)});jQuery(".event-invite-reject").live("click",function(){var a="/services/gateway/?service[module]=WhatsOn&service[action]=InviteReject&service[format]=json&params[actionableId]="+document.actionableId+"&user[token]="+document.userToken;jQuery(this).webService({type:"POST",url:a,dataType:"json",success:function(b){jQuery("#section-invite-mate").fadeOut();setTimeout(function(){jQuery("#section-invite-mate").remove()},1500)},error:"true",loading:true,loadingLocation:".members-invitation-request"})});jQuery(".event-invite-all").live("click",function(){jQuery("#mates-list li").addClass("selected");jQuery("#mates-list li").each(function(a,b){var c=jQuery(b).find("img").attr("id");jQuery("#invite-mates-list-submit").append("<li id=sumbit-mate-"+c+">"+c+"</li>")})});jQuery(".event-invite-all").live("click",function(){jQuery("#mates-list li").addClass("selected");jQuery("#mates-list li").each(function(a,b){var c=jQuery(b).find("img").attr("id");jQuery("#invite-mates-list-submit").append("<li id=sumbit-mate-"+c+">"+c+"</li>")})});jQuery("#mates-list li").live("click",function(){if(jQuery(this).is(".selected")){var a=jQuery(this).find("img").attr("id");jQuery(this).removeClass("selected");jQuery("#invite-mates-list-submit #sumbit-mate-"+a).remove()}else{var a=jQuery(this).find("img").attr("id");jQuery(this).addClass("selected");jQuery("#invite-mates-list-submit").append("<li id=sumbit-mate-"+a+">"+a+"</li>")}});jQuery(".event-invite-button").live("click",function(){var c=jQuery.makeArray();jQuery("#invite-mates-list-submit li").each(function(e,f){c.push(jQuery(f).html())});if(jQuery("#invite-mates-email textarea").val()=="friend@somewhere.com\n"){var d=""}else{var d=jQuery("#invite-mates-email textarea").val().split("\n")}if(jQuery("#invite-mates-message textarea").val()=="enter text..\n"){var b=""}else{var b=jQuery("#invite-mates-message textarea").val()}var a="/services/gigguide/event/"+eventAddInvite.eventId+"/invite.json?params[message]="+b+"&params[invitees][userIds]="+c+"&params[invitees][emails]="+d+"&user[token]="+document.userToken;jQuery(this).webService({type:"POST",url:a,dataType:"json",success:function(f){var e="#"+eventAddInvite.eventId;jQuery("#section-members-going .section-content").append('<span class="button-action-spc event-invite-mates"><span class="symbol symbol-plus">+</span>Invite friends</span>');if(f[0]=="Invited"){jQuery("#invite-mates-result").html("Your mates have been invited to this event")}else{jQuery("#invite-mates-result").html("There was a problem with your request, please try again later...")}jQuery("#invite-mates-result").fadeIn();setTimeout(function(){if(jQuery(e).length){jQuery(e).remove()}else{jQuery(".event-add-me,.event-invite-mates").remove()}jQuery("#simplemodal-overlay,#simplemodal-container").fadeOut();jQuery.modal.close()},2500)},loading:true,loadingLocation:".event-invite-button"})});jQuery(".event-invite-cancel,.modalCloseImg").live("click",function(){var a="#"+eventAddInvite.eventId;if(jQuery(a).length){if(jQuery(".item-counter-additional").length){var c=".item-counter-additional "+a;var b="#going-"+eventAddInvite.eventId+" .item-counter-number";var d=parseInt(jQuery(b).html());jQuery(b).html(d+1);jQuery(c).html("ADDED");jQuery(c).removeClass("event-add-me")}else{jQuery(a).remove()}}else{jQuery(".event-add-me,.event-invite-mates").remove()}jQuery("#section-members-going .section-content").append('<span class="button-action-spc event-invite-mates"><span class="symbol symbol-plus">+</span>Invite friends</span>');jQuery.modal.close()})},inviteFriendsModal:function(){jQuery("#inviteFriendsModalBox").remove();jQuery("#site-footer").append("<div id='inviteFriendsModalBox'></div>");jQuery("#inviteFriendsModalBox").modal({containerCss:{height:480,width:450}});jQuery("#inviteFriendsModalBox").webService({type:"GET",url:"/services/gateway/?service[module]=User&service[action]=getUserBuddies&service[format]=html&service[templateName]=inviteMates&params[offset]=1000&params[userId]="+document.loggedinUserId+"&params[eventId]="+eventAddInvite.eventId+"&params[isMe]=true&user[token]="+document.userToken,dataType:"html",loading:true,loadingText:true,loadingLocation:"#inviteFriendsModalBox",success:function(a){jQuery("#inviteFriendsModalBox").html(a)}})},retrieveCalendar:function(){jQuery(this).expressionWebService({expAction:"retrieveTag",objectId:eventAddInvite.eventId,objectType:eventAddInvite.moduleType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"calendar",extraParam:"tagValue",extraParamValue:"",dataType:"html",loading:true,loadingLocation:"#members-going-list",success:function(a){jQuery(".going-list-summary").html(a);var b=jQuery(".event-add-me span").html();if(b!="Invite mates"){var c=parseInt(jQuery("h2.members-going-list-count span").html());var c=c+1;if(c==1){jQuery(".members-going-list-count").html("There is <span>1</span> Member going")}if(c>1){jQuery(".members-going-list-count").html("There are <span>2</span> Members going")}jQuery(".members-going-list-count span").html(c)}}})},addCalendar:function(){jQuery(this).expressionWebService({expAction:"AddTag",objectId:eventAddInvite.eventId,objectType:eventAddInvite.moduleType,extraParamBoolean:true,extraParamType:"tagType",extraParamTypeValue:"calendar",extraParam:"actionableId",extraParamValue:document.actionableId,dataType:"json",loading:true,loadingLocation:"#members-going-list",success:function(a){if(jQuery(".going-list-summary").length){eventAddInvite.retrieveCalendar()}if(jQuery("#invite-mates-result").length){jQuery("#invite-mates-result").html("You have been added to this event, Invite some mates").fadeIn("slow");setTimeout(function(){jQuery("#invite-mates-result").fadeOut("slow")},2500)}}})},inviteRequest:function(){jQuery(this).webService({type:"get",url:"/services/gateway/?service[module]=WhatsOn&service[action]=InviteOpen&service[format]=html&params[templateName]=openInvite&params[actionableId]="+document.actionableId+"&user[token]="+document.userToken,dataType:"html",success:function(a){if(a!=""){jQuery("#section-invite-mate .section-content").append(a)}},loading:true,loadingLocation:"#section-invite-mate"})}}}();galleryManageTools=function(){return{init:function(b){if(document.jsCurrentTheme=="user"||document.jsCurrentTheme=="ugc"){var a="/services/gateway/gallery/"+b+"/retrieveManageMenu.php?user[token]="+document.userToken+"&params[template]=UserGalleryManageTools.tpl&service[format]=html"}else{var a="/services/gateway/gallery/"+b+"/retrieveManageMenu.php?user[token]="+document.userToken+"&service[format]=html"}if(a!=""){$(this).webService({type:"get",url:a,dataType:"html",success:function(c){jQuery("#manage-tools").html(c);if(document.jsCurrentAction=="ViewAlbum"){$("#album-delete-image").remove()}}})}$("#album-delete-image").live("click",function(c){c.preventDefault();galleryManageTools.albumDeleteImage(b)});$("#album-edit").live("click",function(c){c.preventDefault();galleryManageTools.albumEdit(b)});$("#album-delete").live("click",function(c){c.preventDefault();galleryManageTools.albumDelete(b)});$("#album-merge").live("click",function(c){c.preventDefault();galleryManageTools.albumMerge(b)});$("#user-album-delete-image").live("click",function(c){c.preventDefault();galleryManageTools.userAlbumDeleteImage(b)});$("#user-album-delete").live("click",function(c){c.preventDefault();galleryManageTools.userAlbumDelete(b)})},albumDeleteImage:function(c){var b=$("#selectedImageSection img").attr("id");var a=confirm(document.loggedinUserName+", are you fricken sure you want to delete this image (id: "+b+")?\n Don't say we didn't warn you, once it's deleted, it's deleted.");if(a){window.location.href="/gallery/delete/?albumId="+c+"&imageId="+b}},albumEdit:function(a){window.location.href="/gallery/edit/"+a},albumDelete:function(b){var a=confirm(document.loggedinUserName+", this will delete the album, and you can't recover it, go on, click OK if you are sure.");if(a){window.location.href="/gallery/delete/?albumId="+b}},albumMerge:function(b){var c=$("#destinationAlbumId").val();if(c!=""){var a=confirm(document.loggedinUserName+", are you sure you want to merge this album with album id "+c+"?\n This process is distructive and can not be un-done.");if(a){window.location.href="/gallery/MergeItem?albumId="+document.jsItemID+"&destinationId="+getItem("destinationAlbumId").value}}},userAlbumDeleteImage:function(c){var b=$("#selectedImageSection img").attr("id");var a=confirm(document.loggedinUserName+", are you fricken sure you want to delete this image (id: "+b+")?\n Don't say we didn't warn you, once it's deleted, it's deleted.");if(a){window.location.href="/people/"+document.loggedinUserName+"/gallery/delete/?albumId="+c+"&imageId="+b}},userAlbumDelete:function(b){var a=confirm(document.loggedinUserName+", this will delete the album, and you can't recover it, go on, click OK if you are sure.");if(a){window.location.href="/people/"+document.loggedinUserName+"/gallery/delete/?albumId="+b}}}}();articleManageTools=function(){return{init:function(){$("#content-changelog").live("click",function(b){b.preventDefault();var a="/index.php?module=Default&action=ShowToolTemplate&template=changeLogContentTool&itemID="+document.jsItemID+"&userModule="+document.jsItemType+"&id="+document.jsItemID+"&userAction=View&user[token]="+document.userToken;$(this).webService({type:"post",url:a,dataType:"html",success:function(d){$("#statsArea").html(d);jQuery.modal.close();window.setTimeout(c,500);function c(){$("#statsArea").modal({autoResize:true,containerCss:{height:400,width:545},overlayClose:true})}}})});$("#content-editor-pick").live("click",function(c){c.preventDefault();var a=$("input[name=content-editor-pick]").attr("checked");var b="/services/gateway/?service[module]=Content&service[action]=setEditorsPick&service[format]=html&params[active]="+a+"&params[id]="+document.jsItemID+"&user[token]="+document.userToken;$(this).webService({type:"post",url:b,dataType:"html",success:function(d){if(a==true){$("input[name=content-editor-pick]").attr("checked","checked")}else{$("input[name=content-editor-pick]").attr("checked","")}alert(d)}})});$("#content-suspend").live("click",function(c){c.preventDefault();var b=$("textarea[name=content-suspend-reason]").val();var a="/services/gateway/?service[module]=Content&service[action]=suspendArticle&service[format]=html&params[reason]="+b+"&params[id]="+document.jsItemID+"&user[token]="+document.userToken;var d=confirm(document.loggedinUserName+", you are about to suspend this article, make sure you have a good reason why.");if(d){$(this).webService({type:"post",url:a,dataType:"html",success:function(e){alert(e)}})}})}}}();function endlessScroll(){page=parseInt($(this).parent().find(".endless-scroll-container").attr("page"));serviceURL=$(this).parent().find(".endless-scroll-container").attr("service");socialButtons=$(this).parent().find(".endless-scroll-container").attr("social");loadingElement=$(this).parent().find(".endless-scroll-container");triggerElement=$(this).find(".endless-scroll-trigger");newPage=page+1;if(typeof maxPageResultsSize!="undefined"){var a={"params[page]":newPage,"params[pageSize]":maxPageResultsSize}}else{var a={"params[page]":newPage}}if(newPage<=document.maxAutoScroll){$.get(serviceURL,a,function(b){if(b!=""){$(loadingElement).append(b);$(loadingElement).attr("page",newPage);if(socialButtons=="true"){FB.XFBML.parse();gapi.plusone.go();if($("a.twitter-share-button",b).length>0){$.ajax({url:"http://platform.twitter.com/widgets.js",dataType:"script",cache:true})}}}else{$(this).remove()}})}else{$(this).remove()}};
