1log=function(){},log.error=log.warn=log.debug=log,defined=function(t){return t!==void 0},exists=function(t){return t!=null},finite=function(t){return isFinite(t)?t:0},finiteInt=function(t,n){return finite(parseInt(t,n))},finiteFloat=function(t){return finite(parseFloat(t))},max=function(){for(var t=arguments,n=t[0],e=1;e<t.length;e++)t[e]>n&&(n=t[e]);return n},min=function(){for(var t=arguments,n=t[0],e=1;e<t.length;e++)t[e]<n&&(n=t[e]);return n},Try={these:function(){for(var t=0;t<arguments.length;t++)try{return arguments[t]()}catch(n){}}},Unique={length:0,id:function(){return++this.length}},defined(window.Event)||(Event={}),Event.stop=function(t){t=t||this,t===Event&&(t=window.event),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation();try{t.cancelBubble=!0,t.returnValue=!1}catch(n){}return!1},Event.prep=function(t){return t=t||window.event,defined(t.stop)||(t.stop=this.stop),defined(t.target)||(t.target=t.srcElement),defined(t.relatedTarget)||(t.relatedTarget=t.toElement),t};try{Event.prototype.stop=Event.stop}catch(t){}Function.stub=function(){},Object.prototype.hasOwnProperty||(Object.prototype.hasOwnProperty=function(t){if(!(t in this))return!1;try{for(var n=this.constructor.prototype;n;){if(n[t]===this[t])return!1;if(n===n.constructor.prototype)break;
1n=n.constructor.prototype}}catch(e){}return!0}),defined(window.OBJ)||(OBJ={}),OBJ.extend=function(t){for(var n=arguments,e=0;e<n.length;e++){var r=n[e];for(var s in r)try{!t[s]&&(!r.hasOwnProperty||r.hasOwnProperty(s))&&(t[s]=r[s])}catch(u){}}return t},OBJ.override=function(t){for(var n=arguments,e=0;e<n.length;e++){var r=n[e];for(var s in r)try{(!r.hasOwnProperty||r.hasOwnProperty(s))&&(t[s]=r[s])}catch(u){}}return t},OBJ.extend(Function.prototype,{bind:function(t){var n=this;return function(){return n.apply(t,arguments)}},bindEventListener:function(t){var n=this;return function(e){try{e=Event.prep(e)}catch(r){}return n.call(t,e)}}}),indirectObjects=[],Class=function(t){var n=function(){arguments.length&&this.init&&this.init.apply(this,arguments)};OBJ.override(n,Class),t=t||Object,OBJ.override(n,t),n.superClass=t.prototype,n.prototype=new t,n.prototype.constructor=n,OBJ.extend(n.prototype,Class.prototype);for(var e=1;e<arguments.length;e++)OBJ.override(n.prototype,arguments[e]);return n},OBJ.extend(Class,{initSingleton:function(){return this.singleton?this.singleton:(this.singleton=this.singletonConstructor?new this.singletonConstructor:new this,this.singleton.init&&this.singleton.init.apply(this.singleton,arguments),this.singleton)}}),Class.prototype={destroy:function(){try{this.indirectIndex&&(indirectObjects[this.indirectIndex]=void 0),delete this.indirectIndex}catch(n){}for(var t in this)try{this.hasOwnProperty(t)&&delete this[t]}catch(n){}},getBoundMethod:function(t){return this[name].bind(this)},getEventListener:function(t){return this[t].bindEventListener(this)},getIndirectIndex:function(){return defined(this.indirectIndex)||(this.indirectIndex=indirectObjects.length,indirectObjects.push(this)),this.indirectIndex},getIndirectMethod:function(t){this.indirectMethods||(this.indirectMethods={});var n=this[t];if(typeof n=="function"){var e=this.getIndirectIndex();return this.indirectMethods[t]||(this.indirectMethods[t]=new Function("var o = indirectObjects["+e+"];return o."+t+".apply( o, arguments );")),this.indirectMethods[t]}},getIndirectEventListener:function(t){this.indirectEventListeners||(this.indirectEventListeners={});var n=this[t];if(typeof n=="function"){var e=this.getIndirectIndex();return this.indirectEventListeners[t]||(this.indirectEventListeners[t]=new Function("event","try { event = Event.prep( event ); } catch( e ) {}var o = indirectObjects["+e+"];return o."+t+".call( o, event );")),this.indirectEventListeners[t]}}},OBJ.extend(String,{escapeJSChar:function(t){switch(t){case"\\":return"\\\\";case'"':return'\\"';case"'":return"\\'";case"\b":return"\\b";case"\f":return"\\f";case` 2`:return"\\n";case"\r":return"\\r";case" ":return"\\t"}if(t>=" ")return t;switch(t=t.charCodeAt(0).toString(16),t.length){case 1:return"\\u000"+t;case 2:return"\\u00"+t;case 3:return"\\u0"+t;case 4:return"\\u"+t}return""},encodeEntity:function(t){switch(t){case"<":return"<";case">":return">";case"&":return"&";case'"':return""";case"'":return"'"}return t},decodeEntity:function(t){switch(t){case"amp":return"&";case"quot":return'"';case"gt":return">";case"lt":return"<"}var n=t.match(/^#(\d+)$/);return n&&defined(n[1])?String.fromCharCode(n[1]):(n=t.match(/^#x([0-9a-f]+)$/i),n&&defined(n[1])?String.fromCharCode(parseInt(hex,n[1])):t)}}),OBJ.extend(String.prototype,{escapeJS:function(){return this.replace(/([^ -!#-\[\]-~])/g,function(t,n){return String.escapeJSChar(n)})},escapeJS2:function(){return this.replace(/([\u0000-\u0031'"\\])/g,function(t,n){return String.escapeJSChar(n)})},escapeJS3:function(){return this.replace(/[\u0000-\u0031'"\\]/g,function(t){return String.escapeJSChar(t)})},escapeJS4:function(){return this.replace(/./g,function(t){return String.escapeJSChar(t)})},encodeHTML:function(){return this.replace(/([<>&"])/g,function(t,n){return String.encodeEntity(n)})},decodeHTML:function(){return this.replace(/&(.*?);/g,function(t,n){return String.decodeEntity(n)})},cssToJS:function(){return this.replace(/-([a-z])/g,function(t,n){return n.toUpperCase()})},jsToCSS:function(){return this.replace(/([A-Z])/g,function(t,n){return"-"+n.toLowerCase()})},firstToLowerCase:function(){return this.replace(/^(.)/,function(t,n){return n.toLowerCase()})},rgbToHex:function(){var t=this.match(/(\d+)\D+(\d+)\D+(\d+)/);if(t)return"#"+finiteInt(t[1]).toString(16).pad(2,"0")+finiteInt(t[2]).toString(16).pad(2,"0")+finiteInt(t[3]).toString(16).pad(2,"0")},pad:function(t,n){var e=t-this.length;if(e<=0)return this;defined(n)||(n=" ");for(var r=[],s=0;s<e;s++)r.push(n);return r.push(this),r.join("")},trim:function(){return this.replace(/^\s+|\s+$/g,"")}}),OBJ.extend(Array,{fromPseudo:function(t){for(var n=[],e=0;e<t.length;e++)n.push(t[e]);return n}}),OBJ.extend(Array.prototype,{copy:function(){for(var t=[],n=0;n<this.length;n++)t[n]=this[n];return t},first:function(t,n){for(var e=this.length,r=0;r<e;r++){var s=n?t.call(n,this[r],r,this):t(this[r],r,this);if(s)return this[r]}return null},fitIndex:function(t,n){return!defined(t)||t==null?t=n:t<0?(t=this.length+t,t<0&&(t=0)):t>=this.length&&(t=this.length-1),t},scramble:function(){for(var t=0;t<this.length;t++){var n=Math.floor(Math.random()*this.length),e=this[t];this[t]=this[n],this[n]=e}},add:function(){for(var t=arguments,n=0;n<t.length;n++){var e=this.indexOf(t[n]);e<0&&this.push(arguments[n])}return this.length},remove:function(){for(var t=arguments,n=0;n<t.length;n++){var e=this.indexOf(t[n]);e>=0&&this.splice(e,1)}return this.length},every:function(t,n){for(var e=this.length,r=0;r<e;r++){var s=n?t.call(n,this[r],r,this):t(this[r],r,this);if(!s)return!1}return!0},filter:function(t,n){for(var e=[],r=this.length,s=0;s<r;s++){var u=n?t.call(n,this[s],s,this):t(this[s],s,this);u&&e.push(this[s])}return e},forEach:function(t,n){for(var e=this.length,r=0;r<e;r++)n?t.call(n,this[r],r,this):t(this[r],r,this)},indexOf:function(t,n){n=this.fitIndex(n,0);for(var e=0;e<this.length;e++)if(this[e]===t)return e;return-1},lastIndexOf:function(t,n){n=this.fitIndex(n,this.length-1);for(var e=n;e>=0;e--)if(this[e]==t)return e;return-1},some:function(t,n){for(var e=this.length,r=0;r<e;r++){var s=n?t.call(n,this[r],r,this):t(this[r],r,this);if(s)return!0}return!1},concat:function(){var t=arguments,n=this.copy();for(i=0;i<t.length;i++){var e=t[i];for(j=0;j<e.length;j++)n.push(e[j])}return n},push:function(){for(var t=arguments,n=0;n<t.length;n++)this[this.length]=t[n];return this.length},pop:function(){if(this.length!=0){var t=this[this.length-1];return this.length--,t}},unshift:function(){for(var t=arguments,n=0;n<t.length;n++)this[n+t.length]=this[n],this[n]=t[n];return this.length},shift:function(){if(this.length!=0){for(var t=this[0],n=1;n<this.length;n++)this[n-1]=this[n];return this.length--,t}}}),OBJ.extend(Date,{matchISOString:new RegExp("^([0-9]{4})(?:-(?=0[1-9]|1[0-2])|$)(..)?(?:-(?=0[1-9]|[12][0-9]|3[01])|$)([0-9]{2})?(?:T(?=[01][0-9]|2[0-4])|$)T?([0-9]{2})?(?::(?=[0-5][0-9])|\\+|-|Z|$)([0-9]{2})?(?::(?=[0-5][0-9]|60$|60[+|-|Z]|60.0+)|\\+|-|Z|$):?([0-9]{2})?(.[0-9]+)?(Z|\\+[01][0-9]|\\+2[0-4]|-[01][0-9]|-2[0-4])?:?([0-5][0-9]|60)?$"),fromISOString:function(t){var n=this.matchISOString.exec(t);if(n){var e=finiteInt(n[1],10),r=finiteInt(n[2],10)-1,s=finiteInt(n[3],10),u=finiteInt(n[4],10),a=finiteInt(n[5],10),h=finiteInt(n[6],10),f=finiteInt(Math.round(parseFloat(n[7])*1e3)),d=finiteInt(n[8],10),g=finiteInt(n[9],10),o=new this(0);if(defined(n[8])){o.setUTCFullYear(e,r,s),o.setUTCHours(u,a,h,f);var c=(d*60+g)*6e4;c&&(o=new this(o-c))}else o.setFullYear(e,r,s),o.setHours(u,a,h,f);return o}}}),OBJ.extend(Date.prototype,{getISOTimezoneOffset:function(){var t=-this.getTimezoneOffset(),n=!1;t<0&&(n=!0,t*=-1);var e=Math.floor(t/60).toString().pad(2,"0"),r=Math.floor(t%60).toString().pad(2,"0");return(n?"-":"+")+e+":"+r},toISODateString:function(){var t=this.getFullYear(),n=(this.getMonth()+1).toString().pad(2,"0"),e=this.getDate().toString().pad(2,"0");return t+"-"+n+"-"+e},toUTCISODateString:function(){var t=this.getUTCFullYear(),n=(this.getUTCMonth()+1).toString().pad(2,"0"),e=this.getUTCDate().toString().pad(2,"0");return t+"-"+n+"-"+e},toISOTimeString:function(){var t=this.getHours().toString().pad(2,"0"),n=this.getMinutes().toString().pad(2,"0"),e=this.getSeconds().toString().pad(2,"0"),r=this.getMilliseconds().toString().pad(3,"0"),s=this.getISOTimezoneOffset();return t+":"+n+":"+e+"."+r+s},toUTCISOTimeString:function(){var t=this.getUTCHours().toString().pad(2,"0"),n=this.getUTCMinutes().toString().pad(2,"0"),e=this.getUTCSeconds().toString().pad(2,"0"),r=this.getUTCMilliseconds().toString().pad(3,"0");return t+":"+n+":"+e+"."+r+"Z"},toISOString:function(){return this.toISODateString()+"T"+this.toISOTimeString()},toUTCISOString:function(){return this.toUTCISODateString()+"T"+this.toUTCISOTimeString()}}),defined(window.XMLHttpRequest)||(window.XMLHttpRequest=function(){for(var t=["Microsoft.XMLHTTP","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],n=0;n<t.length;n++)try{return new ActiveXObject(t[n])}catch(e){}}); 3 4defined(window.Node)||(Node={});try{OBJ.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_FRAGMENT_NODE:11})}catch(e){}defined(window.DOM)||(DOM={}),OBJ.extend(DOM,{getElement:function(e){return typeof e=="string"||typeof e=="number"?document.getElementById(e):e},addEventListener:function(e,t,n,r){try{e.addEventListener?e.addEventListener(t,n,r):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}catch(i){}},removeEventListener:function(e,t,n,r){try{e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=void 0}catch(i){}},focus:function(e){try{e=DOM.getElement(e),e.focus()}catch(t){}},blur:function(e){try{e=DOM.getElement(e),e.blur()}catch(t){}},getComputedStyle:function(e){if(e.currentStyle)return e.currentStyle;var t={},n=DOM.getOwnerDocument(e);
4if(n&&n.defaultView&&n.defaultView.getComputedStyle)try{t=n.defaultView.getComputedStyle(e,null)}catch(r){}return t},getStyle:function(e,t){var n=DOM.getComputedStyle(e);return n[t]},getClientDimensions:function(e){e||(e=window);var t={};if(e.innerHeight)return t.x=e.innerWidth,t.y=e.innerHeight,t;var n=e.document.documentElement;if(n&&n.clientHeight)return t.x=n.clientWidth,t.y=n.clientHeight,t;if(document.body)return t.x=document.body.clientWidth,t.y=document.body.clientHeight,t},getDimensions:function(e){if(e){var t=DOM.getComputedStyle(e);return{offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,offsetWidth:e.offsetWidth,offsetHeight:e.offsetHeight,clientWidth:e.clientWidth,clientHeight:e.clientHeight,offsetRight:e.offsetLeft+e.offsetWidth,offsetBottom:e.offsetTop+e.offsetHeight,clientLeft:finiteInt(t.borderLeftWidth)+finiteInt(t.paddingLeft),clientTop:finiteInt(t.borderTopWidth)+finiteInt(t.paddingTop),clientRight:e.clientLeft+e.clientWidth,clientBottom:e.clientTop+e.clientHeight}}},getAbsoluteDimensions:function(e){var t=DOM.getDimensions(e);if(!t)return t;t.absoluteLeft=t.offsetLeft,t.absoluteTop=t.offsetTop,t.absoluteRight=t.offsetRight,t.absoluteBottom=t.offsetBottom;for(var n=0;e;){try{e=e.offsetParent}catch(r){if(log("In DOM.getAbsoluteDimensions: "+r.message),++n>25)return null}if(!e)return t;t.absoluteLeft+=e.offsetLeft,t.absoluteTop+=e.offsetTop,t.absoluteRight+=e.offsetLeft,t.absoluteBottom+=e.offsetTop}return t},getIframeAbsoluteDimensions:function(e){var t=DOM.getAbsoluteDimensions(e);if(!t)return t;var n=DOM.getOwnerIframe(e);if(!defined(n))return t;var r=DOM.getIframeAbsoluteDimensions(n),i=DOM.getWindowScroll(n.contentWindow),o=r.absoluteLeft-i.left,f=r.absoluteTop-i.top;return t.absoluteLeft+=o,t.absoluteTop+=f,t.absoluteRight+=o,t.absoluteBottom+=f,t},setLeft:function(e,t){e.style.left=finiteInt(t)+"px"},setTop:function(e,t){e.style.top=finiteInt(t)+"px"},setRight:function(e,t){e.style.right=finiteInt(t)+"px"},setBottom:function(e,t){e.style.bottom=finiteInt(t)+"px"},setWidth:function(e,t){e.style.width=max(0,finiteInt(t))+"px"},setHeight:function(e,t){e.style.height=max(0,finiteInt(t))+"px"},setZIndex:function(e,t){e.style.zIndex=finiteInt(t)},getWindowScroll:function(e){var t={left:0,top:0};e||(e=window);var n=e.document,r=n.documentElement;return defined(e.pageXOffset)?(t.left=e.pageXOffset,t.top=e.pageYOffset):r&&defined(r.scrollLeft)?(t.left=r.scrollLeft,t.top=r.scrollTop):defined(e.scrollX)?(t.left=e.scrollX,t.top=e.scrollY):n.body&&defined(n.body.scrollLeft)&&(t.left=n.body.scrollLeft,t.top=n.body.scrollTop),t},getAbsoluteCursorPosition:function(e){e=e||window.event;var t=DOM.getWindowScroll(window);return{x:t.left+e.clientX,y:t.top+e.clientY}},invisibleStyle:{display:"block",position:"absolute",left:0,top:0,width:0,height:0,margin:0,border:0,padding:0,fontSize:"0.1px",lineHeight:0,opacity:0,MozOpacity:0,filter:"alpha(opacity=0)"},makeInvisible:function(e){for(var t in this.invisibleStyle)this.invisibleStyle.hasOwnProperty(t)&&(e.style[t]=this.invisibleStyle[t])},mergeTextNodes:function(e){for(var t=0;e;)e.nodeType==Node.TEXT_NODE&&e.nextSibling&&e.nextSibling.nodeType==Node.TEXT_NODE?(e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling),t++):(e.firstChild&&(t+=DOM.mergeTextNodes(e.firstChild)),e=e.nextSibling);return t},selectElement:function(e){var t=e.ownerDocument;if(t.body.createControlRange){var n=t.body.createControlRange();n.addElement(e),n.select()}},isImmutable:function(e){try{if(e.getAttribute("contenteditable")=="false")return!0}catch(t){}return!1},getImmutable:function(e){for(var t=null;e;)DOM.isImmutable(e)&&(t=e),e=e.parentNode;return t},getOwnerDocument:function(e){return e?e.ownerDocument?e.ownerDocument:e.getElementById?e:document:document},getOwnerWindow:function(e){if(!e)return window;if(e.parentWindow)return e.parentWindow;var t=DOM.getOwnerDocument(e);return t&&t.defaultView?t.defaultView:window},getOwnerIframe:function(e){if(e){var t=DOM.getOwnerWindow(e),n=DOM.getOwnerDocument(e),r=t.parent||t.parentWindow;if(r)for(var i=r.document,o=i.getElementsByTagName("iframe"),f=0;f<o.length;f++){var s=o[f];try{var l=s.contentDocument||s.contentWindow.document;if(l===n)return s}catch(a){}}}},filterElementsByClassName:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];DOM.hasClassName(i,t)&&(n[n.length]=i)}return n},filterElementsByAttribute:function(e,t){if(!e)return[];if(!defined(t)||t==null||t=="")return e;for(var n=[],r=0;r<e.length;r++){var i=e[r];i&&i.getAttribute&&i.getAttribute(t)&&(n[n.length]=i)}return n},filterElementsByTagName:function(e,t){if(t=="*")return e;var n=[];t=t.toLowerCase();for(var r=0;r<e.length;r++){var i=e[r];i.tagName&&i.tagName.toLowerCase()==t&&(n[n.length]=i)}return n},getElementsByTagAndAttribute:function(e,t,n){e||(e=document);var r=e.getElementsByTagName(t);return DOM.filterElementsByAttribute(r,n)},getElementsByAttribute:function(e,t){return DOM.getElementsByTagAndAttribute(e,"*",t)},getElementsByAttributeAndValue:function(e,t,n){for(var r=DOM.getElementsByTagAndAttribute(e,"*",t),i=[],o=0;o<r.length;o++)r[o].getAttribute(t)==n&&i.push(r[o]);return i},getElementsByTagAndClassName:function(e,t,n){e||(e=document);var r=e.getElementsByTagName(t);return DOM.filterElementsByClassName(r,n)},getElementsByClassName:function(e,t){return DOM.getElementsByTagAndClassName(e,"*",t)},getAncestors:function(e,t){if(!e)return[];var n=t?[e]:[];for(e=e.parentNode;e;)n.push(e),e=e.parentNode;return n},getAncestorsByTagName:function(e,t,n){var r=DOM.getAncestors(e,n);return DOM.filterElementsByTagName(r,t)},getFirstAncestorByTagName:function(e,t,n){return DOM.getAncestorsByTagName(e,t,n)[0]},getAncestorsByClassName:function(e,t,n){var r=DOM.getAncestors(e,n);return DOM.filterElementsByClassName(r,t)},getFirstAncestorByClassName:function(e,t,n){return DOM.getAncestorsByClassName(e,t,n)[0]},getAncestorsByTagAndClassName:function(e,t,n,r){var i=DOM.getAncestorsByTagName(e,t,r);return DOM.filterElementsByClassName(i,n)},getFirstAncestorByTagAndClassName:function(e,t,n,r){return DOM.getAncestorsByTagAndClassName(e,t,n,r)[0]},getPreviousElement:function(e){for(e=e.previousSibling;e;){if(e.nodeType==Node.ELEMENT_NODE)return e;e=e.previousSibling}return null},getNextElement:function(e){for(e=e.nextSibling;e;){if(e.nodeType==Node.ELEMENT_NODE)return e;e=e.nextSibling}return null},isInlineNode:function(e){if(e.nodeType==Node.TEXT_NODE)return e;if(e.nodeType==Node.DOCUMENT_NODE)return!1;if(e.nodeType!=Node.ELEMENT_NODE)return e;if(e.tagName&&e.tagName.toLowerCase()=="br")return!1;var t=DOM.getStyle(e,"display");if(t&&t.indexOf("inline")>=0)return e},isTextNode:function(e){if(e.nodeType==Node.TEXT_NODE)return e},isInlineTextNode:function(e){if(e.nodeType==Node.TEXT_NODE)return e;if(!DOM.isInlineNode(e))return null},getClassNames:function(e){return!e||!e.className?[]:e.className.split(/\s+/g)}
4,hasClassName:function(e,t){if(!e||!e.className)return!1;for(var n=DOM.getClassNames(e),r=0;r<n.length;r++)if(n[r]==t)return!0;return!1},addClassName:function(e,t){if(!e||!t)return!1;for(var n=DOM.getClassNames(e),r=0;r<n.length;r++)if(n[r]==t)return!0;return n.push(t),e.className=n.join(" "),!1},removeClassName:function(e,t){var n=!1;if(!e||!e.className||!t)return n;for(var r=e.className&&e.className.length?e.className.split(/\s+/g):[],i=[],o=0;o<r.length;o++){if(r[o]==t){n=!0;continue}i.push(r[o])}return n&&(e.className=i.join(" ")),n},replaceWithChildNodes:function(e){for(var t=e.firstChild,n=e.parentNode;e.firstChild;)n.insertBefore(e.removeChild(e.firstChild),e);return n.removeChild(e),t},createInvisibleInput:function(e){e||(e=window.document);var t=document.createElement("input");return t.setAttribute("autocomplete","off"),t.autocomplete="off",DOM.makeInvisible(t),t},getMouseEventAttribute:function(e,t){if(t)for(var n=DOM.getAncestors(e.target,!0),r=0;r<n.length;r++)try{var i=n[r],o=i.getAttribute?i.getAttribute(t):null;if(o)return e.attributeElement=i,e.attribute=o,o}catch(f){}},setElementAttribute:function(e,t,n){if(navigator.userAgent.toLowerCase().match(/webkit/)){for(var r=e.attributes,i=0;i<r.length;i++)if(r[i].name==t)return r[i].nodeValue=n}else e.setAttribute(t,n)},swapAttributes:function(e,t,n){var r=e.getAttribute(t);if(!r)return!1;if(e.tagName.toLowerCase()=="script"){var i=e.cloneNode(!0);return i?(DOM.setElementAttribute(i,n,r),i.removeAttribute(t),e.parentNode.replaceChild(i,e)):!1}else DOM.setElementAttribute(e,n,r),e.removeAttribute(t)},findPosX:function(e){var t=0;if(e.offsetParent)for(;t+=e.offsetLeft,!!e.offsetParent;)e=e.offsetParent;else e.x&&(t+=e.x);return t},findPosY:function(e){var t=0;if(e.offsetParent)for(;t+=e.offsetTop,!!e.offsetParent;)e=e.offsetParent;else e.y&&(t+=e.y);return t}}),typeof $!="function"&&($=DOM.getElement); 5 6var HTTPReq=new Object;HTTPReq.create=function(){var t,o;if(typeof XMLHttpRequest!="undefined")t=new XMLHttpRequest;else try{t=new ActiveXObject("Msxml2.XMLHTTP.4.0")}catch(a){try{t=new ActiveXObject("Msxml2.XMLHTTP")}catch(r){}}try{t&&!t.setRequestHeader&&(t=null)}catch(a){}return t},HTTPReq.getJSON=function(opts){var req=HTTPReq.create();if(!req){opts.onError&&opts.onError("noxmlhttprequest");return}var state_callback=function(){if(req.readyState==4){if(req.status!=200){opts.onError&&opts.onError(req.status?"status: "+req.status:"no data");return}var resObj,e;try{eval("resObj = "+req.responseText+";")}catch(t){}if(e||!resObj){opts.onError&&opts.onError('Error parsing response: "'+req.responseText+'"');return}opts.onData&&opts.onData(resObj)}};req.onreadystatechange=state_callback;var method=opts.method||"GET",data=opts.data||null,url=opts.url;opts.method=="GET"&&opts.data&&(url+=url.match(/\?/)?"&":"?",url+=opts.data),url+=url.match(/\?/)?"&":"?",url+="_rand="+Math.random(),req.open(method,url,!0);var to_send=null;method.toUpperCase()=="POST"&&(req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),to_send=data),req.send(to_send)},HTTPReq.formEncoded=function(t){var o=[],a;for(var r in t)try{if(!t.hasOwnProperty(r))continue;o.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]))}catch(n){}return o.join("&")}; 7 8var LiveJournal=new Object;LiveJournal.hooks={},LiveJournal.register_hook=function(e,t){LiveJournal.hooks[e]||(LiveJournal.hooks[e]=[]),LiveJournal.hooks[e].push(t)},LiveJournal.run_hook=function(){var e=arguments,t=LiveJournal.hooks[e[0]];if(!(!t||!t.length)){for(var r=[],n=1;n<e.length;n++)r.push(e[n]);var a=null;return t.forEach(function(l){a=l.apply(null,r)}),a}},LiveJournal.pageLoaded=!1,LiveJournal.initPage=function(){LiveJournal.pageLoaded||(LiveJournal.pageLoaded=1,LiveJournal.initPagePlaceholders(),LiveJournal.initInboxUpdate(),LiveJournal.initPolls(),LiveJournal.run_hook("page_load"))},DOM.addEventListener(window,"DOMContentLoaded",LiveJournal.initPage),LiveJournal.initInboxUpdate=function(){if(!(!Site||!Site.has_remote||!Site.inbox_update_poll)){var e=$
8("Inbox_Unread_Count"),t=$("Inbox_Unread_Count_Menu");!e&&!t||window.setInterval(LiveJournal.updateInbox,1e3*60*5)}},LiveJournal.updateInbox=function(){var e={action:"get_unread_items"},t={data:HTTPReq.formEncoded(e),method:"POST",onData:LiveJournal.gotInboxUpdate};t.url=Site.currentJournal?"/"+Site.currentJournal+"/__rpc_esn_inbox":"/__rpc_esn_inbox",HTTPReq.getJSON(t)},LiveJournal.gotInboxUpdate=function(e){if(!(!e||e.error)){var t=$("Inbox_Unread_Count"),r=$("Inbox_Unread_Count_Menu");if(!(!t&&!r)){var n=e.unread_count?" ("+e.unread_count+")":"";t&&(t.innerHTML=n),r&&(r.innerHTML=n)}}},LiveJournal.initPagePlaceholders=function(){LiveJournal.initPlaceholders(document)},LiveJournal.initPlaceholders=function(e){var t=DOM.getElementsByTagAndClassName(e,"img","LJ_Placeholder")||[];Array.prototype.forEach.call(t,function(r){var n=DOM.getFirstAncestorByClassName(r,"LJ_Placeholder_Container",!1);if(n){var a=DOM.filterElementsByClassName(n.getElementsByTagName("div"),"LJ_Container")[0];if(a){var l=DOM.filterElementsByClassName(n.getElementsByTagName("div"),"LJ_Placeholder_HTML")[0];if(l){var i=unescape(l.innerHTML),u=function(s){Event.stop(s),a.innerHTML="<span>"+i+"</span>",DOM.makeInvisible(r)};return DOM.addEventListener(r,"click",u),!1}}}})};function _textSpan(){return _textElements("span",arguments)}function _textDiv(){return _textElements("div",arguments)}function _textElements(e,t){for(var r=[],n=0;n<t.length;n++){var a=document.createElement(e);a.innerHTML=t[n],r.push(a)}return r.length==1?r[0]:r}var PollPages={hourglass:null};LiveJournal.initPolls=function(e){var t=e||document,r=DOM.getElementsByTagAndClassName(t,"a","LJ_PollAnswerLink")||[];Array.prototype.forEach.call(r,function(o){DOM.addEventListener(o,"click",LiveJournal.pollAnswerLinkClicked.bindEventListener(o))});var n=DOM.getElementsByTagAndClassName(t,"a","LJ_PollClearLink")||[];Array.prototype.forEach.call(n,function(o){DOM.addEventListener(o,"click",LiveJournal.pollClearLinkClicked.bindEventListener(o))});var a=DOM.getElementsByTagAndClassName(t,"input","LJ_PollSubmit")||[];Array.prototype.forEach.call(a,function(o){DOM.addEventListener(o,"click",LiveJournal.pollButtonClicked.bindEventListener(o))});var l=DOM.getElementsByTagAndClassName(t,"a","LJ_PollChangeLink")||[];Array.prototype.forEach.call(l,function(o){DOM.addEventListener(o,"click",LiveJournal.pollChangeClicked.bindEventListener(o))});var i=DOM.getElementsByTagAndClassName(t,"a","LJ_PollDisplayLink")||[];Array.prototype.forEach.call(i,function(o){DOM.addEventListener(o,"click",LiveJournal.pollDisplayClicked.bindEventListener(o))});var u=DOM.getElementsByTagAndClassName(t,"form","LJ_PollForm")||[];Array.prototype.forEach.call(u,function(o){DOM.addEventListener(o,"submit",LiveJournal.pollFormSubmitted.bindEventListener(o))});var s=DOM.getElementsByTagAndClassName(document,"a","LJ_PollRespondentsLink")||[];Array.prototype.forEach.call(s,function(o){DOM.addEventListener(o,"click",LiveJournal.pollRespondentsLinkClicked.bindEventListener(o))});var d=DOM.getElementsByTagAndClassName(document,"a","LJ_PollUserAnswerLink")||[];Array.prototype.forEach.call(d,function(o){DOM.addEventListener(o,"click",LiveJournal.pollUserAnswerLinkClicked.bindEventListener(o))})},LiveJournal.pollButtonClicked=function(e){if(!PollPages.hourglass){var t=DOM.getAbsoluteCursorPosition(e);PollPages.hourglass=new Hourglass,PollPages.hourglass.init(),PollPages.hourglass.hourglass_at(t.x,t.y+25),PollPages.e=e}return!0},LiveJournal.pollFormSubmitted=function(e){Event.stop(e);var t=LiveJournal.getFormObject(this),r={url:LiveJournal.getAjaxUrl("pollvote"),method:"POST",data:"action=vote&"+HTTPReq.formEncoded(t),onData:LiveJournal.pollUpdateContainer,onError:LiveJournal.pollUpdateContainer};return HTTPReq.getJSON(r),!1},LiveJournal.pollChangeClicked=function(e){Event.stop(e);var t={url:LiveJournal.getAjaxUrl("pollvote"),method:"POST",data:"action=change&pollid="+this.getAttribute("lj_pollid"),onData:LiveJournal.pollUpdateContainer,onError:LiveJournal.pollUpdateContainer};return HTTPReq.getJSON(t),!1},LiveJournal.pollDisplayClicked=function(e){Event.stop(e);var t={url:LiveJournal.getAjaxUrl("pollvote"),method:"POST",data:"action=display&pollid="+this.getAttribute("lj_pollid"),onData:LiveJournal.pollUpdate
8Container,onError:LiveJournal.pollUpdateContainer};return HTTPReq.getJSON(t),!1},LiveJournal.pollUpdateContainer=function(e){if(!e)return!1;if(PollPages.hourglass&&(PollPages.hourglass.hide(),PollPages.hourglass=null),e.error)return LiveJournal.ajaxError(e.error);resultsDiv=document.getElementById("poll-"+e.pollid+"-container"),resultsDiv.innerHTML=e.results_html,LiveJournal.initPolls()},LiveJournal.getFormObject=function(e){for(var t=e.getElementsByTagName("input"),r=new Object,n=0;n<t.length;n++){var a=t[n];a.type=="checkbox"?(r[a.name]||(r[a.name]=new Array),a.checked&&r[a.name].push(a.value)):a.type=="radio"?a.checked&&(r[a.name]=a.value):r[a.name]=a.value}for(var l=e.getElementsByTagName("select"),n=0;n<l.length;n++){var i=l[n];r[i.name]=i.options[i.selectedIndex].value}return r},LiveJournal.pollClearLinkClicked=function(e){Event.stop(e);for(var t=this.getAttribute("lj_pollid"),r=DOM.getElementsByTagAndClassName(document,"input","poll-"+t)||[],n,a=0;a<r.length;a++)n=r[a],n.type=="text"?n.value="":r[a].checked=!1;for(var l=DOM.getElementsByTagAndClassName(document,"select","poll-"+t)||[],a=0;a<l.length;a++)l[a].selectedIndex=0},LiveJournal.pollAnswerLinkClicked=function(e){if(Event.stop(e),!this||!this.tagName||this.tagName.toLowerCase()!="a")return!0;var t=this.getAttribute("lj_pollid");if(!t)return!0;var r=this.getAttribute("lj_qid");if(!r)return!0;var n=this.getAttribute("lj_page"),a=this.getAttribute("lj_pagesize"),l="get_answers",i={pollid:t,pollqid:r,page:n,pagesize:a,action:l},u={url:LiveJournal.getAjaxUrl("poll"),method:"POST",data:HTTPReq.formEncoded(i),onData:LiveJournal.pollAnswersReceived,onError:LiveJournal.ajaxError};if(HTTPReq.getJSON(u),!PollPages.hourglass){var s=DOM.getAbsoluteCursorPosition(e);PollPages.hourglass=new Hourglass,PollPages.hourglass.init(),PollPages.hourglass.hourglass_at(s.x,s.y),PollPages.e=e}return!1},LiveJournal.pollAnswersReceived=function(e){if(!e)return!1;if(PollPages.hourglass&&(PollPages.hourglass.hide(),PollPages.hourglass=null),e.error)return LiveJournal.ajaxError(e.error);var t=e.pollid,r=e.pollqid;if(!t||!r)return!1;var n=e.page,a,l;if(n)a=DOM.getElementsByTagAndClassName(document,"div","lj_pollanswer_paging")[0],l=DOM.getElementsByTagAndClassName(document,"div","lj_pollanswer")[0];else{var i=$("LJ_PollAnswerLink_"+t+"_"+r);if(!i)return!1;a=document.createElement("div"),DOM.addClassName(a,"lj_pollanswer_paging"),l=document.createElement("div"),DOM.addClassName(l,"lj_pollanswer"),i.parentNode.insertBefore(l,i),i.parentNode.insertBefore(a,i),i.parentNode.removeChild(i)}a.innerHTML=e.paging_html?e.paging_html:"",l.innerHTML=e.answer_html?e.answer_html:"(No answers)",typeof ContextualPopup!="undefined"&&ContextualPopup.setup(),LiveJournal.initPolls()},LiveJournal.pollRespondentsLinkClicked=function(e){if(Event.stop(e),!this||!this.tagName||this.tagName.toLowerCase()!="a")return!0;var t=this.getAttribute("lj_pollid");if(!t)return!0;var r="get_respondents";if(answerEle=$("LJ_PollRespondentsLink_"+t),!answerEle)return!1;var n={pollid:t,action:r},a={url:LiveJournal.getAjaxUrl("poll"),method:"POST",data:HTTPReq.formEncoded(n),onData:LiveJournal.pollRespondentsReceived,onError:LiveJournal.ajaxError};if(HTTPReq.getJSON(a),!PollPages.hourglass){var l=DOM.getAbsoluteCursorPosition(e);PollPages.hourglass=new Hourglass,PollPages.hourglass.init(),PollPages.hourglass.hourglass_at(l.x,l.y),PollPages.e=e}return!1},LiveJournal.pollRespondentsReceived=function(e){if(!e)return!1;if(PollPages.hourglass&&(PollPages.hourglass.hide(),PollPages.hourglass=null),e.error)return LiveJournal.ajaxError(e.error);var t=e.pollid;if(!t||(answerEle=$("LJ_PollRespondentsLink_"+t),!answerEle))return!1;var r=e.answer_html?e.answer_html:"(No answers)",n=document.createElement("span");n.innerHTML=r,answerEle.parentNode.replaceChild(n,answerEle),typeof ContextualPopup!="undefined"&&ContextualPopup.setup(),LiveJournal.initPolls()},LiveJournal.pollUserAnswerLinkClicked=function(e){if(Event.stop(e),!this||!this.tagName||this.tagName.toLowerCase()!="a")return!0;var t=this.getAttribute("lj_pollid");if(!t)return!0;var r=this.getAttribute("lj_userid");if(!r)return!0;var n="get_user_answers";if(answerEle=$("LJ_PollUserAnswerLink_"+t+"_"+r),!answerEle)return!1;var a={pollid:t,userid:r,action:n},l={url:LiveJournal.getAjaxUrl("poll"),method:"POST",data:HTTPReq.formEncoded(a),onData:LiveJournal.pollUserAnswersReceived,onError:LiveJournal.ajaxError};if(HTTPReq.getJSON(l),!PollPages.hourglass){var i=DOM.getAbsoluteCursorPosition(e);PollPages.hourglass=new Hourglass,PollPages.hourglass.init(),PollPages.hourglass.hourglass_at(i.x,i.y),PollPages.e=e}return!1},LiveJournal.pollUserAnswersReceived=function(e){if(!e)return!1;if(PollPages.hourglass&&(PollPages.hourglass.hide(),PollPages.hourglass=null),e.error)return LiveJournal.ajaxError(e.error);var t=e.pollid,r=e.userid;if(!t||!r)return!1;var n=$("LJ_PollUserAnswerLink_"+t+"_"+r);if(!n||(answerEle=$("LJ_PollUserAnswerRes_"+t+"_"+r),!answerEle))return!1;
8answerEle.innerHTML=e.answer_html?e.answer_html:"(No answers)",n.innerHTML="",answerEle.style.display="block",typeof ContextualPopup!="undefined"&&ContextualPopup.setup()},LiveJournal.getAjaxUrl=function(e){return Site.currentJournal?"/"+Site.currentJournal+"/__rpc_"+e:"/__rpc_"+e},LiveJournal.ajaxError=function(e){LJ_IPPU?LJ_IPPU.showNote("Error: "+e):alert("Error: "+e)},LiveJournal.getDocumentElementsByClassName=function(e){var t=document.getElementsByTagName("*"),r=DOM.filterElementsByClassName(t,e)||[];return r},LiveJournal.addClickHandlerToElementsWithClassName=function(e,t){var r=LiveJournal.getDocumentElementsByClassName(t);r.forEach(function(n){DOM.addEventListener(n,"click",e)})},LiveJournal.parseGetArgs=function(e){var t={},r=e.split("?");if(!r[1])return t;var n=r[1].split("&");for(var a in n)if(n.hasOwnProperty(a)){var l=n[a].split("=");t[l[0]]=l[1]}return t}; 9 10var ESN=new Object;LiveJournal.register_hook("page_load",function(){ESN.initCheckAllBtns(),ESN.initEventCheckBtns(),ESN.initTrackBtns()}),ESN.initCheckAllBtns=function(){var n=$("ntypeids"),t=$("catids");!n||!t||(ntidList=n.value,catidList=t.value,!(!ntidList||!catidList)&&(n=ntidList.split(","),t=catidList.split(","),t.forEach(function(e){n.forEach(function(i){var a="SubscribeCheckbox-"+e+"-"+i,s=new CheckallButton;s.init({class:a,button:$("CheckAll-"+e+"-"+i),parent:$("CategoryRow-"+e)})})})))},ESN.initEventCheckBtns=function(){var n=document.getElementsByTagName("*"),t=DOM.filterElementsByClassName(n,"SubscriptionInboxCheck")||[];t.forEach(function(e){DOM.addEventListener(e,"click",ESN.eventChecked.bindEventListener())})},ESN.eventChecked=function(n){var t=n.target;if(t){var e=DOM.getFirstAncestorByTagName(t,"tr",!1),i=e.getElementsByTagName("*"),a=DOM.filterElementsByClassName(i,"NotificationOptions")||[];a.forEach(function(s){s.style.visibility=t.checked?"visible":"hidden"})}},ESN.initTrackBtns=function(){if(!(!Site||!Site.has_remote)){var n=DOM.getElementsByTagAndClassName(document,"a","TrackButton");Array.prototype.forEach.call(n,function(t){!t||!t.getAttribute||!t.getAttribute("lj_subid")&&!t.getAttribute("lj_journalid")||DOM.addEventListener(t,"click",ESN.trackBtnClickHandler.bindEventListener(t))})}},ESN.trackBtnClickHandler=function(n){var t=n.target;if(!t)return!0;if(n&&(n.ctrlKey||n.metaKey))return!1;t.isIcon=!1,t.tagName.toLowerCase()=="img"&&(t=t.parentNode,t.isIcon=!0),Event.stop(n);var e={};["arg1","arg2","etypeid","newentry_etypeid","newentry_token","newentry_subid","journalid","subid","auth_token"].forEach(function(l){e[l]=t.getAttribute("lj_"+l)});var i=document.createElement("div"),a=_textDiv("Email me when");DOM.addClassName(a,"track_title"),i.appendChild(a);var s=function(l,g){var h=document.createElement("div"),p=document.createElement("input");p.type="checkbox",p.id="newentrytrack"+Unique.id();var v=document.createElement("label");return v.setAttribute("for",p.id),v.innerHTML=l,h.appendChild(p),h.appendChild(v),i.appendChild(h),p.checked=!!g,p};ESN.trackPopup&&(ESN.trackPopup.hide(),ESN.trackPopup=null);var c=document.createElement("input");c.type="button",c.value="Save Changes",DOM.addClassName(c,"track_savechanges");var o=Number(e.newentry_subid)?1:0,k=Number(e.subid)?1:0,r,u;if(Number(t.getAttribute("lj_dtalkid")))u=s("someone replies in this comment thread",1);else{var d;typeof LJ_cmtinfo!="undefined"?d=LJ_cmtinfo.journal:typeof t.getAttribute("journal")!="undefined"?d=t.getAttribute("journal"):typeof Site!="undefined"&&(d=Site.currentJournal),d&&(r=s(d+" posts a new entry",o)),u=s("someone comments on this post",k)}DOM.addEventListener(c,"click",function(){ESN.toggleSubscriptions(e,n,t,{newEntry:r?r.checked:!1,newComments:u.checked}),ESN.trackPopup&&ESN.trackPopup.hide()});var f=document.createElement("div");DOM.addClassName(f,"track_btncontainer"),i.appendChild(f),f.appendChild(c);var m=document.createElement("a");return m.href=t.href,f.appendChild(m),m.innerHTML="More Options",DOM.addClassName(m,"track_moreopts"),ESN.trackPopup=new LJ_IPPU.showNoteElement(i,t,0),DOM.addEventListener(m,"click",function(l){return Event.stop(l),document.location.href=t.href,ESN.trackPopup&&ESN.trackPopup.hide(),!1}),!1},ESN.toggleSubscriptions=function(n,t,e,i){if(n.subid=Number(n.subid),(n.subid&&!i.newComments||!n.subid&&i.newComments)&&ESN.toggleSubscription(n,t,e,"newComments"),n.newentry_subid=Number(n.newentry_subid),n.newentry_subid&&!i.newEntry||!n.newentry_subid&&i.newEntry){var a=new Object(n);a.subid=Number(e.getAttribute("lj_newentry_subid")),ESN.toggleSubscription(a,t,e,"newEntry")}},ESN.toggleSubscription=function(n,t,e,i){var a="",s={auth_token:i=="newEntry"?n.newentry_token:n.auth_token};if(Number(n.subid))a="delsub",s.subid=n.subid;else{a="addsub";var c;i=="newEntry"?(s.etypeid=n.newentry_etypeid,c=["journalid"]):c=["journalid","arg1","arg2","etypeid"],c.forEac
10h(function(r){Number(n[r])&&(s[r]=parseInt(n[r],10))})}s.action=a;var o={method:"POST",url:LiveJournal.getAjaxUrl("esn_subs"),data:HTTPReq.formEncoded(s)},k=function(r){if(!r)return LJ_IPPU.showNote("Error changing subscription",e);if(r.error)return LJ_IPPU.showNote(r.error,e);if(r.success){if(r.msg&&LJ_IPPU.showNote(r.msg,e),r.subscribed){r.subid&&DOM.setElementAttribute(e,"lj_subid",r.subid),r.newentry_subid&&DOM.setElementAttribute(e,"lj_newentry_subid",r.newentry_subid),DOM.setElementAttribute(e,"title","Untrack This");var u=e.getAttribute("lj_dtalkid");if(u)ESN.updateThreadIcons(u,"on");else if(e.isIcon)e.firstChild.src=Site.imgprefix+"/silk/entry/untrack.png";else{var d=e.innerHTML;e.innerHTML=e.getAttribute("js_swapname"),DOM.setElementAttribute(e,"js_swapname",d)}}else{r.event_class=="LJ::Event::JournalNewComment"?DOM.setElementAttribute(e,"lj_subid",0):r.event_class=="LJ::Event::JournalNewEntry"&&DOM.setElementAttribute(e,"lj_newentry_subid",0),DOM.setElementAttribute(e,"title","Track This");var u=e.getAttribute("lj_dtalkid");if(u){for(var f="off",m,l=u;m=ESN.getThreadParentBtn(l);){if(l=m.getAttribute("lj_dtalkid"),!l){log("could not find parent_dtalkid");break}if(Number(m.getAttribute("lj_subid"))){f="parent";break}}ESN.updateThreadIcons(u,f)}else if(e.isIcon)e.firstChild.src=Site.imgprefix+"/silk/entry/track.png";else{var d=e.innerHTML;e.innerHTML=e.getAttribute("js_swapname"),DOM.setElementAttribute(e,"js_swapname",d)}}r.auth_token&&DOM.setElementAttribute(e,"lj_auth_token",r.auth_token),r.newentry_token&&DOM.setElementAttribute(e,"lj_newentry_token",r.newentry_token)}};o.onData=k,o.onError=function(r){LJ_IPPU.showNote("Error: "+r)},HTTPReq.getJSON(o)},ESN.getThreadParentBtn=function(n){var t=LJ_cmtinfo[n+""];if(!t)return log("no comment info"),null;var e=t.parent;return e?$("lj_track_btn_"+e):null},ESN.updateThreadIcons=function(n,t){var e=$("lj_track_btn_"+n);if(!e){log("no button");return}var i=LJ_cmtinfo[n+""];if(!i){log("no comment info");return}if(!(Number(e.getAttribute("lj_subid"))&&t!="on")){i.rc&&i.rc.length&&i.rc.forEach(function(c){window.setTimeout(function(){var o;switch(t){case"on":o="parent";break;case"off":o="off";break;case"parent":o="parent";break;default:alert("Unknown tracking state "+t);break}ESN.updateThreadIcons(c,o)},300)});var a;switch(t){case"on":a="/silk/entry/untrack.png";break;case"off":a="/silk/entry/track.png";break;case"parent":a="/silk/entry/untrack.png";break;default:alert("Unknown tracking state "+t);break}if(typeof e.firstChild.tagName!="undefined"&&e.firstChild.tagName.toLowerCase()=="img")e.firstChild.src=Site.imgprefix+a;else{var s=e.innerHTML;e.innerHTML=e.getAttribute("js_swapname"),DOM.setElementAttribute(e,"js_swapname",s)}}}; 11 12function changeOpac(e,t){var i=$(e);if(i&&i.style){var s=i.style;s&&(IPPU.isSafari()&&t>=100&&(t=99.99),s.filters&&(s.filters.alpha.opacity=t*100),s.opacity=t)}}IPPU=new Class(Object,{setFixedPosition:function(e){IPPU.isIE()||(this.fixedPosition=e,this.updateContent())},clickHandler:function(e){if(this.clickToClose&&this.visible()){e=Event.prep(e);var t=e.target;DOM.getAncestorsByClassName(t,"ippu",!0).length>0||this.cancel()}},setCancelledCallback:function(e){this.cancelledCallback=e},cancel:function(){this.cancelledCallback&&this.cancelledCallback(),this.hide()},setHiddenCallback:function(e){this.hiddenCallback=e},setupClickCapture:function(){if(!(!this.visible()||this.clickHandlerSetup)&&!(!this.clickToClose&&!this.modal)){if(this.clickHandlerFunc=this.clickHandler.bindEventListener(this),this.modal){if(this.overlay)return;this.overlay=document.createElement("div"),this.overlay.style.left="0px",this.overlay.style.top="0px",this.overlay.style.margin="0px",this.overlay.style.padding="0px",this.overlay.style.backgroundColor="#000000",this.overlay.style.zIndex="900",IPPU.isIE()?(this.overlay.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)",this.overlay.style.position="absolute",this.overlay.style.width=document.body.scrollWidth,this.overlay.style.height=document.body.scrollHeight):this.overlay.style.position="fixed",this.ele.parentNode.insertBefore(this.overlay,this.ele),this.updateOverlay(),DOM.addEventListener(this.overlay,"click",this.clickHandlerFunc)}else DOM.addEventListener(document,"click",this.clickHandlerFunc);this.clickHandlerSetup=!0}},updateOverlay:function(){if(this.overlay){var e=DOM.getClientDimensions();this.overlay.style.width=e.x-1+"px",IPPU.isIE()||(this.overlay.style.height=e.y-1+"px"),this.visibleOverlay?(this.overlay.backgroundColor="#000000",changeOpac(this.overlay,.5)):(this.overlay.backgroundColor="#FFFFFF",changeOpac(this.overlay,0))}},resizeHandler:function(e){this.updateContent()},removeClickHandlers:function(){if(this.clickHandlerSetup){var e=this,t=function(i){e.clickHandler(i)};DOM.removeEventListener(document,"click",this.clickHandlerFunc,!1),this.overlay&&(DOM.removeEventListener(this.overlay,"click",this.clickHandlerFunc,!0),this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0),this.clickHandlerFunc=void 0,this.clickHandlerSetup=!1}},setClickToClose:function(e){if(this.clickToClose=e,!this.clickHandlerSetup&&e&&this.visible()){var t=this.setupClickCapture.bind(this);window.setTimeout(t,100)}else!e&&this.clickHandlerSetup&&this.removeClickHandlers();this.updateContent()},setModal:function(e){var t=this.modal==e;e&&this.setClickToClose(!1),this.modal=e,t&&(this.removeClickHandlers(),this.updateContent())},setOverlayVisible:function(e){this.visibleOverlay=e,this.updateContent()},updateContent:function(){this.autoCenter(),this.updateTitlebar(),this.updateOverlay(),this.titlebar&&this.setTitlebarClass(this.titlebar.className);var e=this.setupClickCapture.bind(this);window.setTimeout(e,100),this.fixedPosition&&this.ele.style.position!="fixed"?this.ele.style.position="fixed":!this.fixedPosition&&this.ele.style.position=="fixed"&&(this.ele.style.position="absolute")},getTitlebarElement:function(){return this.titlebar},setTitlebarClass:function(e){this.titlebar&&(this.titlebar.className=e)},setOverflow:function(e){this.ele&&(this.ele.style.overflow=e)},visible:function(){return this.shown},setTitlebar:function(e){if(this.showTitlebar=e,e){if(!this.titlebar){var t=document.createElement("div");if(!t)return;t.style.width="100%",this.title&&(t.innerHTML=this.title),this.ele.insertBefore(t,this.content),this.titlebar=t}}else this.titlebar&&(this.ele.removeChild(this.titlebar),this.titlebar=!1)},setTitle:function(e){this.title=e,this.updateTitlebar()},updateTitlebar:function(){this.showTitlebar&&this.titlebar&&this.title!=this.titlebar.innerHTML&&(this.titlebar.innerHTML=this.title)},addClass:function(e){DOM.addClassName(this.ele,e)},removeClass:function(e){DOM.removeClassName(this.ele,e)},setAutoCenterCallback:function(e){this.autoCenterCallback=e},autoCenter:function(){if(!(!this.visible||!this.visible())){if(this.autoCenterCallback){this.autoCenterCallback(this);return}this.autoCenterX&&this.centerX(),this.autoCenterY&&this.centerY()}},center:function(){this.centerX(),this.centerY()},centerOnWidget:function(e,t,i){t=t||0,i=i||0,this.setAutoCenter(!1,!1),this.setAutoCenterCallback(null);var s=DOM.getAbsoluteDimensions(e),a=DOM.getAbsoluteDimensions(this.ele),n=s.absoluteRight-s.offsetWidth/2-a.offsetWidth/2+i,r=s.absoluteBottom-s.offsetHeight/2-a.offsetHeight/2+t;n=n<0?0:n,r=r<0?0:r,DOM.setLeft(this.ele,n),DOM.setTop(this.ele,r)},centerX:function(){if(!(!this.visible||!this.visible())){var e=DOM.getClientDimensions(),t=e.x/2-DOM.getDimensions(this.ele).offsetWidth/2;if(!this.fixedPosition){var i=DOM.getWindowScroll();t+=i.left}DOM.setLeft(this.ele,t)}},centerY:function(){if(!(!this.visible||!this.visible())){var e=DOM.getClientDimensions(),t=e.y/2-DOM.getDimensions(this.ele).offsetHeight/2;if(!this.fixedPosition){var i=DOM.getWindowScroll();t+=i.top}DOM.setTop(this.ele,t)}},setAutoCenter:function(e,t){if(this.autoCenterX=e||!1,this.autoCenterY=t||!1,!e&&!t){this.setAutoCenterCallback(null);return}this.autoCenter()},setDimensions:function(e,t){e=e+"",t=t+"",e.match(/^\d+$/)&&(e+="px"),t.match(/^\d+$/)&&(t+="px"),this.ele.style.width=e,this.ele.style.height=t},moveForward:function(e){e||(e=1),this.ele&&(this.ele.style.zIndex+=e)},moveBackward:function(e){e||(e=1),this.ele&&(this.ele.style.zIndex-=e)},setLocation:function(e,t){this.setLeft(e),this.setTop(t)},setTop:function(e){e=e+"",e.match(/^\d+$/)&&(e+="px"),this.ele.style.top=e},setLeft:function(e){e=e+"",e.match(/^\d+$/)&&(e+="px"),this.ele.style.left=e},getElement:function(){return this.ele},setContent:function(e){this.content.innerHTML=e},setContentElement:function(e){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.content.appendChild(e)},setFadeIn:function(e){this.fadeIn=e},setFadeOut:function(e){this.fadeOut=e},setFadeSpeed:function(e){this.fadeSpeed=e},show:function(){if(this.shown=!0,this.fadeIn){var e=.01;changeOpac(this.ele,e)}document.body.appendChild(this.ele),this.ele.style.position="absolute",(this.autoCenterX||this.autoCenterY)&&this.center(),this.updateContent(),this.resizeHandlerFunc||(this.resizeHandlerFunc=this.resizeHandler.bindEventListener(this),DOM.addEventListener(window,"resize",this.resizeHandlerFunc,!1)),this.fadeIn&&this.fade("in"),this.hideSelects()},fade:function(e,t){var i,s,a=10;e=="in"?(s=1/a,i=.1):(this.ele.style.opacity?i=finiteFloat(this.ele.style.opacity):i=.99,s=-1/a);var n=this.fadeSpeed;n||(n=1);var r=a/n*5;this.fadeMode=e;var l=this,h=function(){if(i+=s,l.fadeMode&&l.fadeMode!=e){t&&t.call(l,[]);return}if(i<=.1){t&&t.call(l,[]),l.fadeMode=null;return}else if(i>=1){t&&t.call(l,[]),l.fadeMode=null;return}else changeOpac(l.ele,i),window.setTimeout(h,r)};h()},hide:function(){this.visible()&&(this.fadeOut&&this.ele?this.fade("out",this._hide.bind(this)):this._hide())},_hide:function(){this.hiddenCallback&&this.hiddenCallback(),this.shown=!1,this.removeClickHandlers(),this.ele&&document.body.removeChild(this.ele),this.resizeHandlerFunc&&DOM.removeEventListener(window,"resize",this.resizeHandlerFunc),this.showSelects()},setAutoHideSelects:function(e){this.autoHideSelects=e,this.updateContent()},hideSelects:function(){if(!(!this.autoHideSelects||!IPPU.isIE()))for(var e=document.getElementsByTagName("select"),t,i=0;i<e.length;i++)t=e[i],t&&(DOM.getAncestorsByClassName(t,"ippu",!0).length>0||t.style.visibility!="hidden"&&(t.style.visibility="hidden",this.hiddenSelects.push(t)))},showSelects:function(){if(this.autoHideSelects)for(var e;e=this.hiddenSelects.pop();)e.style.visibility=""},init:function(e){var t=document.createElement("div");this.ele=t,this.shown=!1,this.autoCenterX=!1,this.autoCenterY=!1,this.titlebar=null,this.title="",this.showTitlebar=!1,this.clickToClose=!1,this.modal=!1,this.clickHandlerSetup=!1,this.docOverlay=!1,this.visibleOverlay=!1,this.clickHandlerFunc=!1,this.resizeHandlerFunc=!1,this.fixedPosition=!1,this.autoCenterCallback=null,this.cancelledCallback=null,this.autoHideSelects=!1,this.hiddenCallback=null,this.fadeOut=!1,this.fadeIn=!1,this.hiddenSelects=[],this.fadeMode=null,t.style.position="absolute",t.style.zIndex="1000",DOM.addClassName(t,"ippu"),this.content=document.createElement("div"),this.content.innerHTML=e,this.ele.appendChild(this.content)}}),IPPU.center=function(e){e.centerX(),e.centerY()},IPPU.centerX=function(e){e.centerX()},IPPU.centerY=function(e){e.centerY()},IPPU.isIE=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("msie")!=-1},IPPU.isSafari=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("safari")!=-1}; 13 14LJ_IPPU=new Class(IPPU,{init:function(t){t||(t=""),LJ_IPPU.superClass.init&&LJ_IPPU.superClass.init.apply(this,[]),this.uniqId=this.generateUniqId(),this.cancelThisFunc=this.cancel.bind(this),this.setTitle(t),this.setTitlebar(!0),this.setTitlebarClass("lj_ippu_titlebar"),this.addClass("lj_ippu"),this.setAutoCenterCallback(IPPU.center),this.setDimensions(400,"auto"),this.setFixedPosition(!0),this.setClickToClose(!0),this.setAutoHideSelects(!0)},setTitle:function(t){var i=" <div style='float:right; padding-right: 8px'><img src='"+Site.imgprefix+"/CloseButton.gif' width='15' height='15' id='"+this.uniqId+"_c
14ancel' /></div>"+t;LJ_IPPU.superClass.setTitle.apply(this,[i])},generateUniqId:function(){var t=new Date;return"lj_ippu_"+t.getHours()+t.getMinutes()+t.getMilliseconds()},show:function(){LJ_IPPU.superClass.show.apply(this);var t=this.setup_lj_ippu.bind(this);window.setTimeout(t,300)},setup_lj_ippu:function(t){var i=this.cancelThisFunc;document.getElementById(this.uniqId+"_cancel").onclick=function(){i()}},hide:function(){LJ_IPPU.superClass.hide.apply(this)}}),LJ_IPPU.showNote=function(t,i,n,s){var e=document.createElement("div");return e.innerHTML=t,LJ_IPPU.showNoteElement(e,i,n,s)},LJ_IPPU.showErrorNote=function(t,i,n){return LJ_IPPU.showNote(t,i,n,"ErrorNote")},LJ_IPPU.showNoteElement=function(t,i,n,s){var e=new IPPU;e.init();var a=document.createElement("div");DOM.addClassName(a,"Inner"),a.appendChild(t),e.setContentElement(a),e.setTitlebar(!1),e.setFadeIn(!0),e.setFadeOut(!0),e.setFadeSpeed(4),e.setDimensions("auto","auto"),s||(s="Note"),e.addClass(s);var o;if(!(i&&(o=DOM.getAbsoluteDimensions(i),!o))){var l=DOM.getClientDimensions();if(l){if(!o)e.setAutoCenter(!0,!0),e.show();else{e.setAutoCenter(!1,!1),e.setLocation(o.absoluteLeft,o.absoluteBottom+4),e.show();var r=DOM.getAbsoluteDimensions(e.getElement());r.absoluteRight>l.x&&e.setLocation(l.x-r.offsetWidth-30,o.absoluteBottom+4)}return e.setClickToClose(!0),e.moveForward(),defined(n)||(n=5e3),n&&window.setTimeout(function(){e&&e.hide()},n),e}}},LJ_IPPU.textPrompt=function(t,i,n){t+="";var s=new LJ_IPPU(t),e=document.createElement("div");DOM.addClassName(e,"ljippu_textprompt"),i&&e.appendChild(_textDiv(i));var a=document.createElement("textarea");DOM.addClassName(a,"htmlfield"),a.cols=40,a.rows=5,e.appendChild(a);var o=document.createElement("div");DOM.addClassName(o,"submitbtncontainer");var l=document.createElement("input");DOM.addClassName(l,"submitbtn"),l.type="button",l.value="Insert",o.appendChild(l),e.appendChild(o),s.setContentElement(e),s.setAutoCenter(!0,!0),s.setDimensions("60%","auto"),s.show(),a.focus(),DOM.addEventListener(l,"click",function(r){s.hide(),n&&n.apply(null,[a.value])})}; 15 16Hourglass=new Class(Object,{init:function(e,t){if(this.ele=document.createElement("img"),!!this.ele){var s=Site?Site.imgprefix:"";this.ele.src=s?s+"/hourglass.gif":"/img/hourglass.gif",this.ele.style.position="absolute",DOM.addClassName(this.ele,t),e&&this.hourglass_at_widget(e)}},hourglass_at:function(e,t){this.ele.width=17,this.ele.height=17,this.ele.style.top=t-8+"px",this.ele.style.left=e-8+"px",this.ele.id="lj_hourglass"+e+"."+t,document.body.appendChild(this.ele)},add_class_name:function(e){this.ele&&DOM.addClassName(this.ele,e)},hourglass_at_widget:function(e){var t=DOM.getAbsoluteDimensions(e),s=t.absoluteLeft,i=t.absoluteTop,l=t.absoluteRight-s,a=t.absoluteBottom-i;l&&a&&(s+=l/2,i+=a/2),this.hourglass_at(s,i)},hide:function(){if(this.ele)try{document.body.removeChild(this.ele)}catch(e){}}}); 17 18var ContextualPopup=new Object;ContextualPopup.popupDelay=500,ContextualPopup.hideDelay=250,ContextualPopup.disableAJAX=!1,ContextualPopup.debug=!1,ContextualPopup.cachedResults={},ContextualPopup.currentRequests={},ContextualPopup.mouseInTimer=null,ContextualPopup.mouseOutTimer=null,ContextualPopup.currentId=null,ContextualPopup.hourglass=null,ContextualPopup.elements={},ContextualPopup.setup=function(){if(!(!Site||!Site.ctx_popup)){var t=[];if(Site.ctx_popup_userhead){var o=DOM.getElementsByTagAndClassName(document,"span","ljuser");o.forEach(function(i){for(var c=i.getElementsByTagName("img"),P=0;P<c.length;P++){var s=c.item(P),m=s.parentNode,l;m&&m.href&&(l=m.href.match(/\?userid=(\d+)/i))?s.userid=l[1]:s.username=i.getAttribute("lj:user"),!(!s.username&&!s.userid)&&(t.push(s),DOM.addClassName(s,"ContextualPopup"))}})}if(Site.ctx_popup_icons){var u=document.getElementsByTagName("img")||[],r="www\\.dreamwidth\\.org/userpic",a="(^"+Site.iconprefix+"|"+r+")",n=new RegExp(a+"/\\d+/\\d+$");Array.prototype.forEach.call(u,function(i){i.src.match(n)&&(i.up_url=i.src,DOM.addClassName(i,"ContextualPopup"),t.push(i))})}var C=1;t.forEach(function(i){ContextualPopup.elements[C+""]=i,i.ctxPopupId=C++}),DOM.addEventListener(document.body,"mousemove",ContextualPopup.mouseOver.bindEventListener())}},ContextualPopup.isCtxPopElement=function(t){return t&&DOM.getAncestorsByClassName(t,"ContextualPopup",!0).length},ContextualPopup.mouseOver=function(e){var target=e.target,ctxPopupId=target.ctxPopupId;if(!(!eval("ContextualPopup")||!ContextualPopup.isCtxPopElement)){if((!target||!ContextualPopup.isCtxPopElement(target))&&(ContextualPopup.mouseInTimer&&(window.clearTimeout(ContextualPopup.mouseInTimer),ContextualPopup.mouseInTimer=null),ContextualPopup.ippu)){if(ContextualPopup.mouseInTimer||ContextualPopup.mouseOutTimer)return;ContextualPopup.mouseOutTimer=window.setTimeout(function(){ContextualPopup.mouseOut(e)},ContextualPopup.hideDelay);return}if(ContextualPopup.mouseOutTimer&&(window.clearTimeout(ContextualPopup.mouseOutTimer),ContextualPopup.mouseOutTimer=null),!!ctxPopupId){var cached=ContextualPopup.cachedResults[
18ctxPopupId+""];cached||ContextualPopup.getInfo(target),!ContextualPopup.mouseInTimer&&(!ContextualPopup.ippu||ContextualPopup.currentId&&ContextualPopup.currentId!=ctxPopupId)&&(ContextualPopup.mouseInTimer=window.setTimeout(function(){ContextualPopup.showPopup(ctxPopupId)},ContextualPopup.popupDelay))}}},ContextualPopup.popupClosed=function(){ContextualPopup.mouseOut()},ContextualPopup.mouseOut=function(t){ContextualPopup.mouseInTimer&&window.clearTimeout(ContextualPopup.mouseInTimer),ContextualPopup.mouseOutTimer&&window.clearTimeout(ContextualPopup.mouseOutTimer),ContextualPopup.mouseInTimer=null,ContextualPopup.mouseOutTimer=null,ContextualPopup.currentId=null,ContextualPopup.hidePopup()},ContextualPopup.showPopup=function(t){if(ContextualPopup.mouseInTimer&&window.clearTimeout(ContextualPopup.mouseInTimer),ContextualPopup.mouseInTimer=null,!(ContextualPopup.ippu&&ContextualPopup.currentId&&ContextualPopup.currentId==t)){ContextualPopup.currentId=t,ContextualPopup.constructIPPU(t);var o=ContextualPopup.elements[t+""],u=ContextualPopup.cachedResults[t+""];if(!(!o||u&&u.noshow)&&ContextualPopup.ippu){var r=ContextualPopup.ippu;r.setAutoCenter(!1,!1);var a=DOM.getAbsoluteDimensions(o);if(!a)return;var n=DOM.getClientDimensions();if(!n)return;var C=r.getElement();C.style.visibility="hidden",ContextualPopup.ippu.setLocation(a.absoluteLeft,a.absoluteBottom),ContextualPopup.ippu.show();var i=DOM.getAbsoluteDimensions(C);i.absoluteRight>n.x&&ContextualPopup.ippu.setLocation(n.x-i.offsetWidth-30,a.absoluteBottom),C.style.visibility="visible"}}},ContextualPopup.constructIPPU=function(t){ContextualPopup.ippu&&(ContextualPopup.ippu.hide(),ContextualPopup.ippu=null);var o=new IPPU;o.init(),o.setTitlebar(!1),o.setFadeOut(!0),o.setFadeIn(!0),o.setFadeSpeed(15),o.setDimensions("auto","auto"),o.addClass("ContextualPopup"),o.setCancelledCallback(ContextualPopup.popupClosed),ContextualPopup.ippu=o,ContextualPopup.renderPopup(t)},ContextualPopup.renderPopup=function(t){var o=ContextualPopup.ippu;if(o&&t){var u=ContextualPopup.cachedResults[t];if(u){if(!u.username||!u.success||u.noshow){o.hide();return}}else{o.setContent("<div class='Inner'>Loading...</div>");return}var r=u.display_username,a=document.createElement("div");DOM.addClassName(a,"Inner");var n=document.createElement("div");DOM.addClassName(n,"Content");var C=document.createElement("span");if(C.innerHTML=" | ",u.url_userpic){var i=document.createElement("div"),c=document.createElement("a");c.href=u.url_allpics;var P=document.createElement("img");P.src=u.url_userpic,P.width=u.userpic_w,P.height=u.userpic_h,i.appendChild(c),c.appendChild(P),DOM.addClassName(i,"Userpic"),a.appendChild(i)}a.appendChild(n);var s=document.createElement("div");if(u.is_comm){var m="",l="";u.is_member&&(m="You are a member of "+r),u.is_watching&&(l="You have subscribed to "+r),m&&l?s.innerHTML=m+"<br />"+l:m||l?s.innerHTML=m+l:s.innerHTML=r}else if(u.is_syndicated)u.is_watching?s.innerHTML="You have subscribed to "+r:s.innerHTML=r;else if(u.is_requester)s.innerHTML="This is you";else{var x="",l="";u.is_trusting&&u.is_trusted_by?x=r+" and you have mutual access":u.is_trusting?x="You have granted access to "+r:u.is_trusted_by&&(x=r+" has granted access to you"),u.is_watching&&u.is_watched_by?l=r+" and you have mutual subscriptions":u.is_watching?l="You have subscribed to "+r:u.is_watched_by&&(l=r+" has subscribed to you"),x&&l?s.innerHTML=x+"<br />"+l:x||l?s.innerHTML=x+l:s.innerHTML=r}DOM.addClassName(s,"Relation"),n.appendChild(s);var M=LiveJournal.run_hook("ctxpopup_extrainfo",u);if(M&&n.appendChild(M),u.is_logged_in&&u.is_comm){var v=document.createElement("span");if(!u.is_closed_membership||u.is_member){var d=document.createElement("a"),y;u.is_member?(d.href=u.url_leavecomm,d.innerHTML="Leave",y="leave"):u.is_invited?(d.href=u.url_acceptinvite,d.innerHTML="Accept invitation",y="accept"):(d.href=u.url_joincomm,d.innerHTML="Join community",y="join"),ContextualPopup.disableAJAX||DOM.addEventListener(d,"click",function(p){return Event.prep(p),Event.stop(p),ContextualPopup.changeRelation(u,t,y,p)}),v.appendChild(d)}else v.innerHTML="Community closed";n.appendChild(v)}var _;if(u.is_logged_in&&(u.is_person||u.is_identity)&&u.can_message){_=document.createElement("span");var A=document.createElement("a");A.href=u.url_message,A.innerHTML="Send message",_.appendChild(A),n.appendChild(_),u.
18is_requester&&n.appendChild(document.createElement("br"))}if((u.is_person||u.is_comm)&&!u.is_requester&&u.can_receive_vgifts){var j=document.createElement("span"),R=document.createElement("a");R.href=u.url_vgift,R.innerHTML="Send virtual gift",j.appendChild(R),(u.is_logged_in&&u.is_comm||_)&&n.appendChild(document.createElement("br")),n.appendChild(j)}var f,h;if(u.is_logged_in&&!u.is_requester){if(u.is_trusting){var I=document.createElement("span"),w=document.createElement("a");w.href=u.url_addtrust,(u.is_person||u.other_is_identity)&&(f=document.createElement("span"),w.innerHTML="Remove access"),I.appendChild(w),DOM.addClassName(I,"RemoveTrust"),ContextualPopup.disableAJAX||DOM.addEventListener(w,"click",function(p){return Event.stop(p),ContextualPopup.changeRelation(u,t,"removeTrust",p)}),f&&f.appendChild(I)}else{var N=document.createElement("span"),O=document.createElement("a");O.href=u.url_addtrust,(u.is_person||u.other_is_identity)&&(f=document.createElement("span"),O.innerHTML="Grant access"),N.appendChild(O),DOM.addClassName(N,"AddTrust"),ContextualPopup.disableAJAX||DOM.addEventListener(O,"click",function(p){return Event.prep(p),Event.stop(p),ContextualPopup.changeRelation(u,t,"addTrust",p)}),f&&f.appendChild(N)}if(!u.is_watching&&!u.other_is_identity){var J=document.createElement("span"),H=document.createElement("a");H.href=u.url_addwatch,h=document.createElement("span"),H.innerHTML="Subscribe",J.appendChild(H),DOM.addClassName(J,"AddWatch"),ContextualPopup.disableAJAX||DOM.addEventListener(H,"click",function(p){return Event.prep(p),Event.stop(p),ContextualPopup.changeRelation(u,t,"addWatch",p)}),h.appendChild(J)}else if(u.is_watching){var S=document.createElement("span"),D=document.createElement("a");D.href=u.url_addwatch,h=document.createElement("span"),D.innerHTML="Remove subscription",S.appendChild(D),DOM.addClassName(S,"RemoveWatch"),ContextualPopup.disableAJAX||DOM.addEventListener(D,"click",function(p){return Event.stop(p),ContextualPopup.changeRelation(u,t,"removeWatch",p)}),h.appendChild(S)}DOM.addClassName(s,"RelationshipStatus")}(u.is_logged_in&&u.is_comm||_&&(f||h))&&n.appendChild(document.createElement("br")),f&&n.appendChild(f),f&&h&&n.appendChild(document.createElement("br")),h&&n.appendChild(h);var g;if(u.is_logged_in&&!u.is_requester&&!u.is_syndicated&&!u.is_comm)if(g=document.createElement("span"),u.is_banned){var L=document.createElement("span"),b=document.createElement("a");b.href=window.Site.siteroot+"/manage/banusers",b.innerHTML="Unban user",L.appendChild(b),DOM.addClassName(L,"SetUnban"),ContextualPopup.disableAJAX||DOM.addEventListener(b,"click",function(p){return Event.prep(p),Event.stop(p),ContextualPopup.changeRelation(u,t,"setUnban",p)}),g.appendChild(L)}else{var q=document.createElement("span"),E=document.createElement("a");E.href=window.Site.siteroot+"/manage/banusers",u.is_comm?E.innerHTML="Ban community":E.innerHTML="Ban user",q.appendChild(E),DOM.addClassName(q,"SetBan"),ContextualPopup.disableAJAX||DOM.addEventListener(E,"click",function(p){return Event.prep(p),Event.stop(p),ContextualPopup.changeRelation(u,t,"setBan",p)}),g.appendChild(q)}g&&(n.appendChild(document.createElement("br")),n.appendChild(g)),(u.is_logged_in&&!u.is_requester||f||h)&&n.appendChild(document.createElement("br"));var B=document.createElement("span");if(B.innerHTML="View: ",n.appendChild(B),u.is_person||u.is_comm||u.is_syndicated){var T=document.createElement("a");T.href=u.url_journal,u.is_person?T.innerHTML="Journal":u.is_comm?T.innerHTML="Community":u.is_syndicated&&(T.innerHTML="Feed"),n.appendChild(T),n.appendChild(C.cloneNode(!0))}var U=document.createElement("a");U.href=u.url_profile,U.innerHTML="Profile",n.appendChild(U);var X=document.createElement("div");DOM.addClassName(X,"ljclear"),X.innerHTML=" ",n.appendChild(X),o.setContentElement(a)}},ContextualPopup.changeRelation=function(t,o,u,r){if(!t)return!0;if(u=="setBan"||u=="setUnban"){var a=t.display_name,n=u=="setUnban"?"Are you sure you wish to unban "+a+"?":"Are you sure you wish to ban "+a+"?";if(!confirm(n))return!1}var C={target:t.username,action:u},i=t[u+"_authtoken"];i||log("no auth token for action"+u),C.auth_token=i;var c=LiveJournal.getAjaxUrl("changerelation"),P=function(l){if(u=="setBan"||u=="setUnban"){var x=t.display_name,M=u=="setUnban"?"Are you sure you wish to unban "+x+"?":"Are you sure you wish to ban "+x+"?";return confirm(M)?u:!1}if(ContextualPopup.hourglass&&ContextualPopup.hideHourglass(),l.error){ContextualPopup.showNote(l.error,o);return}if(l.note&&ContextualPopup.showNote(l.note,o),!!l.success){if(ContextualPopup.cachedResults[o+""]){var v=["is_trusting","is_watching","is_member","is_banned"];v.forEach(function(d){ContextualPopup.cachedResults[o+""][d]=l[d]})}ContextualPopup.renderPopup(o)}},s={data:HTTPReq.formEncoded(C),method:"POST",url:c,onError:ContextualPopup.gotError,onData:P},m=DOM.getAbsoluteCursorPosition(r);return!ContextualPopup.hourglass&&m&&(ContextualPopup.hourglass=new Hourglass,ContextualPopup.hourglass.init(null,"lj_hourglass"),ContextualPopup.hourglass.add_class_name("ContextualPopup"),ContextualPopup.hourglass.hourglass_at(m.x,m.y)),HTTPReq.getJSON(s),!1},ContextualPopup.showNote=function(t,o){var u;if(ContextualPopup.ippu)u=ContextualPopup.ippu.getElement();else if(o)var u=ContextualPopup.elements[o+""];LJ_IPPU.showNote(t,u)},ContextualPopup.hidePopup=function(t){ContextualPopup.hourglass&&ContextualPopup.hideHourglass(),ContextualPopup.ippu&&(ContextualPopup.ippu.hide(),ContextualPopup.ippu=null)},ContextualPopup.getInfo=function(t){var o=t.ctxPopupId,u=t.username,r=t.userid,a=t.up_url;if(o&&!ContextualPopup.currentRequests[o+""]){ContextualPopup.currentRequests[o]=1,u||(u=""),r||(r=0),a||(a="");var n=HTTPReq.formEncoded({user:u,userid:r,userpic_url:a,mode:"getinfo"}
18),C=LiveJournal.getAjaxUrl("ctxpopup"),C=Site.currentJournal?"/"+Site.currentJournal+"/__rpc_ctxpopup":"/__rpc_ctxpopup",i=function(c){if(ContextualPopup&&ContextualPopup.hourglass&&ContextualPopup.hideHourglass(),ContextualPopup.cachedResults[o]=c,c.error){if(c.noshow)return;ContextualPopup.showNote(c.error,o);return}c.note&&ContextualPopup.showNote(c.note,c.ctxPopupId),ContextualPopup.currentRequests[o]=null,ContextualPopup.renderPopup(o),setTimeout(function(){ContextualPopup.cachedResults[o]=null},60*1e3)};HTTPReq.getJSON({url:C,method:"GET",data:n,onData:i,onError:ContextualPopup.gotError})}},ContextualPopup.hideHourglass=function(){ContextualPopup.hourglass&&(ContextualPopup.hourglass.hide(),ContextualPopup.hourglass=null)},ContextualPopup.gotError=function(t){ContextualPopup.hourglass&&ContextualPopup.hideHourglass(),ContextualPopup.debug&&ContextualPopup.showNote("Error: "+t)},LiveJournal.register_hook("page_load",ContextualPopup.setup); 19 20var Tropo=new Object;Tropo.init=function(){var e=DOM.getElementsByClassName($("menu"),"topnav");e.forEach(function(n){DOM.addEventListener(n,"mouseover",function(a){Tropo.showSubNav(n.id)}),DOM.addEventListener(n,"mouseout",function(a){Tropo.hideSubNav()})})},Tropo.hideSubNav=function(){var e=DOM.getElementsByClassName($("menu"),"topnav"),n=DOM.getElementsByClassName($("menu"),"subnav");e.forEach(function(a){DOM.removeClassName(a,"hover")}),n.forEach(function(a){DOM.removeClassName(a,"hover")})},Tropo.showSubNav=function(e){Tropo.hideSubNav(),$(e)&&DOM.addClassName($(e),"hover")},LiveJournal.register_hook("page_load",Tropo.init); 21
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.