var baseserverurl="http://www.entrythingy.com";var loadimage="<img src=http://entrythingy.s3.amazonaws.com/images/loading.gif>";function setHTML(B,A){if(!$(B)){return}$(B).innerHTML=A}function d(A){A=unescape(A);return A.replace(/\+/g," ")}function doBRs(A){A=A.replace(/\n/g,"");return A.replace(/<br>/g,"\n")}function $(A){return document.getElementById(A)}function cd(){return document.createElement("div")}function n(A){A=d(A);return A.replace(/ /g,"_")}function empty(A){if(!A){return}while(A.hasChildNodes()){A.removeChild(A.firstChild)}}var JSC_NEWWIDGET=100;var currjson;function handleJSON(C,A){currjson=A;if(C==JSC_NEWWIDGET){if(A.s=="ok"){var B="<span class=bold>Cool! Here's the code for your EntryThingy.</span><br>Click and copy this html code to a web page, upload it to your site at <i>"+currdomain+'</i> and try it out: &nbsp;<a href="#" onclick="ddrivetip(event, \'When you put this html code on a web page, upload it to your site and try it out, you\\\'ll see a login form that you, your clients and partners can use to login to your EntryThingy.<br><br><b>Your code will only work on web pages at <i>'+currdomain+"</i></b>. That\\'s because you wouldn\\'t want other people to be able to grab your widget and use it on their site - it\\'s your EntryThingy!','', 350);\" class=getit>(more info)</a><br>";B+="<textarea style='border-color:#999999; border-width:1px; border-style:solid; background:#ffffff; width:920px; margin-top:3px; margin-bottom:10px; height:100px' onclick='this.select()'>";B+='<script src="http://entrythingy.s3.amazonaws.com/resources/entrythingy.js" type="text/javascript" language="Javascript"><\/script>\n';B+='<iframe id="et_uploadtarget" name="et_uploadtarget" src="" style="width:0px;height:0px;border:0"></iframe>\n';B+="<span id='et_dataarea0'></span><span id='et_dataarea1'></span><span id='et_dataarea2'></span><span id='et_dataarea3'></span><span id='et_dataarea4'></span>\n";B+="<div id='et_apparea' style='text-align:left;'><p><img src=http://entrythingy.s3.amazonaws.com/images/loading.gif> &nbsp; <a href=http://www.entrythingy.com>Loading EntryThingy: The embeddable digital call for entries, entry management and jury system for art, photography, design and video...</a></p></div>\n";B+='<script type="text/javascript" language="Javascript">\n';B+='var sitecode="'+A.c+'";\n';B+="entryThingy();\n";B+="<\/script>\n";B+="</textarea>";B+="<br><br><span class=bold>Next steps:</span><br>After you've put your EntryThingy on your site, login with the email and password you just entered. You can then add your first call for entries.\n";B+="<br><br><span class=bold>Don't feel like putting a EntryThingy on your site right now?</span><br><a href=\"http://www.entrythingy.com/entrythingy="+A.c+"\">Go here for your personal EntryThingy</a> at entrythingy.com. You can always come back later and get the html code for your site - just use the same domain, email and password as you did now.\n<br><br>Or: We can host your entrythingy right here. We'll make it look just like your site. Contact us and we'll set it up.";B+='<br><br><br><span class=bold>Other options:</span><ul><li>Want to start over? <a href=/>Click here</a><li>Not quite sure what to do? <a href=/vtour.html>Watch the video</a> - It\'ll show you how it works</li><li>Contact us at hello<span style="display:none">!removethis!</span>@<span style="display:none">!removethis!</span>entrythingy.com</span>, we\'d love to help out!</li></ul>';B+='<iframe src=/awc.html style="width:0px;height:0px;border:0"></iframe>';setHTML("maintable","<table width=100%><tr valign=top><td width=31>&nbsp;</td><td>"+B+"</td><td width=35 style='background:url(http://49video.resources.s3.amazonaws.com/images/uploadthingy_rightline1.gif) repeat-y;'>&nbsp;</td></tr></table>")}else{if(A.s=="wrongpassword"){setHTML("getwidget","Ooops. This domain has already been registered and that was not the correct password. <a href=# onclick='window.location.reload();'>Please click here to try again.</a>")}else{if(A.s=="dupemail"){setHTML("getwidget","Ooops. This email has already been registered with another domain. <a href=# onclick='window.location.reload();'>Please click here to try again.</a>")}else{setHTML("getwidget","Ooops. There was an error. <a href=# onclick='window.location.reload();'>Please click here to try again.</a>")}}}}else{setHTML("getwidget","Ooops. There was an error. <a href=# onclick='window.location.reload();'>Please click here to try again.</a>")}}var commandcnt=0;var showwaitsave;function sendCommand(A,D,C){if(C){showwaitsave=$(C).innerHTML;setHTML(C,"<table border=0><tr valign=center><td>loading...</td><td>"+loadimage+"</td></tr></table>")}var B=document.createElement("script");B.src=A+D+"&cnt="+commandcnt;empty($("dataarea"));$("dataarea").appendChild(B);commandcnt++}var currdomain;function getNewWidget(){var B=$("domain").value;var A=null;B=B.toLowerCase();B=B.replace(/^\s+|\s+$/g,"");if(B.indexOf("http://")==0){B=B.substring(7)}if(B.indexOf("www.")==0){B=B.substring(4)}if(B.indexOf("/")>0){B=B.substring(0,B.indexOf("/"))}if(B.length<5||B.lastIndexOf(".")<2||B.lastIndexOf(".")>B.length-3||B.indexOf(" ")!=-1){A="Ooops. That is not a valid domain.\nDomain example: mysite.com.\n\nWe need to know which domain your EntryThingy will live on so nobody else can use it - except you on your site!"}else{if(B.indexOf("/")!=-1){A="Ooops. That is not a valid domain - you can't have a '/' in the domain.\nDomain example: mysite.com"}else{if(B.indexOf("@")!=-1){A="Ooops. That is not a valid domain - you can't have a '@' in the domain.\nDomain example: mysite.com"}else{if($("name").value.length<2){A="Ooops. Your name must be at least 2 characters long."}else{if($("email").value.length<7||$("email").value.indexOf("@")==-1||$("email").value.indexOf(".")==-1){A="Ooops. Please enter a valid email address."}else{if($("password").value.length<5){A="Ooops. Your password must be at least 5 characters long."}else{if($("password").value!=$("confirmpassword").value){A="Ooops. You did not confirm your password correctly."}else{if(!$("tos").checked){A="Ooops. You must agree to the Terms of Service."}}}}}}}}if(A!=null){alert(A)}else{sendCommand(baseserverurl,"/widget?d="+escape(B)+"&name="+escape($("name").value)+"&eml="+escape($("email").value)+"&pw="+escape($("password").value)+"&cpw="+escape($("confirmpassword").value),"getwidget");currdomain=B}}function expandspan(A){if($(A).style.display=="inline"){$(A).style.display="none"}else{$(A).style.display="inline"}};