String.prototype.trim=function(){return this.replace("/^s+|s+$/g","");};function CheckForm(b){if(b.search_zip.value!=""){var c=(/\d{5}(-\d{4})?/);var a=c.test(b.search_zip.value);if(!a){alert('"'+b.search_zip.value+'" is not a valid zip code');b.search_zip.focus();return false;}}else{if(b.search_city.value==""){alert("Please enter a city or zip code!");b.search_zip.focus();return false;}if(b.search_state.value==""){alert("Please select a state!");b.search_state.focus();return false;}}return true;}function CheckQuoteForm(b){if(b.full_name.value.trim()==""){alert("Full Name Required");b.full_name.value="";b.full_name.focus();return false;}if(b.contact_phone.value.trim()==""){alert("Contact Phone Required");b.contact_phone.value="";b.contact_phone.focus();return false;}else{var i="(/(^(?\d{3})?s|-\d{3}-\d{4}$)|(^(?\d{3}\d{3}\d{4}$)/)";var h=i.test(b.contact_phone.value);if(!h){alert('Please enter contact phone as "###-###-####"');b.contact_phone.focus();return false;}}if(b.contact_email.value.trim()==""){alert("Contact Email Required");b.contact_email.value="";b.contact_email.focus();return false;}else{var d=b.contact_email.value.indexOf("@");var e=b.contact_email.value.lastIndexOf(".");var g=b.contact_email.value.length-1;if(d<1||e-d<2||g-e>4||g-e<2){alert('"'+b.contact_email.value+'" is not a valid email');b.contact_email.focus();return false;}}if(b.date_month.value.trim()==""){alert("Move In Month Required");b.date_month.value="";b.date_month.focus();return false;}if(b.date_date.value.trim()==""){alert("Move In Date Required");b.date_date.value="";b.date_date.focus();return false;}if(b.date_year.value.trim()==""){alert("Move In Year Required");b.date_year.value="";b.date_year.focus();return false;}var f=new Date();var c=Date.parse(b.date_month.value+"/"+b.date_date.value+"/"+b.date_year.value);f.setTime(c);if(f=="NaN"||f=="Invalid Date"){alert("Invalid Move In Date. Please Use Calendar to Select Move In Date.");b.date_month.value="";b.date_date.value="";b.date_year.value="";b.date_month.focus();return false;}var a=new Date();a.setTime(Date.parse((a.getMonth()+1)+"/"+a.getDate()+"/"+a.getFullYear()));if(f<a){alert("Move In Date must be Today or Greater");b.date_month.value="";b.date_date.value="";b.date_year.value="";b.date_month.focus();return false;}b.submit_button.disabled=true;b.submit_button.style.backgroundColor="#999999";return true;}function showhide(a){if(document.getElementById){obj=document.getElementById(a);if(obj.style.display=="none"){obj.style.display="";}else{obj.style.display="none";}}}function hideinfo(){if(!document.getElementsByTagName&&!document.createElement&&!document.createTextNode){return;}var d=document.getElementsByTagName("span");for(var g=d.length-1;g>=0;g--){if(d[g].className=="render_info"){var a=/ at /;var c=/ dot /g;var h=document.createElement("a");var b=d[g].firstChild.nodeValue;b=b.replace(a,"@");b=b.replace(c,".");b=b.replace(a,"@");b=b.replace(c,".");h.setAttribute("href","mailto:"+b);h.appendChild(document.createTextNode(b));h.setAttribute("class","render_info");h.setAttribute("className","render_info");var f=d[g].parentNode;for(var e=0;e<f.childNodes.length;e++){if(f.childNodes[e]==d[g]){if(!f.replaceChild){return;}f.replaceChild(h,f.childNodes[e]);break;}}}}}function addDays(a,b){return new Date(a.getTime()+b*24*60*60*1000);}function OpenCouponWindow(a){leftVal=(500-screen.width)/2*-1;topVal=(500-screen.height)/2*-1;window.open(a,"couponwindow","height=500, width=500,left="+leftVal+",top="+topVal+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");}function OpenQuoteWindow(a){leftVal=(625-screen.width)/2*-1;topVal=(625-screen.height)/2*-1;window.open(a,"quotewindow","height=625, width=625,left="+leftVal+",top="+topVal+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");}function OpenMapWindow(a){leftVal=(605-screen.width)/2*-1;topVal=(535-screen.height)/2*-1;window.open(a,"mapwindow","height=535, width=605,left="+leftVal+",top="+topVal+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");}function validateDate(a){var b="/^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(/|-|.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(/|-|.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(/|-|.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(/|-|.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($| (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}( [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/";if((a.value.match(b))&&(a.value!="")){return true;}else{return false;}}function bookmark_us(a,c){if(window.sidebar){window.sidebar.addPanel(c,a,"");}else{if(window.opera&&window.print){var b=document.createElement("a");b.setAttribute("href",a);b.setAttribute("title",c);b.setAttribute("rel","sidebar");b.click();}else{if(document.all){window.external.AddFavorite(a,c);}}}}
