/*!
 * @copyright 2011-Present Advanced Care Solutions, Inc.
 * @author Christopher Rahauiser <crahauiser@acs-web.com>
 */
(function(c){c.global=(function(){return{errorPrefix:'<p class="error bottom ui-helper-clearfix ui-corner-all ui-widget ui-state-error"><span class="ui-icon ui-icon-alert"></span>',errorSuffix:"</p>",successPrefix:'<p class="success bottom ui-helper-clearfix ui-corner-all ui-widget ui-state-highlight"><span class="ui-icon ui-icon-check"></span>',successSuffix:"</p>"}}());c.fn.contactFlyout=function(b){var a=c.extend({animateIn:{right:0},animateOut:{right:-406},animateDuration:800,triggerSelector:"#contact-tab"},b);return this.each(function(){var h=c(this),g=c(a.triggerSelector);c(window).load(function(){h.height(c(document).height()).show()});h.data("open",false);g.click(function(e){var f=c(this),j=h.data("open");e.preventDefault();if(j===true){h.data("open",false).animate(a.animateOut,a.animateDuration)}else{h.data("open",true).animate(a.animateIn,a.animateDuration)}})})};function d(t){var q=/^\d{5}$|^\d{5}-\d{4}$/,a=/^[A-Z0-9._%\-]+@[A-Z0-9.\-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|jobs|museum|gov|edu|mil|asia|int)$/i,b=c.trim(c("#state").val()),p=c.trim(c("#zipcode").val()),m=c.trim(c("#email").val()),n="",o=c("#contact-messages"),r=null,s=c(this);t.preventDefault();o.empty();if(c.trim(c("#first_name").val())===""){n="The First Name field is required.";r="#first_name"}else{if(c.trim(c("#last_name").val())===""){n="The Last Name field is required.";r="#last_name"}else{if(b!==""&&b.length!==2){n="The State field must be a valid 2 letter state.";r="#state"}else{if(p!==""&&!q.test(p)){n="The Zipcode must be a valid postal code, in the format ##### or #####-####.";r="#zipcode"}else{if(m===""){n="The Email field is required.";r="#email"}else{if(!a.test(m)){n="The Email field must be a valid email address.";r="#email"}else{if(c.trim(c("#comments").val())===""){n="The Comments field is required.";r="#comments"}}}}}}}if(n!==""){o.html(c.global.errorPrefix+n+c.global.errorSuffix);c(r).focus();return}c.ajax({url:s.attr("action"),data:s.serialize(),dataType:"json",type:"POST",error:function(){o.html(c.global.errorPrefix+"An unknown error has occurred. We apologize for the inconvenience. Please try again later."+c.global.errorSuffix)},success:function(e){if(e&&e.model_error){o.html(e.model_error)}else{if(e&&e.success){o.html(c.global.successPrefix+e.success+c.global.successSuffix)}else{o.html(c.global.errorPrefix+"An unknown error has occurred. We apologize for the inconvenience. Please try again later."+c.global.errorSuffix)}}s.find(":input").each(function(){if(!c(this).is(":submit")){c(this).val("")}})}})}c("#contact-flyout").contactFlyout();c("#contact-form").attr("novalidate","novalidate").bind("submit.contact",d);c("#market_selection").bind("change.marketselection focusout.marketselection",function(){var a=c(this.options[this.selectedIndex]).data("page");if(!a){return}window.location.href=a});c("#timeline ul li").find("img:first").each(function(){var b=c(this),a=b.next(".timeline-details");a.removeClass("timeline-hover").css("top",0).hide();b.data("timelineDetails",a).bind("mouseenter.timeline",function(g){var h=c(this);g.preventDefault();h.data("timelineDetails").stop().fadeIn(800)}).bind("mouseleave.timeline",function(g){var h=c(this);g.preventDefault();h.data("timelineDetails").stop().hide().css("opacity",1)})})}(jQuery));var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-26432704-1"]);_gaq.push(["_trackPageview"]);(function(){var b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)})();
