function resetCategories(){document.getElementById("subsubcategory_id_container").innerHTML=""}function trim(a){return((""+a).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,"$1"))}function flag(a,b){var c=b;if(b=="adult"){c="adult content"}if(confirm("Are you sure you want to flag this "+PAGE_NAME+" as "+c+"?")){alert("Thank you, a site moderator will review this "+PAGE_NAME+" shortly.");loadURL("/page/flag/"+a+"?type="+b)}}function tagIt(a,b){showToolTip(a,b);document.getElementById("tags").value=document.getElementById("hiddenTags").value;document.getElementById("tags").focus()}function convertToWiki(a){if(confirm("Are you sure you want to convert this "+PAGE_NAME+" to a wiki-style Community  "+PAGE_NAME_CAPS+"?\n\nThis change can not be undone.")){var b="/page/convert/?page_id="+a+"&type=wiki";location.href=b}}function addFavoritePage(a,b){if(b==null){alert("You must be logged in to add this "+PAGE_NAME+" to your favorites.  Please log in and try again!")}else{loadURL("/user/addFavoritePage/"+a);alert(PAGE_NAME_CAPS+" successfully added to your favorites!")}}function removeFavoritePage(a,b){if(b==null){alert("You must be logged in to remove this "+PAGE_NAME+" from your favorites.  Please log in and try again!")}else{if(confirm("Are you sure you want to remove this "+PAGE_NAME+" from your favorites?")){loadURL("/user/removeFavoritePage/"+a);dijit.byId("FavoritePages").refresh()}}}function removeSubscription(a,b){if(b==null){alert("You must be logged in to remove this "+PAGE_NAME+" from your favorites.  Please log in and try again!")}else{if(confirm("Are you sure you want to unsubscribe from this "+PAGE_NAME+"?")){loadURL("/user/removeSubscription/"+a);dijit.byId("Subscriptions").refresh()}}}function saveTags(a){var b=document.getElementById("tags").value;if(b!=document.getElementById("hiddenTags").value){b=trim(b);b=b.replace("'","");b=b.replace('"',"");b=b.replace(";","");b=b.replace("&","");b=b.replace("+","");if(b.length>0){loadURL("/page/tagIt?page_id="+a+"&tags="+b)}document.getElementById("hiddenTags").value=b}document.getElementById("bubble_tooltip_content").innerHTML="<center>Your tags have been saved... Cheers!</center>";setTimeout("hideTags()",2000)}function hideTags(){hideToolTip()}function vote(b,a){loadURL("/page/vote?type=page&page_id="+a+"&rating="+b);alert("Thanks for your vote!")}function addMsg(){var a=document.getElementById("message");if(a.style.display=="none"){a.style.display="block"}else{a.style.display="none"}}function validatePage(){var a=document.getElementById("page_category_reference_category_id").value;if(a==""){alert("ERROR: You Must Select a Category!");return false}else{changed=false;document.getElementById("createBtn").disabled=true;return true}}function validateEmail(a){var b=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(b.test(a)==false){alert("Please enter a valid email address!");return false}}function validateSignUp(){var a=document.getElementById("email").value;var b=document.getElementById("user_eula").checked;var c=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(c.test(a)==false){alert("Please enter a valid email address!");return false}if(!b){alert("In order to publish your "+PAGE_NAME+", you must agree to the Terms of Use!");return false}return true}var oldHTML;function resetEmailDIV(){document.getElementById("EMAILDIV").innerHTML=oldHTML;if(document.getElementById("email_to").value=""){document.getElementById("email_to").style.color="#c0c0c0";document.getElementById("email_to").value="Type Email Address Here"}if(document.getElementById("name")){document.getElementById("name").value=""}document.getElementById("msg").value=""}function changeEmail(){var a=document.getElementById("emailall").value;var b=document.getElementById("emailaddress");if(b.style.display=="none"){b.style.display="block"}else{b.style.display="none"}}function focusEmail(){if(document.getElementById("email_to").value=="Type Email Address Here"){document.getElementById("email_to").value="";document.getElementById("email_to").style.color="#000000"}}function resetEmail(){var a=document.getElementById("email_to").value;if(a.length<1){document.getElementById("email_to").style.color="#c0c0c0";document.getElementById("email_to").value="Type Email Address Here"}}function emailPage(l,f,o){var n=false;try{if(document.getElementById("emailall").checked){n=true}}catch(d){n=false}if(n){if(confirm("Are you sure you want to email this "+PAGE_NAME+" to all your contacts?")){var c=document.getElementById("msg").value;var b="/page/email_contacts/?page_id="+o+"&msg="+c;location.href=b}}else{var j=document.getElementById("email_to").value;var a=f;if(f==null){a=document.getElementById("name").value}var p=document.getElementById("msg").value;a=encodeURIComponent(a);p=encodeURIComponent(p);var h;if(a.length>0){h=a+" sent you "+APP_ARTICLE+" "+APP_NAME+"  "+PAGE_NAME_CAPS+" ('"+l+"'):"}else{h="You've received "+APP_ARTICLE+" "+APP_NAME+"  "+PAGE_NAME_CAPS+" ('"+l+"'):"}var g=j.split(",");var k=true;var m=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;for(var e=0;e<g.length;e++){if(m.test(trim(g[e]))==false){alert(trim(g[e])+" is not a valid email address.  Please enter a valid email address and try again.  If you have multiple recipients, please separate each email address with a comma.");k=false}}if(k){l="You've received "+APP_ARTICLE+" "+APP_NAME+" "+PAGE_NAME+" - '"+l+"'";loadURL("/page/email?page_action=email_page&url="+encodeURI(location.href)+"&sub="+l+"&to="+j+"&message="+p+"&body="+h);oldHTML=document.getElementById("EMAILDIV").innerHTML;document.getElementById("EMAILDIV").innerHTML="<BR/><center><font class='SIDEBARTEXT'>You've successfully emailed this "+PAGE_NAME+'.</font><BR/><BR/><font onclick="resetEmailDIV()" class="LINK">Email This '+PAGE_NAME_CAPS+" Again</font><BR/><BR/></center>"}}}function subscribe(c,d){var b=document.getElementById("email").value;var a="You've successfully subscribed to ";if(b.length<3){alert("Please enter a valid email address!")}else{loadURL("/page/email?id="+d+"&page_action=subscribe&sub="+APP_NAME+" - You've Successfully Subscribed to '"+c+"'&to="+b+"&body="+a);document.getElementById("subscribeDIV").innerHTML="<BR/><center><font class='SIDEBARTEXT'>You've been successfully subscribed<BR/><BR/>Thanks!</font></center><BR/><BR/>"}};
