function urchinTracker(A){return }function callAjaxUpdater(D,A){var B=document.getElementById(D);try{new Ajax.Updater(B,A,{evalScripts:true});return true}catch(C){setTimeout("callAjaxUpdater('"+D+"', '"+A+"')",500);return false}}function emailAlert(A,D){var C=document.getElementById("myEmailAlert");var B="/emailAlert!register?"+D;if(C){B+="&email="+C.value}new Ajax.Updater(A,B);return false}function checkLegalTerms(){var A=document.getElementById("logupForm");A.logupButton.disabled=!A.terms.checked}function showEmailFriend(A){var B="/EmailFriend!show?offerHashId="+A;new Ajax.Updater("email_friend_div",B,{onLoading:emailFriendClock()});$("email_friend_div").show()}function emailFriendSend(){var C=document.getElementById("emailFriendForm");var B=C.sendCopy.checked?1:0;var A="/EmailFriend?offerHashId="+C.offerHashId.value+"&fromEmail="+C.fromEmail.value+"&toEmail="+C.toEmail.value+"&comment="+C.comment.value+"&sendCopy="+B;new Ajax.Updater("email_friend_div",A,{onLoading:emailFriendClock()});return false}function emailFriendClock(){$("email_friend_div").update('<div id="email_friend_form_div"><div class="loading"></div></div>')}function getPermanentUrl(A){if(!A){alert("empty offerId!");return false}var B=document.getElementById("permanent_url");new Ajax.Updater(B,"PermanentUrl?offerId="+A);return true}function seeMore(B){var A=document.getElementById(B+"_seemore");A.style.visibility="hidden";A.style.display="none";var A=document.getElementById(B+"_rows");A.style.visibility="visible";A.style.display="";return false}function moreOptionsBox(B,C){toggleVisibility(C);var A="/MoreOptionsBox?idHash="+B+"&divId="+C;callAjaxUpdater(C,A,{onLoading:showClock(C)})}function toggleVisibility(B){var A=document.getElementById(B);if(A.style.visibility=="hidden"||A.style.display=="none"){A.style.visibility="visible";A.style.display=""}else{A.style.visibility="hidden";A.style.display="none"}}function showClock(A){$(A).update('<div class="loading"></div>')}function addShortList(B,C){var A="/UpdateShortList!add?idHash="+B+"&div="+C;new Ajax.Updater(C+B,A);updateCounter()}function delShortList(C,A){var B="/UpdateShortList!del?idHash="+C+"&div="+A;new Ajax.Updater(A+C,B);updateCounter()}function updateCounter(){setTimeout("callAjaxCounter()",1000)}function callAjaxCounter(){new Ajax.Updater("counter","/UpdateShortList!check");return }function showRssBox(A){var B=document.getElementById("rss_box");B.style.visibility="visible";B.style.display="";callAjaxUpdater("rss_box",A);return false}function showAlertBox(B,C){var A=document.getElementById(B);if(A.style.visibility=="hidden"){A.style.visibility="visible";A.style.display="";C+="&divName="+B;callAjaxUpdater(B,C)}else{A.style.visibility="hidden";A.style.display="none"}return false}function showAlertBoxHome(B,C){var A=document.getElementById(B);if(A.style.visibility=="hidden"){A.style.visibility="visible";A.style.display=""}C+="&divName="+B;callAjaxUpdater(B,C);return false}function counter(B,A){A="/countNew?"+A;callAjaxUpdater(B,A)}function editAlert(B){editDiv="editAlertDiv";createDiv="newAlertDiv";$("editAlertDiv").show();$("newAlertDiv").hide();var A="/MyAlerts!input?aid="+B;callAjaxUpdater(editDiv,A,{onLoading:showClock(editDiv)})}function updateAlert(){var A="/MyAlerts!update?"+$("editAlertForm").serialize();editDiv="editAlertDiv";callAjaxUpdater(editDiv,A,{onLoading:showClock(editDiv)})}function checkNewAlertForm(){var A=document.getElementById("newAlertForm");if(A.what.value.length>0||A.where.value.length>0){A.newAlertButton.disabled=false}else{A.newAlertButton.disabled=true}}function stats(A){urchinTracker(A)}function checkOfferState(C){var A="OfferState!check?offId="+C;var B=document.getElementById("td_offer_state_"+C);new Ajax.Updater(B,A,{onLoading:showClock(B)});return false}function checkAllOfferState(A){for(i=0;i<A.length;i++){setTimeout("checkOfferState("+A[i]+")",(i+1)*500)}}function updateOfferState(D,C){if(confirm("Do you want to change the state of offer "+D+" ?")){var A="OfferState!update?offId="+D+"&state="+C;var B=document.getElementById("td_offer_state_"+D);new Ajax.Updater(B,A,{onLoading:showClock(B)})}return false}function showTopLocation(C){var A="locations_textarea";var C=document.getElementById("numberTopLocations").value;var B="DusInjection!showLocations?numberTopLocations="+C;callAjaxUpdater(A,B,{onLoading:showClock(A)});$(A).show();return false}function toggleTopLocationVisibility(B,A){if(A){$(B).show()}else{$(B).hide()}}function URLEncode(E){var G="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";var B="0123456789ABCDEF";var F="";for(var C=0;C<E.length;C++){var D=E.charAt(C);if(D==" "){F+="+"}else{if(G.indexOf(D)!=-1){F+=D}else{var A=D.charCodeAt(0);if(A>255){alert("Unicode Character '"+D+"' cannot be encoded using standard URL encoding.\n(URL encoding only supports 8-bit characters.)\nA space (+) will be substituted.");F+="+"}else{F+="%";F+=B.charAt((A>>4)&15);F+=B.charAt(A&15)}}}}return F}function URLDecode(E){var A="0123456789ABCDEFabcdef";var D="";var B=0;while(B<E.length){var C=E.charAt(B);if(C=="+"){D+=" ";B++}else{if(C=="%"){if(B<(E.length-2)&&A.indexOf(E.charAt(B+1))!=-1&&A.indexOf(E.charAt(B+2))!=-1){D+=unescape(E.substr(B,3));B+=3}else{alert("Bad escape combination near ..."+E.substr(B));D+="%[ERROR]";B++}}else{D+=C;B++}}}return D}function deleteSection(A){if(confirm("Deleting Section "+A+" and all related URLs...\nContinue?")){var B="SectionEdit!delete?secId="+A;window.location.href=B}}function clearAllUrls(B){if(confirm("Deleting all URLs for Section "+B+"...\nContinue?")){var A="SectionEdit!clearAll?secId="+B;window.location.href=A}}function counterSection(C,A){var B="?";if(A.indexOf("?")!=-1){B="&"}A=A+B+"countOnly=true";callAjaxUpdater(C,A)}function createSection(){var A=document.getElementById("SectionEditForm");A.action="SectionEdit!create";return true}function addUrl(B){var A="SectionUrl!edit?secId="+B;new Ajax.Updater("section_url_div",A);$("section_url_div").show()}function generateAjaxUri(){var B=document.getElementById("seuTextTextfield").value;if(!B){alert("missing field: Anchor text");return }var A="SectionEdit!generateAjaxUri?urlBatchContent="+B;new Ajax.Updater("seuUriDiv",A);showClock("seuUriDiv")}function editUrl(B){var A="SectionUrl!edit?seuId="+B;new Ajax.Updater("section_url_div",A);$("section_url_div").show()}function createUrl(){var A=document.getElementById("UrlEditForm");A.action="SectionUrl!create";return true}function automaticUrl(){var C=document.getElementById("seuTextTextfield").value;var B=document.getElementById("secIdHiddenField").value;var A="SectionEdit!urlBatch?urlBatchContent="+C+"&secId="+B;window.location.href=A;return true}function deleteUrl(B){if(confirm("Deleting Anchor "+B+"...\nContinue?")){var A="SectionUrl!delete?seuId="+B;window.location.href=A}}function checkUrlForm(){var A=document.getElementById("UrlEditForm");if(A.seuText.value==""){alert("Text field required");return false}else{if(A.seuUri.value==""){alert("URI field required");return false}}return true};