var AccountBlogSingleEntry={};AccountBlogSingleEntry.entryContentEditor=undefined;AccountBlogSingleEntry.quotedHTML="";AccountBlogSingleEntry.initialEditorText="<p>Please add a comment.</p>";var AccountBlogVoting={};AccountBlogVoting.initSharedObjectCommunicator=function(){if($("#soCommContent").length>0){var c="/server/swf/singlemedia/so_comm_center.swf";var a={};var d={allowScriptAccess:"always"};var b={name:"singleMediaSO"};swfobject.embedSWF(c,"soCommContent","30","30","9.0.0","/server/swf/expressInstall.swf",a,d,b);setTimeout("AccountBlogVoting.checkDisableVoting()",1000)}};AccountBlogVoting.hideVoteButton=function(a){$("li#"+String(a)).parent("ul").find("a.voteButton").remove()};AccountBlogVoting.checkDisableVoting=function(){$("li.entryId").each(function(a){var b=parseInt($(this).attr("id"),10);if(AccountBlogVoting.checkVoted(b)==true){AccountBlogVoting.hideVoteButton(b)}})};AccountBlogVoting.checkVoted=function(b){var a=false;try{$.getSWF("soCommContent").checkVoteExists(b)}catch(c){a=true}if(a===false){return $.getSWF("soCommContent").checkVoteExists(b)}else{return false}};AccountBlogVoting.savedVoteToSharedObject=function(c){try{$.getSWF("soCommContent").saveVote(c)}catch(d){}var b=$.getCookie("entryVotes");if(b==undefined||typeof(b)=="undefined"){b=""}var a=c+","+b;$.setCookie("entryVotes",a,365)};AccountBlogSingleEntry.styleComponents=function(){$("#commentForm input[type=checkbox]").styledCheckbox();$("#anonymousWebsite").keydown(function(b){if(b.keyCode==9){var a=AccountBlogSingleEntry.entryContentEditor;$(a.getContainer()).addClass("active");AccountBlogSingleEntry.autoClearTinyMCE(a,"focus");a.focus();b.stopImmediatePropagation();b.preventDefault();return false}})};AccountBlogSingleEntry.createComments=function(){$(".commentsList li.collapsible").collapsibleComment();$(".commentsList li").deleteCommentWarning();$(".commentsList li").quotableComment();$(".commentsList li").editableComment();$("#commentForm input:submit").mouseover(function(){AccountBlogSingleEntry.setQuoteContent()})};AccountBlogSingleEntry.setQuoteContent=function(){var d=$("#add_comment_content");var c=d.val();var b=$("#add_comment_content_tbl tr.quotedText td").html();if(b!==null){b='<div class="quoted"><blockquote>'+b+"</blockquote></div>";b='<div class="quoted">'+$(b).find("a.remove").remove().end().html()+"</div>";if(b!==AccountBlogSingleEntry.quotedHTML){AccountBlogSingleEntry.quotedHTML=b;d.val(b+c).text(b+c);console.info("If you see this, quoting should have been added successfully")}}else{var c=d.text();if(c.indexOf('<div class="quoted">')!==-1){var a=c.indexOf("</div>")+6;var e=c.length;var f=c.substr(a,e);d.val(f).text(f);AccountBlogSingleEntry.quotedHTML=""}}};AccountBlogSingleEntry.setupContentEditor=function(){var b={iframeID:"#add_comment_content_ifr",fieldsetID:"#createEntryContent",form:"form#commentForm",initialEditorText:AccountBlogSingleEntry.initialEditorText,embedPlaceHolderImageClass:" width600"};var a={height:"137",theme_advanced_buttons1:"bold, italic, underline, link, unlink, externalEmbed, image"};var d=new EmbedCommon("add_comment_content",b,a);var c=function(){};EmbedCommon.addButton("link",c);EmbedCommon.addButton("externalEmbed",c);EmbedCommon.addButton("image",c);EmbedCommon.addEvent("onClick",function(){$("#commentForm input:submit").mouseover()});EmbedCommon.addEvent("onKeyUp",function(){AccountBlogSingleEntry.includeQuoteHTML()});EmbedCommon.addEvent("onChange",function(){AccountBlogSingleEntry.includeQuoteHTML()});AccountBlogSingleEntry.entryContentEditor=EmbedCommon.getEditor();AccountBlogSingleEntry.entryContentEditor.render()};AccountBlogSingleEntry.includeQuoteHTML=function(){var a;var b=EmbedCommon.tinyEditor;if(AccountBlogSingleEntry.quotedHTML.length>1){a=AccountBlogSingleEntry.quotedHTML+b.getContent()}else{a=b.getContent()}EmbedCommon.updateTextArea(a)};AccountBlogSingleEntry.fixQuoteMarkup=function(){$("div.quoted").each(function(){$(this).parent("div.comment").before($(this))});$("blockquote a.remove").hide()};AccountBlogSingleEntry.initInviteFriends=function(){AccountBlogSingleEntry.initInviteFriends.BindShowServices();InviteFriends.RequestCompleteCallback=function(){};$("#servicesCredentials fieldset.services a.facebook").click(function(){if(InviteFriends.Facebook.IsLoggedIn){$("div.justPosted p.invite").html('<a href="#">Select other services.</a>');$("div.expand").removeClass("expand").addClass("facebook")}AccountBlogSingleEntry.initInviteFriends.SetupFacebookReturnLink()});$("#iphoneHeaderComponent span.close").click(function(){$.setCookie("iphoneHeaderComponent","1",5000);$("#iphoneHeaderComponent").hide()});$("#justPostedHeaderComponent span.close").click(function(){$.setCookie("justPostedHeaderComponent","1",5000);$("#justPostedHeaderComponent").hide()});InviteFriends.AfterSendCallback=function(){$("h2.browse").removeClass("browse").addClass("sent");$("div.mainCol div.links").html("")}};AccountBlogSingleEntry.initInviteFriends.BindShowServices=function(){$("#justPostedHeaderComponent p.invite a").click(function(){$("div.justPosted").addClass("expand");$("#inviteFriendsComponent").show();$("div.justPosted p.invite a").replaceWith($(this).text())})};AccountBlogSingleEntry.initInviteFriends.SetupFacebookReturnLink=function(){$("#justPostedHeaderComponent p.invite a").click(function(){$("div.facebook").removeClass("facebook").addClass("expand");$("div.justPosted p.invite").html("Invite your friends to see it.");InviteFriends.ResetInviteForm()})};AccountBlogSingleEntry.formValid=function(){AccountBlogSingleEntry.hideInvalidMessage();AccountBlogSingleEntry.disableSubmit();var b=true;var a=AccountBlogSingleEntry.entryContentEditor.getContent();if(a==AccountBlogSingleEntry.initialEditorText){b=false;AccountBlogSingleEntry.showInvalidMessage("Please add a comment.")}else{if($("#add_comment_content").text().length<1){b=false;AccountBlogSingleEntry.showInvalidMessage("Please add a comment.")}}$(".wrapMainSubNoBottom").columnEqualizer();if($("#anonymousName").length!==0){$("#anonymousName").parents(".roundedInputField").removeClass("inputError");if($("#anonymousName").val().length<1){$("#anonymousName").parents(".roundedInputField").addClass("inputError");AccountBlogSingleEntry.showInvalidMessage("Please include your name");b=false}}if(b===false){AccountBlogSingleEntry.enableSubmit()}return b};AccountBlogSingleEntry.showInvalidMessage=function(a){$("#commentForm input:submit").after('<span class="error commentFormErrorMsg">'+a+"</span>")};AccountBlogSingleEntry.hideInvalidMessage=function(){$(".commentFormErrorMsg").remove()};AccountBlogSingleEntry.resetForm=function(){AccountBlogSingleEntry.hideInvalidMessage();$("tr.quotedText").remove();tinyMCE.activeEditor.setContent("<p>Please add a comment.</p>");tinyMCE.activeEditor.save();EmbedCommon.refreshEditorHeight()};AccountBlogSingleEntry.disableSubmit=function(){$("#commentForm .submitBtnWrapper").parent().addClass("disabled");$("#commentForm .submitBtnWrapper").parent().find("label").css("opacity",0.4)};AccountBlogSingleEntry.enableSubmit=function(){$("#commentForm .submitBtnWrapper").parent().removeClass("disabled");$("#commentForm .submitBtnWrapper").parent().find("label").css("opacity",1)};AccountBlogSingleEntry.fixLinks=function(){$("div.entryText a, ul.commentsList div.comment a").attr("target","_blank");if($(".shareEntryFooter ul li:first-child a").length>0){var a=$(".shareEntryFooter ul li:first-child a").attr("href");var b="http://www.twitter.com/home/?status="+a.split("?u=")[1];$("a.smallIcon:eq(1)").attr("href",a);$("a.smallIcon:eq(0)").attr("href",b)}};AccountBlogSingleEntry.fixImages=function(){$(".entryText p img").removeAttr("width").removeAttr("height")};$(document).ready(function(){AccountBlogVoting.initSharedObjectCommunicator();AccountBlogSingleEntry.fixLinks();AccountBlogSingleEntry.fixImages();AccountBlogSingleEntry.styleComponents();AccountBlogSingleEntry.createComments();AccountBlogSingleEntry.fixQuoteMarkup();AccountBlogSingleEntry.setupContentEditor();AccountBlogSingleEntry.initInviteFriends();setTimeout("$('.wrapMainSubNoBottom').columnEqualizer()",1000);setTimeout("$('.wrapMainSubNoBottom').columnEqualizer()",4000)});