/*
 *  © 2000-2010 deviantART, Inc. All rights reserved.
 */
if(!window.AutoExec){AutoExec=[]}if(!window.createNode){window.createNode=Tree.create}if(!window.getTag){window.getTag=Tree.tag}if(!window.getNodeObject){window.getNodeObject=Tree.getObject}if(!window.setNodeObject){window.setNodeObject=Tree.setObject}if(!window.getElement){window.getElement=Tree.get}if(!window.getElements){window.getElements=Tree.gets}if(!window.getAncestor){window.getAncestor=Tree.ancestor}if(!window.getNodeText){window.getNodeText=Tree.getText}if(!window.setNodeText){window.setNodeText=Tree.setText}if(!window.getNodeContents){window.getNodeContents=function(A){return A.innerHTML}}if(!window.setClass){window.setClass=Tree.addClass}if(!window.unsetClass){window.unsetClass=Tree.removeClass}if(!window.setNodeContents){window.SETNODECONTENTS_REPLACE=0;window.SETNODECONTENTS_APPEND=1;window.SETNODECONTENTS_PREPEND=2;window.SETNODECONTENTS_BEFORENODE=3;window.SETNODECONTENTS_AFTERNODE=4;window.setNodeContents=function(D,E,A,C){if((D.innerHTML!=undefined)&&((!A)||D.insertAdjacentHTML!=undefined)){if(A){if(A<3){D.insertAdjacentHTML(A==SETNODECONTENTS_APPEND?"BeforeEnd":"AfterBegin",E)}else{D.insertAdjacentHTML(A==SETNODECONTENTS_BEFORENODE?"BeforeBegin":"AfterEnd",E)}}else{D.innerHTML=E}}else{var B=D.ownerDocument.createRange();if(!D.firstChild){A=0}if(A){if(A==SETNODECONTENTS_APPEND){B.setStartBefore(D.firstChild)}else{if(A==SETNODECONTENTS_PREPEND){B.setStartAfter(D.lastChild)}else{if(A==SETNODECONTENTS_AFTERNODE){B.setStartAfter(D);if(D.nextSibling){D.parentNode.insertBefore(B.createContextualFragment(E),D.nextSibling)}else{D.parentNode.appendChild(B.createContextualFragment(E))}}else{if(A==SETNODECONTENTS_BEFORENODE){B.setStartBefore(D);D.parentNode.insertBefore(B.createContextualFragment(E),D)}}}}}else{B.selectNodeContents(D);B.deleteContents()}if(A==SETNODECONTENTS_PREPEND&&D.childNodes.length>0){D.insertBefore(B.createContextualFragment(E),D.firstChild)}else{if(A<3){D.appendChild(B.createContextualFragment(E))}}}}}if(!window.hasClass){window.hasClass=function(B,A){if(B){return Tree.hasClass.apply(Tree,arguments)}return false}}if(!window.createSuperNode){window.createSuperNode=function(C,A,D){var E=createNode(C,A);if(D){if(!D.join){D=[D]}for(var B=0;B<D.length;B++){if(!(typeof D[B]).match(/object/i)){setNodeContents(E,D[B],1)}else{E.appendChild(D[B])}}}return E}}if(!window.appendNode){window.appendNode=function(A,B){if(B.nextSibling){return B.parentNode.insertBefore(A,B.nextSibling)}else{return B.parentNode.appendChild(A)}}}if(!window.setActiveClass){window.setActiveClass=function(C,B){var A,D;B=B||"active";A=Tree.ancestor(C,".switcher");if(D=Tree.get(A,C.tagName.toLowerCase()+"."+B)){Tree.removeClass(D,B)}Tree.addClass(C,B)}}if(!window.getNextSibling){window.getNextSibling=function(A){while(A&&(A=A.nextSibling)){if(A.nodeValue==null){return A}}return null}}if(!window.getPreviousSibling){window.getPreviousSibling=function(A){while(A=A.previousSibling){if(A.nodeValue==null){return A}}return null}}if(!window.getFirstChild){window.getFirstChild=function(A){A=A.firstChild;if((!A)||A.nodeValue==null){return A}return getNextSibling(A)}}if(!window.getLastChild){window.getLastChild=function(A){A=A.lastChild;if(A.nodeValue==null){return A}return getPreviousSibling(A)}}if(!window.setStyle_DOM){window.setStyle_DOM=function(A,C,B){if(C=="opacity"&&browser.isGecko&&navigator.appVersion.indexOf("Mac")<0){if(A.style.opacity==undefined){C="-moz-opacity"}if(B==1){B=0.99}}A.style[C]=B}}if(!window.setStyle_IE){window.setStyle_IE=function(A,C,B){if(C=="opacity"){A.style.filter="alpha(opacity="+(B*100)+")"}else{A.runtimeStyle.setAttribute(C,B)}}}if(!window.holdStyle){window.holdStyle=function(B,A){setStyle(B,A,getStyle(B,A))}}if(!window.removeStyle){removeStyle=function(B,A){B.style.removeProperty(A)}}if(Browser.isIE){window.setStyle=setStyle_IE}else{window.setStyle=setStyle_DOM}if(!window.getStyle){window.getStyle=Station.read}if(!window.setStyles){window.setStyles=function(C,B){var D=new Object();for(var A in B){if(!D[A]){setStyle(C,A,B[A])}}}}if(!window.cancelEvent){window.cancelEvent=function(){if(window.event){window.event.returnValue=false}return false}}var _lastMouseCoords;if(!window.getMouseCoords){window.getMouseCoords=function(B,A){_lastMouseCoords={x:B.clientX,y:B.clientY};if(browser.isKHTML&&!A){_lastMouseCoords.x-=window.pageXOffset;_lastMouseCoords.y-=window.pageYOffset}if(A&&!(browser.isKHTML||browser.isIE)){_lastMouseCoords.x+=window.pageXOffset;_lastMouseCoords.y+=window.pageYOffset}return _lastMouseCoords}}if(!window.isLeftClick){window.isLeftClick=function(eMouse){with(eMouse){return !(button>1||ctrlKey||shiftKey||altKey||metaKey)}}}if(!window.getEventTarget){window.getEventTarget=function(A){return(A.srcElement||A.target)}}if(!window.getEventLink){window.getEventLink=function(B){var A=getEventTarget(B);if(!(A.tagName&&getTag(A)=="a")){A=getAncestor(A,"a")}if(A&&getTag(A)=="a"){return A}else{return null}}}window._forcePageLayout=function(){if(Browser.isGecko||Browser.isOpera){document.body.style.height="1px";document.body.style.height="auto"}else{if(!Browser.isKHTML){document.body.style.display="none";document.body.style.display="block"}}};if(!window.mergeObjects){window.mergeObjects=function(B,A){var C;for(C in A){B[C]=A[C]}}}if(!window.forEachItem){window.forEachItem=function(A,C,D){if(D==true){for(var B in A){if(C(A[B],B)==-1){return }}}else{if(A&&(A.length!=undefined)&&(typeof A)!="string"){for(var B=0;A[B];B++){if(C(A[B],B)==-1){return }}}else{C(A,0)}}}}if(!window.forEachAncestor){window.forEachAncestor=function(B,A){var C=(B.ownerDocument||document).documentElement;do{if(A(B)==-1){return }}while(B.parentNode&&(B=B.parentNode)!=C)}}if(Browser.isKHTML&&!window.getComputedStyle){if(typeof (document.defaultView.getComputedStyle)!="function"){window.getComputedStyle=function(A,B){return A.style};window.getComputedStyle.faux=true}else{window.getComputedStyle=function(A,B){return document.defaultView.getComputedStyle(A,B)||A.style}}}var _styleStack=Array();if(!window.pushStyle){window.pushStyle=function(B,D,C){var A,E;if(!C){C=getStyle(B,D)}A=findEntry(_styleStack,"node",B);if(!A){A={node:B};_styleStack.push(A)}if(!A[D]){A[D]=Array()}A[D].push(C)}}if(!window.popStyleValue){window.popStyleValue=function(A,B){try{return findEntry(_styleStack,"node",A)[B].pop()}catch(C){return null}}}if(!window.popStyle){window.popStyle=function(A,B,C){setStyle(A,B,popStyleValue(A,B)||C)}}if(!window.findEntry){window.findEntry=function(B,D,A,E){var C=null;forEachItem(B,function(F){if(F[D]==A){C=F;return -1}},E);return C}}if(!window.getCurrentTime){window.getCurrentTime=function(){return(new Date()).valueOf()}}if(!window.hookEvent){window.hookEvent=function(){if(arguments[1]=="applicationready"){$j(arguments[2])}else{if(arguments[1] in _customEventHandlers){_customEventHandlers[arguments[1]].push({node:arguments[0],call:arguments[2],debug:null})}else{Events.hook.apply(Events,arguments)}}}}if(!window.hookEventOnce){window.hookEventOnce=function(D,E,C,A){function B(F){C(F);unhookEvent(D,E,arguments.callee,A)}hookEvent(D,E,B,A)}}if(!window.unhookEvent){window.unhookEvent=function(C,E,B,A){if(E in _customEventHandlers){var D;D=_customEventHandlers[E];forEachItem(D,function(G,F){if(G.node==C&&G.call==B){D.splice(F,1)}});return }Events.unhook.apply(Events,arguments)}}if(!window.nullEvent){window.nullEvent=function(){return false}}if(!window.cancelEvent){window.cancelEvent=function(C){if(!C){C=window.event}if(!C){return false}if(C.cancelable){if(Browser.isKHTML&&C.type=="click"){var A,B;A=Tree.ancestor(C.target,"a");if(A){B=A.onclick||null;A.onclick=nullEvent;setTimeout(function(){A.onclick=B},1)}}C.preventDefault()}else{C.returnValue=false}return false}}if(!window.stopEvent){window.stopEvent=function(A){if(A.bubbles&&A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}return A}}if(!window._customEventHandlers){window._customEventHandlers=[]}if(!window.registerCustomEvent){window.registerCustomEvent=function(A){if(!(A in _customEventHandlers)){_customEventHandlers[A]=Array()}}}if(!window.fireCustomEvent){window.fireCustomEvent=function(C,G,E,D){var B=true,A=true,F={currentTarget:C,target:null,timeStamp:0,type:G,bubbles:true,stopPropogation:function(){A=false},cancelable:true,preventDefault:function(){if(F.cancelable){B=false}}};if(E){mergeObjects(F,E)}forEachItem(_customEventHandlers[G],function(I,H){if(!I){return }forEachAncestor(I.node,function(J){if(J==C){F.target=J;I.call(F);if(!A){return -1}}})});return B}}if(!window.browser){window.browser=Browser}dre_assert=DRE.assert;dre_notice=DRE.notice;dre_warning=DRE.warning;if(!window.setCookie){window.setCookie=function(C,B){var A=new Date();document.cookie=C+"="+B+"; expires=7 Aug, "+String(A.getFullYear()+1)+" 13:33:37 GMT; "+(deviantART.isLocal?"path=/; domain=deviantart.com":"path=/");delete A}}if(!window.getCookie){window.getCookie=function(C,B){var A=(document.cookie+"; "+C+"="+(B||"")+";").match(RegExp("\\b"+C+"=(.*?);"));return A?A[1]:null}}if(!window.appendNode){window.appendNode=function(A,B){if(B.nextSibling){return B.parentNode.insertBefore(A,B.nextSibling)}else{return B.parentNode.appendChild(A)}}}if(!window.removeNode){window.removeNode=function(A){return A.parentNode.removeChild(A)}}if(!window.Animations){window.Animations={get:function(name){with(Animations){if(!lookup[name]){lookup[name]=registry[name]()}return lookup[name]}},register:function(A,B){Animations.registry[A]=B},lookup:{},registry:{}}}if(!window.Animation){window.Animation=function(A){this.playing=false;this.length=0;this.properties=null;this.properties=this._properties=Array()}}Animation.prototype.push=function(A){this.length=this._properties.length+1;return this._properties.push(A)};Animation.prototype.pop=function(A){this.length=this._properties.length-1;return this._properties.pop(A)};window._runningAnimations=Array();Animation.prototype.play=function(A,B){if(this.playing){return }if(!A){A=this.node}if(!B){B=this.to}this._finish=this._loopback=false;if(this.loop==undefined){this.loop=null}fireCustomEvent(this,"beforeplaystart");forEachItem(this._properties,function(C){C._node=C.node||A;C._to=C.to||B;if(C.from=="current"||C.from=="current"){C._offset=parseFloat(getStyle(C._node,C.property));if(isNaN(C._offset)){C._offset=0}if(C._to!="previous"){pushStyle(C._node,C.property,C._offset)}}else{C._offset=C.from||0}if(typeof (C._to)=="object"){if((C.property=="left"||C.property=="left")&&getStyle(C._node,"position")=="relative"){r=getNodeDocumentRect(C._node);tr=getNodeDocumentRect(C._to);if(C.property=="left"){C._multiplier=tr.x-r.x}else{C._multiplier=tr.y-r.y}}else{C._multiplier=parseFloat(getStyle(C._to,C.property))-C._offset}}else{if(C._to=="previous"){C._multiplier=popStyleValue(C._node,C.property,C._offset)-C._offset}else{C._multiplier=(C._to||0)-C._offset}}C._round=(C.round==undefined)?true:C.round;C._unit=C.unit||"";C._prefix=C.prefix||"";C._inverse=C.inverse||false});fireCustomEvent(this,"playstart");this._runningIndex=_runningAnimations.length;_runningAnimations.push(this);this.playing=true;this._startTime=this._lastFrameTime=getCurrentTime();this._endTime=this._startTime+this.duration;this._timer=window.setInterval("_runningAnimations["+(this._runningIndex)+"]._iteration()",this.interval)};Animation.prototype.stop=function(A){window.clearInterval(this._timer);if(!this.playing){return }if(!A){this._endTime=getCurrentTime();this._iteration()}this.playing=false;setTimeout("fireCustomEvent(_runningAnimations["+this._runningIndex+'], "playstop")',1)};Animation.prototype.finish=function(){this._finish=true};Animation.prototype._iteration=function(){with(this){if(!playing){return }var x=0,y,i,rem,Now=getCurrentTime();if(Now>=_endTime){if(loop&&!(_finish&&_loopback)){_startTime=_endTime;_endTime+=duration;if(loop==2||_loopback){_loopback=!_loopback}}else{x=1}}else{if((Now-_lastFrameTime)>=interval){_lastFrameTime=Now;x=(Now-_startTime)/duration}else{return }}for(i=0;i!=_properties.length;i++){with(_properties[i]){if(f||(rem==undefined)){y=x;if(f){if(_inverse){y=1-y}y=f(y);if(_inverse^_loopback){y=1-y}}rem=y}else{y=rem}y*=_multiplier;if(_round){y=Math.round(y)}y+=_offset;y=_prefix+y+_unit;setStyle(_node,property,y)}}if(x==1){stop(true)}}};registerCustomEvent("beforeplaystart");registerCustomEvent("playstart");registerCustomEvent("playstop");window._transitionStop=function(B){var A=getEventTarget(B);A.node.parentNode.removeChild(A.node);unhookEvent(A,"playstop",_transitionStop)};if(!window.Transition){window.Transition=function(C){var A,B;A=this.animation=new Animation();this.node=C;this.duration=0;this.interval=0;this.f=Interpolators.line;B=this.canvas=C.cloneNode(true);setStyle(B,"opacity",0.99);setStyle(B,"position","absolute");setStyle(B,"width",C.offsetWidth+"px");setStyle(B,"zIndex",30);B.disabled=true;C.parentNode.insertBefore(B,C)}}Transition.prototype.play=function(){var A=this.animation;A.duration=this.duration;A.interval=this.interval;A.node=this.canvas;A.push({property:"opacity",f:this.f,from:0.99,to:0,round:false});hookEvent(A,"playstop",_transitionStop);A.play()};Animations.register("BrowseButtonPulse",function(){var A=new Animation();A.duration=500;A.interval=50;A.loop=2;A.push({node:getElement("#browselink"),property:"opacity",f:Interpolators.sineCurve,from:1,to:0.3,round:false});A.push({node:getElement("#browsepath"),property:"opacity",f:null,from:1,to:0.3,round:false});return A});window.FORM_DEFAULT_ERROR="";if(!window.getFormControls){window.getFormControls=function(B,A){var E;var J=[];var I=B.getElementsByTagName("input");var F=I.length;if(F){for(E=0;E<F;E++){J.push(I[E])}}var H=B.getElementsByTagName("select");var D=H.length;if(D){for(E=0;E<D;E++){J.push(H[E])}}var G=B.getElementsByTagName("textarea");var K=G.length;if(K){for(E=0;E<K;E++){J.push(G[E])}}if(!A){return J}var C=Array();for(E=0;J[E];E++){if(A&&(J[E].name==A)){C.push(J[E])}}return C}}if(!window.formControlValidates){window.formControlValidates=function(F){if(F.getAttribute("pattern")&&F.value!=""){var D=String(F.value),B;if(F.getAttribute("ignore")){B=RegExp(F.getAttribute("ignore"),"g");D=D.replace(B,"")}B=RegExp("^"+F.getAttribute("pattern")+"$","");return B.test(D)}if(F.getAttribute("required")=="required"||F.getAttribute("required")=="required-if-selected"){if(F.getAttribute("required")=="required-if-selected"){var E=getAncestor(F,".option");while(E&&hasClass(E.parentNode,"option")){E=E.parentNode}if(E&&!hasClass(E,"option-selected")){return true}}switch(getTag(F)){case"textarea":case"input":switch(F.type){case"radio":var A=false;forEachItem(getFormControls(F.form,F.name),function(G){if(G.checked){A=true;return -1}});return A;break;case"checkbox":return F.checked;break}break;case"select":return(F.selectedIndex>0);break}return(F.value!="")}else{if(String(F.getAttribute("required")).indexOf("match:")==0){var C=document.getElementById(F.getAttribute("required").split(":")[1]);if(C&&(C!=F)&&(formControlValidates(C))&&(C.value!=F.value)){return false}}}return true}}if(!window.getFormErrorPrefix){window.getFormErrorPrefix=function(A){return String(A.getAttribute("error")||FORM_DEFAULT_ERROR).replace(/\\n/g,"\n")+"\n\n"}}if(!window.getFormControlError){window.getFormControlError=function(A){return A.getAttribute("error")||A.getAttribute("title")||""}}if(!window.validateForm){window.validateForm=function(B,A){var D,C=false,E=Array();if(B.type=="submit"){D=B;B=getEventTarget(D);A=true}forEachItem(getFormControls(B),function(G){if(!formControlValidates(G)){var F=getFormControlError(G);if(F!=""){E.push(F)}C=true}});if(A&&C){if(D){cancelEvent(D)}if(!E.length){E.push("Please ensure that all required fields have been filled in.")}alert(getFormErrorPrefix(B)+E.join("\n"))}return(!C)}}if(!window.serializeForm){window.serializeForm=function(D){var E={};var A=getFormControls(D);var C=A.length;for(var B=0;B<C;B++){var F=A[B];if(!F.name){continue}if(F.type=="radio"){if(F.checked){E[F.name]=F.value}}else{if(F.type=="checkbox"){if(F.checked&&F.name.indexOf("[]")>0){var G=F.name.split("[]")[0];if(!E[G]){E[G]=new Array()}E[G].push(F.value)}else{E[F.name]=F.checked}}else{E[F.name]=F.value}}}return E}}window._formsFirstControl=undefined;if(!window.enhanceForms){window.enhanceForms=function(A){if(!(A&&A.tagName)){A=document}forEachItem(getElements(A,"form"),function(B){if(!_formsFirstControl){forEachItem(getElements(B,"input"),function(C){if((!C.disabled)&&C.getAttribute("autofocus")=="autofocus"){C.focus();_formsFirstControl=C}if(C.getAttribute("confirm")){hookEvent(C,"click",_formButtonClicked)}})}hookEvent(B,"submit",validateForm)})}}if(!window.postTo){window.postTo=function(B,D,A){var C=document.createElement("form");document.body.appendChild(C);C.action=B;C.method="post";if(A){C.target=A}addFormData(C,D);C.submit()}}if(!window.replaceFormData){window.replaceFormData=function(E,D,F){for(var C in D){var G;if(!F){var A=E.getElementsByTagName("input");for(var B=0;G=A[B];B++){if(G.name==C){break}}}if(!G){G=document.createElement("input");E.appendChild(G);G.type="hidden"}G.name=C;G.value=D[C]}}}if(!window.addFormData){window.addFormData=function(B,A){replaceFormData.call(this,B,A,true)}}hookEvent(deviantART,"applicationready",enhanceForms,false,"Prepare Enhanced Form Controls");$j(function(){if(!window.Menus){window.Menus={zzLegacy:true,extractTitles:MenuTraffic.getTitles,extractMoodURL:function(A){var C=-1,B=Menus.extractTitles(A);dre_assert(B[0] in {Moods:0,mood:0});B=B.slice(1);while(B[++C]){B[C]=B[C].toLowerCase();B[C]=B[C].replace(/ /g,"_");B[C]=B[C].replace(/[^a-zA-Z0-9\-\'_]/g,"");if(B[C]=="wow"){B[C]="surprise"}}return"http://e.deviantart.com/emoticons/moods/"+B.join("/")+".gif"}}}});if(!window.LitBox){window.LitBox={get:function(B){var A;A=getNodeObject(B);if(!A){A={node:B,over:false};A.ani=new Animation();A.ani.interval=25;A.ani.duration=1500;A.ani.push({property:"top",from:"current",to:0,unit:"px",f:Interpolators.pulse,invert:true,node:getElement(B,"q")});setNodeObject(B,A)}return A},hover:function(B){var A;A=LitBox.get(B);A.over=true;if(A.ani.playing){A.ani.stop()}setTimeout(function(){LitBox.play(A)},400)},play:function(A){if(A.over){A.interval=setInterval(function(){LitBox.step(A)},80)}},step:function(A){var C,B;B=getElement(A.node,"q");C=getStyle(B,"top");setStyle(B,"top",((parseInt(C)||0)-1)+"px")},out:function(B){var A;A=LitBox.get(B);A.over=false;setTimeout(function(){LitBox.slide(A)},400)},slide:function(A){if(A.interval){clearInterval(A.interval)}if(!A.over){A.ani.play()}}}}if(!window.Floaters){window.Floaters={}}if(!Floaters.findSafeCoordinates){Floaters.findSafeCoordinates=function(E,C){var A,B,D;A=Ruler.screen.rect();B={x:0,y:0,w:E.offsetWidth,h:E.offsetHeight};D=Ruler.document.node(C,true);if(browser.isIE){A.y+=document.body.scrollTop;A.y2+=document.body.scrollTop}D.x2=D.x+C.offsetWidth;D.y2=D.y+C.offsetHeight;if(D.x2+B.w>A.x2){B.x=Math.max(D.x2-B.w,2)}else{B.x=D.x}if(D.y2+B.h>A.y2){B.y=Math.max(D.y-B.h,2)}else{B.y=D.y2}B.x2=B.x+B.w;B.y2=B.y+B.h;return B}}if(!window.popup){window.popup=function(A,B,C,H,I,G){var A=A||"";var C=C||500;var B=B||"DA";var H=H||600;var D=(screen.width-C)/2;var F=(screen.height-H)/2.1;var E=window.open(A,B,"left = "+D+", top = "+F+", toolbar = 0, scrollbars = 1, location = 0, status = "+(G?1:0)+", statusmenubar = 0, resizable = 1, width="+C+", height="+H);if(browser.isIE&&event){stopEvent(event);cancelEvent(event)}if(I){return E}return false}}if(!window.deviantTab){window.deviantTab=function(B){var D,G,F;if(B){deviantTab.a=B;setTimeout("deviantTab()",150);return }else{B=deviantTab.a}var D,E,A,C;D=0;A=B;while(A=getPreviousSibling(A)){if(getTag(A)=="a"){D++}}G=Tree.gets("iframe");for(F=0;G[F];F++){G[F].style.visibility="hidden"}E=getAncestor(B,"div.supernav");C=getElement(E,"i.super");if(C){unsetClass(C,"super")}E=getElement(E,"div.floating-highlight");E.style.left=(D*Math.round(100/B.parentNode.getElementsByTagName("a").length))+"%";setClass(getPreviousSibling(B),"super");setClass(getAncestor(B,"div.bubbleview"),"limbo");document.body.scrollTop=0}}if(!window.trimWhiteSpace){window.trimWhiteSpace=function(A){A=String(A);A=A.replace(/^\s+/,"");A=A.replace(/\s+$/,"");A=A.replace(/\s+/g," ");return A}}if(!window.zzClass){window.zzClass=function(A,D,C){A.prototype=D;for(var B in C){A[B]=C[B]}return A}}if(!window.Extend){window.Extend=function(C,A,E,D){var B;A.prototype=copyObject(C.prototype);for(B in E){A.prototype[B]=E[B]}for(B in D){A[B]=D[B]}return A}}if(!window.prettyNumber){window.prettyNumber=function(A){var B,C;A=String(A);C=(3-((A.length)%3))%3;for(B=1;B<=C;B++){A="0"+A}A=A.replace(/(\d\d\d(?!$))/g,"$1,");A=A.substr(C);return A}}if(!window.copyObject){window.copyObject=function(C){if(C==null){return null}var D,B;if(C.length&&C.push){D=Array()}else{D={}}for(var A in C){B=C[A];if(typeof B=="object"){B=copyObject(B)}D[A]=B}return D}}if(!window.getRealSize){window.getRealSize=function(B,A){if(A=="width"){return B.offsetWidth-(parseInt(getStyle(B,"padding-left"))+parseInt(getStyle(B,"padding-right"))+parseInt(getStyle(B,"border-left-width"))+parseInt(getStyle(B,"border-right-width")))}else{if(A=="height"){return B.offsetHeight-(parseInt(getStyle(B,"padding-top"))+parseInt(getStyle(B,"padding-bottom"))+parseInt(getStyle(B,"border-top-width"))+parseInt(getStyle(B,"border-bottom-width")))}}dre_warning('Received dim=="'+A+'", expected "width" or "height"')}}if(!window.matchWidth){window.matchWidth=function(A,B){setStyle(A,"width",getRealSize(B,"width")+"px")}}ccc_cache=[];ccc_results=[];if(!window.ccc){window.ccc=function(){var A,D,B,C;A=[];D=-1;while(++D!=arguments.length){A[D]=arguments[D]}D=-1;while(C=ccc_cache[++D]){B=-1;while(++B!=C.length){if(C[B]!=A[B]){break}}if(B==C.length){return ccc_results[D]}}C=A[0].apply(this,A.slice(1));ccc_cache.push(A);ccc_results.push(C);return C}}if(!window.encodeString){window.encodeString=function(A){A=escape(A);A=A.replace(/\+/g,"%2B");A=A.replace(/\%u([\dABCDEF]{4})/g,"%26%23x$1%3B");return A}}if(!window.userlink){window.userlink=function(A,B){if(A.username){B=A.symbol;A=A.username}return B+'<a href="http://'+A+'.deviantart.com/">'+A+"</a>"}}if(!window.pluralize){window.pluralize=function(B,A,C){if(B!=1){A+=(C||"s")}return B+A}}if(window.DWait){DWait.run("jms/lib/zzlegacy.js")}var Snap={registry:[],register:function(A){this.registry.push(A)},busy:false,click:{point:{x:0,y:0},reg:null,node:null,offset:{x:0,y:0}},surface:{node:null,busy:false,init:function(){if(!Snap.surface.node){Snap.surface.node=createNode("div.surface",{id:"dragsurface"});document.body.appendChild(Snap.surface.node)}},show:function(n){with(Snap.surface){dre_assert(!busy);init();busy=true;n.removeAttribute("title");node.appendChild(n);position();node.style.display="block"}},animations:{callback:null,create:function(C,B){var A=new Animation();A.node=Snap.surface.node;A.duration=C;A.interval=B;hookEvent(A,"playstop",Snap.surface.animations.finished);return A},finished:function(A){Snap.surface.animations.callback.call(Snap.click.reg,Snap.click.node);Snap.surface.animations.callback=null;setTimeout(Snap.surface.hide,1)}},slide:function(x,y,w,h,opacity,callback){Snap.surface.animations.callback=callback;with(ccc(Snap.surface.animations.create,150,25)){properties.length=0;push({property:"left",f:Interpolators.pulse,from:"current",unit:"px",to:x});push({property:"top",f:null,from:"current",unit:"px",to:y});if(w){push({property:"width",f:null,from:"current",unit:"px",to:w})}if(h){push({property:"height",f:null,from:"current",unit:"px",to:h})}if(opacity){push({property:"opacity",f:null,node:node.firstChild,from:"current",round:false,to:1})}play()}},drop:function(callback){Snap.surface.animations.callback=callback;with(ccc(Snap.surface.animations.create,250,25)){properties.length=0;push({property:"top",f:Interpolators.pulse,from:"current",unit:"px",inverse:true,to:parseInt(getStyle(Snap.surface.node,"top"))+200});push({property:"opacity",node:Snap.surface.node.firstChild,f:null,from:0.6,round:false,to:0});play()}},hide:function(){dre_assert(Snap.surface.busy);with(Snap.surface.node){style.display="none";while(firstChild){removeChild(firstChild)}}Snap.surface.busy=false},position:function(){var t=Snap.click.offset;with(Snap.surface.node){if(browser.isIE){runtimeStyle.pixelLeft=Snap.cursorCoords.x-t.x;runtimeStyle.pixelTop=Snap.cursorCoords.y-t.y}else{style.left=(Snap.cursorCoords.x-t.x)+"px";style.top=((Snap.cursorCoords.y-t.y)+document.body.scrollTop)+"px"}}}},candidate:function(e){if(Snap.busy||Snap.surface.busy){return true}var i,n,r,t;n=getEventTarget(e);i=Snap.registry.length;while(r=Snap.registry[--i]){t=r.getCorrectedNode.call(r,n);if(t){Snap.hookup();with(Snap.click){point=Ruler.screen.mouse(e);reg=r;node=t}return cancelEvent(e)}}return true},hookup:function(){hookEvent(document,"mousemove",Snap.watch);hookEvent(document,"mouseup",Snap.end)},unhook:function(){unhookEvent(document,"mousemove",Snap.watch);unhookEvent(document,"mousemove",Snap.walk);unhookEvent(document,"mouseup",Snap.end)},watch:function(B){if(Snap.busy){return }var D,C,A;D=Ruler.screen.mouse(B);C=Snap.click.point;if(Math.abs(C.x-D.x)<4&&Math.abs(C.y-D.y)<4){return true}A=Ruler.screen.node(Snap.click.node);if(window.Slots){if(browser.isGecko){A.y+=(window.pageYOffset*2)}else{A.y+=document.body.scrollTop}}A.x=C.x-A.x;A.y=C.y-A.y;Snap.click.offset=A;Snap.busy=true;Snap.cursorCoords=Ruler.screen.mouse(B);documentThunker.getReady();unhookEvent(document,"mousemove",Snap.watch);hookEvent(document,"mousemove",Snap.walk);Snap.click.reg.snap.call(Snap.click.reg,Snap.click.node);Snap.airSpace=documentThunker.walk(Snap.cursorCoords);return cancelEvent(B)},walk:function(A){if(!Snap.busy){return }Snap.cursorCoords=Ruler.screen.mouse(A);Snap.surface.position();Snap.airSpace=documentThunker.walk.call(documentThunker,Snap.cursorCoords);return cancelEvent(A)},end:function(A){Snap.unhook();if(Snap.busy){var B;if(Snap.airSpace){B=Snap.airSpace.thunk(Snap.click.reg);if(B){switch(B){case"collect":break}}else{Snap.airSpace.exitSpace()}}Snap.click.reg.over.call(Snap.click.reg,Snap.click.node,B);Snap.busy=false}},airSpace:null};hookEvent(document,"mousedown",Snap.candidate);if(window.DWait){DWait.run("jms/legacy/snap.js")}Thunker=zzClass(function(B,C){this.node=B;this.targets=[];this.registry=[];for(var A in C){this[A]=C[A]}},{register:function(A){this.registry.push(A)},getReady:function(){dre_assert(Snap.busy);var B,A=-1,C;this.targets.length=0;while(thunker=this.registry[++A]){if(thunker.ask.call(thunker,Snap.click.reg,Snap.click.node)){dre_assert(thunker.rect);this.targets.push(thunker)}}},hitTest:function(){dre_assert(Snap.busy);return thunkerHitTestArray(this.targets,Snap.cursorCoords)},walk:function(B){var A;A=this.hitTest(B);if(A!=this.airSpace){if(this.airSpace){this.airSpace.exitSpace()}if(this.airSpace=A){A.enterSpace()}}if(this.airSpace){if(this.airSpace.rect){B={x:B.x-this.airSpace.rect.x,y:B.y-this.airSpace.rect.y}}this.airSpace.walk.call(this.airSpace,B)}return this.airSpace},airSpace:null,enterSpace:function(){},exitSpace:function(){if(this.airSpace){this.airSpace.exitSpace();this.airSpace=null}},thunk:function(){dre_notice("default thunker.thunk called");this.airSpace=null;return false}});function thunkerHitTestArray(C,D){var A,B;for(A=0;A!=C.length;A++){B=C[A].rect;if((D.x>B.x)&&(D.y>B.y)&&(D.x<B.x2)&&(D.y<B.y2)){return C[A]}}}documentThunker=new Thunker(document,{});if(window.DWait){DWait.run("jms/legacy/thunk.js")}ReverseQuery={registry:[],register:function(A){A.node=null;this.registry.push(A)},ask:function(C){var A,B=-1;while(A=ReverseQuery.registry[++B]){if(A.ask(C)){return B}}},breakdown:function(E){var C=-1,D,A={original:E,types:0,query:[]};D=E.split(" ");while(D[++C]){var B=D[C].split(":");if(B.length>1&&B[1]){if(!A[B[0]]){A[B[0]]=[]}A[B[0]].push(B.slice(1));A.types++}else{A.query.push(B)}}if(A.sort=="time"){if(A.special){A.types--}A.special=["newest"];A.original=A.original.replace(/\bsort:time\b/,"")}else{if(A.boost=="popular"&&A.max_age=="24h"){A.types--;if(A.special){A.types--}A.special=["popular"];A.original=A.original.replace(/\bboost:popular\b/,"");A.original=A.original.replace(/\bmax_age:24h\b/,"")}}A.original=trimWhiteSpace(A.original);if(A.query.length){A.types++}return A}};ReverseQuery.register({type:"basic",place:1,ask:function(A){if((A.original=="")||(A.types==1&&(A.devwatch||(A.special&&A.special.length==1&&A.special[0] in {prints:0,dd:0,devwatch:0})))){return true}return false},availableItems:{newest:"Newest",popular:"Popular",prints:"Prints",dd:"Daily Deviations",empty:"(empty)",devwatch:"deviantWATCH"},create:function(){var A,B;A=[];B='setActiveClass(this, "searchdata");Slots.selectedLabel(getNodeText(this));return cancelEvent();';for(var C in this.availableItems){if(C=="devwatch"){A.pop();A.push(createNode("br"));A.push(createNode("br"));A.push("Subscription: ");if(window.Slots&&Slots.state.slotsAvailable<Slots.state.slotsReserved){B='this.blur();alert("The deviantWATCH slot is ready to go, with a deviantART Subscription.");return cancelEvent();'}}A.push(createNode("a.a search-special-"+C,{href:"#",onclick:B},this.availableItems[C]));A.push(", ")}A.pop();return createNode("label",{},A)},fill:function(C){var A,B;A=C.special?C.special[0]:"empty";B=getElement(this.node,"a.search-special-"+(C.devwatch?"devwatch":C.special))||getElement(this.node,"a.search-special-empty");setActiveClass(B,"searchdata")},reverse:function(){var B,A=getElement(this.node,"a.searchdata");B=A.className.match(/search\-special\-([a-z]+)/)[1];return(B=="empty"?{label:"",query:""}:{label:this.availableItems[B],query:"special:"+B})}});ReverseQuery.register({type:"category",place:2,ask:function(A){if(A.types==1&&A.special){return true}if(!(A["in"]&&A["in"].length==1)){return false}if(A.types==1){return true}if(A.types==2&&A.special){return true}return false},create:function(){return[createNode("label",{},["Show: ",this.fastselect=createNode("select",{onchange:'Slots.selectedLabel("...")'},[createNode("option",{value:"sort:time"},"Newest"),createNode("option",{value:"boost:popular max_age:24h"},"Popular")]),createNode("br"),"In: ",createNode("a.a",{href:"#",floater:"menu",menuri:"art",onfloaterselection:'var _modda = getNodeObject(getAncestor(this,"div.switch"));_modda.setLabel.call(_modda,this.getAttribute("floaterresult"));'},"All Categories")])]},setLabel:function(B){var A;if(B=="art"){A="All Categories"}else{A=Menus.extractTitles(B).pop()}setNodeText(getElement(this.node,"a"),A);this.selectedLabel(A)},selectedLabel:function(A){if(!A){A=getNodeText(getElement(this.node,"a"))}A=" "+A;if(A==" All Categories"){A=""}Slots.selectedLabel(["Newest","Popular"][this.fastselect.selectedIndex]+A)},fill:function(C){var A=C["in"],B=getElement(this.node,"a");setNodeText(B,A||"All Categories");B.setAttribute("floaterresult",A?"art/"+A:"art");getElement(this.node,"select").selectedIndex=((C.special&&C.special[0]=="popular")?1:0)},reverse:function(){var A,B;A=getElement(this.node,"a").getAttribute("floaterresult").split("/").slice(1).join("/");B=getElement(this.node,"select");if(A){return{label:["Newest","Popular"][B.selectedIndex]+" "+getNodeText(getElement(this.node,"a")),query:"in:"+A+" "+B.value}}else{return{label:["Newest","Popular"][B.selectedIndex],query:"special:"+(["newest","popular"][B.selectedIndex])}}}});ReverseQuery.register({type:"deviant",place:3,ask:function(A){if(!(A.by&&A.by.length==1||A.favby)){return false}if(A.types==1){return true}if(A.types==2&&A.special&&A.special[0]=="newest"){return true}return false},create:function(){return[createNode("label",{},["Who?",createNode("input.itext",{type:"text",onkeypress:'if ((window.event || arguments[0]).keyCode == 13)return false;Slots.selectedLabel("...");return true',onchange:'Slots.selectedLabel("..."); return true'})]),createNode("a.a r",{href:"#",floater:"friends",onfloaterselection:'getElement(this.parentNode,"input.itext").value=this.getAttribute("floaterresult");Slots.selectedLabel(this.getAttribute("floaterresult")+"\'s " + ["Newest","Favourites"][getElement(this.parentNode,"select").selectedIndex])'},"Friends..."),createNode("label",{},this.fastselect=createNode("select",{onchange:'Slots.selectedLabel("...")'},[createNode("option",{value:"sort:time by:"},"Newest"),createNode("option",{value:"favby:"},"Favourites")]))]},fill:function(A){getElement(this.node,"input.itext").value=(A.by?(A.by[0]||""):(A.favby?A.favby[0]||"":""));getElement(this.node,"select").selectedIndex=A.favby?1:0},reverse:function(){var A=trimWhiteSpace(getElement(this.node,"input.itext").value);if(!A){return null}else{return{label:A+"'s "+["Newest","Favourites"][this.fastselect.selectedIndex],query:this.fastselect.value+A}}}});ReverseQuery.register({type:"search",place:4,ask:function(A){return true},create:function(){return[createNode("label",{},["Keywords",createNode("input.itext search",{onkeypress:'if ((window.event || arguments[0]).keyCode == 13)return false;Slots.selectedLabel("..."); return true;',onchange:'Slots.selectedLabel("...")',type:"text"})]),createNode("label",{},createNode("select.r",{onchange:'Slots.selectedLabel("...")'},[createNode("option",{value:"sort:time"},"Newest"),createNode("option",{value:"boost:popular max_age:24h"},"Popular")])),createNode("label",{},[createNode("a.a",{href:"#",floater:"menu",menuri:"art",onfloaterselection:"Slots.catSelect(this)"},"Categories"),", ",createNode("a.a",{href:"#",floater:"friends",onfloaterselection:"Slots.appendSlotEdit('by',this.getAttribute('floaterresult'))"},"Friends")]),createNode("label",{"for":"supersuperprintscheck"},[createNode("input.icheck",{id:"supersuperprintscheck",type:"checkbox",onchange:'Slots.selectedLabel("...")',onclick:'Slots.selectedLabel("...")'}),"Just Prints"])]},fill:function(B){var A=B.original;if((B.types==1&&B.special)||(B.types==1&&B.favby)){A=""}getElement(this.node,"input.itext").value=trimWhiteSpace((" "+A+" ").replace(/ attribute:print /g,""));getElement(this.node,"select").selectedIndex=((B.special&&B.special[0]=="popular")?1:0);getElement(this.node,"input.icheck").checked=((B.attribute&&B.attribute[0]=="print")?1:0)},reverse:function(){var C,B,A;C=trimWhiteSpace(getElement(this.node,"input.itext").value);B=getElement(this.node,"select");A=getElement(this.node,"input.icheck").checked;if(C){return{label:"...",query:C+=" "+B.value+(A?" attribute:print":"")}}else{return{label:["Newest","Popular"][B.selectedIndex],query:"special:"+["newest","popular"][B.selectedIndex]}}}});if(window.DWait){DWait.run("jms/legacy/reversequery.js")}Slots={node:null,getNodeRect:function(C){var A,B;B=Ruler.screen.node(C);A=window.pageYOffset||document.body.scrollTop;if(browser.isGecko){B.y+=A;B.y2+=A}return B},nodes:{view:null,slots:null,bubble:null,badbubble:null,selection:null,fishipop:null},defaultState:{saves:0,save_error:false,quit:false,freeze:false,reload:true,firstRun:false,slotsAvailable:null,slotsReserved:null,slots:[]},state:{},init:function(node){with(this.nodes){view=node;slots=getElement(view,"div.slots");bubble=getElement(view,"div.slotter");badbubble=getElement(view,"div.reserved");selection=null;fishipop=getElement("div.fishipop");hookEvent(view,"mousedown",this.mouseDown);hookEvent(view,"click",this.click)}this.state=copyObject(this.defaultState)},cleanUp:function(){unhookEvent(this.nodes.view,"mousedown",this.mouseDown);unhookEvent(this.nodes.view,"click",this.click)},letsGo:function(){this.init(Modals.push(getElement("#custobox").cloneNode(true),Slots.bam));with(this.state){firstRun=deviantART.pageData.slots.firstRun;slotsAvailable=deviantART.pageData.slots.slotsAvailable;slotsReserved=deviantART.pageData.slots.slotsReserved;slots=deviantART.pageData.slots.data;dre_assert(!slots[0],"slots.data must be 1-based");dre_assert(slotsAvailable<=slotsReserved)}for(var i=1;i<=this.state.slotsReserved;i++){var a,t;a=this.state.slots[i];if(i>this.state.slotsAvailable){t=createNode("div.slot busyslot",{},"(reserved)")}else{if(!a){t=createNode("div.slot emptyslot",{},"(empty)")}else{t=createNode("div.slot",{slotstring:a.string,slottype:a.type},a.label)}}this.nodes.slots.appendChild(t)}setNodeText(getElement(this.nodes.view,"div.slotcount"),this.state.slotsAvailable+" channels");this.nodes.slots.setAttribute("openslots",this.state.slotsAvailable);documentThunker.register(new SlotThunker(this.nodes.slots.parentNode))},bam:function(result){var i,slots;if(result=="finished"){if(Slots.state.saves){return false}with(getElement(Slots.nodes.view,"input.confirm")){disabled=true;style.cursor="wait";value="(saving)"}slots=getElements(Slots.nodes.slots,"div.slot");Slots.state.save_error=false;DiFi.pushPost("Fish","clear",[0],Slots.saving);Slots.state.saves=1;for(i=0;slots[i];i++){if(hasClass(slots[i],"emptyslot")){continue}if(hasClass(slots[i],"busyslot")){break}Slots.state.saves++;DiFi.pushPost("Fish","add",[0,"deviation",slots[i].getAttribute("slotstring"),"000000"],Slots.saving)}DiFi.send();return false}return true},saving:function(success,data){if(!success){Slots.state.save_error=true}if(!(--Slots.state.saves)){if(Slots.state.save_error){alert("Unable to save your customizations at this time. Please try again shortly.");with(getElement(Slots.nodes.view,"input.confirm")){disabled=false;style.cursor="default";value="OK"}}else{Slots.exit()}}},gotLabel:function(B,A){this.nodeValue=B?A.response.content:"???"},selectedDefaultState:{changed:false},selectedState:{},selectedLabel:function(A){dre_assert(this.nodes.selection);if(A!=this.selectedState.changed){this.selectedState.changed=A;this.nodes.selection.firstChild.nodeValue=A}},save:function(){if(!(this.nodes.selection&&this.selectedState.changed)){return }var B,A,C;B=getNodeObject(getElement(this.nodes.bubble,"div.active")).reverse();if((!B)||B.query==this.nodes.selection.getAttribute("slotstring")){return }if(B.label=="..."){DiFi.pushPrivateGet("Fish","label",[0,"deviation",B.query],Slots.gotLabel,this.nodes.selection.firstChild);DiFi.send()}this.selectedState.changed=false;this.nodes.selection.firstChild.nodeValue=B.label||"(empty)";if(B.query.match(/^\s*$/)){this.nodes.selection.className="slot emptyslot";this.nodes.selection.removeAttribute("slotid");this.nodes.selection.removeAttribute("slotstring");if(B.label=="(empty)"){}else{if(Slots.state.slotsReserved>Slots.state.slotsAvailable){Slots.nodes.slots.insertBefore(Slots.nodes.selection,getElement(Slots.nodes.slots,"div.busyslot"))}else{Slots.nodes.slots.appendChild(this.nodes.selection)}}}else{this.nodes.selection.className="slot";this.nodes.selection.setAttribute("slotstring",B.query);this.nodes.selection.firstChild.nodeValue=B.label}},reset:function(){if(confirm("Do you want to reset your slots back to Newest, Popular, Prints, and Daily Deviations?")){DiFi.pushPost("Fish","reset",[0],Slots.exit);DiFi.send()}},deleted:function(){if(Slots.nodes.selection){Slots.bubbleSelect(0);setActiveClass(getElement(Slots.nodes.view,"a.search-special-empty"),"searchdata");this.selectedState.changed=true;Slots.select(null)}},exit:function(){postTo(window.location.href)},select:function(H){if(this.nodes.selection){this.save();setStyle(this.nodes.bubble,"visibility","hidden");setStyle(this.nodes.badbubble,"visibility","hidden");unsetClass(this.nodes.selection,"active")}if(H){this.selectedState=copyObject(this.selectedDefaultState);var F,A,E,G,D,B,C;F=ccc(ReverseQuery.breakdown,H.getAttribute("slotstring")||"");A=Math.max(4,Slots.getNodeRect(H).y-(((this.nodes.bubble.offsetHeight-25)+Slots.getNodeRect(this.nodes.view).y+H.parentNode.parentNode.scrollTop)))+"px";setActiveClass(this.nodes.selection=H);if(hasClass(H,"busyslot")){setStyle(this.nodes.badbubble,"top",A);setStyle(this.nodes.badbubble,"visibility","visible");return }else{setStyle(this.nodes.bubble,"top",A);setStyle(this.nodes.bubble,"visibility","visible")}E=getElement(this.nodes.bubble,"div.switcher");if(!E.firstChild){E.appendChild(D=createNode("div.tabbles"));G=true}else{G=false;D=getElement(E,"div.tabbles")}C=-1;while(B=ReverseQuery.registry[++C]){var H;if(G){H=createNode("div.switch",{},B.create());B.node=H;setNodeObject(H,B);E.appendChild(H);if(C>0){D.appendChild(document.createTextNode(" | "))}D.appendChild(createNode("a.a",{href:"#",onclick:"Slots.bubbleSelect("+C+",this);return cancelEvent()"},B.type))}B.fill(F)}C=ReverseQuery.ask(F);this.bubbleSelect(C);setStyle(this.nodes.bubble,"visibility","visible")}},bubbleSelect:function(B,C){var B,A;if(!C){C=getElements(this.nodes.bubble,"a")[B]}setActiveClass(C);setActiveClass(A=getElements(this.nodes.bubble,"div.switch")[B]);if(B=getElement(A,"input.itext")){B.focus();if(B.select){B.select()}}},click:function(A){var B;if(hasClass(B=getEventTarget(A),"slot")&&hasClass(B.parentNode,"slots")){Slots.select(B)}},mouseDown:function(A){var B=getEventTarget(A);if(B.firstChild){B=B.firstChild}if(!(getAncestor(B,"div.slotter")||getAncestor(B,"div.reserved"))){if(!Floaters.current){Slots.select(null)}}},drop:function(A){var B=createNode("div.slot emptyslot",{},"(empty)");if(Slots.state.slotsReserved==Slots.state.slotsAvailable){Slots.nodes.slots.appendChild(B)}else{Slots.nodes.slots.insertBefore(B,Slots.nodes.slots.childNodes[Slots.state.slotsAvailable-1])}},appendSlotEdit:function(B,A){var C;document.title=A;B+=":";C=getElement(getElement(Slots.nodes.bubble,"div.active"),"input.search");if((" "+C.value+" ").indexOf(" "+B+A+" ")>=0){return }if(C.value.indexOf("special:")==0){C.value=""}if((" "+C.value).indexOf(" "+B)>=0){C.value=B+A+" or "+C.value}else{C.value=B+A+(C.value?" "+C.value:"")}C.focus();if(C.select){C.select()}Slots.selectedLabel("...")},catSelect:function(B){var A=B.getAttribute("floaterresult");A=A.split("/");dre_assert(A[0]=="art");A=A.slice(1).join("/");if(A){Slots.appendSlotEdit("in",A)}}};if(window.Snap){Snap.register({getCorrectedNode:function(A){if(A.nodeValue){A=A.parentNode}if(getTag(A)=="div"&&hasClass(A,"slot")&&!hasClass(A,"emptyslot")&&A.firstChild.nodeType!=1){return A}return null},snap:function(A){var B;Snap.click.offset.y+=(getAncestor(A,"div.slots").parentNode.scrollTop||0);B=A.cloneNode(true);matchWidth(B,A);Snap.surface.show(B);setStyle(A,"visibility","hidden");this.displaySlot=A},over:function(C,D){if(1||D=="return"){var A,B;Snap.surface.hide();this.slideOver(C);if(Slots.nodes.view){Slots.select(C)}}else{Slots.drop(C);Snap.surface.drop(this.dropOver)}},slideOver:function(A){setStyle(A,"visibility","visible")},dropOver:function(A){if(A.parentNode){A.parentNode.removeChild(A)}}})}SlotThunker=Extend(Thunker,Thunker,{ask:function(A,B){this.rect=Slots.getNodeRect(this.node);this.workset=getElements(getAncestor(B,"div.slots"),"div.slot");this.measureHeight=this.workset[0].offsetHeight;return true},thunk:function(){return"return"},createSlideAni:function(A){a=new Animation();a.duration=300;a.interval=25;a.push({node:A,property:"marginTop",from:"current",to:0,unit:"px",f:Interpolators.pulse});return a},walk:function(E){var B,D,C;D=this.workset[Math.min(Math.round((E.y+(this.workset[0].parentNode.parentNode.scrollTop||0))/this.measureHeight),Number(this.workset[0].parentNode.getAttribute("openslots")||20))];if(!D){D=this.workset[this.workset.length-1]}if(notTheSame(this,D)){var B,A=notTheSame.lastOldValue;if(D){D.parentNode.insertBefore(Snap.click.reg.displaySlot,D)}}},exitSpace:function(){}});function notTheSame(D,C,B){var A;if(!B){B="_checkTheSame"}A=D[B];arguments.callee.lastOldValue=A;D[B]=C;return(A!=C)}if(window.DWait){DWait.run("jms/legacy/slots.js")}PlusFrontpage={add:function(E,C){var B,D,A;B=getElement("#customize-modal-form").cloneNode(true);A=getElement(B,"div.new-slot");if(A){A.innerHTML=C;A.setAttribute("slotstring",E)}else{D=true}Modals.push(B,PlusFrontpage.modalOver);DiFi.pushPrivateGet("Fish","get",[0],PlusFrontpage.modalReady,{form:B,query:E,label:C,preview:D});DiFi.send()},modalOver:function(result,data){var i,slots;if(result=="ok"){with(getElement(this,"input.confirm")){disabled=true;value="(saving)";style.cursor="wait"}PlusFrontpage.modal_saves=0;PlusFrontpage.modal_save_error=false;slots=getElements(getElement(this,"div.load-slots"),"div.slot");DiFi.pushPost("Fish","clear",[0]);for(i=0;slots[i];i++){if(slots[i].firstChild.nodeType==1&&slots[i].firstChild.checked){DiFi.pushPost("Fish","add",[0,"deviation",getElement(this,"div.new-slot").getAttribute("slotstring"),"000000"],PlusFrontpage.modalSaved)}else{if(slots[i].getAttribute("slotstring")){DiFi.pushPost("Fish","add",[0,"deviation",slots[i].getAttribute("slotstring"),"000000"],PlusFrontpage.modalSaved)}}PlusFrontpage.modal_saves++}DiFi.send();return false}},modal_saves:0,modal_save_error:false,modalSaved:function(B,A){if(!B){PlusFrontpage.modal_save_error=true}PlusFrontpage.modal_saves--;if(!B){alert("Front Page Customization is currently unavailable. Please try again shortly.")}window.location.href="http://www.deviantart.com/#da"},modalReady:function(I,C){var D,G,A,F,H,B,E;if(I){A=getElement(this.form,"div.load-slots");B=Number(A.getAttribute("openslots"))||20;F=[];if(this.preview){E=4}for(D=0;D!=20;D++){G=C.response.content[D];if((!G)&&this.preview&&E){E=false;G={query:this.query,title:this.label,class_mod:"active"}}if(D<B){A.appendChild(createNode(G?("div.slot "+(G.class_mod||"")):"div.slot emptyslot",{slotstring:G?G.query:"",style:this.preview?{}:{cursor:"default"},onclick:"if (PlusFrontpage.selectedRadio) PlusFrontpage.selectedRadio.checked=false; this.firstChild.checked = true; PlusFrontpage.selectedRadio=this.firstChild;"},[this.preview?"":H=createNode("input",{type:"radio",name:"custobox-replace"}),G?G.title:"(empty)"]));if(D==0&&H){H.checked=true;PlusFrontpage.selectedRadio=H}}else{A.appendChild(createNode("div.slot emptyslot",{style:{cursor:"default"}},[this.preview?"":H=createNode("input",{type:"radio",disabled:"disabled"}),"(reserved)"]))}F.push(H)}if(!this.preview){Forms.radioWatch(F)}else{A.insertBefore(getElement(A,"div.active"),A.firstChild);documentThunker.register(new SlotThunker(A.parentNode))}}else{alert("+Frontpage is unavailable at this time. Please try again shortly.")}}};if(window.DWait){DWait.run("jms/legacy/plusfrontpage.js")}DWait.count();