Back to site

Join our Email Newsletter!

#th_embed_signup {font-family:Arial; font-size:12px;}

#th_embed_signup fieldset
{
text-align: Left;
-moz-border-radius: 4px; border-radius: 4px;
-webkit-border-radius: 4px; border: 1px solid #000000;
padding-top: 1.5em; margin: .5em 0;
background-color: #FFFFFF; color: #333333;
}


#th_embed_signup .requiredHint
{
text-align: right;
font-style: italic;
overflow: hidden;
color: #333333;
margin: 0 9% 0 0;
}

.th-field-group input
{
border: 1px solid #A5B8C9;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
color: #3B3B3B;
padding-top: 4px;
padding-bottom: 4px;
font-size: 15px;
outline: none;
width:100%;
}

/* Field Error Messages */
#th_embed_signup .field-validation-error
{
font-size:12px;
color:Red;
font-weight:bold;
}

#th_embed_signup #th-embedded-subscribe
{
clear: both;width: auto; display: block; margin: 1em 0 1em 5%;
}

#th_embed_signup .th-credits
{
text-align:center;
font-size:10px;
color:#666;
}

#th_embed_signup .th-credits a, #th_embed_signup .th-credits a:hover
{
color:#666;
text-decoration:none;
}

/* Responses */
#th_embed_signup #th-responses
{
float: Left;
top: -1.4em;
padding: 0em .5em 0em .5em;
overflow: hidden;
width: 100%;
margin: 0 5%;
clear: both;
}

#th_embed_signup #th-responses div
{
float:Left;
font-weight: bold;
width: 100%;
margin: 1em 0;
padding: 1em .5em .5em 0;
top: -1.5em;
z-index: 1;
}

#th_embed_signup #th-error-response
{
background: FBE3E4;
color: #D12F19;
}

#th_embed_signup #th-success-response
{
background: #E3FBE4;
color: #529214;
}

#th_embed_signup .response .disclaimer
{
color:Red;
}

#th_embed_signup .th-field-hidden
{
display:none;
}

#th_embed_signup .headingText
{
color: rgb(0, 0, 0); text-align: center; font-size: 16px; font-family: Verdana, Geneva, sans-serif;
}

#th_embed_signup .th-fields
{
font-size:12px; color:#000000; font-family:Arial
}


Fresh Generation: Join Our Mailing List for Discounts and Special Offers! (:

* indicates a required field

Email *

First name

Last name

Birthday

var th_embedSignUpForm = function () {

var signUpForm;

var jQueryLoaded;

var err_required_class = "th-validate-required";
var err_required_msg = "Please fill in all required fields";

var err_email_class = "th-validate-email";
var err_email_invalid_msg = "Invalid email address";

var err_num_class = "th-field-number";
var err_num_invalid_msg = "Invalid number";

var err_date_class = "th-field-date";
var err_date_invalid_msg = "TargetHero can only read dates written like this: MM/dd/yyyy";

var dateFormat = "MM/dd/yyyy";

function IsEmail(value) {
if (value == '') return true;
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
return emailReg.test(value);
}

function IsNumber(value) {
if (value == '') return true;
return (value - 0) == value && value.length > 0 && value != "'";
}

function IsDate(value) {

if (value == '') return true;

var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
var matchArray = value.match(datePat); // is the format ok?

var datestatus = true;
if (matchArray == null || matchArray[1] == null)
return false;
else
if (matchArray[3] = null || matchArray[5] == null)
return false;

var month = 0;
var day = 0;

//Check how to parse the date format
if (dateFormat.toLowerCase().indexOf("mm") == 0) {
month = value.split("/")[0];
day = value.split("/")[1];
}
else {
day = value.split("/")[0];
month = value.split("/")[1];
}

var year = value.split("/")[2];

if (month < 1 || month > 12) { // check month range
datestatus = false;
}

if (day < 1 || day > 31) datestatus = false;
if ((month == 4 || month == 6 || month == 9 || month == 11) && day == 31) datestatus = false;
if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day == 29 && !isleap))
datestatus = false;
}

return datestatus;
}

function ValidateField(field) {

var fieldValue = $.trim($(field).val());
var err_el = $(field).parent().find("#" + $(field).attr("err_el"));

//Required
if ($(field).hasClass(err_required_class)) {
if (fieldValue == '') {
$(err_el).html(err_required_msg);
return false;
}
else {
$(err_el).html("");
}
}

//Email
if ($(field).hasClass(err_email_class)) {
if (!IsEmail(fieldValue)) {
$(err_el).html(err_email_invalid_msg);
return false;
}
else {
$(err_el).html("");
}
}

//Number
if ($(field).hasClass(err_num_class)) {
if (!IsNumber(fieldValue)) {
$(err_el).html(err_num_invalid_msg);
return false;
}
else {
$(err_el).html("");
}
}

//Date
if ($(field).hasClass(err_date_class)) {
if (!IsDate(fieldValue)) {
$(err_el).html(err_date_invalid_msg);
return false;
}
else {
$(err_el).html("");
}
}

return true;
}

var jquery_checks_counter = 0;
var jquery_checks_max = 50;

return {
jQuery_checks: function () {
//Check if Jquery has been loaded
if (jquery_checks_counter++ > jquery_checks_max) {
jQueryLoaded = true;
return;
}

try {
var jQueryLoaded = jQuery;
jQueryLoaded = true;
}
catch (err) {
var jQueryLoaded = false;
setTimeout('th_embedSignUpForm.jQuery_checks();', 200);
return;
}

//Load jQuery Form
var head = document.getElementsByTagName('head')[0];
var dnsHost = "app.targethero.com";
var port = "443";
if (port != "") port = ":" + port;
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "http://" + dnsHost + port + "/scripts/jquery.form.js";
head.appendChild(script);

//Ensure js is loaded
setTimeout('th_embedSignUpForm.jQuery_form_checks();', 200);
},
jQuery_form_checks: function () {

if (jquery_checks_counter++ > jquery_checks_max) return;

try {
var formCheck = IsJqueryFormAlive();
} catch (err) {
setTimeout('th_embedSignUpForm.jQuery_form_checks();', 200);
return;
}

th_embedSignUpForm.init();
},
init: function () {
signUpForm = $("#th-embedded-subscribe-form");
jQuery(document).ready(function ($) {
if ($(signUpForm).val() != undefined) {

$(signUpForm).unbind("submit");

options = {
url: $(signUpForm).attr("action"),
type: 'POST',
beforeSubmit: function () {
if (th_embedSignUpForm.validateForm(signUpForm)) {
return true;
}

return false;
},
success: function (data) {
th_embedSignUpForm.postSubmitForm(data, signUpForm);
}
};

//Note that form is Ajaxified
$(signUpForm).append("<input type=\"hidden\" name=\"isAjax\" value=\"True\" />");

$(signUpForm).ajaxForm(options);
}
});
},
validateForm: function (form) {
$(form).find(".response").hide();

var isValid = true;

//Validate the form
$.each($(form).find("input:text"), function (n, p) {
if (!ValidateField(p))
isValid = false;
});

return isValid;
},
postSubmitForm: function (data, form) {

$(form).find(".response").hide();

var dataArr = data.split(';');
var responseElem;
if (dataArr[0] == "1") {
//Show Success Message
$(form).find("#th-success-response").show().html(dataArr[1]);
}
else {
//Show Error Message
$(form).find("#th-error-response").show().html(dataArr[1]);
}

$(form).find("#th-responses").show();
}
}
} ();

//Initialize Form

try {
jQueryLoaded = jQuery;
jQueryLoaded = true;
} catch (err) {
jQueryLoaded = false;
}

if (!jQueryLoaded) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
head.appendChild(script);

if (script.readyState && script.onload !== null) {
script.onreadystatechange = function () {
if (this.readyState == 'complete')
th_embedSignUpForm.jQuery_checks();
}
}
}

setTimeout('th_embedSignUpForm.jQuery_checks();', 200);