/*
 *  © 2000-2010 deviantART, Inc. All rights reserved.
 */
if(!window.AutoExec){AutoExec=[]}if(window.DWait){DWait.run("jms/pages/submission.js")}var SPDeviation={showHelp:function(B){var A=B.parentNode;if(hasClass(A,"helpactive")){unsetClass(A,"helpactive")}else{setClass(A,"helpactive")}B.blur();return cancelEvent()},checkLoad:function(A,B){if(typeof (window[A])=="undefined"){if(!B){alert("We are unable to process this request. It is possible that this page has not yet fully loaded. \nIf problem persists please try refreshing the page")}return false}return true},flipDownlodable:function(C){var A=$j("#watermark").get(0);var D=$j("#devisdownloadable").get(0);if(A&&D){var B;if(!C){var C=window.event}if(C.target){B=C.target}else{if(C.srcElement){B=C.srcElement}}if(B&&B.id=="watermark"&&A.checked){D.checked=false}else{if(B&&B.id=="devisdownloadable"&&D.checked){A.checked=false}}}},toggleWatermarker:function(){var A=$j("#watermark").get(0);var B=$j("#devsize").get(0);if(A&&B&&B.value){if(B.value==0){A.checked=false;A.disabled=true}else{A.disabled=false}}},showEditFileModal:function(){dndDeck.modalizeDeck("deck_modal_file_layout",{addfile:true,updatecontextualdata:true,ieforms:["form1","form2","form3"]},dndDeck.editFileSelectHandler,function(A){if(A){$j("#deckPreviewId").val("");A.toggleContextualFileMenus(true);SPDeviation.setDeviationThumb(A,"edit_image_thumb");$j("#dont_notify_watchers").show();if(A.is_displayable){$j("#change_button_preview").hide();$j("#generic_image_thumb").hide()}else{if(A.status>0){$j("#change_button_preview").show();$j("#generic_image_thumb").show()}else{$j("#dont_notify_watchers").hide();$j("#change_button_preview").hide();$j("#edit_image_thumb").hide()}}}})},showEditPreviewModal:function(){dndDeck.modalizeDeck("deck_modal_preview_layout",{addfile:true,filter:"displayable",ieforms:["form1","form2","form3"]},dndDeck.editPreviewSelectHandler,function(A){if(A&&A.is_displayable){$j("#deckPreviewId").val(A.deckId);SPDeviation.setDeviationThumb(A,"edit_image_thumb");if(literatureEditMode){$j("#previewKillerId").val("");$j("#remove_button_preview").show()}}})},showNewPreviewModal:function(){dndDeck.modalizeDeck("deck_modal_preview_layout",{addfile:true,filter:"displayable",restoreselection:true,ieforms:["form1","form2","form3"]},dndDeck.newPreviewSelectHandler,function(A){if(A&&A.is_displayable){SPDeviation.setDeviationThumb(A,"preview_thumb");$j("#deckPreviewId").val(A.deckId)}else{$j("#preview_thumb").attr("src",DndDeck.IMAGE_NO_PREVIEW);$j("#deckPreviewId").val("")}})},showNewReleaseModal:function(){dndDeck.modalizeDeck("deck_modal_file_layout",{addfile:true,restoreselection:true,ieforms:["form1","form2","form3"]},dndDeck.newPreviewSelectHandler,function(A){if(A){$j("#deckNarfId").val(A.deckId);$j("#model_release_info_id").val("Release form file <em>"+A.name+"</em> is chosen for submission.")}else{$j("#model_release_info_id").val("No release form is selected")}$j("#model_release_info_text_id").html($j("#model_release_info_id").val())})},showNewPermissionModal:function(){dndDeck.modalizeDeck("deck_modal_file_layout",{addfile:true,restoreselection:true,ieforms:["form1","form2","form3"]},dndDeck.newPreviewSelectHandler,function(A){if(A){$j("#deckSprfId").val(A.deckId);$j("#permission_document_info_id").val("Permission document file <em>"+A.name+"</em> is chosen for submission.")}else{$j("#permission_document_info_id").val("No permission document is selected")}$j("#permission_document_info_text_id").html($j("#permission_document_info_id").val())})},setDeviationThumb:function(A,C){var B=$j("#"+C);B.show();if(!A.fileheight||A.fileheight>100){B.height(100)}else{B.height(A.fileheight)}if(A.thumbUrl){B.attr("src",A.thumbUrl)}else{B.attr("src",DndDeck.IMAGE_NEEDS_PREVIEW)}},toggleTextEditor:function(){dndDeck.addTextModal(function(A){if(A){$j("#change_button_text").css("visibility","hidden");$j("#text_preview_spinner").show();$j("#existing_text_preview").html("Processing, please wait");setTimeout(SPDeviation.waitForEditedText.bindTo(A),2000)}});return cancelEvent()},waitForEditedText:function(){if(this.status==2||this.status==-1){$j("#deckId_id").val(this.deckId);$j("#existing_text_preview").html(this.text_preview);$j("#dont_notify_watchers").show();$j("#text_preview_spinner").hide();return }setTimeout(SPDeviation.waitForEditedText.bindTo(this),3000)},removePreview:function(){$j("#deckPreviewId").val("");$j("#previewKillerId").val("purge");$j("#edit_image_thumb").height(100);$j("#edit_image_thumb").attr("src",DndDeck.IMAGE_OPT_PREVIEW);$j("#remove_button_preview").hide();return cancelEvent()},toggleCommons:function(){if(SPDeviation.checkLoad("creativeCommons")){creativeCommons.open()}return cancelEvent()},previewingDescription:false,doPreview:function(C){var A=$j("#devdesc");var D=encodeURI(A.val()).replace(/&/g,"%26").replace(/\+/g,"%2B");var B;if(D.length==0){return cancelEvent()}if(!SPDeviation.previewingDescription){SPDeviation.previewingDescription=true}else{C.value="Preview Artist's Comments";B=$j("#previewdiv").css("cursor","default").hide();A.show();SPDeviation.previewingDescription=false;return cancelEvent()}C.value="Edit Artist's Comments";var B=$j("#previewdiv");if(!B.length){B=$j('<div class="previewcontainer" id="previewdiv"></div>');B.appendTo(A.parent())}B.css({cursor:"wait",width:(A[0].offsetWidth-10)+"px"}).html("...").show();A.hide();DiFi.pushPost("DASubmitDeviation","format_description",[A.val()],function(F,E){if(!F){return cancelEvent()}B.css("cursor","default").html("<strong>Preview:</strong><br />"+E.response.content)});DiFi.send();return cancelEvent()},nextScreen:function(C,A){if(!$j("#sp_agree").is(":checked")){alert("Before continuing you must agree to the Submission Policy");return }if(!$j("#tos_agree").is(":checked")){alert("Before continuing you must agree to the Terms of Service");return }if(A){$j("#command_id").val(A)}var B=$j("#submission_form");B.empty();this.copyElementValues(["form1","form2","form3","commons_container"],B.get(0));B.attr("action",C);B.submit()},copyElementValues:function(B,A){if(typeof A=="string"){A=$j("#"+A).get(0)}if(B.constructor!=Array){B=[B]}$j.each(B,function(){$j("#"+this).find(":input").each(function(){var C=this;var E=C.tagName.toLowerCase();var D=$j(C).val();if(D==null){D=""}switch(E){case"input":switch(C.type.toLowerCase()){case"hidden":case"text":$j('<input type="'+C.type+'" name="'+C.name+'"/>').val(D).appendTo(A);break;case"checkbox":case"radio":if($j(C).is(":checked")){$j('<input type="hidden" name="'+C.name+'"/>').val(D).appendTo(A)}break}break;case"select":$j('<input type="hidden" name="'+C.name+'"/>').val(D).appendTo(A);break;case"textarea":$j(C).clone(true).appendTo(A).val(D);break}})})}};if(window.DWait){DWait.run("jms/pages/submit/SPDeviation.js")}var SPFilm={nextThumb:function(B){var A=parseInt($j("#film_thumbs_id_"+B).val());this.moveIt(B,++A);if(window.event){event.cancelBubble=true}return false},prevThumb:function(B){var A=parseInt($j("#film_thumbs_id_"+B).val());this.moveIt(B,--A);if(window.event){event.cancelBubble=true}return false},enable:function(B){$j("#film_selector").data("thumb_data",B.videoThumbs);if(!B.handler.reselect){for(var A=0;A<5;A++){SPFilm.setFormFields(A,0,null,0);if($j("#film_th_navigator_"+A).length>0){$j("#film_th_navigator_"+A).css("visibility","hidden")}}var C=0;for(var A=0;A<B.videoThumbs.length;A++){if(B.videoThumbs[A].sel=="1"){if($j("#film_thumbs_img_"+C).length>0){SPFilm.setFormFields(C,B.videoThumbs[A].numb,B.videoThumbs[A].th,B.videoThumbs[A].ts);if($j("#film_th_navigator_"+C).length>0&&B.videoThumbs[A+1]&&B.videoThumbs[A+1].sel!="1"){$j("#film_th_navigator_"+C).css("visibility","visible")}}C++}}}$j("#film_selector").show();$j("#file_keeper").show()},load_thumbs:function(thumbs){if(typeof thumbs=="string"){thumbs=eval("("+thumbs+")")}$j("#film_selector").data("thumb_data",thumbs)},removeCredit:function(A){$j(A).siblings("input[type=text]").val("");$j(A).parent().hide();if(window.event){event.cancelBubble=true}return false},addCredit:function(){var B=$j("<div/>").appendTo("#film_credit_holder");$j('<input type="text" name="film_credit_roles[]" value="" class="itext roles" size="20" max-length="30"/>').appendTo(B);$j('<input type="text" name="film_credit_names[]" value="" class="itext names" size="20" max-length="80"/>').appendTo(B);var A=$j('<input type="button" value="-" class="remove"/>').appendTo(B);A.click(bind(SPFilm,SPFilm.removeCredit,A));$j('<div class="separator">&nbsp;</div>').appendTo(B);if(window.event){event.cancelBubble=true}return false},moveIt:function(F,E){F=parseInt(F);var A=$j("#film_selector").data("thumb_data");var D=Math.floor(A.length/5);var B=parseInt(F*D);var C=parseInt(((F+1)*D)-1);if(isNaN(E)){E=B}if(E>C){E=B}if(E<B){E=C}if(A[E]){SPFilm.setFormFields(F,A[E].numb,A[E].th,A[E].ts)}},getTimestamp:function(B){function A(C){var D;D="0"+Math.floor(C);return D.substr(Math.max(0,D.length-2))}var B=parseInt(B);return A(B/60)+":"+A(B%60)},setFormFields:function(F,E,A,B){var D="http://s.deviantart.com/styles/minimal/minish/spitbite/fthumb-loader.gif";var C=SPFilm.getTimestamp(B);$j("#film_thumbs_img_"+F).attr("src",D).height(100);$j("#film_thumbs_ts_"+F).html(C);$j("#film_thumbs_ts_s_"+F).val(C);$j("#film_thumbs_id_"+F).val(E);if(A){$j("#film_thumbs_img_"+F).attr("src",A);$j("#film_thumbs_url_"+F).val(A)}else{$j("#film_thumbs_url_"+F).val(D)}}};if(window.DWait){DWait.run("jms/pages/submit/SPFilm.js")}(function(){var A={whichRadioChecked:function(C,B){return $j("#"+C).find('input[name="'+B+'"]:checked').val()},checkRadiosByValue:function(C,B,D){$j("#"+C).find('input:radio[name="'+B+'"]').each(function(){if(this.value==D){this.checked=true}else{this.checked=false}})},isRadioChecked:function(C,B,D){stdLog("isRadioChecked: "+C+", "+B+", "+D);return $j("#"+C).find('input[name="'+B+'"]').filter(function(E){return $j(this).is("[value="+D+"]")}).is(":checked")}};window.CreativeCommons=Base.extend({constructor:function(){this.helpType=""},radioClickHandler:function(D){var C=D.target||D.srcElement;var B=C.name;var E=C.value;if(B=="commons"&&E=="0"){A.checkRadiosByValue(this.form,null,0)}else{if(B!="commons"&&E!="0"){A.checkRadiosByValue(this.form,"commons",1)}}},open:function(){var D=$j("#commons_container").clone(true).get(0);D.id="commons_container_clone";var C=Modals.push.call({gecko_fix:true},D,function(F,E){if(F!="ok"){return }A.checkRadiosByValue("commons_container","commons",E.commons);A.checkRadiosByValue("commons_container","commonsuses",E.commonsuses);A.checkRadiosByValue("commons_container","commonsmodifications",E.commonsmodifications);this.makeLabel()}.bindTo(this));A.checkRadiosByValue("commons_container_clone","commons",A.whichRadioChecked("commons_container","commons"));A.checkRadiosByValue("commons_container_clone","commonsuses",A.whichRadioChecked("commons_container","commonsuses"));A.checkRadiosByValue("commons_container_clone","commonsmodifications",A.whichRadioChecked("commons_container","commonsmodifications"));var B=this.radioClickHandler;$j("#commons_container_clone").find("input:radio").each(function(){$j(this).click(B)});this.helpType="";this.showHelp("all")},makeLabel:function(){var B=this.makeTag("commons_container");if(B!=="none"){DiFi.pushPrivateGet("Deck","loadLicense",[B],function(E,D){var C=D.response.content;$j("#cc-optional").hide();$j("#cc-info").html(C)});DiFi.send()}else{$j("#cc-optional").show();$j("cc-info").html("")}},showHelp:function(B){if(!B){B=this.makeTag("commons_container_clone")}stdLog("Help Type: ",B);var C=$j("#commons_container_clone .description-scroll").get(0);if(this.helpType!=B){DiFi.pushPrivateGet("Deck","loadLicenseHelp",[B],function(F,E){if(!F){return }var D=E.response.content;$j(C).show();$j(C).find("div").html(D.help);this.helpType=D.type;if(this.helpType!="all"){$j("form#commons_container_clone span.commons_help_more").show()}else{$j("form#commons_container_clone span.commons_help_more").hide()}}.bindTo(this));DiFi.send()}},makeTag:function(C){var B="none";if(A.isRadioChecked(C,"commons","1")){B="by";if(A.isRadioChecked(C,"commonsuses","0")){B+="-nc"}if(A.isRadioChecked(C,"commonsmodifications","0")){B+="-nd"}else{if(A.isRadioChecked(C,"commonsmodifications","2")){B+="-sa"}}}return B}})})();if(window.DWait){DWait.run("jms/pages/submit/CreativeCommons.js")}function groupExclusiveClicked(){if(this.checked){$j("#gallery_folder_selector").attr("disabled","disabled");var A=$j(this).parents(".groupselector_grp").find("input.groupselector")[0];$j("input.groupselector").each(function(){this.checked=(this==A);if(this!=A){this.setAttribute("disabled","disabled");$j(this).parent().find(".selected_only").hide()}})}else{$j("#gallery_folder_selector").attr("disabled","");$j("input.groupselector").attr("disabled","")}}function initGroupSubmissionForm(){var A=0;var G=0;var E=window.location.hash;if(E&&E.charAt(0)=="#"){E=E.substr(1)}E=E.split(",");if(E&&E.length){for(var D=0;D<E.length;D++){var B=E[D].split("=");if(B&&B.length>1){var C=B[0];var F=B[1];if(C=="group"){A=F}else{if(C=="folder"){G=F}}}}}$j("input.groupselector").each(function(){if(A){var H=this.parentNode.id.split("_");if(H[1]==A){this.checked=true}}if(this.checked){$j(this).parent().find(".selected_only").show().find("select option").each(function(){if(G&&G==this.value){$j(this).attr("selected","1")}else{if(G){$j(this).removeAttr("selected")}}})}});$j(".exclusivecheck").each(function(){if(this.checked){$j(this).parent().show();bind(this,groupExclusiveClicked)()}});$j("input.groupselector").click(function(){var H=$j(this).parent();if(this.checked){H.find(".selected_only").show()}else{H.find(".selected_only").hide()}H.find(".exclusivecheck").click(groupExclusiveClicked)[0].checked=false;$j("input.groupselector").attr("disabled","")})}if(window.DWait){DWait.run("jms/pages/submit/GroupSubmission.js")}Pager.more.clickMultiple=function(F){var G,B,C,H,A,E,D;F.blur();B=Pager.getFromNode(F);G=Tree2.getByAttribute(F.parentNode,"a","menumarker");if(!G){E=F.parentNode.firstChild;while(E){E.className="f";E=E.nextSibling}F.setAttribute("menumarker","menumarker");F.className="f tentative"}else{G.setAttribute("menumarker","");C=Tree.gets(F.parentNode,"a.tentative");for(D=0;D!=C.length;D++){C[D].className="f"}H=C[0].getAttribute("menuri");if(C.length>1){H+="-"+C.pop().getAttribute("menuri").split("/").pop()}return Pager.clickBack(F,H)}return false};Pager.more.hoverMultiple=function(F){var E,D,C,B,A;D=Pager.getFromNode(F);B=Tree2.getByAttribute(F.parentNode,"a","menumarker");if(!B){return }A=false;E=F.parentNode.firstChild;while(E){if(E==F||E==B){if(F!=B){A=!A}E.className="f tentative"}else{E.className=A?"f tentative":"f"}E=E.nextSibling}};Pager.more.jumpTo=function(A,D,B,E,C){DRE.assert(D.indexOf(A.options.rootri)==0,"Jump target must be within pager rootri");DRE.assert(A.options.paned,"Use loadPage instead of jumpTo for non-paned pagers");DRE.assert(B||(!A.options.callback_immediately),"When options.callback_immediately is in use, target selection parameter is required");A.jump_target=D;A.jump_target_selection=B;A.jump_target_callback=E;A.jump_target_cbo=C;Bug.log(A.jump_target,"aren't we cookin' it now sure");Pager.loadPage(A,A.options.rootri)};Pager.more.jumpThrough=function(C,E,B){var D,A;DRE.assert(C.jump_target.indexOf(B)==0);A=Tree.get(E,"div.pagescroll");DRE.assert(A,"Expected: div.pagescroll in page node");if(B==C.jump_target){Bug.log(C.jump_target,"got it at "+B);C.jump_target=null;if(C.jump_target_selection){D=Tree2.getByAttribute(E,"a","menuri",C.jump_target_selection);C.jump_target=null;Pager.clickBack(D)}else{D=Tree.get(E,"a.selected")}if(D){if(C.jump_target_callback){C.jump_target_callback.call(C.jump_target_cbo,C,D)}}else{DRE.notice("Missing scroll-to node at "+B)}}else{Bug.log(C.jump_target,"don't got it at "+B);D=Tree2.getByAttribute(E,"a","menuri",C.jump_target.split("/").slice(0,B.split("/").length+1).join("/"));if(!D){DRE.notice("Failed jump_target lookup: "+C.jump_target+" at "+B)}Pager.clickBack(D)}A.scrollTop=(D.offsetTop+60)-A.offsetHeight};Pager.more.pushd=function(A,C,B){A.pushd_stack=A.pushd_stack||[];A.pushd_stack.push([C,B])};Pager.more.popd=function(A){var B;if(!(A.pushd_stack&&A.pushd_stack.length>0)){DRE.assert(A.options.rootri,"If popd runs out of stack, the pager must at least have a rootri");Pager.loadPage(A,A.options.rootri)}else{B=A.pushd_stack.pop();Pager.more.jumpTo(A,B[0],B[1])}};if(window.DWait){DWait.run("jms/lib/pager.js.more.js")}SuperArtSubmitZoneJapan={big_data:null,getList:function(A){A=A.replace(/[\r\n]+/g,"\n");A=A.replace(/^\n+/,"");A=A.split("\n");return A},extract:function(D,C){var B,A;C=C.replace(/_/g,"/");D=SuperArtSubmitZoneJapan.getList(D);A=[];for(B=0;B!=D.length;B++){if(D[B].split(":")[0]==C){do{B++;if(!(D[B]&&D[B].charAt(0)==".")){break}A.push(D[B].slice(1))}while(1);return A.join("\n")}}return null},hooza:0,rub:function(B,C){var D,A;B=[].concat(B);for(D=0;D!=B.length;D++){if(C.indexOf(B[D])>=0){B.splice(D--,1)}}return B},getIndent:function(A){var B;for(B=0;A.charAt(B)==".";B++){}return B},search_index:null,getSearchableIndex:function(){if(!SuperArtSubmitZoneJapan.search_index){SuperArtSubmitZoneJapan.search_index=SuperArtSubmitZoneJapan.createSearchableIndex(SuperArtSubmitZoneJapan.big_data.split("\n"),0,{items:[],title:null,parent:null,next:null,previous:null})}return SuperArtSubmitZoneJapan.search_index},createSearchableIndex:function(H,B,E,F){var D,C,G,A;A=SuperArtSubmitZoneJapan.getIndent(H[B]);if(H[0].indexOf(":")!=-1){DRE.notice("Unexpected leaf node")}for(C=0;H[B+C];C++){G=SuperArtSubmitZoneJapan.getIndent(H[B+C]);if(G==A){F={title:H[B+C],items:[],parent:E,next:null,previous:F};if(F.previous){F.previous.next=F}E.items.push(F)}else{if(G<A){break}else{if(G-A>1){continue}else{if(H[B+C].indexOf(":")==-1){arguments.callee(H,B+C,F)}else{F.items.push({items:[],title:H[B+C],parent:F})}if(F.items.length>1){F.items[F.items.length-2].next=F.items[F.items.length-1];F.items[F.items.length-1].previous=F.items[F.items.length-2]}}}}}return E},find4:function(C,I,J){var A,B,G,J,H,E,D,F;DRE.assert(I,"Got lump");DRE.assert(I.items.length,"No leaf please");for(A=0;B=I.items[A];A++){DRE.assert(B.parent==I,"double checking something");if(F){debug("checkin out "+B.title)}G=C.length?SuperArtSubmitZoneJapan.rub(C,B.title.toLowerCase()):[];if(F&&G.length!=C.length){debug("WWWWWWWWWWWWWWWWWOAH LOOK: "+G)}if(B.items.length>0){if(F){debug(")) "+B.title)}J=arguments.callee(G,B,J);if(F){debug("(( "+B.title)}}else{if(F){debug("THUNK "+B.title)}if(G.length==0){H=B.title.split(":");if(!Number(H[1])){DRE.notice("Not a Category: "+B.title)}else{if(!J[H[1]]){if(!E){E=[];D=B;while(D=D.parent){if(D.title){E.unshift(D.title)}}}J[H[1]]=E.concat([H[0]]).join(" > ").replace(/\./g,"")}}}}}return J},callmeback:function(B,A){if(Tree.get("#DASubmitDeviation-categories-override")){SuperArtSubmitZoneJapan.big_data=Tree.get("#DASubmitDeviation-categories-override").value.replace(/^\s+/,"");B(A)}else{(vms_feature("pachunkajunk")?DiFi.pushPublicGet:DiFi.pushPublicStaticGet)("DASubmitDeviation","dbcategories",[],SuperArtSubmitZoneJapan.calleveryoneback,[B,A]);DiFi.send()}},calleveryoneback:function(B,A){if(!(B&&A.response.content.length>0)){alert("Unable to load categories. Please try again later.");return"All is lost!"}SuperArtSubmitZoneJapan.big_data=A.response.content.replace(/^\s+/,"");DRE.assert(SuperArtSubmitZoneJapan.big_data.length>0);this[0](this[1])},modal:function(B){var A;if(A=SuperArtSubmitZoneJapan.form){Modals.push.call({gecko_fix:true},A,B);return }A=SuperArtSubmitZoneJapan.getForm();Modals.push.call({gecko_fix:true},A,B);Pager.loadPage(SuperArtSubmitZoneJapan.getChooser(),"artsubmit")},getChooser:function(){return(SuperArtSubmitZoneJapan.chooser||(SuperArtSubmitZoneJapan.chooser=Pager.create({more_links:false,master_links:false,callback_immediately:true,rootri:"artsubmit",theme:"light",paned:true,callback:function(B,A){var C,D;D=B.split("/");C=Tree.get(Tree.ancestor(A.node,"form"),"input.ri");if(D[0]=="artid"){C.value=D.slice(1).join("/")}else{if(D[0]=="artsubmit"&&D[1]=="none"){C.value=1123}else{C.value=""}}(Tree.get(Tree.ancestor(A.node,"form"),"input.ok")||{}).disabled=(C.value=="");((Tree.get(Tree.ancestor(A.node,"form"),"input.desc")||{}).style||{}).visibility=(C.value==""||C.value==1123?"hidden":"visible");return false}})))},getForm:function(){var B,A;A=this.getChooser();B=Tree.create("form",{id:"modal-form-category",style:{width:"700px",height:Browser.isIE?"auto":((window.innerHeight||document.body.clientHeight)>610?"613px":"500px")}},Tree.create("div.light",{style:{padding:"14px 32px"}},[Tree.create("div.pb",{},[Tree.create("input.isearch isearchblank",{type:Browser.isKHTML?"search":"text",results:0,style:{display:"none",position:"absolute",top:"8px",right:"30px"},onkeydown:'if (this.value == "")this.className="isearch"',onkeyup:'this.className = this.value ? "isearch" : "isearch isearchblank";setTimeout(SuperArtSubmitZoneJapan.search, 300);'}),Tree.create("strong",{},"Categories")]),A.node,Tree.create("input.ri",{name:"ri",type:"hidden"}),Tree.create("input.title",{name:"title",type:"hidden"}),Tree.create("div.pppt r",{},[Tree.create("input.ibutton desc",{type:"button",style:{position:"absolute",left:"30px",zIndex:500,width:"16ex"},value:"Gallery Info",onclick:"SuperArtSubmitZoneJapan.descriptionClick(this)"}),Tree.create("input.ibutton ok",{name:"ok",style:{width:"12ex"},type:"button",value:"OK",onclick:"SuperArtSubmitZoneJapan.modalDone(this)"})," ",Tree.create("input.ibutton cancel",{name:"cancel",style:{width:"12ex"},type:"button",value:"Cancel",onclick:'Modals.pop("cancel")'})])]));if(Browser.isKHTML){B.addEventListener("click",function(){var C;C=Tree.get(SuperArtSubmitZoneJapan.form,"div.pager-panes");if(C.offsetTop>120){C.style.display="none";SuperArtSubmitZoneJapan.form.style.display="none";SuperArtSubmitZoneJapan.form.style.display="block";setTimeout("Tree.get(SuperArtSubmitZoneJapan.form, 'div.pager-panes').style.display = 'block'",1)}})}if((window.innerHeight||document.body.clientHeight)>610){Tree.addClass(A.node,"pager-tall-cat-chooser")}else{Tree.addClass(A.node,"pager-semitall-cat-chooser")}A.node.style.border="1px solid #AAA";return SuperArtSubmitZoneJapan.form=B},jumpedTo:function(A,B){Station.push(B,"visibility",{to:"visible",time:100},{to:"hidden",time:100},{to:"visible",time:100},{to:"hidden",time:100},{to:"visible",time:100})},descriptionClick:function(B){var A,C,D;C=SuperArtSubmitZoneJapan.form;A=Pager.getFromNode(Tree.get(C,"div.pager2"));if(!Tree.get(A.node,"a.selected")){Pager.more.popd(A)}else{SuperArtSubmitZoneJapan.pushd();Pager.loadPage(A,"artsubmit/description/"+Tree.get(C,"input.ri").value)}},pushd:function(){var B,A,C;B=SuperArtSubmitZoneJapan.form;A=Pager.getFromNode(Tree.get(B,"div.pager2"));C=SuperArtSubmitZoneJapan.getTitlePath(A);if(C.length>1){C.pop()}Pager.more.pushd(A,"artsubmit/"+C.join("/"),A.selection)},modalDone:function(C){var B,A;B=Tree.ancestor(C,"form");A=Pager.getFromNode(Tree.get(B,"div.pager2"));if(A.pushd_stack&&A.pushd_stack.length>0){Pager.more.popd(A)}if(!Tree.get(B,"input.ri").value){alert("Please select a category first.");return }Tree.get(B,"input.title").value=SuperArtSubmitZoneJapan.getTitlePath(A).join(", ");Modals.pop("ok")},getTitlePath:function(A){var B,D,C;B=Tree.gets(A.node,"a");D=[];for(C=0;C!=B.length;C++){if(Tree.hasClass(B[C],"selected")||Tree.hasClass(B[C],"more-selected")){D.push(Tree.getText(B[C]))}}return D},waitSearch:null,searchGo:function(A){},lastSearch:null,search:function(){var A;DRE.assert(SuperArtSubmitZoneJapan.form);A=Tree.get(SuperArtSubmitZoneJapan.form,"input.isearch").value;if(SuperArtSubmitZoneJapan.lastSearch==A){return }Pager.loadPage(Pager.getFromNode(Tree.get(SuperArtSubmitZoneJapan.form,"div.pager2")),A==""?"artsubmit":"artsubmit/search/"+A)},pathFromID:function(H){var D,G,C,B,A,F;function E(I){return I.split(":")[0].replace(/\./g,"").replace(/\//g,"_")}DRE.assert(SuperArtSubmitZoneJapan.big_data);G=SuperArtSubmitZoneJapan.big_data;G=G.replace(/\r/,"");D=G.indexOf(":"+H);if(D==-1){return null}D=G.indexOf("\n",D);if(D!=-1){G=G.substring(0,D)}else{}G=G.split("\n");while(!B){B=G.pop()}C=[];A=SuperArtSubmitZoneJapan.getIndent(B);F=G.length-1;while(A>0){while(G[F].charAt(A-1)=="."){F--}A--;C.unshift(E(G[F]));DRE.assert(A==0||G[F].charAt(A-1)==".","Can't jump down more than one level")}C.unshift("artsubmit");return C.join("/")},searchKeyPress:function(){}};if(window.MenuTraffic){MenuTraffic.overrides.artsubmit=function(J){var F,M,G,E,C,K,I,A,B,H,L,D;if(!window.Page){Page=deviantART.pageData||{}}if(!SuperArtSubmitZoneJapan.big_data){SuperArtSubmitZoneJapan.callmeback(arguments.callee,J);return true}M=J.split("/");F=[];if(M[1]=="none"){}else{if(M[1]=="frequent"){for(G=0;Page.submit_frequent[G];G++){F.push({href:"/",title:Page.submit_frequent[G].title,path:["artid",Page.submit_frequent[G].id],children:null})}}else{if(M[1]=="search"){DRE.assert(M[2]);H=M[2].toLowerCase().split(" ");K=SuperArtSubmitZoneJapan.getList(SuperArtSubmitZoneJapan.big_data);K=SuperArtSubmitZoneJapan.find4(H,SuperArtSubmitZoneJapan.getSearchableIndex(),{});for(G in K){F.push({href:"http://browse.deviantart.com/"+G+"/",title:K[G],path:["artid",G],children:null})}}else{if(M[1]=="description"){(vms_feature("pachunkajunk")?DiFi.pushPublicGet:DiFi.pushPublicStaticGet)("Deck","categoryPathHelp",[M[2]],function(Q,P){var N,O;if(!Q){MenuTraffic.got(Q,J)}else{O=[];for(N=0;P.response.content[N];N++){O.push({href:"/",title:P.response.content[N].title,text:P.response.content[N].description,path:[],children:null})}MenuTraffic.got(Q,J,{all:null,title:null,path:M,children:O})}});DiFi.send();return true}else{C=[].concat(M);DRE.assert(C[0]=="artsubmit");C.shift();K=SuperArtSubmitZoneJapan.big_data;while(C[0]){DRE.assert(K);K=SuperArtSubmitZoneJapan.extract(K,C.shift())}K=K.split("\n");if(M.length==1){if(Page.submit_frequent){F.push({href:"/",title:"Frequently Used",flag:1,path:["artsubmit","frequent"],children:[]});B=true}F.push({href:"/",title:"My Scrapbook",flag:1,path:["artsubmit","none"]})}for(G=0;K[G];G++){if(K[G].charAt(0)=="."){DRE.assert(I);I.children=[];continue}A=K[G].split(":");I={href:"/",title:A[0],flag:0};A[0]=A[0].replace(/\//g,"_");if(A[1]){if(A[1].charAt(A[1].length-1)=="/"){I.path=["art"].concat(A[1].substring(0,A[1].length-1).split("/"));I.children=[]}else{if(A[1].indexOf("artsubmit/unknown/")==0){I.path=A[1].split("/");I.title="[?] "+I.title;I.children=null}else{if(Number(A[1])){I.path=["artid",A[1]];I.children=null}else{I.path=("art/"+A[1]).split("/");I.children=null}}}}else{I.path=M.concat([A[0]]);I.children=null}F.push(I);if(!M[1]&&A[0]=="Fan Art"&&deviantART.pageData&&deviantART.pageData.i_am_super_privileged){F.push({path:["catpicker","film"],title:"Film & Animation",children:[],flag:0,href:"/"})}else{if(A[0]=="Clipart"&&Number(A[1])==1365&&deviantART.pageData&&deviantART.pageData.i_am_super_privileged){F.push({path:["catpicker","resources","filmresources"],title:"Film Resources",children:[],flag:0,href:"/"})}}}}}}}MenuTraffic.got(true,J,{all:null,title:null,path:M,children:F});if(B&&Tree.get("#modal-form-category")){Pager.clickBack(Tree.get(Tree.get(Tree.get("#modal-form-category"),"div.page2"),"a"))}return true}}if(window.Pager){Pager.overrides.push(function(D,B,C,A,E){if(D.path[0]=="artsubmit"){if(D.path[1]=="frequent"){E.style.width="400px"}else{if(D.path[1]=="none"){Tree.get(E,"div.pagescroll").style.overflow="hidden"}else{if(D.path[1]=="search"||D.path[1]=="description"){E.style.width="634px"}}}}return false})}if(window.Pager){Pager.overrides.push(function(B,I,C,A){var D,E,F,G,H;if(B.path[0]=="artsubmit"){if(B.path[1]=="description"){for(i=0;F=B.children[i];i++){if(F.text){C.push("<strong>Gallery Info: "+F.title+"</strong><div>"+F.text.replace(/(?:\\|<\/?a[^>]*>)/g,"")+"</div><br/><br/>")}}if(C.length){C.unshift('<div style="padding:12px">Your selection will submit to...<br/><br/>')}else{C.push('<div style="padding:12px">Sorry, information is not available for this category.<br/><br/>')}C.unshift('<div class="top"><a class="f back" href="" onclick="Pager.more.popd(Pager.getFromNode(this));return Events.stop()">Back</a></div>');C.push('<input type="button" value="Back" onclick="Pager.more.popd(Pager.getFromNode(this))"/>')}else{if(B.path[1]=="none"){C.push('<div style="text-align:center;padding:16px" class="artsubmit-description"><br/><img width="18" height="18" src="http://s.deviantart.com/icons/userpage/general.gif" alt=""/><br/>This selection will submit to your <a class="h" target="_new" href="http://help.deviantart.com/242/">scrapbook</a> instead of your main gallery</div>')}else{for(i=0;F=B.children[i];i++){if(D!=undefined&&F.flag!=D){if(B.path.length==1){C.push('<div style="font-size:.7em">&nbsp;</div>')}else{C.push('<div class="hr">-</div>')}}D=F.flag;E=F.path.join("/");if(B.path[1]=="search"){if(C.length==0){C.push('<div class="top"><a class="f back" href="" onclick="Pager.loadPage(Pager.getFromNode(this), \'artsubmit\');return Events.stop()">Back</a></div>')}html_class="hyper";H=F.title.replace(/\//g,"_").split(" > ");H.pop();H="artsubmit/"+H.join("/");G=" onclick=\"Pager.more.jumpTo(Pager.getFromNode(this), '"+H+"', this.getAttribute('menuri'), SuperArtSubmitZoneJapan.jumpedTo);return Events.stop()\" "}else{if(B.path[1]=="frequent"){html_class="hyper";H=SuperArtSubmitZoneJapan.pathFromID(F.path[1]);if(!H){continue}G=" onclick=\"Pager.more.jumpTo(Pager.getFromNode(this), '"+H+"', this.getAttribute('menuri'), SuperArtSubmitZoneJapan.jumpedTo);return Events.stop()\" "}else{if(E=="art/0"){continue}if(F.children!=null){html_class="f more"}else{html_class="f"}if(E.indexOf("artsubmit/unknown")==0){G=" onclick=\"alert('Category doesn\\'t exist: "+F.path.slice(2).join("/")+"');return Events.stop()\" "}else{if(E=="artsubmit/none"||E=="artid/1123"){G=" onclick=\"Pager.clickBack(this);Pager.loadPage(Pager.getFromNode(this), 'artsubmit/none', Tree.ancestor(this, 'div.page2'), 'next');return Events.stop()\" "}else{G=A}}}}C.push('<a menuri="'+E+'" href="'+(F.path[0]=="artid"?"http://browse.deviantart.com/"+F.path[1]+"/":"")+'" class="'+html_class+'" '+(B.path[1]=="frequent"?' title="'+F.title+'" ':"")+G);if(F.children==null){C.push(' ondblclick="Pager.clickBack(this);SuperArtSubmitZoneJapan.modalDone(this)" ')}C.push(">"+F.title+"</a>")}}}return C}return false})}if(window.Pager){Pager.overrides.push(function(G,D,E,C){var B,A,F,H;if(G.path[0]=="catpicker"){for(i=0;F=G.children[i];i++){if(!F.children){F.path=["artid",F.id]}}for(i=0;F=G.children[i];i++){A=F.path.join("/");if(F.children!=null){html_class="f more"}else{html_class="f"}E.push('<a menuri="'+A+'" href="'+(F.path[0]=="artid"?"http://browse.deviantart.com/"+F.path[1]+"/":"")+'" class="'+html_class+'" '+(G.path[1]=="frequent"?' title="'+F.title+'" ':"")+C);if(F.children==null){E.push(' ondblclick="Pager.clickBack(this);SuperArtSubmitZoneJapan.modalDone(this)" ')}E.push(">"+F.title+"</a>")}return E}return false})}if(window.DWait){DWait.run("jms/lib/pager.js.artsubmit.js")}DWait.count();