$('.deductible').click(function(e) {
var factory_warranty = $('input[name=factory_warranty]:checked').val();
var snowplow = $('input[name=snowplow]:checked').val();
var usage = $('input[name=usage]:checked').val();
var milestr = $('#current_milage').val();
var turbo = $('input[name=turbo]:checked').val();
var purchase_date = $('input[name=purchase_date]:checked').val();
$('.deductible').each(function() {
if ($(this).is(":focus") && !$(this).hasClass('uiButton') && !$('.deductible').hasClass('uiButton')) {
$(this).toggleClass('uiButton');
} else if ($(this).hasClass('uiButton') && $(this).is(':focus')) {
} else if (!$(this).hasClass('uiButton') && !$('.term-years').is(':focus') && !$('.term-years').hasClass('uiButton') && $(this).is(':focus')) {
$(this).toggleClass('uiButton');
} else if (!$(this).hasClass('uiButton') && !$('.term-years').is(':focus') && $('.term-years').hasClass('uiButton') && $(this).is(':focus') && $('.deductible').hasClass('uiButton')) {
$('.deductible').removeClass('uiButton');
$(this).toggleClass('uiButton');
$('.term-years').each(function(i) {
if ($('#' + i + '_year_term').hasClass('uiButton')) {
termstr = $('#' + i + '_year_term').val();
$('.deductible').each(function(i) {
if ($('#deductible' + i).hasClass('uiButton')) {
deductstr = $('#deductible' + i).val();
if (deductstr.indexOf('$') > -1) {
deductstr = deductstr.replace(/\D/g, '');
get_plan_pricing(plan_type, plan_code, termstr, deductstr, milestr, factory_warranty, snowplow, usage, turbo, purchase_date);
$('.term-years').click(function() {
var milestr = $('#current_milage').val();
var factory_warranty = $('input[name=factory_warranty]:checked').val();
var snowplow = $('input[name=snowplow]:checked').val();
var usage = $('input[name=usage]:checked').val();
var milestr = $('#current_milage').val();
var turbo = $('input[name=turbo]:checked').val();
var purchase_date = $('input[name=purchase_date]:checked').val();
$('.term-years').each(function() {
if ($(this).is(":focus") && !$(this).hasClass('uiButton') && !$('.term-years').hasClass('uiButton')) {
$(this).toggleClass('uiButton');
} else if ($(this).is(":focus") && !$(this).hasClass('uiButton') && $('.term-years').hasClass('uiButton')) {
$('.term-years').removeClass('uiButton');
$(this).toggleClass('uiButton');
$('.deductible').each(function(i) {
if ($('#deductible' + i).hasClass('uiButton')) {
deductstr = $('#deductible' + i).val();
if (deductstr === 'Disappearing') {
deductstr = deductstr.replace(/\D/g, '');
$('.plan-price').click(function(e) {
if ($('.next').prop('disabled', true)) {
$('.next').prop('disabled', false);
if ($(this).is(':focus') && !$(this).hasClass('uiButton') && !$('.plan-price').hasClass('uiButton')) {
$(this).toggleClass('uiButton');
} else if ($('.plan-price').hasClass('uiButton') && $(this).is(':focus') && !$(this).hasClass('uiButton')) {
$('.plan-price').removeClass('uiButton');
$(this).toggleClass('uiButton');