document.write (''); document.write (''); document.write (''); document.write (''); document.write (''); document.write (''); var stateCA = new Array(13); stateCA[0] = ""; stateCA[1] = ""; stateCA[2] = ""; stateCA[3] = ""; stateCA[4] = ""; stateCA[5] = ""; stateCA[6] = ""; stateCA[7] = ""; stateCA[8] = ""; stateCA[9] = ""; stateCA[10] = ""; stateCA[11] = ""; stateCA[12] = ""; stateCA[13] = ""; var stateUS = new Array(54); stateUS[0] = ""; stateUS[1] = ""; stateUS[2] = ""; stateUS[3] = ""; stateUS[4] = ""; stateUS[5] = ""; stateUS[6] = ""; stateUS[7] = ""; stateUS[8] = ""; stateUS[9] = ""; stateUS[10] = ""; stateUS[11] = ""; stateUS[12] = ""; stateUS[13] = ""; stateUS[14] = ""; stateUS[15] = ""; stateUS[16] = ""; stateUS[17] = ""; stateUS[18] = ""; stateUS[19] = ""; stateUS[20] = ""; stateUS[21] = ""; stateUS[22] = ""; stateUS[23] = ""; stateUS[24] = ""; stateUS[25] = ""; stateUS[26] = ""; stateUS[27] = ""; stateUS[28] = ""; stateUS[29] = ""; stateUS[30] = ""; stateUS[31] = ""; stateUS[32] = ""; stateUS[33] = ""; stateUS[34] = ""; stateUS[35] = ""; stateUS[36] = ""; stateUS[37] = ""; stateUS[38] = ""; stateUS[39] = ""; stateUS[40] = ""; stateUS[41] = ""; stateUS[42] = ""; stateUS[43] = ""; stateUS[44] = ""; stateUS[45] = ""; stateUS[46] = ""; stateUS[47] = ""; stateUS[48] = ""; stateUS[49] = ""; stateUS[50] = ""; stateUS[51] = ""; stateUS[52] = ""; stateUS[53] = ""; stateUS[54] = ""; jQuery(document).ready(function($) { $(".progressBar").each(function(index) {var currId = $(this).attr('id');$(this).wrap("
");$(this).css("display", "block");$(this).css("width", "0%");});$("#birthday").datepicker({ changeYear: true, dateFormat: "mm/dd/yy", minDate: "-100Y", maxDate: 0, yearRange: "1900:" + new Date().getFullYear() }); }); jQuery(document).ready(function($) { /******************************************************************************* * Format answer blocks' width according to the question text width ******************************************************************************/ $.formatAnswers = function() { var answerList = $("#surveyStart div.answerBlock"); $.each(answerList, function(key, val) { if ($(val).prev().css("display") == "inline-block") { var questWidth = $(val).prev().css("width").replace("px", ""); var containerWidth = $(val).closest("#surveyStart").css("width").replace("px", ""); $(val).css("width", (parseInt(containerWidth) - parseInt(questWidth) - 70) + "px");// -70 because of the naviBar width } }); } $.applyInlineForIE7 = function() { $.each($("#surveyStart > div > div"), function(key, val) { if ($(val).prev().css("display") == "inline-block") $(val).prev().addClass("inlineIE7"); }); } $.formatAnswers(); $.applyInlineForIE7(); /******************************************************************************* * Registration fields logic ******************************************************************************/ $('#surveyStart .datepicker').each(function() { if ($(this).val() != "") { // Converts Java date format back to datepicker format var myDate = new Date($(this).val()); var month = (myDate.getMonth()+1); var day = myDate.getDate(); if (month < 10) month = "0" + month; if (day < 10) day = "0" + day; $(this).val(month + "/" + day + "/" + myDate.getFullYear()); } var options = { changeYear: true }; if ($(this).hasClass("showAlways")) options.altField = 'input#date' + $(this).attr('id'); if ($(this).closest('.packageBlock').length > 0) options.minDate = +1; $(this).datepicker(options); }); $('#surveyStart select#country').change(function(){ selectedCountry = $('#surveyStart #country :selected').val(); if (selectedCountry == 'CA') { var newHtmlCA = ""; $('#surveyStart #fieldBlockstate > div.fieldBlockInput').html(newHtmlCA); } else if (selectedCountry == 'US') { var newHtmlUS = ""; $('#surveyStart #fieldBlockstate > div.fieldBlockInput').html(newHtmlUS); } else { var newHtml = ""; $('#surveyStart #fieldBlockstate > div.fieldBlockInput').html(newHtml); } }); $("#surveyStart [id^=homePhone]").keyup(function(){ if(this.value.length == $(this).attr('maxlength')) { var inputs = $(this).closest('form').find(':input'); inputs.eq( inputs.index(this)+ 1 ).focus(); } }); $("#surveyStart [id^=officePhone]").keyup(function(){ if(this.value.length == $(this).attr('maxlength')) { var inputs = $(this).closest('form').find(':input'); inputs.eq( inputs.index(this)+ 1 ).focus(); } }); $("#surveyStart [id^=cellPhone]").keyup(function(){ if(this.value.length == $(this).attr('maxlength')) { var inputs = $(this).closest('form').find(':input'); inputs.eq( inputs.index(this)+ 1 ).focus(); } }); $("#surveyStart [id^=faxNumber]").keyup(function(){ if(this.value.length == $(this).attr('maxlength')) { var inputs = $(this).closest('form').find(':input'); inputs.eq( inputs.index(this)+ 1 ).focus(); } }); /******************************************************************************* * Add a selectAll and DeselectAll button for multiple Answer questions ******************************************************************************/ $("#surveyStart .selectAll").click(function() { $(this).parent().find("input[type='checkbox']").attr("checked", true); }); $("#surveyStart .deselectAll").click(function() { $(this).parent().find("input[type='checkbox']").attr("checked", false); }); /******************************************************************************* * Remove all the hidden questions to not submit them to the form controller ******************************************************************************/ $("#surveyStart > #submitButton > input[type='submit'], #surveyStart > #submitButton > button[type='submit']").click(function() { $.each($("#surveyStart > div.questionBlock"), function(key, val) { if ($(val).css("display") == "none") $(val).remove(); }); }); $("#surveyStart > #unsubscribeButton > input[type='submit'], #surveyStart > #unsubscribeButton > button[type='submit']").click(function() { $.each($("#surveyStart > div.questionBlock"), function(key, val) { if ($(val).css("display") == "none") $(val).remove(); }); $("").appendTo('form'); }); /******************************************************************************* * Trigger the click event on each of the checked inputs to unhide questions ******************************************************************************/ $("#surveyStart input:checked").each(function() { $(this).trigger("click"); $(this).prop('checked', true); } ); /******************************************************************************* * Check / Uncheck radio buttons ******************************************************************************/ $('#surveyStart :radio').click(function() { var previousValue = $(this).attr('previousValue'); if(previousValue == 'true' || previousValue == 'checked') $(this).attr('checked', false).attr('previousValue', false); else { $(this).closest(".radioGroup").find(':radio').attr('previousValue', false); $(this).attr('previousValue', true); } }); $('fieldset.highlightLeft div.ui-radio, fieldset.starPicker div.ui-radio').click(function() { var remove = false; if($(this).find('label').hasClass('ui-btn-active')) remove = true; $(this).find('label').removeClass('ui-btn-highlighted'); var elem = $(this).prev(); while(elem.length > 0) { if(remove) elem.find('label').removeClass('ui-btn-highlighted'); else elem.find('label').addClass('ui-btn-highlighted'); elem = elem.prev(); } elem = $(this).next(); while(elem.length > 0) { elem.find('label').removeClass('ui-btn-highlighted'); elem = elem.next(); } }); $('fieldset.highlightLeft div.ui-radio input, fieldset.starPicker div.ui-radio input').each(function() { if($(this).is(':checked')) { var $uiRadio = $(this).closest('div.ui-radio'); var elem = $uiRadio.prev(); while(elem.length > 0) { elem.find('label').addClass('ui-btn-highlighted'); elem = elem.prev(); } } }); $.each($('.zd-slider'), function() { var emoji = []; var values = []; var name; var selectedVal; $.each($(this).find('.zd-slider-hidden input'), function(index) { emoji.push($(this).parent().find('label[for='+$(this).attr('id')+']').html()); values.push($(this).attr('value')); name = $(this).attr('name'); if($(this).is(':checked')) selectedVal = index; }); if(selectedVal == undefined) selectedVal = Math.floor(emoji.length/2); $(this).find('.zd-top-slider') .slider({ max: emoji.length-1, value: selectedVal }) .slider("pips", { rest: "label", labels: emoji }) .on("slidechange", function( e, ui ) { var input = $('.zd-slider .zd-slider-hidden input[name="'+name+'"][value="'+values[ui.value]+'"]'); input.prop('checked', true).trigger("click"); }); }); try { $('fieldset div.ui-checkbox input[type=checkbox]').checkboxradio('refresh'); } catch(e) {} $('fieldset.highlightLeft div.ui-radio, fieldset.starPicker div.ui-radio').mouseenter(function() { var elem = $(this).prev(); while(elem.length > 0) { elem.find('label').addClass('ui-btn-hovered'); elem = elem.prev(); } }).mouseleave(function() { var elem = $(this); while(elem.length > 0) { elem.find('label').removeClass('ui-btn-hovered'); elem = elem.prev(); } elem = $(this).next(); while(elem.length > 0) { elem.find('label').removeClass('ui-btn-hovered'); elem = elem.next(); } }); }); document.write(''); document.write (''); document.write (''); document.write (''); document.write ('
'); document.write (' '); document.write (' '); document.write ('
'); document.write (' '); document.write (' '); document.write (' '); document.write (' '); document.write (' '); document.write (' '); document.write (' '); document.write ('
'); document.write ('
'); document.write ('
'); document.write (' '); document.write ('
'); document.write ('
'); document.write ('
'); document.write (' '); document.write ('
'); document.write ('
'); document.write ('
'); document.write (''); document.write ('');