$('#ctl00_pageContent_ContactUs_divQuestion select').bind('change', function() {			debugger;			alert($(this).val());		});var intTime;$.id = function (x) { return document.getElementById(x); };function pngFix() { };function embedVideo() {    swfobject.embedSWF("/resources/suavePlayer.swf", "myContent", "640", "388", "9.0.0");}(function (slice) {    Function.prototype.bind = function () {        var method = this, args = slice.call(arguments), src = args.shift();        return function () {            return method.apply(src, args.concat(slice.call(arguments)));        };    };})([].slice);// parseUri 1.2.2// (c) Steven Levithan <stevenlevithan.com>// MIT License$.fx.step["backgroundColor"] = function (fx) {    if (fx.state === 0) {        fx.start = $.getColor(fx.elem, "backgroundColor");        fx.end = $.getRGB(fx.end);    }    var rgb = [], M = Math;    for (var i = 0; i < 3; i++) {        rgb.push(M.max(M.min(parseInt((fx.pos * (fx.end[i] - fx.start[i])) + fx.start[i], 10), 255), 0));    }    fx.elem.style["backgroundColor"] = "rgb(" + rgb.join(",") + ")";};if ($.validator)    $.validator.messages.required = "This is a required field.";$.extend({    getRGB: function (color) {        var result;        if (color && color.constructor == Array && color.length == 3)            return color;        if ((result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)))            return [parseInt(result[1], 10), parseInt(result[2], 10), parseInt(result[3], 10)];        if ((result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)))            return [parseFloat(result[1]) * 2.55, parseFloat(result[2]) * 2.55, parseFloat(result[3]) * 2.55];        if ((result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)))            return [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)];        if ((result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)))            return [parseInt(result[1] + result[1], 16), parseInt(result[2] + result[2], 16), parseInt(result[3] + result[3], 16)];    },    getColor: function (elem, attr) {        var color;        do {            color = $.curCSS(elem, attr);            if (color !== '' && color != 'transparent' || $.nodeName(elem, "body"))                break;            attr = "backgroundColor";        } while ((elem = elem.parentNode));        return $.getRGB(color);    },    classes: {},    classify: function (name, object, parent) {        function klass() {            this.init.apply(this, arguments);        }        if (parent && $.classes[parent]) {            function subklass() { };            subklass.prototype = $.classes[parent].prototype;            klass.prototype = new subklass;        }        for (var y in object)            klass.prototype[y] = object[y];        if (!klass.prototype.init)            klass.prototype.init = function () { };        klass.prototype.constructor = klass;        $.classes[name] = klass;        $.fn[name] = function () {            return this.each(function (i, element) {                element.classBehaviors = element.classBehaviors || {};                if (element.classBehaviors[name]) return;                function behavior() { };                function klassBehavior() {                    this.element = element;                    this.init.apply(this, arguments);                    for (var attr in this) {                        if (attr.indexOf("on") === 0) {                            var handler = attr.substr(2);                            if ($.fn[handler])                                $(this.element)[handler](this[attr].bind(this));                        }                    }                }                behavior.prototype = $.classes[name].prototype;                klassBehavior.prototype = new behavior;                element.classBehaviors[name] = new klassBehavior();                return element.classBehaviors[name];            });        };        return klass;    }});$.classify("mainnavmenu", {    hide_timeout: null,    last_menu: null,    hide_time: 300,    hover_class: "Hover",    init: function () {        this.submenus = {};        this.menus = $(">li", this.element);        this.menus.each(function (i, menu) {            $(menu).hover(this.mouseOverHandler.bind(this, menu), this.mouseOutHandler.bind(this, menu));        } .bind(this));    },    mouseOverHandler: function (menu, e) {        clearTimeout(this.hide_timeout);        this.showMenu(menu);    },    mouseOutHandler: function (menu, e) {        clearTimeout(this.hide_timeout);        this.hide_timeout = setTimeout(this.hideMenu.bind(this, menu), this.hide_time);    },    showMenu: function (menu) {        if (this.last_menu !== null)            this.hideMenu(this.last_menu);        $(menu).addClass(this.hover_class);        this.last_menu = menu;    },    hideMenu: function (menu) {        $(menu).removeClass(this.hover_class);        this.last_menu = null;    }});$.classify("mainnavmenunew", {    show_time: 150,    hide_time: 300,    hover_class: "Hover",    visible: false,    last_menu: null,    submenus: {},    menu_alignments: {},    menu_offsets: {},    submenu_widths: {},    submenu_heights: {},    init: function () {        this.menus = $(">li", this.element);        $("<li class='dhtml-menu'><div class='dhtml-viewport'><div class='dhtml-window'><div class='dhtml-wrapper'></div></div></div></li>").appendTo(this.element)[0];        this.viewport = $(".dhtml-viewport", this.element)[0];        this.wrapper = $(".dhtml-wrapper", this.element)[0];        var fromTop = 0;        this.menus.each(function (i, menu) {            $(menu).hover(this.mouseOverHandler.bind(this, menu), this.mouseOutHandler.bind(this, menu));            var id = menu.id;            var sub = this.submenus[id] = $(".Menu", menu)[0];            if (!sub) return;            $(sub).hover(this.mouseOverHandler.bind(this, menu), this.mouseOverHandler.bind(this, menu));            this.menu_alignments[id] = menu.offsetLeft;            this.wrapper.appendChild(sub);            var height = $(sub).height();            this.submenu_widths[id] = $(sub).width();            this.submenu_heights[id] = height;            this.menu_offsets[id] = fromTop;            fromTop += (height + 1);        } .bind(this));        this.toggleViewport(false);    },    mouseOverHandler: function (menu, e) {        clearTimeout(this.hide_timeout);        clearTimeout(this.show_timeout);        this.show_timeout = setTimeout(this.activateMenu.bind(this, menu), this.show_time);    },    mouseOutHandler: function (menu, e) {        clearTimeout(this.hide_timeout);        clearTimeout(this.show_timeout);        this.hide_timeout = setTimeout(this.toggleVisibility.bind(this, false), this.hide_time);    },    activateMenu: function (menu) {        if (this.last_menu)            this.hideMenu(this.last_menu);        $(menu).addClass(this.hover_class);        if (!this.visible)            this.toggleVisibility(true);        this.last_menu = menu;        if (this.all_hidden) {            $(this.viewport).css({ left: this.menu_alignments[menu.id], height: this.submenu_heights[menu.id], width: this.submenu_widths[menu.id] });            $(this.wrapper).css({ left: this.menu_alignments[menu.id] });            this.all_hidden = false;        } else {            $(this.viewport).animate({ left: this.menu_alignments[menu.id], height: this.submenu_heights[menu.id], width: this.submenu_widths[menu.id] }, 120);            $(this.wrapper).animate({ marginTop: "-" + this.menu_offsets[menu.id] + "px" }, 120);        }    },    toggleVisibility: function (visible) {        this.visible = visible;        $(this.viewport).animate({ opacity: visible ? 1 : 0 }, 250, this.toggleViewport.bind(this, visible));        if (!visible && this.last_menu)            this.hideMenu(this.last_menu);    },    toggleViewport: function (visible) {        $(this.viewport).css({ display: visible ? "block" : "none" });        if (!visible)            this.all_hidden = true;    },    hideMenu: function (menu) {        $(menu).removeClass(this.hover_class);        this.last_menu = null;    }});$.classify("carousel", {    index: 0,    dots: [],    active_carousel: "Activated",    active_item: "Active",    current_dot: "CurrentDot",    dot_width: 17,    dot_align: 470,    item_width: 843,    scrolling: false,    item_class: "CarouselItems",    item_tag: "ul",    init: function () {        this.wrapper = $("." + this.item_class, this.element)[0];        if (!this.wrapper) return;        this.items = $(this.item_tag, this.wrapper);        if (this.items.length > 1) {            $(this.element).addClass(this.active_carousel);            this.right = $("<div id='carousel-right'></div>").appendTo(this.element);            this.left = $("<div id='carousel-left'></div>").appendTo(this.element);            $(this.right).click(this.calculateIndex.bind(this, 1));            $(this.left).click(this.calculateIndex.bind(this, -1));            this.total = this.items.length * this.item_width;            $(this.wrapper).css({ width: this.total + "px" });            this.initDotNavigation();            window["currentCarousel"] = this;        }    },    calculateIndex: function (change) {        if (this.scrolling) return;        var index = this.index + change;        if (index >= this.items.length)            index = 0;        else if (index < 0)            index = this.items.length - 1;        this.scrollCarousel(index);        this.setCurrentDot();    },    initDotNavigation: function () {        this.dots = [];        this.dot_wrapper = $("<div id='dot-navigation'></div>").appendTo(this.element);        for (var i = 0, item, dot; item = this.items[i]; i++) {            dot = $("<div class='Dot'></div>").appendTo(this.dot_wrapper);            $(dot).click(this.dotClickHandler.bind(this, i));            this.dots.push(dot[0]);        }        var width = (this.dot_width * this.dots.length);        $(this.dot_wrapper).css({ left: (this.dot_align - (width / 2)) + "px" });        this.setCurrentDot();    },    dotClickHandler: function (index) {        if (this.scrolling) return;        this.scrollCarousel(index);        this.setCurrentDot();    },    setCurrentDot: function () {        if (this.active_dot)            $(this.active_dot).removeClass(this.current_dot);        this.active_dot = this.dots[this.index];        $(this.active_dot).addClass(this.current_dot);    },    scrollCarousel: function (index) {        if (index === this.index || this.scrolling) return;        this.scrolling = true;        var diff = Math.abs(this.index - index);        this.index = index;        $(this.wrapper).animate({            left: "-" + (this.index * this.item_width) + "px"        }, diff * 600, function () {            this.scrolling = false;        } .bind(this));    },    scrollOutOfSight: function () {        $(this.wrapper).animate({            left: "-" + (this.item_width * this.items.length) + "px"        }, 750);    },    scrollIntoSight: function () {        $(this.wrapper).css({ left: this.total + "px" });        $(this.wrapper).animate({            left: "0px"        }, 750);    }});$.classify("productCarousel", {    item_width: 696,    dot_align: 350}, "carousel");$.classify("search", {    text: "Search",    active_class: "Searching",    hovering: false,    init: function (search) {        this.query = $(".TextInput", this.element)[0];        this.help = $(".Help", this.element)[0];        if (!this.query || !this.help) return;        $(this.element).hover(this.focusHandler.bind(this), this.blurHandler.bind(this));        if ($.trim(this.query.value).length === 0)            this.query.value = this.text;    },    focusHandler: function () {        this.query.focus();        $(this.element).addClass(this.active_class);        $(this.help).fadeIn(200);        if (this.query.value === this.text)            this.query.value = "";    },    blurHandler: function (e) {        $(this.element).removeClass(this.active_class);        $(this.help).fadeOut(150);        if ($.trim(this.query.value).length === 0)            this.query.value = this.text;    }});$.classify("pageloader", {    hashes: {},    loaded_pages: {},    current_link: "",    init: function () {        if ($.browser.msie) return;        if (typeof $.fn.ask_the_professionals === "function") return;        this.findLiveLinksIn(this.element);        this.wrapper = $.id("wrapper");        this.wrapper_class = this.wrapper.className;        $("<div id='stage-wrapper'><div id='stage'></div></div>").appendTo(this.element);        this.stage = $.id("stage");        this.slug = this.sliceHashFromHref(document.location.href);        setInterval(this.pollCurrentHash.bind(this), 500);        var hash = document.location.hash.substring(1);        if (hash.length > 0)            document.location = hash;    },    pollCurrentHash: function () {        var hash = document.location.hash.substring(1);        if (!this.loading && hash.length > 0 && hash !== this.slug)            this.checkForPage(this.sliceHashFromHref(hash));    },    parseUri: function (str) {//alert(str);        var o = {            strictMode: false,            key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"],            q: {                name: "queryKey",                parser: /(?:^|&)([^&=]*)=?([^&]*)/g            },            parser: {                strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,                loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/            }        },    		m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),    		uri = {},    		i = 14;        while (i--) uri[o.key[i]] = m[i] || "";        uri[o.q.name] = {};        uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {            if ($1) uri[o.q.name][$1] = $2;        });//alert(m);        return uri;    },    sliceHashFromHref: function (href) {        var last = this.parseUri(href).path;        return last.split("#")[0];    },    findLiveLinksIn: function (scope) {        var host = document.location.host;        $("a", scope).each(function (i, link) {            //if (!link.scannedByPageLoader && !link.className.match("NoTransition") && !link.className.match("WithoutTransition")) {            if (!link.scannedByPageLoader && !link.className.match("NoTransition")) {                    link.scannedByPageLoader = true;                    if (link.href && link.href.indexOf(host) > -1 && !link.href.indexOf("asktheprofessionals") > -1 &&  !link.href.indexOf("asktheprofessionals") > -1) {                        $(link).click(this.liveLinkClickHandler.bind(this, link.href));                }            }        } .bind(this));    },    liveLinkClickHandler: function (href, e) {        if (!(e && e.currentTarget && e.currentTarget.target == '_blank')) {            e.preventDefault();            if (this.loading || this.current_link === href) return;            this.loading = true;            this.checkForPage(href);        }    },    checkForPage: function (href) {        if (this.loaded_pages[href])            this.startTransition(this.loaded_pages[href]);        else            this.fetchPage(href);        //debugger;	        document.location.hash = this.slug = this.sliceHashFromHref(href);    },    fetchPage: function (href) {        $.ajax({            url: href,            success: this.successHandler.bind(this, href),            error: this.errorHandler.bind(this, href)        });    },    successHandler: function (href, html) {        this.loaded_pages[href] = html;        this.startTransition(html);    },    errorHandler: function (href) {        document.location = href;    },    startTransition: function (html) {        this.prior_class = this.wrapper_class;        var matching_classes = html.match(/wrapper(?:.*)?class="(\w+)(?:.*)?\>/);        if (matching_classes && matching_classes[1]) {            this.wrapper_class = matching_classes[1];            this.swapOutMarkup(html);        }    },    swapOutMarkup: function (html) {	    $(this.stage).css({ opacity: 0 });        this.stage.innerHTML = html;        this.fadeElementsOut(html);        initPageBehaviors();        setTimeout(this.fadeElementsIn.bind(this), 1000);    },    fadeElementsOut: function (html) {        if (window.currentCarousel) {            setTimeout(currentCarousel.scrollOutOfSight.bind(currentCarousel), 250);            $(">div:first-child", currentCarousel.element).animate({ opacity: 0 }, 750);        }        if ($(".Carousel", html).length < 1) {            setTimeout(function () { $(".Carousel").animate({ opacity: 0 }, 750); } .bind(this), 350);            setTimeout(function () { $(".Twitter").animate({ opacity: 0 }, 750); } .bind(this), 350);        }        setTimeout(function () { $(".Landing", this.wrapper).animate({ opacity: 0 }, 750); } .bind(this), 350);        if (this.prior_class !== this.wrapper_class)            setTimeout(function () { $(".Layout", this.wrapper).animate({ opacity: 0 }, 750); } .bind(this), 550);    },    fadeElementsIn: function () {        initPageBehaviors();        $(this.stage).animate({ opacity: 1 }, 750, this.finishFading.bind(this));        $(".CarouselItems", this.stage).css({ opacity: 0 });        $(".Carousel", this.wrapper).empty();        if (this.prior_class !== this.wrapper_class)            $(".Layout", this.stage).css({ opacity: 0 });    },    finishFading: function () {        this.wrapper.className = this.wrapper_class;        this.wrapper.innerHTML = $("section", this.stage)[0].innerHTML; /*$(this.stage).html(); */        $(".CarouselItems", this.wrapper).css({ opacity: 0.5 }).animate({ opacity: 1 }, 400);        $(".Landing", this.wrapper).animate({ opacity: 1 }, 1000);        $(".Layout", this.wrapper).animate({ opacity: 1 }, 1000);        initPageBehaviors();        if (window.currentCarousel)            currentCarousel.scrollIntoSight();        this.findLiveLinksIn(this.element);        this.loading = false;        this.stage.innerHTML = "";        $(".mainNavMenu").mainnavmenu();        $(".ScrollingContent").scrollingContent();        $(".ResultsColumn").searchScrollingContent();        $(".Slideshow").slideshow();    }});$.classify("scrollingContent", {    current_scroll: 0,    height: 320,    increment: 200,    arrows: "<hr/><div class='scroll-down'></div><div class='scroll-up'></div>",    extra_styles: "",    init: function () {        //	if ($.browser.msie && $.browser.version < 7) return;        var el = $(this.element);        el.wrap("<div style='height:" + this.height + "px;width:100%;overflow:hidden;position:relative;" + this.extra_styles + "' />");        el.css({ position: "absolute", top: "0", left: "0" });        this.el_height = el.height();        this.total_height = this.el_height - this.height + 20;        //if (this.total_height < 0) return;        var parent = this.element.parentNode.parentNode;        $(this.arrows).appendTo(parent);        $("<div class='scrollbar'></div>").appendTo(this.element.parentNode);        this.bar = $(".scrollbar", parent);        this.bar.css({ display: "block", opacity: 0, height: ((this.height / this.el_height * this.height) + "px") });        this.up = $(".scroll-up", parent);        this.down = $(".scroll-down", parent);        this.up.click(this.scroll.bind(this, true));        this.down.click(this.scroll.bind(this, false));        this.toggleScrollingIcons();    },    scroll: function (up) {        if (this.current_scroll === 0 && up) return;        var target = up ? (this.current_scroll - this.increment) : (this.current_scroll + this.increment);        if (target < 0) target = 0;        if (target > this.total_height) target = this.total_height;        this.current_scroll = target;        this.animateScrollIndicator();        $(this.element).animate({ top: "-" + target + "px" });        this.toggleScrollingIcons();    },    toggleScrollingIcons: function () {        this.up[this.current_scroll === 0 ? "removeClass" : "addClass"]("Link");        this.down[this.current_scroll === this.total_height ? "removeClass" : "addClass"]("Link");    },    animateScrollIndicator: function () {        this.bar.animate({ opacity: 0.25, top: ((this.current_scroll / this.el_height) * this.height) + "px" }, 500);        setTimeout(function () {            this.bar.animate({ opacity: 0 }, 400);        } .bind(this), 500);    }});$.classify("searchScrollingContent", {    height: 385,    arrows: "<div class='scroll-down'></div><div class='scroll-up'></div>",    extra_styles: "margin-bottom:1.5em;"}, "scrollingContent");$.classify("sparkles", {    low_opacity: 0.05,    high_opacity: 0.36,    duration: 2500,    init: function () {        if ($.browser.msie) return;        for (var i = 0; i < 3; ++i)            $("<div id='sparkle-" + i + "' class='Sparkle'></div>").appendTo(this.element);        this.initSparkleMovement();    },    initSparkleMovement: function (index) {        $(".Sparkle").each(function (i, sparkle) {            var s = $(sparkle);            s.css({ opacity: 0, display: "block" });            setTimeout(this.twinkleIn.bind(this, s), i * 1200);        } .bind(this));    },    twinkleIn: function (s) {        s.animate({ opacity: this.high_opacity }, this.duration);        setTimeout(this.twinkleOut.bind(this, s), this.duration * 1.2);    },    twinkleOut: function (s) {        s.animate({ opacity: this.low_opacity }, this.duration);        setTimeout(this.twinkleIn.bind(this, s), this.duration * 1.2);    }});$.classify("slideshowCarousel", {    item_width: 635,    item_class: "SlideshowList",    item_tag: "li",    dot_align: 328,    scrollCarousel: function (index) {        if (index === this.index || this.scrolling) return;        this.scrolling = true;        var diff = Math.abs(this.index - index);        this.index = index;        $(this.element).animate({            marginLeft: "-" + (this.index * this.item_width) + "px"        }, diff * 600, function () {            this.scrolling = false;        } .bind(this));    }}, "carousel");$.classify("slideshow", {    init: function () {        this.images = $("img", this.element);        $("<div class='SlideshowWrapper'><ul class='SlideshowList'></ul><div class='ClearFix'></div></div>").appendTo(this.element);        this.slideshow = $(".SlideshowList", this.element);        this.images.each(function (i, img) {            var li = document.createElement("li");            li.appendChild(img);            $(li).appendTo(this.slideshow);        } .bind(this));        $(".SlideshowWrapper").slideshowCarousel();        $("p", this.element).remove();    }});function initPageBehaviors() {    clearTimeout(intTime);    //intTime = setTimeout(showInterstitial, 2000);    try { $(".Carousel").carousel(); } catch (r) { }    try { $(".SearchForm").search(); } catch (r) { }    try { $(".ProductCarousel").productCarousel(); } catch (r) { }    try { $(".Sparkles").sparkles(); } catch (r) { }    $('#ingredients_list').click(function () {        $('#ingredient_pop_up2').hide();        $('#ingredient_pop_up').show();        $('#overlay').fadeIn('slow');    });	    $('.popup_head').click(function () {        $('#ingredient_pop_up').hide();        $('#overlay').fadeOut('slow');    });	$('#ingredients_list3').click(function () {        $('#ingredient_pop_up2').hide();        $('#ingredient_pop_up').show();        $('#overlay').fadeIn('slow');    });    $('#ingredients_list2').click(function () {        $('#ingredient_pop_up').hide();        $('#ingredient_pop_up2').show();        $('#overlay2').fadeIn('slow');    });    $('.popup_head2').click(function () {        $('#ingredient_pop_up2').hide();        $('#overlay2').fadeOut('slow');    });	   // if ($.validator){   // $(".ValidatedForm").bind('#SubmitForm', validateForm(e));	$(".SubmitForm").click(function(e){		validateForm(e);    });    $(".SubmitFormContactUs").click(function (e) {        validateFormContactUs(e);    });	   /* $("#submit").click(function (e) {        testSearchField(e);    });    //}*/    if (document.location.href.match(/contact-us|index.php|register|atp-coupon|coupon-signup/)) {        $("a").each(function () {            var newClass = this.getAttribute("class") + " NoTransition";            this.setAttribute("class", newClass);        })    }}$(function () {    initPageBehaviors();    try { $("body").pageloader(); } catch (r) { }    try { $(".Slideshow").slideshow(); } catch (r) { }    try { $(".mainNavMenu").mainnavmenu(); } catch (r) { }    try { $(".ScrollingContent").scrollingContent(); } catch (r) { }    try { $(".ResultsColumn").searchScrollingContent(); } catch (r) { }    //try { $("SELECT").sb(); } catch (r) { }});function checkDate(year, month, pdate) {	    var cdate = new Date(year, month , pdate);           //cdate.setDate(pdate);    //cdate.setYear(year);    //cdate.setMonth(month);    if (cdate.getDate() != pdate || cdate.getMonth() != month || (cdate.getYear() + 1900 != year)) {        return false;    }    else {            return true;        }    } function validateForm(e) {    var formIsValid = true;    // check that a valid email address has been entered    var emailRegExp = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/;    if (!emailRegExp.test(String($(".eMail").val()).toUpperCase())) {        addError("eMail", "Please enter a valid email address.");        formIsValid = false;    } else {        removeError("eMail");    }    // check that first name has one or more characters    if ($(".fname").val().length < 1) {        addError("fname", "This field is required.");        formIsValid = false;    } else {        removeError("fname");    }    // check that last name has one or more characters    if ($(".lname").val().length < 1) {        addError("lname", "This field is required.");        formIsValid = false;    } else {        removeError("lname");    }    // check that address is...    if ($(".addr").val().length < 1) {        addError("addr", "This field is required.");        formIsValid = false;    } else {        removeError("addr");    }    // check that city name has one or more characters    if ($(".city").val().length < 1) {        addError("city", "This field is required.");        formIsValid = false;    } else {        removeError("city");    }    // check that a state has been selected    if ($(".state").val() == "") {        addError("state", "This field is required.");        formIsValid = false;    } else {        removeError("state");    }    // check that a valid zip code of 5-9 numbers is entered    var zipRegExp = /(^\d{5}$)|(^\d{5}-\d{4}$)/;    if (!zipRegExp.test($(".zCode").val())) {        addError("zCode", "Please enter a valid zip code.");        formIsValid = false;    } else {        removeError("zCode");    }    // check that a valid day time phone number is entered    var phoneRegExp = /^\(?[1-9]\d{2}\)?\s?\-?\.?\d{3}\s?\-?\.?\d{4}$/;    if (!phoneRegExp.test($(".pNumberDay").val())) {        addError("pNumberDay", "Valid phone number required.");        formIsValid = false;    } else {        removeError("pNumberDay");    }    // check that a valid evening time phone number is entered    if (!phoneRegExp.test($(".pNumberEve").val())) {		        addError("pNumberEve", "Valid phone number required.");        formIsValid = false;    } else {        removeError("pNumberEve");    }	//Check for text area		if ($(".contactTextArea").length){		if ($(".contactTextArea").val().length > 2000 ) {			addError("contactTextArea", "Enter Text Less than 2000 words ");					formIsValid = false;		} else {			removeError("contactTextArea");		}	}	//check captcha	if($("#recaptcha_response_field").val().length<1)	{		$(".reCaptcha").html("This is required field");		formIsValid = false;	}	else	{		$(".reCaptcha").html("");	}	    // calculate users date and determine if they are 18 years old    if ($(".bMonth").val() == "" || $(".bDay").val() == "" || $(".bYear").val() == "") {        addError("bMonth", "This field is required.");        formIsValid = false;    } else {	        var currentDate = new Date();        var userAge = currentDate.getFullYear() - Number($(".bYear").val());		        if (((currentDate.getMonth() + 1) < Number($(".bMonth").val())) || (((currentDate.getMonth() + 1) == Number($(".bMonth").val())) && (currentDate.getDate() < Number($(".bDay").val())))) {            // user hasn't had birthday - subtract one year from age            userAge--;        }        if (userAge < 18 && currentDate.getFullYear()) {            // +++ display an error message that user is not 18 years old            addError("bMonth", "You must be 18 years old.");            formIsValid = false;        } else {			//if(checkDate(year,month,pdate))            //removeError("bMonth");        		var pdate = $(".bDay").val();		var month = $(".bMonth").val();		var year = $(".bYear").val();		if(!(checkDate(year,month,pdate)))			{  				removeError("bMonth");								if ($(".bMonth").parent().find("label[class=error]").attr("generated") == "true"){					$(".bMonth").parent().find("label[class=error]").html("Please Enter a valid date.");					$(".bMonth").parent().find("label[class=error]").css("display", "block");				}				else {					var appendText = '<label for="bMonth" generated="true" class="error">Please Enter a valid date.</label>';					$(".bMonth").parent().append(appendText);				}				//addError("bMonth", "Please Enter a valid date.");				formIsValid = false;			}		else {	            removeError("bMonth");			}		}    }	    if (!formIsValid) {		e.preventDefault();    }}function validateFormContactUs(e) {    var formIsValid = true;    // check that a valid email address has been entered    var emailRegExp = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/;    if (!emailRegExp.test(String($(".eMail").val()).toUpperCase())) {        addError("eMail", "Please enter a valid email address.");        formIsValid = false;    } else {        removeError("eMail");    }    // check that first name has one or more characters    if ($(".fname").val().length < 1) {        addError("fname", "This field is required.");        formIsValid = false;    } else {        removeError("fname");    }    // check that last name has one or more characters    if ($(".lname").val().length < 1) {        addError("lname", "This field is required.");        formIsValid = false;    } else {        removeError("lname");    }    // check that address is...    if ($(".addr").val().length < 1) {        addError("addr", "This field is required.");        formIsValid = false;    } else {        removeError("addr");    }    // check that city name has one or more characters    if ($(".city").val().length < 1) {        addError("city", "This field is required.");        formIsValid = false;    } else {        removeError("city");    }    // check that a state has been selected    if ($(".state").val() == "") {        addError("state", "This field is required.");        formIsValid = false;    } else {        removeError("state");    }    // check that a valid zip code of 5-9 numbers is entered    var zipRegExp = /(^\d{5}$)|(^\d{5}-\d{4}$)/;    if (!zipRegExp.test($(".zCode").val())) {        addError("zCode", "Please enter a valid zip code.");        formIsValid = false;    } else {        removeError("zCode");    }    // check that a valid day time phone number is entered    var phoneRegExp = /^\(?[1-9]\d{2}\)?\s?\-?\.?\d{3}\s?\-?\.?\d{4}$/;    $(".pNumberDay").val(contact_us_trim($(".pNumberDay").val()));    removeError("pNumberDay");    if ($(".pNumberDay").val() != "")    {        if (!phoneRegExp.test($(".pNumberDay").val())) {            addError("pNumberDay", "Valid phone number required.");            formIsValid = false;        }    }    $(".pNumberEve").val(contact_us_trim($(".pNumberEve").val()));    removeError("pNumberEve");    // check that a valid evening time phone number is entered    if ($(".pNumberEve").val() != "") {        if (!phoneRegExp.test($(".pNumberEve").val())) {            addError("pNumberEve", "Valid phone number required.");            formIsValid = false;        }    }    //Check for text area    removeError("contactTextArea");    if ($(".contactTextArea").val() == "") {        addError("contactTextArea", "This field is required.");        formIsValid = false;    }    if ($(".contactTextArea").length) {        if ($(".contactTextArea").val().length > 2000) {            addError("contactTextArea", "Enter Text Less than 2000 words ");            formIsValid = false;        }    }    //check captcha    if ($("#recaptcha_response_field").val().length < 1) {        $(".reCaptcha").html("This is required field");        formIsValid = false;    }    else {        $(".reCaptcha").html("");    }    // calculate users date and determine if they are 18 years old    if ($(".bMonth").val() == "" || $(".bDay").val() == "" || $(".bYear").val() == "") {        addError("bMonth", "This field is required.");        formIsValid = false;    } else {        var currentDate = new Date();        var userAge = currentDate.getFullYear() - Number($(".bYear").val());        if (((currentDate.getMonth() + 1) < Number($(".bMonth").val())) || (((currentDate.getMonth() + 1) == Number($(".bMonth").val())) && (currentDate.getDate() < Number($(".bDay").val())))) {            // user hasn't had birthday - subtract one year from age            userAge--;        }        if (userAge < 18 && currentDate.getFullYear()) {            // +++ display an error message that user is not 18 years old            addError("bMonth", "You must be 18 years old.");            formIsValid = false;        } else {            //if(checkDate(year,month,pdate))            //removeError("bMonth");            var pdate = $(".bDay").val();            var month = $(".bMonth").val();            var year = $(".bYear").val();            if (!(checkDate(year, month, pdate))) {                removeError("bMonth");                if ($(".bMonth").parent().find("label[class=error]").attr("generated") == "true") {                    $(".bMonth").parent().find("label[class=error]").html("Please Enter a valid date.");                    $(".bMonth").parent().find("label[class=error]").css("display", "block");                }                else {                    var appendText = '<label for="bMonth" generated="true" class="error">Please Enter a valid date.</label>';                    $(".bMonth").parent().append(appendText);                }                //addError("bMonth", "Please Enter a valid date.");                formIsValid = false;            }            else {                removeError("bMonth");            }        }    }    if (!formIsValid) {        e.preventDefault();    }}function contact_us_trim (str) {//return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');var str = str.replace(/^\s\s*/, ''),ws = /\s/,i = str.length;while (ws.test(str.charAt(--i)));return str.slice(0, i + 1);} function testElement(cl, exp, msg) {    if (!exp.test($("." + cl).val())) {        addError(cl, msg);        return false;    } else {        removeError(cl);        return true;    }}function addError(cl, msg) {  //  if ($("." + cl).parent().find("label[class=error]").attr("generated") == "true") {   //     $("." + cl).parent().find("label[class=error]").css("display", "block");   // } else {		removeError(cl);		var appendText = '<label for="' + cl + '" generated="true" class="error">' + msg + '</label>';        $("." + cl).parent().append(appendText);	//	}}function removeError(cl) {    //$("." + cl).parent().find("label[class=error]").css("display", "none");	var objRemove = $("." + cl).parent().find("label[class=error]");	objRemove.remove();}/*function testSearchField(e) {    if ($("#query").val().length < 1) {        e.preventDefault();    } else {        pageTracker._trackEvent('Search Form', 'Submit', $("#query").val());    }}*//*function showInterstitial() {    clearTimeout(intTime);    try {        var viewed = Number(document.cookie.match('viewed=([0-9]{1,})')[1]);    } catch (e) {        var viewed = 0;    }    if (viewed > 1) {        var date = new Date();        date = date.setTime(date.getTime() + (30 * 86400000));        var exp = new Date(date);        document.cookie = 'viewed=' + (viewed + 1) + ";path=/;expires=" + exp;        return;    }    $("#interstitial").css('display', 'block');    $("#interstitial").css('opacity', '0');    $("#interstitial").animate({ opacity: 1 }, 1000, function () {        $("#interBackground").click(function () {            closeInterstitial();        });        var date = new Date();        date = date.setTime(date.getTime() + (30 * 86400000));        var exp = new Date(date);        document.cookie = 'viewed=' + (viewed + 1) + ";path=/;expires=" + exp;        swfobject.embedSWF($("#interstitial").find("input[name=path]").val(), "interContentArea", $("#interstitial").find("input[name=width]").val(), $("#interstitial").find("input[name=height]").val(), "9.0.0", null, null, { wmode: "transparent", menu: "false" });        var hwidth = "-" + (Number($("#interstitial").find("input[name=width]").val()) / 2) + "px";        $("#interContentArea").css("left", hwidth);        $("#interContentArea").css("display", "block");        $("#interContentArea").click(function () {            closeInterstitial();        });        $("#interstitial").bind("click", closeInterstitial);        var disp = Number($("#interContent").children("div").attr("class"));        intTime = setTimeout(closeInterstitial, disp);    });}function closeInterstitial() {    clearTimeout(intTime);    $("#interstitial").unbind("click", closeInterstitial);    $("#interstitial").animate({ opacity: 0 }, 1000, function () {        $("#interstitial").css('display', 'none');    });}*/
