wdbNS={};wdbNS.baseURL="http://www.luminarypub.com/services/writersdb/";function countrymenu(A){if(A.options[A.selectedIndex].value=="Other"){$("othercountryField").style.display="block";new Effect.Highlight("othercountryField")}else{new Effect.Fade("othercountryField")}}function multsub(A){if(A.checked==true){xajax_mult_on()}else{xajax_mult_off();$("titlemenu").options.selectedIndex=0}}function resetDate(B,A){if(B.value!=""&&B.value!=A){if(confirm("Reset to today's date?")){B.value=A}}else{alert("Please use the calendar button to the right of the text field.")}}function pay_show(){$("amtpaid").value="0.00";$("payfield").style.display="block";new Effect.Highlight("payfield",{queue:"end"});$("amtpaid").select();$("amtpaid").focus()}function pay_hide(){if(Element.visible("payfield")){$("payfield").style.display="none"}}function showhide(B,A){if(B.checked==true){new Effect.Appear(A)}else{new Effect.Fade(A)}}function checkpend(B){var A=$("titlemenu");var C=A.options[A.selectedIndex].value;xajax_check_pending(C);if($("pendbool").value<1){return true}else{if(confirm("You already have a pending submission of this title. Are you sure you wish to submit to a second market?")){return true}else{return false}return false}}function colorRow(B,D,A){var C="subrow"+D;if(B.checked==true){$(C).className="hlrow sm"}else{$(C).className=A}}function addComment(){if(Element.visible("commentArea")){new Effect.toggle("commentArea","blind")}new Effect.toggle("addCommentForm","blind",{afterFinish:addCommentFocus})}function addCommentFocus(){$("addCommentField").focus()}function viewComments(){if(Element.visible("addCommentForm")){new Effect.toggle("addCommentForm","blind")}new Effect.toggle("commentArea","blind")}function embed_graph(){ea=new Effect.Appear("embed_code","blind",{queue:"front"});$("embed_code_field").activate()}function clear_response(A){if(confirm("Are you sure you want to reset the submission status to Pending?")){$("resetProg").style.visibility="visible";xajax_clear_response(A)}}function changepaid(){var A=prompt("Please enter the revised amount:");if(isNaN(A)){alert("Error: Please enter numbers and decimal point only.")}else{$("resetProg").style.visibility="visible";xajax_change_amt_paid(A)}}function qresponse(B){var A=prompt("Please enter a brief description of the response:");if(A!=null){xajax_qresponse(B,A)}}function delquery(A){if(confirm("Are you sure you want to delete this query?")){xajax_delquery(A)}}function cETB(){var A=document.createElement("img");A.id="editimg";A.src="http://www.luminarypub.com/services/writersdb/images/pencil.png";A.addClassName("twitedit");A.title="Edit tweet text";$("twitter_text").appendChild(A);Event.observe("editimg","click",edit_tweet)}function compose_tweet(){var B=$("titlemenu");var D=$("marketmenu");if($("send_to_twitter").checked==true){var E=B.options[B.selectedIndex].innerHTML;var I=D.options[D.selectedIndex].innerHTML;if($("sendmult").checked==true){var H="a few manuscripts"}else{var H='manuscript "'+E+'"'}var A="Sending "+H+" to "+I+".";if(A.length>140){if(H.length<57){var C=I.truncate(126-H.length);var F=H}else{if(I.length<57){var F=H.truncate(125-I.length)+'"';var C=I}else{var F=H.truncate(56)+'"';var C=I.truncate(57)}}A="Sending "+F+" to "+C+"."}$("twitter_text").innerHTML="<strong>Twitter:</strong> "+A;$("twitter_content").value=A;cETB();var G=new Effect.Highlight("twitter_text")}else{$("twitter_text").innerHTML="";$("twitter_content").value="";Event.stopObserving("editimg","click",edit_tweet);$("twitter_text").removeChild($("editimg"))}Event.observe("titlemenu","change",compose_tweet);Event.observe("marketmenu","change",compose_tweet)}function get_twitter_creds(){if($("send_to_twitter").checked==true){var A='<div style="padding: 0.5em;"><h3>Twitter Credentials</h3><p>You have not yet stored your Twitter login credentials in this site. Maybe this is the first time you\'ve used this feature?</p><p>Please enter your Twitter username and password:</p><p>Username: <input type="text" name="twituser" id="twituser" size="12"><br>Password: <input type="password" name"twitpass" id="twitpass" size="12"></p><p><strong>Please note:</strong> We\'ll do our best to keep this information safe, but we are not responsible if somehow it is stolen.</p><p>If you do not yet have a Twitter account, you can <a href="https://twitter.com/signup" target="twitter_win">get one here</a>.</p></div>';Dialog.confirm(A,{className:"dialog",title:"Twitter Login",width:350,height:315,zIndex:100,showEffect:Effect.Appear,hideEffect:Effect.Fade,draggable:true,resizable:false,wiredDrag:false,okLabel:"Save Credentials",cancelLabel:"Cancel",onOk:function(){xajax_store_twitter_creds($F("twituser"),$F("twitpass"))},onCancel:function(){$("send_to_twitter").checked=false;Dialog.closeInfo()}})}}function edit_tweet(){if($("send_to_twitter").checked==true){var A=prompt("Please enter your revised text for Twitter.",$F("twitter_content"));if(A.length>140){alert("Sorry: The edited text is greater than 140 characters long, and cannot be sent to Twitter.")}else{if(A.length<1){alert("Sorry: It appears you did not enter any text. The content of your Twitter message has not been changed.")}else{$("twitter_text").innerHTML="<strong>Twitter:</strong> "+A;$("twitter_content").value=A;cETB();var B=new Effect.Highlight("twitter_text")}}}else{alert("Sorry: It looks like you are not sending a message to Twitter, so there is nothing to edit.")}}function subStatusReact(C){var F=$F(C);var E=C.options[C.selectedIndex];var B=E.id.split("_");var D=B[1];var A=B[2];if(F=="add_options"){window.location.href=wdbNS.baseURL+"subs/custom_status"}else{if(D=="won"||(D=="std"&&A=="2")){pay_show()}else{pay_hide()}}}Event.observe(window,"load",ie_fix_corners)
