var lt="WYSIWYG functionality based on widgEdit.js (modified by Xanga)";lt+="Copyright (C) 2005 Cameron Adams (http://www.themaninblue.com/), which is licensed under the GNU General Public License";lt+="(either version 2 of the License, or (at your option) any later version - http://www.gnu.org/licenses/)";var timeoutFunction;if(window.restrictedSetTimeout){timeoutFunction=window.restrictedSetTimeout}else{timeoutFunction=window.setTimeout}var widgToolbarItems=new Array();widgToolbarItems.push("bold");widgToolbarItems.push("italic");widgToolbarItems.push("hyperlink");widgToolbarItems.push("smiley");widgToolbarItems.push("htmlsource");widgToolbarItems.push("commentplaintext");widgToolbarItems.push("commenthelp");var widgInsertParagraphs=true;function widgInit(){if(typeof (document.designMode)=="string"&&(document.all||document.designMode=="off")){var B=document.getElementsByTagName("textarea");for(var A=0;A<B.length;A++){var C=B[A];if(C.className.classExists("widgEditor")){if(C.id==""){C.id=C.name}timeoutFunction(function(){new widgEditor(C.id)},500*(A))}}}else{return false}return true}function widgEditor(B){var A=this;this.theTextarea=document.getElementById(B);this.theContainer=document.createElement("div");this.theGenericDiv=document.createElement("div");this.theIframe=document.createElement("iframe");this.theInput=document.createElement("input");this.theExtraInput=document.createElement("input");this.IE=false;this.locked=true;this.pasteCache="";this.wysiwyg=true;if(document.all){this.IE=true}if(this.theTextarea.id==null){this.theTextarea.id=this.theTextarea.name}this.theTextarea.style.visibility="hidden";this.theContainer.id=this.theTextarea.id+"WidgContainer";this.theContainer.className="itemfooter";this.theIframe.id=this.theTextarea.id+"WidgIframe";this.theIframe.className="widgIframe";this.theInput.type="hidden";this.theInput.id=this.theTextarea.id;this.theInput.name=this.theTextarea.name;this.theInput.value=this.theTextarea.value;this.theToolbar=new widgToolbar(this);this.theExtraInput.type="hidden";this.theExtraInput.id=this.theTextarea.id+"WidgEditor";this.theExtraInput.name=this.theTextarea.name+"WidgEditor";this.theExtraInput.value="true";this.theTextarea.id+="WidgTextarea";this.theTextarea.name+="WidgTextarea";this.theContainer.appendChild(this.theToolbar.theList);this.theTextarea.parentNode.replaceChild(this.theContainer,this.theTextarea);this.theGenericDiv.appendChild(this.theIframe);this.theContainer.appendChild(this.theInput);this.theGenericDiv.appendChild(this.theExtraInput);this.theInput.widgEditorObject=this;document.getElementById("x-spaceholder").parentNode.replaceChild(this.theGenericDiv,document.getElementById("x-spaceholder"));this.writeDocument(this.theInput.value);this.initEdit();this.modifyFormSubmit();return true}widgEditor.prototype.cleanSource=function(){var A="";if(this.wysiwyg){A=this.theIframe.contentWindow.document.getElementsByTagName("body")[0].innerHTML}else{A=this.theTextarea.value}A=A.validTags();A=A.replace(/^\s+/,"");A=A.replace(/\s+$/,"");A=A.replace(/ style="[^"]*"/g,"");A=A.replace(/<br>/g,"<br />");A=A.replace(/<br \/>\s*<\/(h1|h2|h3|h4|h5|h6|li|p)/g,"</$1");A=A.replace(/(<img [^>]+[^\/])>/g,"$1 />");A=A.replace(/(<[^\/]>|<[^\/][^>]*[^\/]>)\s*<\/[^>]*>/g,"");A=A.replace(/<img[^<>]*src="http:\/\/s.xanga.com\/images\/(happy|sad|winky|silly|laughing|angry|censored|bitter|confused|clueless|wtf|shocked|stunned|surprised|whatevah|bummed|pleased|cool|blush|shy|kiss|smooch|heart)[\d]?.gif"[^<>]*>/gi,":$1:");if(this.wysiwyg){this.theIframe.contentWindow.document.getElementsByTagName("body")[0].innerHTML=A}else{this.theTextarea.value=A}this.theInput.value=A;return true};widgEditor.prototype.convertSPANs=function(B){if(B){var G=this.theIframe.contentWindow.document.getElementsByTagName("span");while(G.length>0){var A=new Array();var F=null;var H=null;for(var D=0;D<G[0].childNodes.length;D++){A.push(G[0].childNodes[D].cloneNode(true))}switch(G[0].getAttribute("style")){case"font-weight: bold;":F=this.theIframe.contentWindow.document.createElement("strong");H=F;break;case"font-style: italic;":F=this.theIframe.contentWindow.document.createElement("em");H=F;break;case"font-weight: bold; font-style: italic;":H=this.theIframe.contentWindow.document.createElement("em");F=this.theIframe.contentWindow.document.createElement("strong");F.appendChild(H);break;case"font-style: italic; font-weight: bold;":H=this.theIframe.contentWindow.document.createElement("strong");F=this.theIframe.contentWindow.document.createElement("em");F.appendChild(H);break;default:replaceNodeWithChildren(G[0]);break}if(F!=null){for(var D=0;D<A.length;D++){H.appendChild(A[D])}G[0].parentNode.replaceChild(F,G[0])}G=this.theIframe.contentWindow.document.getElementsByTagName("span")}}else{var E=this.theIframe.contentWindow.document.getElementsByTagName("em");while(E.length>0){var A=new Array();var C=this.theIframe.contentWindow.document.createElement("span");C.setAttribute("style","font-style: italic;");for(var D=0;D<E[0].childNodes.length;D++){A.push(E[0].childNodes[D].cloneNode(true))}for(var D=0;D<A.length;D++){C.appendChild(A[D])}E[0].parentNode.replaceChild(C,E[0]);E=this.theIframe.contentWindow.document.getElementsByTagName("em")}var I=this.theIframe.contentWindow.document.getElementsByTagName("strong");while(I.length>0){var A=new Array();var C=this.theIframe.contentWindow.document.createElement("span");C.setAttribute("style","font-weight: bold;");for(var D=0;D<I[0].childNodes.length;D++){A.push(I[0].childNodes[D].cloneNode(true))}for(var D=0;D<A.length;D++){C.appendChild(A[D])}I[0].parentNode.replaceChild(C,I[0]);I=this.theIframe.contentWindow.document.getElementsByTagName("strong")}}return true};widgEditor.prototype.initEdit=function(){var A=this;try{this.theIframe.contentWindow.document.designMode="on"}catch(B){timeoutFunction(function(){A.initEdit()},250);return false}if(!this.IE){this.convertSPANs(false)}this.theContainer.style.visibility="visible";this.theTextarea.style.visibility="visible";if(typeof document.addEventListener=="function"){this.theIframe.contentWindow.document.addEventListener("mouseup",function(){widgToolbarCheckState(A);return true},false);this.theIframe.contentWindow.document.addEventListener("keyup",function(C){A.keyCheck(C,A);return true},false)}else{this.theIframe.contentWindow.document.attachEvent("onmouseup",function(){widgToolbarCheckState(A);return true});this.theIframe.contentWindow.document.attachEvent("onkeyup",function(C){A.keyCheck(C,A);return true})}this.locked=false;return true};widgEditor.prototype.keyCheck=function(B,A){var C=B.keyCode;if(C!=null&&C!=37&&C!=38&&C!=39&&C!=40){return true}else{return widgToolbarCheckState(A)}};widgEditor.prototype.insertNewParagraph=function(A,E){var D=this.theIframe.contentWindow.document.getElementsByTagName("body")[0];var C=this.theIframe.contentWindow.document.createElement("p");for(var B=0;B<A.length;B++){C.appendChild(A[B])}if(typeof (E)!="undefined"){D.insertBefore(C,E)}else{D.appendChild(C)}return true};widgEditor.prototype.modifyFormSubmit=function(){var A=this;var C=this.theContainer.parentNode;var B=null;while(C.nodeName.toLowerCase()!="form"){C=C.parentNode}B=C.onsubmit;if(typeof C.onsubmit!="function"){C.onsubmit=function(){A.updateWidgInput();return A.cleanSource()}}else{C.onsubmit=function(){A.updateWidgInput();A.cleanSource();return B()}}return true};widgEditor.prototype.paragraphise=function(){if(widgInsertParagraphs&&this.wysiwyg){var C=this.theIframe.contentWindow.document.getElementsByTagName("body")[0];for(var B=0;B<C.childNodes.length;B++){if(C.childNodes[B].nodeName.toLowerCase()=="#text"&&C.childNodes[B].data.search(/^\s*$/)!=-1){C.removeChild(C.childNodes[B]);B--}}var A=new Array();for(var B=0;B<C.childNodes.length;B++){if(C.childNodes[B].nodeName.isInlineName()){A.push(C.childNodes[B].cloneNode(true));C.removeChild(C.childNodes[B]);B--}else{if(C.childNodes[B].nodeName.toLowerCase()=="br"){if(B+1<C.childNodes.length){if(C.childNodes[B+1].nodeName.toLowerCase()=="br"){while(B<C.childNodes.length&&C.childNodes[B].nodeName.toLowerCase()=="br"){C.removeChild(C.childNodes[B])}if(A.length>0){this.insertNewParagraph(A,C.childNodes[B]);A=new Array()}}else{if(!C.childNodes[B+1].nodeName.isInlineName()){C.removeChild(C.childNodes[B])}else{if(A.length>0){A.push(C.childNodes[B].cloneNode(true));C.removeChild(C.childNodes[B])}else{C.removeChild(C.childNodes[B])}}}B--}else{C.removeChild(C.childNodes[B])}}else{if(A.length>0){this.insertNewParagraph(A,C.childNodes[B]);A=new Array()}}}}if(A.length>0){this.insertNewParagraph(A)}}return true};widgEditor.prototype.refreshDisplay=function(){if(this.wysiwyg){this.theIframe.contentWindow.document.getElementsByTagName("body")[0].innerHTML=this.theInput.value}else{this.theTextarea.value=this.theInput.value}return true};widgEditor.prototype.switchMode=function(){if(!this.locked){this.locked=true;if(this.wysiwyg){this.updateWidgInput();this.theTextarea.value=this.theInput.value;this.theGenericDiv.replaceChild(this.theTextarea,this.theIframe);this.wysiwyg=false;this.locked=false}else{this.updateWidgInput();this.theGenericDiv.replaceChild(this.theIframe,this.theTextarea);this.writeDocument(this.theInput.value);this.initEdit();this.wysiwyg=true}}return true};widgEditor.prototype.updateWidgInput=function(){if(this.wysiwyg){if(!this.IE){this.convertSPANs(true)}this.paragraphise();this.cleanSource()}else{this.processSmileys();this.theInput.value=this.theTextarea.value}return true};widgEditor.prototype.processSmileys=function(){var A=this.theTextarea.value;A=A.replace(/:(kiss|heart):/g,'<img src="http://s.xanga.com/images/$12.gif" />');A=A.replace(/:(happy|sad|winky|silly|laughing|angry|censored|bitter|confused|clueless|wtf|shocked|stunned|surprised|whatevah|bummed|pleased|cool|blush|shy|smooch):/g,'<img src="http://s.xanga.com/images/$1.gif" />');this.theTextarea.value=A};widgEditor.prototype.writeDocument=function(B){var A='		<html>			<head>			<style>			body            {	            font-family: Arial, Helvetica, sans-serif;	            font-size: 80%;	            background-color: #FFFFFF;	            color: #000000;            }			</style>			</head>			<body id="iframeBody">				INSERT:CONTENT:END			</body>		</html>	';A=A.replace(/INSERT:CONTENT:END/,B);this.theIframe.contentWindow.document.open();this.theIframe.contentWindow.document.write(A);this.theIframe.contentWindow.document.close();return true};function widgToolbar(D){var A=this;this.widgEditorObject=D;this.theList=document.createElement("ul");this.theList.id=this.widgEditorObject.theInput.id+"WidgToolbar";this.theList.className="widgToolbar";this.theList.widgToolbarObject=this;for(var C=0;C<widgToolbarItems.length;C++){switch(widgToolbarItems[C]){case"bold":this.addButton(this.theList.id+"ButtonBold","submitcomment-wysi submitcomment-bold","bold","bold","http://s.xanga.com/images/comment-wysi-bold.gif");break;case"italic":this.addButton(this.theList.id+"ButtonItalic","submitcomment-wysi submitcomment-italic","italic","italic","http://s.xanga.com/images/comment-wysi-italic.gif");break;case"hyperlink":this.addButton(this.theList.id+"ButtonLink","submitcomment-wysi submitcomment-link","hyperlink","link","http://s.xanga.com/images/comment-wysi-addlink.gif");break;case"smiley":this.addButton(this.theList.id+"ButtonSmiley","submitcomment-wysi submitcomment-smileys","smileys","smiley","http://s.xanga.com/images/comment-wysi-smiley.gif");break;case"htmlsource":this.addCheckBox(this.theList.id+"ButtonHTML","submitcomment-edithtml","Edit HTML","html");break;case"commenthelp":this.addHyperlink(this.theList.id+"LinkHelp","submitcomment-help","(comment help)","http://help.xanga.com/comments.htm","_new",null);break;case"commentplaintext":var B=location.href;if(B.indexOf("#")>=0){B=B.substring(0,B.indexOf("#"))}if(B.indexOf("?")<0){B+="?plain=1#addcomments"}else{B+="&plain=1#addcomments"}this.addHyperlink(this.theList.id+"LinkPlain","submitcomment-switchmode","comment box not working?",B,null,confirmChange);break}}return true}widgToolbar.prototype.addButton=function(E,G,B,K,F){var A=document.createElement("li");var C=document.createElement("a");var H=document.createElement("img");var D=document.createTextNode(B);A.id=E;A.className=G;C.title=B;C.menuaction=K;C.onclick=widgToolbarAction;C.onmouseover=widgToolbarMouseover;C.href="javascript:return false;";if(F!=null){H.src=F;H.alt=B;C.appendChild(H);var L=document.createElement("span");var J=document.createElement("span");var I=document.createElement("span");L.className="wysibutton-bg";J.className="wysibutton-bg wysibutton-bg-2";I.className="wysibutton-bg wysibutton-bg-3";C.appendChild(L);C.appendChild(J);C.appendChild(I)}else{C.appendChild(D)}A.appendChild(C);this.theList.appendChild(A);return true};widgToolbar.prototype.addHyperlink=function(F,I,C,H,A,G){var B=document.createElement("li");var D=document.createElement("a");var E=document.createTextNode(C);B.id=F;B.className=I;D.href=H;if(G!=null){D.onclick=G}if(A!=null){D.target=A}D.appendChild(E);B.appendChild(D);this.theList.appendChild(B);return true};widgToolbar.prototype.addCheckBox=function(B,H,E,G){var D=document.createElement("li");var F=document.createElement("input");var C=document.createElement("label");var A=document.createTextNode(E);D.id=B;D.className=H;C.htmlFor="xswitchmode";F.menuaction=G;F.onclick=widgToolbarAction;F.onmouseover=widgToolbarMouseover;F.type="checkbox";F.id="xswitchmode";C.appendChild(F);C.appendChild(A);D.appendChild(C);this.theList.appendChild(D);return true};widgToolbar.prototype.setState=function(D,B){if(D!="SelectBlock"){var C=document.getElementById(this.theList.id+"Button"+D);if(C!=null){if(B=="on"){C.className=C.className.addClass("submitcomment-wysi-on")}else{C.className=C.className.removeClass("submitcomment-wysi-on");C.blur()}}}else{var A=document.getElementById(this.theList.id+"SelectBlock");if(A!=null){A.value="";A.value=B}}return true};function widgToolbarAction(){var A;if(this.menuaction=="html"){A=this.parentNode.parentNode.parentNode.widgToolbarObject}else{A=this.parentNode.parentNode.widgToolbarObject}var F=A.widgEditorObject;var B=F.theIframe;var E="";if(!F.wysiwyg&&this.menuaction!="html"){return false}switch(this.menuaction){case"html":F.switchMode();break;case"smiley":loadSmileyFrame();break;case"link":if(this.parentNode.className.classExists("submitcomment-wysi-on")){B.contentWindow.document.execCommand("Unlink",false,null);F.theToolbar.setState("Link","off")}else{if(B.contentWindow.document.selection){E=B.contentWindow.document.selection.createRange().text;if(E==""){alert("Please select the text you wish to hyperlink.");break}}else{E=B.contentWindow.getSelection();if(E==""){alert("Please select the text you wish to hyperlink.");break}}var G=prompt("Enter the URL for this link:","http://");if(G!=null){B.contentWindow.document.execCommand("CreateLink",false,G);if(!B.contentWindow.document.selection){try{E=B.contentWindow.getSelection()}catch(D){return false}E.collapseToEnd();B.contentWindow.document.execCommand("Unlink",false,null);B.contentWindow.focus()}F.theToolbar.setState("Link","on");F.theToolbar.setState("Link","off")}}break;default:B.contentWindow.document.execCommand(this.menuaction,false,null);var C=this.menuaction.replace(/^./,function(H){return H.toUpperCase()});if(B.contentWindow.document.queryCommandState(this.menuaction,false,null)){F.theToolbar.setState(C,"on")}else{F.theToolbar.setState(C,"off")}}if(F.wysiwyg==true){B.contentWindow.focus()}else{F.theTextarea.focus()}if(this.menuaction=="html"){return true}else{return false}}function widgToolbarCheckState(G,I){if(!I){timeoutFunction(function(){widgToolbarCheckState(G,true);return true},500)}var F=null;var H=null;var B=null;var D=0;var A=G.theToolbar.theList.childNodes;for(var C=0;C<A.length;C++){A[C].className=A[C].className.removeClass("submitcomment-wysi-on")}if(G.theIframe.contentWindow.document.selection){F=G.theIframe.contentWindow.document.selection;H=F.createRange();try{B=H.parentElement()}catch(E){return false}}else{try{F=G.theIframe.contentWindow.getSelection()}catch(E){return false}if(F.rangeCount>0){H=F.getRangeAt(0);B=H.commonAncestorContainer}else{H=G.theIframe.contentWindow.document.createRange();H.setStart(G.theIframe.contentWindow.document.body,0);F.addRange(H);B=G.theIframe.contentWindow.document.body}}while(B.nodeType==3){B=B.parentNode}while(B.nodeName.toLowerCase()!="body"){switch(B.nodeName.toLowerCase()){case"a":G.theToolbar.setState("Link","on");break;case"em":G.theToolbar.setState("Italic","on");break;case"i":G.theToolbar.setState("Italic","on");break;case"li":break;case"span":if(B.getAttribute("style")=="font-weight: bold;"){G.theToolbar.setState("Bold","on")}else{if(B.getAttribute("style")=="font-style: italic;"){G.theToolbar.setState("Italic","on")}else{if(B.getAttribute("style")=="font-weight: bold; font-style: italic;"){G.theToolbar.setState("Bold","on");G.theToolbar.setState("Italic","on")}else{if(B.getAttribute("style")=="font-style: italic; font-weight: bold;"){G.theToolbar.setState("Bold","on");G.theToolbar.setState("Italic","on")}}}}break;case"strong":G.theToolbar.setState("Bold","on");break;default:G.theToolbar.setState("SelectBlock","<"+B.nodeName.toLowerCase()+">");break}B=B.parentNode;D++}return true}function widgToolbarMouseover(){window.status="";return true}function acceptableChildren(C){var A=C.childNodes;for(var B=0;B<A.length;B++){if(!A[B].nodeName.isAcceptedElementName()){if(!A[B].nodeName.isInlineName()){if(C.nodeName.toLowerCase()=="p"){acceptableChildren(replaceNodeWithChildren(C));return true}changeNodeType(A[B],"p")}else{replaceNodeWithChildren(A[B])}B=-1}}for(var B=0;B<A.length;B++){acceptableChildren(A[B])}return true}function changeNodeType(F,B){var A=new Array();var E=document.createElement(B);var D=F.parentNode;if(D!=null){for(var C=0;C<F.childNodes.length;C++){A.push(F.childNodes[C].cloneNode(true))}for(var C=0;C<A.length;C++){E.appendChild(A[C])}D.replaceChild(E,F)}return true}function replaceNodeWithChildren(D){var A=new Array();var C=D.parentNode;if(C!=null){for(var B=0;B<D.childNodes.length;B++){A.push(D.childNodes[B].cloneNode(true))}for(var B=0;B<A.length;B++){C.insertBefore(A[B],D)}C.removeChild(D);return C}return true}String.prototype.addClass=function(A){if(this!=""){if(!this.classExists(A)){return this+" "+A}}else{return A}return this};String.prototype.classExists=function(C){var A="(^| )"+C+"W*";var B=new RegExp(A);if(B.test(this)){return true}return false};String.prototype.isAcceptedElementName=function(){var B=new Array("#text","a","em","strong");var C=this.toLowerCase();for(var A=0;A<B.length;A++){if(C==B[A]){return true}}return false};String.prototype.isInlineName=function(){var C=new Array("#text","a","em","font","span","strong","img");var B=this.toLowerCase();for(var A=0;A<C.length;A++){if(B==C[A]){return true}}return false};String.prototype.removeClass=function(C){var A="(^| )"+C+"W*";var B=new RegExp(A);return this.replace(B,"")};String.prototype.validTags=function(){var A=this;A=A.replace(/<[^> ]*/g,function(B){return B.toLowerCase()});A=A.replace(/<[^>]*>/g,function(B){B=B.replace(/ [^=]+=/g,function(C){return C.toLowerCase()});return B});A=A.replace(/<[^>]*>/g,function(B){B=B.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"');return B});return A};function change_identity(H){var F=document.getElementById("x-wrapper");var A=document.getElementById("chooseidentity-other");var B=document.getElementById("itemsubmitter-other-join");var E=document.getElementById("addeprops");var C=document.getElementById("choosemini");var G=document.getElementById("chooseprofilepic");var D=document.getElementById("captcha");if(H=="xanga"){A.style.display="none";B.style.display="none";E.style.display="block";C.style.display="block";G.style.display="block";D.style.display="none"}if(H=="other"){A.style.display="block";B.style.display="inline";E.style.display="none";C.style.display="none";G.style.display="none";D.style.display="block"}F.style.display="none";F.style.display="block"}function anonymousSubmit(){var A=document.getElementById("selectnonx");if(A!=null&&A.checked){submitPageForm(false);return true}return false}function CreateLinkPlain(){var B=prompt("Enter link location (e.g. http://www.xanga.com):","http://");if(B){var A=prompt("Enter link title:","");if(A){B='<A href="'+B+'">'+A+"</A>";prompt("Copy and paste this HTML into your Entry:",B)}else{EditorBoxFocus()}}return false}function confirmChange(){return confirm("Are you sure you want to try a different comment box?\n\nAnything you've written in the current comment box will be lost...")}function GetPlainTextContent(A){return document.getElementById(A).value}function SetPlainTextContent(A,B){document.getElementById(A).value=B}function PreviewHtml(B){var A=window.open("","_preview","scrollbars=1,resizable=1,width=450,height=500,top=0");A.document.body.innerHTML=CommentRestriction(GetPlainTextContent(B));A.focus();return false}function insertHTML(A){InsertHtmlCode(A)}function CommentRestriction(A){A=A.replace(/&quot;/gi,'"');A=A.replace(/</gi,"&lt;");A=A.replace(/>/gi,"&gt;");A=A.replace(/&lt;a(.*?)&gt;/gi,"<a$1>");A=A.replace(/&lt;\/a&gt;/gi,"</A>");A=A.replace(/(&lt;P&gt;&nbsp;&lt;\/P&gt;)|(&lt;P&gt;&amp;nbsp;&lt;\/P&gt;)/gi,"");A=A.replace(/&lt;p&gt;/gi,"<P>");A=A.replace(/&lt;\/p&gt;/gi,"</P>");A=A.replace(/&lt;br\s*\/?\s*&gt;/gi,"<BR/>");A=A.replace(/&lt;i&gt;/gi,"<I>");temp="</I>";A=A.replace(/&lt;\/i&gt;/gi,temp);A=A.replace(/&lt;b&gt;/gi,"<B>");A=A.replace(/&lt;\/b&gt;/gi,"</B>");A=A.replace(/&lt;u&gt;/gi,"<U>");A=A.replace(/&lt;\/u&gt;/gi,"</U>");A=A.replace(/&lt;em&gt;/gi,"<EM>");A=A.replace(/&lt;\/em&gt;/gi,"</EM>");A=A.replace(/&lt;strong&gt;/gi,"<STRONG>");A=A.replace(/&lt;\/strong&gt;/gi,"</STRONG>");A=A.replace(/&lt;[^&gt; | ^&lt;].*?&gt;/gi,"");A=A.replace(/\n|\f|\r/g,"<BR/>");return A}function showSigninText(){document.getElementById("displayOnly").style.display="none";document.getElementById("displayNotSignedIn").style.display=""}function hideSigninText(){document.getElementById("displayOnly").style.display="";document.getElementById("displayNotSignedIn").style.display="none"}function showSigninText2(){document.getElementById("Stars_StarRateCtrl").style.display="none";document.getElementById("displayNotSignedIn").style.display=""}function hideSigninText2(){document.getElementById("Stars_StarRateCtrl").style.display="";document.getElementById("displayNotSignedIn").style.display="none"}var StarIncremented=false;function StarCallback(){if(!StarIncremented){try{var B=parseInt(document.getElementById("NumStars").innerHTML);B++;document.getElementById("NumStars").innerHTML=B;StarIncremented=true}catch(A){}try{top.StarCallback()}catch(A){}}}var hovPanel;var hovPanelBg=false;var clickedToOpen=false;function clearSrc(){document.getElementById("x-signinframe").src="javascript:false;";document.getElementById("x-profilepicframe").src="javascript:false;";document.getElementById("x-smileyframe").src="javascript:false;";document.getElementById("x-miniframe").src="javascript:false;"}function loadHovPanel(){clickedToOpen=true}function openHovPanel(A){if(!clickedToOpen){return }hovPanel=document.getElementById(A);if(!hovPanelBg){hovPanelBg=document.getElementById("x-hovpanel-bg")}hovPanelBg.style.height=getDocumentHeight()+"px";hovPanelBg.style.display="block";function B(){hovPanelBg.style.display="block"}timeoutFunction(B,100);hovPanel.style.top=getCurrentYPos()+60+"px";hovPanel.style.display="block"}function closeHovPanel(A){if(A){hovPanel=document.getElementById(A)}if(!hovPanel){hovPanel=parent.document.getElementById(A)}if(!hovPanelBg){hovPanelBg=parent.document.getElementById("x-hovpanel-bg")}hovPanel.style.display="none";function B(){hovPanelBg.style.display="none"}timeoutFunction(B,100);hovPanelBg.style.display="none"}function getCurrentYPos(){if(document.body&&document.body.scrollTop){return document.body.scrollTop}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(window.pageYOffset){return window.pageYOffset}return 0}function getDocumentHeight(){return getCurrentYPos()+3*1024}function attachHovPanel(A,B){var D=document.getElementById(A);var C=document.getElementById(B+"-contents");C.appendChild(D)}function loadSignInFrame(A){clickedToOpen=true;document.getElementById("x-signinframe").src=A+"&rand2="+(Math.random()*9999999)}function showSignIn(){openHovPanel("x-hovpanel-signinjoin");document.getElementById("x-signinframe").focus()}function submitPageForm(B){if(B!=null&&B==true){document.getElementById("registered").value=true}var A=document.forms.aspnetForm;if(A.onsubmit!=null){A.onsubmit()}A.submit()}function notLoggedIn(){closeHovPanel("x-hovpanel-chooseprofilepic");loadSignInFrame("/signinverify.aspx?loggedOut=parent.showSignIn();&loggedIn=parent.showProfilePic();&registered=parent.showProfilePic();&showsignin=True&rand="+Math.random()*9999999)}function showProfilePic(){closeHovPanel("x-hovpanel-signinjoin");loadProfilePic()}function loadProfilePic(){clickedToOpen=true;document.getElementById("x-profilepicframe").src="/profilepicchooser.aspx?rand="+(Math.random()*9999999)}function DisplayProfilePic(H,D,E,A){var B=document.getElementById("profilepic-default");var C=document.getElementById("profilepic-selected");B.style.display="none";C.style.display="inline";var I=document.getElementById("selected-profilepic-url");I.value=D;var F=document.getElementById("profilepic-img");F.src=H;F.alt=E;var G=document.getElementById("profilepic-title");G.innerHTML=E}function clearProfilePic(){var A=document.getElementById("profilepic-default");var C=document.getElementById("profilepic-selected");A.style.display="block";C.style.display="none";var B=document.getElementById("selected-profilepic-url");B.value=""}function popupProfilePic(){var B=document.getElementById("profilepic-img");var A=window.open(B.src,"_profull","width=200,height=220,resizable=1")}function loadSmileyFrame(){clickedToOpen=true;document.getElementById("x-smileyframe").src="/smileychooser.aspx?rand="+(Math.random()*9999999)}function insertSmiley(D){var C=document.getElementById("cbox-editorWidgIframe");C.contentWindow.focus();var B;var F;if(C.contentWindow.document.selection!=null&&C.contentWindow.document.selection.createRange().pasteHTML!=null){B=C.contentWindow.document.selection.createRange();B.collapse(true);B.pasteHTML('<img src="'+D+'" />')}else{try{F=C.contentWindow.getSelection()}catch(E){return false}B=F.getRangeAt(0);B.collapse(true);var A=C.contentWindow.document.createElement("img");A.src=D;B.insertNode(A)}closeHovPanel("x-hovpanel-smileys")}var miniMessage=false;var miniTooltip=' <span class="tooltip">[click to choose]</span>';var miniChosenTooltip=' credits <span class="tooltip">(will be deducted after you click "submit")</span>';var miniGallery=false;var miniChoose=false;var miniChosen=false;var miniChosenA=false;var miniChosenIMG=false;var miniChosenText=false;var miniChosenCredits=false;function getItem(A,C){var B=A.firstChild;while(B){if(B.title==C){return B.innerHTML}B=B.nextSibling}return""}function chooseMiniOver(A){if(!miniMessage){miniMessage=document.getElementById("mini-message-wrapper-choose")}if(!miniGallery){miniGallery=miniMessage.innerHTML}miniExpression=getItem(A,"Expression");miniMessage.innerHTML=miniExpression}function chooseMiniOut(){miniMessage.innerHTML=miniGallery}function chooseMini(B,A,D,C){if(!miniChoose){miniChoose=document.getElementById("choosemini-choose")}if(!miniChosen){miniChosen=document.getElementById("choosemini-chosen")}if(!miniChosenA){miniChosenA=document.getElementById("choosemini-chosen-a")}if(!miniChosenIMG){miniChosenIMG=document.getElementById("choosemini-chosen-img")}if(!miniChosenText){miniChosenText=document.getElementById("choosemini-chosen-text")}if(!miniChosenCredits){miniChosenCredits=document.getElementById("choosemini-chosen-credits")}miniChosenA.title=B;miniChosenIMG.src=A;miniChosenIMG.alt=B;miniChosenText.innerHTML=D;miniChosenCredits.innerHTML=C+miniChosenTooltip;miniChoose.style.display="none";miniChosen.style.display="block";window.location.hash="choosemini"}function resetMini(){if(!miniChoose){miniChoose=document.getElementById("choosemini-choose")}if(!miniChosen){miniChosen=document.getElementById("choosemini-chosen")}miniChoose.style.display="block";miniChosen.style.display="none"}var iFrame=false;var miniPanel=false;var miniPanelBg=false;var featuredMiniPanel=false;var selectedMiniPanel=false;var selectedMiniPlayer=false;var miniIdHolder=false;var commentText=false;var htmlCommentText=false;var signInPanel=false;function selectMini(A){loggedOut="parent.requestLogin();";loggedIn="parent.openSettings("+A+");";loadSignInFrame("/signinverify.aspx?loggedOut="+loggedOut+"&loggedIn="+loggedIn+"&registered="+loggedIn+"&showsignin=True&rand="+Math.random()*9999999)}function galleryLogin(){loggedOut="parent.requestLogin();";loggedIn="parent.openGallery()";loadSignInFrame("/signinverify.aspx?loggedOut="+loggedOut+"&loggedIn="+loggedIn+"&registered="+loggedIn+"&showsignin=True&rand="+Math.random()*9999999)}function requestLogin(){closeMiniPanel();openHovPanel("x-hovpanel-signinjoin");document.getElementById("x-signinframe").focus()}function verifyCredits(A){if(!signInPanel){signInPanel=document.getElementById("x-hovpanel-signinjoin")}if(signInPanel.style.display=="block"){closeHovPanel("x-hovpanel-signinjoin")}editMiniPanel("/CreditsVerifyPage.aspx?inventoryId="+A+"&random="+Math.random())}function openGallery(){if(!signInPanel){signInPanel=document.getElementById("x-hovpanel-signinjoin")}if(signInPanel.style.display=="block"){closeHovPanel("x-hovpanel-signinjoin")}openMiniPanel("/MinisGalleryPage.aspx?mode=gallery&rand="+Math.random()*9999999,320)}function openSettings(A){if(!signInPanel){signInPanel=document.getElementById("x-hovpanel-signinjoin")}if(signInPanel.style.display=="block"){closeHovPanel("x-hovpanel-signinjoin")}openMiniPanel("/MinisGalleryPage.aspx?miniId="+A+"&mode=settings&rand="+Math.random()*9999999,320)}function openExpansion(A){openMiniPanel("/MinisExpansionPage.aspx?activeMiniId="+A+"&rand="+Math.random()*9999999,320)}function requestPurchase(A,C,B){window.open(A)}var miniId=-1;var miniCredits=0;function confirmSelection(B,D,A,E,C){chooseMini(B,A,E,C);tagId="selected-mini-id";if(!miniIdHolder){miniIdHolder=document.getElementById(tagId)}miniIdHolder.value=D;miniId=D;miniCredits=C}function cancelSelection(){resetMini();tagId="selected-mini-id";if(!miniIdHolder){miniIdHolder=document.getElementById(tagId)}miniIdHolder.value=-1}function editMiniPanel(B,A){if(!iFrame){iFrame=document.getElementById("x-miniframe")}iFrame.src=B;loadHovPanel()}function openMiniPanel(B,A){editMiniPanel(B,A);openHovPanel("x-hovpanel-chooseminis")}function closeMiniPanel(){closeHovPanel("x-hovpanel-chooseminis")}function editCommentMini(A){assignFlash("x-commentmini",A,120,120);loadHovPanel()}function openCommentMini(A){editCommentMini(A);openHovPanel("x-hovpanel-commentmini")}function getCurrentYPos(){if(document.body&&document.body.scrollTop){return document.body.scrollTop}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(window.pageYOffset){return window.pageYOffset}return 0}function assignMini(B,A){assignFlash(B,"http://s.xanga.com/minis/flash/"+A+".swf",40,40,"middle")}function appendFlash(B,D){var A="&nbsp;";if(D!=""){A='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="flashObject"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+D+'" <param name="quality" value="high" /><param name="wmode" value="transparent"/>	<embed src="'+D+'" wmode="transparent" quality="high" name="minigift" allowScriptAccess="always"type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'}var C=document.getElementById(B).innerHTML;document.getElementById(B).innerHTML=A+C}function assignFlash(C,D,A,B){assignFlash(C,D,A,B,"middle")}function assignFlash(D,E,A,C,F){var B="&nbsp;";if(E!=""){if(isMacXFF()){B='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" height="'+A+'" width="'+C+'" id="flashObject" align="'+F+'"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+E+'" <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="'+E+'" quality="high" bgcolor="#ffffff" height="'+A+'" width="'+C+'" name="minigift" align="'+F+'" allowScriptAccess="always"allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'}else{B='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" height="'+A+'" width="'+C+'" id="flashObject" align="'+F+'"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+E+'" <param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent"/><embed src="'+E+'" wmode="transparent" quality="high" bgcolor="#000000" height="'+A+'" width="'+C+'" name="minigift" align="'+F+'" allowScriptAccess="always"allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'}}document.getElementById(D).innerHTML=B}function assignCredits(B,C){var A=document.getElementById(B);A.firstChild.nodeValue=C+" credits"}function assignDescription(E,C,B,F){var D=document.getElementById(E);D.firstChild.nodeValue=C;var A=document.getElementById(B);A.firstChild.nodeValue=F}function verifyComment(){if(!commentText){commentText=document.getElementById("bdescr")}if(!htmlCommentText){htmlCommentText=document.getElementById("htmleditor")}if(!miniIdHolder){miniIdHolder=document.getElementById("x_mini_id_holder")}if(miniIdHolder.value!=-1){var A;if(htmlCommentText!=null){A=htmlCommentText.contentWindow.document.body.innerHTML;A=A.replace("<P>","");A=A.replace("&nbsp;","");A=A.replace("</P>","");if(A==""){alert("You must post a comment to leave a mini. :)")}}else{if(commentText!=null&&commentText.value==""){alert("You must post a comment to leave a mini. ^_^")}}}}function isMacXFF(){var A=navigator.userAgent.toLowerCase();if(A.indexOf("mac")!=-1&&A.indexOf("firefox")!=-1){return true}else{return false}}function repairFlash(){var A=document.getElementById("maincontent")!=null?document.getElementById("maincontent").getElementsByTagName("SPAN"):document.getElementsByTagName("SPAN");mini_bgs=new Array();for(i=0;i<A.length;i++){if(A[i].className.search("mini-bg")!=-1){mini_bgs.push(A[i])}}for(j=0;j<mini_bgs.length;j++){mini_bgs[j].style.backgroundColor="#ddd";mini_bgs[j].style.border="2px solid #ddd";mini_bgs[j].style.MozOpacity=1}if(!hovPanelBg){hovPanelBg=document.getElementById("x-hovpanel-bg")}hovPanelBg.style.backgroundColor="#000";hovPanelBg.style.border="2px solid #000";hovPanelBg.style.MozOpacity=1}function confirmSubmit(A){var D=document.getElementById("xangasubmit");D.style.display="none";var C=document.getElementById("blocksubmit");C.style.display="block";var B=1;if(xPublicUser==xPrivateUser&&miniChosen!=false&&miniChosen.style.display=="block"){B=confirm("Are you sure you want to give yourself a mini? This will cost you: "+miniCredits+" credits.")}if(!B){resetSubmit()}return B}function resetSubmit(){var B=document.getElementById("xangasubmit");B.style.display="block";var A=document.getElementById("blocksubmit");A.style.display="none"}var xPrivateUser="";var xPublicUser="";function setPrivateUser(A){xPrivateUser=A}function setPublicUser(A){xPublicUser=A}function clearTextWarn(A){A=A.replace(/<br[^<>]*>/gi,"");A=A.replace(/\s/gi,"");if(A){var B=confirm("You will lose your existing work, continue?");return B}return true}function readTextEditor(){if(location.search.match("plain=1")!=null){var B=document.getElementById("cbox-editor");return B.value}else{var A=document.getElementById("xswitchmode");if(A.checked){var B=document.getElementById("cbox-editorWidgTextarea");return B.value}else{try{var C=document.getElementById("cbox-editorWidgIframe").contentWindow;return C.document.body.innerHTML}catch(D){return""}}}}function purifyForTextarea(A){A=A.replace(/<img[^<>]*src="http:\/\/s.xanga.com\/images\/(happy|sad|winky|silly|laughing|angry|censored|bitter|confused|clueless|wtf|shocked|stunned|surprised|whatevah|bummed|pleased|cool|blush|shy|kiss|smooch|heart)[\d]?.gif"[^<>]*>/gi,":$1:");return A}function purifyForWysiwg(A){A=purifyForTextarea(A);A=A.replace(/:(kiss|heart):/g,'<img src="http://s.xanga.com/images/$12.gif" />');A=A.replace(/:(happy|sad|winky|silly|laughing|angry|censored|bitter|confused|clueless|wtf|shocked|stunned|surprised|whatevah|bummed|pleased|cool|blush|shy|smooch):/g,'<img src="http://s.xanga.com/images/$1.gif" />');return A}function rewriteTextEditor(C){if(location.search.match("plain=1")!=null){var B=document.getElementById("cbox-editor");if(clearTextWarn(B.value)){B.value=purifyForTextarea(C)}B.focus()}else{var A=document.getElementById("xswitchmode");if(A.checked){var B=document.getElementById("cbox-editorWidgTextarea");if(clearTextWarn(B.value)){B.value=purifyForTextarea(C)}B.focus()}else{try{var D=document.getElementById("cbox-editorWidgIframe").contentWindow;if(clearTextWarn(D.document.body.innerHTML)){D.document.body.innerHTML=purifyForWysiwg(C)}}catch(E){return false}}}document.location.hash="addcomments"}function insertIntoTextEditor(E){var C="x"+Math.floor(Math.random()*99999999);E=E+'<span id="'+C+'"></span>';var H;var I;if(window.getSelection){if(location.search.match("plain=1")!=null){var J=document.getElementById("cbox-editor");J.focus();var A=J.selectionStart;var D=J.selectionEnd;J.value=J.value.substr(0,A)+E+J.value.substr(D,J.value.length);J.focus()}else{var F=document.getElementById("xswitchmode");if(F.checked){var J=document.getElementById("cbox-editorWidgTextarea");J.focus();var A=J.selectionStart;var D=J.selectionEnd;J.value=J.value.substr(0,A)+E+J.value.substr(D,J.value.length);J.focus()}else{try{var B=document.getElementById("cbox-editorWidgIframe").contentWindow;B.focus();H=B.getSelection();I=H.getRangeAt(0);var K=B.document.createElement("span");K.innerHTML=E;I.insertNode(K);K=B.document.getElementById(C);I.selectNode(K);I.collapse(false)}catch(G){return false}}}document.location.hash="addcomments"}else{if(document.selection){if(location.search.match("plain=1")!=null){var J=document.getElementById("cbox-editor");J.focus();document.selection.createRange().text=E;document.location.hash="addcomments"}else{var F=document.getElementById("xswitchmode");if(F.checked){var J=document.getElementById("cbox-editorWidgTextarea");J.focus();document.selection.createRange().text=E;document.location.hash="addcomments"}else{var B=document.getElementById("cbox-editorWidgIframe").contentWindow;B.focus();H=B.document.selection;I=H.createRange();I.collapse(true);I.pasteHTML(E);var K=B.document.getElementById(C);I.moveToElementText(K);I.collapse(false);I.select()}}}else{prompt("Copy and paste the following HTML into your comment box:",E)}}}function addReplyToLink(B,D,A){var C='<a href="'+B+'" class="replyto x--'+A+'--x">@'+D+"</a>&nbsp;-&nbsp;";insertIntoTextEditor(C)}function parseQuery(B){var D=location.search.substring(1);var C=D.split("&");for(var A=0;A<C.length;A++){var E=C[A].split("=");if(E[0]==B){return E[1]}}}function autoReplyTo(){if(location.search.match("reply=")!=null){var D=parseQuery("reply");var B="reply-"+D;var A=document.getElementById(B);if(A){var C=window.onload;if(typeof window.onload!="function"){window.onload=A.onclick}else{window.onload=function(){A.onclick();return C()}}}}}function editComment(A){var G="text-"+A;var D=document.getElementById(G);var I=document.getElementById("edit-comment");var F=document.getElementById("choosemini");var J=document.getElementById("cancel-editing");if(D){var E=D.innerHTML;rewriteTextEditor(E);I.value=A;F.style.display="none";J.style.display="inline";var B="img-"+A;var C=document.getElementById(B);if(C){var H=C.src.match(/\/([^\/]*\.(?:jpg|jpeg|jpe|gif|bmp|tiff|tif|emf|png))/i)[1];DisplayProfilePic(C.src,H,"previous profile pic",0);timeoutFunction(function(){DisplayProfilePic(C.src,H,"previous profile pic",0)},50)}tagId="selected-mini-id";if(!miniIdHolder){miniIdHolder=document.getElementById(tagId)}miniIdHolder.value=-1}}function ajaxSubmit(G,A){var E=A.split(",");var C=new Array();if(E!=""){for(var D=0;D<E.length;D++){var F=document.getElementById(E[D]);C.push('"'+E[D]+'":"'+F+'"')}}var B="{"+C.join(",")+"}";var H=new XHR({method:"post",onSuccess:doAlert,urlEncoded:false});H.setHeader("Content-Type","application/json");H.send(G,B)}function doAlert(A){alert(A)};