if(!("console"in window)||!("firebug"in console)){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i)window.console[names[i]]=function(){}}function getRegionName(a){switch(a){case"mapHighlands":return"Historic High Country";case"mapGaMtns":return"Northeast Georgia Mountains";case"mapAtlanta":return"Atlanta Metro";case"mapHeartland":return"Historic Heartland";case"mapClassic":return"Classic South";case"mapPresidential":return"Presidential Pathways";case"mapMagnolia":return"Magnolia Midlands";case"mapPlantation":return"Plantation Trace";case"mapCoast":return"The Georgia Coast";default:return""}}function delayedControlLoad(b,c,d,a){a!=""&&$$(a).each(function(a){a.disabled="disabled"});setTimeout(function(){new Ajax.Request(b,{method:"post",onSuccess:function(b){var d=b.responseJSON;$(c).update(b.responseText);a!=""&&$$(a).each(function(a){a.disabled=""})}})},d)}function escapeURIString(a){return encodeURIComponent(a.replace("'","'"))}function setMaxLength(d){d=d?d:"countOk";var b=document.getElementsByTagName("textarea"),e=document.createElement("div");e.className="counter";for(var a=0;a<b.length;a++)if(b[a].getAttribute("maxlength")){var c=e.cloneNode(true);c.relatedElement=b[a];c.className=d;c.innerHTML="<span>0</span>/"+b[a].getAttribute("maxlength");b[a].parentNode.insertBefore(c,b[a].nextSibling);b[a].relatedElement=c.getElementsByTagName("span")[0];Event.observe(b[a],"blur",checkMaxLength);Event.observe(b[a],"keypress",checkMaxLength);Event.observe(b[a],"paste",checkMaxLength);checkMaxLengthWithValue(b[a])}}function checkMaxLength(){checkMaxLengthWithValue(this)}function checkMaxLengthWithValue(a){var c=a.getAttribute("maxlength"),b=a.value.length;if(b>c){a.value=a.value.substr(0,c);b=c}else a.relatedElement.className="countOk";a.relatedElement.firstChild.nodeValue=b}function checkForEnterKey(a,b){if(a.keyCode==Event.KEY_RETURN){b();Event.stop(a)}}function isJSON(a){try{jQuery.parseJSON(a);return true}catch(b){return false}}jQuery(document).ready(function(){jQuery("input.default-value").css("color","#333");var a=[];jQuery("input.default-value").focus(function(){if(!a[this.id])a[this.id]=this.value;if(this.value==a[this.id]){this.value="";this.style.color=active_color}jQuery(this).blur(function(){if(this.value==""){this.style.color=inactive_color;this.value=a[this.id]}})})});function checkForEnterKey(a,b){if(a.keyCode==Event.KEY_RETURN){b();Event.stop(a)}}jQuery(document).ready(function(){jQuery("#btn-register a").click(function(a){a.preventDefault();populateModal(this)});jQuery("#btn-login a").click(function(a){a.preventDefault();populateModal(this)});jQuery("a#btn-newsletter").click(function(a){a.preventDefault();populateModal(this)})});function populateModal(b){jQuery("#modal-box").html();var a="";jQuery("#modal-box").load(jQuery(b).attr("href")+"/?EscapeUrl="+a,null,function(){bindForm()}).modal({overlayClose:true,onShow:function(){setTimeout(function(){jQuery("#screen-name input").focus()},100)}})}function showLoginResponse(a){if(isJSON(a)){var c=a.Message,e=a.CloseAndStayOnPage,d=a.UrlToLoad;if(c.Message&&c.Message!=""){alert(c.Message);jQuery.modal.close();window.location.href=d}else if(e){var b=jQuery("#sign-in-wrapper");b.hide();jQuery.modal.close();b.load(b.data("loginControlUrl"),function(){b.show()});typeof document.afterLogin=="function"&&document.afterLogin()}else{jQuery.modal.close();window.location.href=d}}else{jQuery("#modal-box").html(a);bindForm()}}function bindForm(){jQuery("#modal-box form").ajaxForm({success:showLoginResponse})}
