$(document).ready(function() {
    //all fields/inputs/checkboxes etc. will be false/disabled/readonly in every section except for section2

    //section1
    $('#social_security').val( $('#social_security1').val().toString() + $('#social_security2').val().toString() + $('#social_security3').val().toString() );

    $('#bank_tel').val( $('#bank_tel1').val().toString() + $('#bank_tel2').val().toString() + $('#bank_tel3').val().toString() );


    //section2
    if (globalVars.browser_name == 'MSIE' && globalVars.browser_version == '6.0') {
        //change default location placement
        $('#pay_date_form').datePicker( {
            clickInput : true,
            showYearNavigation : false,
            verticalPosition : 1,
            verticalOffset : 120,
            horizontalOffset : 0
        } );
    } else {
        $('#pay_date_form').datePicker( {
            clickInput : true,
            showYearNavigation : false
        } );
    }
    var tomorrow = shiftDate(1);
    var limit_date = shiftDate(35);
    $('#pay_date_form').dpSetStartDate(tomorrow);
    $('#pay_date_form').dpSetEndDate(limit_date);
    $('#pay_date_form').bind('dateSelected', function(e, x, y) {
        //i don't know how to do this better at the moment -rchung
        var classname_data = $(y).get( 0 ).className.split(' ');
        var weekday_clicked = false;
        var weekend_clicked = false;
        for (var i=0; i < classname_data.length; i++) {
            if (classname_data[i] !== '') {
                if (classname_data[i] == 'weekday') {
                    weekday_clicked = true;
                    break;
                } else if (classname_data[i] == 'weekend') {
                    weekend_clicked = true;
                    break;
                }
            }
        }
        //alert('weekday_clicked='+ weekday_clicked +' weekend_clicked='+ weekend_clicked);

        if (weekday_clicked) {
            $('#pay_date_form').removeClass("LV_invalid_field");
            $('#pay_date_form').addClass("LV_valid_field");
            $('#pay_date_form').css({
                'backgroundColor':'#FFF'
            });
            $('a.dp-choose-date').removeClass("LV_invalid_field");
            $('a.dp-choose-date').addClass("LV_valid_field");
            $('#direct_deposit').focus();
        } else if (weekend_clicked) {
            $('#pay_date_form').val('');
            $('#pay_date_form').removeClass("LV_valid_field");
            $('#pay_date_form').addClass("LV_invalid_field");
            $('#pay_date_form').css({
                'backgroundColor':'#FFFF99'
            });
            $('a.dp-choose-date').removeClass("LV_valid_field");
            $('a.dp-choose-date').addClass("LV_invalid_field");
            //alert('Application Tip:\n\nYou have selected a weekend as your pay date. Please select a weekday.');
            //var title = "Application Tip:";
            var content = "<div style='text-align:center;'>";
            content += "You have selected a <span style='font-weight:600;'>weekend</span> as your pay date. ";
            content += "Please <span style='font-weight:600;'>select a weekday</span>.";
            content += "</div>";
            //content += "<div style='clear:both;text-align:center;'>";
            //content += "</div>";

            //$.alerts.okButton = '&nbsp;OK&nbsp;';
            //jAlert(content, title);
            if (globalVars.browser_name == 'MSIE' && globalVars.browser_version == '6.0') {
                $.fn.launch_jAlert_IE6(content, false, 'paydate_form');
            } else {
                //alert('event='+event+' params='+params);
                $.fn.launch_jAlert(Array(content), false, 'paydate_form');
            }
        } else {
    //no date was picked
    }
    });

    
    //Hide/Show the CA Agreement button when the user changes the state of residence
    $('#state').bind('change', function() {
    	if ($('#state').val() == 'CA') {
    		if($('#field_cali_agree').is(":hidden")) {
    			//Make CA agreement visible
    			$('#field_cali_agree').show();
    		}
    	} else {
    		if($('#field_cali_agree').is(":visible")) {
    			//Hide CA agreement
    			$('#field_cali_agree').hide();	
    		}
    	}
    }); 
    
    
    $('#pay_date_form').bind('change', function() {
        var d = Date.fromString(this.value);
        if (this.value != '') {
            var week_number = d.getDay();

            if (week_number == 6 || week_number == 0) {
                $('#pay_date_form').removeClass("LV_valid_field");
                $('#pay_date_form').addClass("LV_invalid_field");
                $('#pay_date_form').css({
                    'backgroundColor':'#FFFF99'
                });
                $('a.dp-choose-date').removeClass("LV_valid_field");
                $('a.dp-choose-date').addClass("LV_invalid_field");
                //var title = "Application Tip:";
                var content = "<div style='text-align:center;'>";
                content += "You have selected a <span style='font-weight:600;'>weekend</span> as your pay date. ";
                content += "Please <span style='font-weight:600;'>select a weekday</span>.";
                content += "</div>";
                //content += "<div style='clear:both;text-align:center;'>";
                //content += "</div>";

                //$.alerts.okButton = '&nbsp;OK&nbsp;';
                //jAlert(content, title);

                if (globalVars.browser_name == 'MSIE' && globalVars.browser_version == '6.0') {
                    $.fn.launch_jAlert_IE6(content, false, 'paydate_form');
                } else {
                    //alert('event='+event+' params='+params);
                    $.fn.launch_jAlert(Array(content), false, 'paydate_form');
                }
            } else {
                $('#pay_date_form').removeClass("LV_invalid_field");
                $('#pay_date_form').addClass("LV_valid_field");
                $('#pay_date_form').css({
                    'backgroundColor':'#FFF'
                });
                $('a.dp-choose-date').removeClass("LV_invalid_field");
                $('a.dp-choose-date').addClass("LV_valid_field");
            }
        }
    });

	//shift is based on plus or minus days
	function shiftDate(shift) {
		var date_obj = new Date();
		var retval = (date_obj.getMonth() + 1) + '/' + (date_obj.getDate()) + '/' + date_obj.getFullYear();
		
		// convert txtDate to the miliseconds (mm-1 because months start with 0)
		mSeconds = ( new Date() ).getTime();
		// initialize date object
		objDate = new Date();
		// set shifted date (86400000 is the number of miliseconds in one day)
		objDate.setTime(mSeconds + 86400000 * shift);
		if (shift) {
			// get month, day and year from shifted date (reuse mm, dd and yyyy variables)
			mm = objDate.getMonth() + 1;
			dd = objDate.getDate();
			yyyy = objDate.getFullYear();
			// set leading zero if needed
			if (mm < 10) {
				mm = "0" + mm;
			}
			if (dd < 10) {
				dd = "0" + dd;
			}
			// write back shifted date to the HTML element
			retval = mm + '/' + dd + '/' + yyyy;
		}
		return retval;
	}
	
	var blankfailureMessage = {
		'is_military' : "Please select your <span style='font-style:italic;font-weight:bold;'>military status</span>.",
		//'have_account' : "Please select if you <span style='font-style:italic;font-weight:bold;'>own a bank account</span>.",
		'requested_amount' : "Please select your <span style='font-style:italic;font-weight:bold;'>requested amount</span>.",
		'first_name' : "Please select your <span style='font-style:italic;font-weight:bold;'>first name</span>.",
		'last_name' : "Please select your <span style='font-style:italic;font-weight:bold;'>last name</span>.",
		'email' : "Please select your current <span style='font-style:italic;font-weight:bold;'>email</span>.",
		'home_phone1' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home telephone number</span>.",
		'home_phone2' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home telephone number</span>.",
		'home_phone3' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home telephone number</span>.",
		'address1' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home address</span>.",
		'zipcode' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home zipcode</span>.",
		'city' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home city</span>.",
		'state' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home state</span>.",
		
		'bd_month' : "Please select your <span style='font-style:italic;font-weight:bold;'>birthday month</span>.",
		'bd_day' : "Please select your <span style='font-style:italic;font-weight:bold;'>birthday day</span>.",
		'bd_year' : "Please select your <span style='font-style:italic;font-weight:bold;'>birthday year</span>.",
		'social_security1' : "Please enter your <span style='font-style:italic;font-weight:bold;'>social security number</span>.",
		'social_security2' : "Please enter your <span style='font-style:italic;font-weight:bold;'>social security number</span>.",
		'social_security3' : "Please enter your <span style='font-style:italic;font-weight:bold;'>social security number</span>.",
		'account_type' : "Please select your <span style='font-style:italic;font-weight:bold;'>type of account</span>.",
		'bankmonths' : "Please select <span style='font-style:italic;font-weight:bold;'>how long you have had your bank account</span>.",
		'aba' : "Please enter your <span style='font-style:italic;font-weight:bold;'>ABA/bank routing number</span>.",
		'account_number' : "Please enter your <span style='font-style:italic;font-weight:bold;'>account number</span>.",
		'bank_name' : "Please enter the <span style='font-style:italic;font-weight:bold;'>name of your bank</span>.",
		'bank_tel1' : "Please enter the <span style='font-style:italic;font-weight:bold;'>telephone number of your bank</span>.",
		'bank_tel2' : "Please enter the <span style='font-style:italic;font-weight:bold;'>telephone number of your bank</span>.",
		'bank_tel3' : "Please enter the <span style='font-style:italic;font-weight:bold;'>telephone number of your bank</span>.",
		
		'pay_date_form' : "Please click calendar to <span style='font-style:italic;font-weight:bold;'>enter your next pay date</span>.",
		'direct_deposit' : "Please select <span style='font-style:italic;font-weight:bold;'>how you receive your paycheck</span>.",
		'income_type' : "Please select your <span style='font-style:italic;font-weight:bold;'>income type</span>.",
		'income_monthly' : "Please select your <span style='font-style:italic;font-weight:bold;'>monthly income</span>.",
		'months_employed' : "Please select <span style='font-style:italic;font-weight:bold;'>how long you have been employed</span>.",
		'pay_frequency' : "Please select <span style='font-style:italic;font-weight:bold;'>how often you are paid</span>.",
		'employer_name' : "Please enter your <span style='font-style:italic;font-weight:bold;'>employer's name</span>.",
		'phone_work1' : "Please enter your <span style='font-style:italic;font-weight:bold;'>employer's phone number</span>.",
		'phone_work2' : "Please enter your <span style='font-style:italic;font-weight:bold;'>employer's phone number</span>.",
		'phone_work3' : "Please enter your <span style='font-style:italic;font-weight:bold;'>employer's phone number</span>.",
		'phone_home1' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home phone number</span>.",
		'phone_home2' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home phone number</span>.",
		'phone_home3' : "Please enter your <span style='font-style:italic;font-weight:bold;'>home phone number</span>.",
		
		'own_home' : "Please select <span style='font-style:italic;font-weight:bold;'>whether or not you own your home</span>.",
		'residence_months' : "Please select <span style='font-style:italic;font-weight:bold;'>the length of time you have been living in your current home</span>.",
		'best_time_tocall' : "Please select the <span style='font-style:italic;font-weight:bold;'>best time to call you</span>.",
		'drivers_license' : "Please enter your <span style='font-style:italic;font-weight:bold;'>driver's license number</span>.",
		'drivers_license_st' : "Please select your <span style='font-style:italic;font-weight:bold;'>driver's license state</span>.",
		'cali_agree' : "You have indicated that you live in California.\nPlease <span style='font-style:italic;font-weight:bold;'>agree to the California Residence Agreement</span>.",
		'terms_agree' : "Please check the box to acknowledge the <span style='font-style:italic;font-weight:bold;'>Terms of agreement and Privacy Policy</span>"
	};
	
	$.fn.getBlankMessages = function(fields) {
		var retval = Array();
		var retvalIndex = 0;
		//alert('getBlankMessages='+fields);
		//loop through this sections fields for blank values
		for (var i=0; i < fields.length; i++) {
			//alert(fields[i]);
			if ( $('#' + fields[i]).val().replace(/^\s+|\s+$/g,"").length == 0 ||
				$('#' + fields[i]).val().replace(/^\s+|\s+$/g,"").toUpperCase() == 'MM' ||
				$('#' + fields[i]).val().replace(/^\s+|\s+$/g,"").toUpperCase() == 'DD' ||
				$('#' + fields[i]).val().replace(/^\s+|\s+$/g,"").toUpperCase() == 'YYYY' ||
				$('#' + fields[i]).val().replace(/^\s+|\s+$/g,"").toUpperCase() == 'SELECT' ||
				fields[i] == 'cali_agree' ||
				fields[i] == 'terms_agree'
			) {
				//alert('i='+i);
				//alert(blankfailureMessage.fields[i]);
				//special cases
				//alert(fields[i].search(/social_security/i));
				if (fields[i].search(/social_security/i) != -1) {
					if (fields[i] == 'social_security1') {
						//blankfailureMessage index is based on the order that the appropriate message was added to blankfailureMessage
						retval[retvalIndex] = "<div>" + blankfailureMessage['social_security1'] + "</div>";
						retvalIndex++;
						i+= 2;
					} else if (fields[i] == 'social_security2') {
						//blankfailureMessage index is based on the order that the appropriate message was added to blankfailureMessage
						retval[retvalIndex] = "<div>" + blankfailureMessage['social_security1'] + "</div>";
						retvalIndex++;
						i++;
					} else if (fields[i] == 'social_security3') {
						//blankfailureMessage index is based on the order that the appropriate message was added to blankfailureMessage
						retval[retvalIndex] = "<div>" + blankfailureMessage['social_security1'] + "</div>";
						retvalIndex++;
					}
				} else if (fields[i].search(/bank_tel/i) != -1) {
					//blankfailureMessage index is based on the order that the appropriate message was added to blankfailureMessage
					if (fields[i] == 'bank_tel1') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['bank_tel1'] + "</div>";
						retvalIndex++;
						//skip the next 2 indices
						i+= 2;
					} else if (fields[i] == 'bank_tel2') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['bank_tel1'] + "</div>";
						retvalIndex++;
						//skip the next 2 indices
						i++;
					} else if (fields[i] == 'bank_tel3') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['bank_tel1'] + "</div>";
						retvalIndex++;
					}
				} else if (fields[i].search(/phone_work/i) != -1) {
					//blankfailureMessage index is based on the order that the appropriate message was added to blankfailureMessage
					if (fields[i] == 'phone_work1') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['phone_work1'] + "</div>";
						retvalIndex++;
						//skip the next 2 indices
						i+= 2;
					} else if (fields[i] == 'phone_work2') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['phone_work1'] + "</div>";
						retvalIndex++;
						//skip the next 2 indices
						i++;
					} else if (fields[i] == 'phone_work3') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['phone_work1'] + "</div>";
						retvalIndex++;
					}
				} else if (fields[i].search(/phone_home/i) != -1) {
					//blankfailureMessage index is based on the order that the appropriate message was added to blankfailureMessage
					if (fields[i] == 'phone_home1') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['phone_home1'] + "</div>";
						retvalIndex++;
						//skip the next 2 indices
						i+= 2;
					} else if (fields[i] == 'phone_home2') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['phone_home1'] + "</div>";
						retvalIndex++;
						//skip the next 2 indices
						i++;
					} else if (fields[i] == 'phone_home3') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['phone_home1'] + "</div>";
						retvalIndex++;
					}
				} else if (fields[i].search(/cali_agree/i) != -1) {
					//alert(fields[i]);
					//var checked_value = $('#cali_agree_yes:radio:checked').val();
					//alert($('#cali_agree_yes').is('checked'));
					//alert($('#' + fields[i]).val() + ' ' + $('#state').val());
					if ($('#' + fields[i]).val() != 'AGREE' && $('#state').val() == 'CA') {
						retval[retvalIndex] = "<div>" + blankfailureMessage['cali_agree'] + "</div>";
						retvalIndex++;
					}
				} else if (fields[i].search(/terms_agree/i) != -1) {
					if (!$('#terms_agree').is(':checked')) {
						retval[retvalIndex] = "<div>" + blankfailureMessage['terms_agree'] + "</div>";
						retvalIndex++;
					}
				} else {
					retval[retvalIndex] = "<div>" + blankfailureMessage[fields[i]] + "</div>";
					retvalIndex++;
					if (fields[i] == 'pay_date_form') {
						//special case - change input and calendar image red
						$('#' + fields[i]).addClass('LV_invalid_field');
						$('.dp-choose-date').addClass('LV_invalid_field');
					}
				//alert(fields[i]);
				//alert( test[fields[i]] );
					
				//alert(i + ' ' + fields[i]);
				}
			//alert(i + ' ' + fields[i]);
			}
		//}
		}
		
		return retval;
	};

    
    //var isExit = true;
    function redirect(loc) {
        isExit = false;
        var msg = "You have made a selection that allows " + globalVars.site_name + " to provide you with an Alternate Offer.\n\n";
        msg += "Please click 'OK' to continue to your ALTERNATE APPLICABLE OFFER and lose all data on this form\n";
        msg += "or\n";
        msg += "Click 'Cancel' to stay on this page and continue to APPLY for a PERSONAL LOAN.";
        var exit = confirm(msg);

        if (exit == true) {
            var win = window.location.href = loc;

        /*if (!win.focus) {
                win.focus();
            }
            if (!win || !win.top) {
                alert("It appears our new window to the site has been stopped by your pop up blocker.\n\nPlease allow this page to be opened to view a much more compatible offer.");
            }*/
        }
    }

    /*
    $('#is_military').change( function() {
        if ($('#is_military').val() == 'yes') {
            $('#is_military').val('');
            redirect('military_loans.php?q=1');
        }
    });*/
    
    $('#have_account').change( function() {
        if ($('#have_account').val() == 'no') {
            $('#have_account').val('');
            redirect('credit_repair.php?q=2');
        }
    });
    

    $.fn.new_window = function (loc) {
        //isExit = false;
        var win = window.open(loc,"","left=0,top=0");
        if (!win || !win.top) {
            alert("It appears our new window to the site has been stopped by your pop up blocker.\n\nPlease allow this page to be opened to view a much more compatible offer.");
        }
    };


    //SCROLL TO
    $.easing.elasout = function(x, t, b, c, d) {
        return c*(t/=d)*t + b;
    };
    $('#scrolltoone, #scrolltothisone').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
        $.scrollTo( '#scrolltoone', 700, {
            easing:'elasout'
        });
    });
    $('#scrolltotwo, #scrolltonexttwo, #scrolltothistwo').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
        $.scrollTo( '#scrolltotwo', 700, {
            easing:'elasout'
        });
    });
    $('#scrolltothree, #scrolltonextthree, #scrolltothisthree').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
        $.scrollTo( '#scrolltothree', 700, {
            easing:'elasout'
        });
    });
    $('#scrolltofour, #scrolltonextfour, #scrolltothisfour').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
        $.scrollTo( '#scrolltofour', 700, {
            easing:'elasout'
        });
    });

    
    if ( $('#home_phone1') ) {
        $('#home_phone1').autotab({
            target: $('#home_phone2'),
            format: 'numeric'
        });
        $('#home_phone2').autotab({
            target: $('#home_phone3'),
            format: 'numeric',
            previous: $('#home_phone1')
        });
        $('#home_phone3').autotab({
            previous: $('#home_phone2'),
            format: 'numeric'
        });
    }
    
    if ( $('#phone_home1') ) {
        $('#phone_home1').autotab({
            target: $('#phone_home2'),
            format: 'numeric'
        });
        $('#phone_home2').autotab({
            target: $('#phone_home3'),
            format: 'numeric',
            previous: $('#phone_home1')
        });
        $('#phone_home3').autotab({
            previous: $('#phone_home2'),
            format: 'numeric'
        });
    }
    
    if ( $('#phone_work1') ) {
        $('#phone_work1').autotab({
            target: $('#phone_work2'),
            format: 'numeric'
        });
        $('#phone_work2').autotab({
            target: $('#phone_work3'),
            format: 'numeric',
            previous: $('#phone_work1')
        });
        $('#phone_work3').autotab({
            previous: $('#phone_work2'),
            format: 'numeric'
        });
    }
    
    if ( $('#social_security1') ) {
        $('#social_security1').autotab({
            target: $('#social_security2'),
            format: 'numeric'
        });
        $('#social_security2').autotab({
            target: $('#social_security3'),
            format: 'numeric',
            previous: $('#social_security1')
        });
        $('#social_security3').autotab({
            previous: $('#social_security2'),
            format: 'numeric'
        });
    }
    
    if ( $('#bank_tel1') ) {
        $('#bank_tel1').autotab({
            target: $('#bank_tel2'),
            format: 'numeric'
        });
        $('#bank_tel2').autotab({
            target: $('#bank_tel3'),
            format: 'numeric',
            previous: $('#bank_tel1')
        });
        $('#bank_tel3').autotab({
            previous: $('#bank_tel2'),
            format: 'numeric'
        });
    }
    
    //Limit key strokes with alphanumeric pack
    $('#first_name').alpha( {
        allow: "-. "
    } );
    $('#first_name').alpha( {
        ichars: "_"
    } );
    $('#last_name').alphanumeric( {
        allow: "-.' "
    } );
    $('#last_name').alphanumeric( {
        ichars: "_"
    } );
    $('#home_phone1').numeric();
    //the autotab seems to have this issue
    $('#home_phone1').numeric( {
        ichars:"_ "
    } );
    $('#home_phone2').numeric( {
        ichars:"!@#$%^&*()+=_-<>?{[}]|~`\\,."
    } );
    //the autotab seems to have this issue
    $('#home_phone2').numeric( {
        ichars:"_ "
    } );
    $('#home_phone3').numeric( {
        ichars:"!@#$%^&*()+=_-<>?{[}]|~`\\,."
    } );
    //the autotab seems to have this issue
    $('#home_phone3').numeric( {
        ichars:"_ "
    } );
    $('#address1').alphanumeric( {
        allow: "-&#'. "
    } );
    $('#address1').alphanumeric( {
        ichars: "_"
    } );
    $('#zipcode').numeric();
    $('#city').alpha( {
        allow: "-. "
    } );
    $('#city').alpha( {
        ichars: "_"
    } );
    
    $('#social_security1').numeric();
    //the autotab seems to have this issue
    $('#social_security1').numeric( {
        ichars:"_ "
    } );
    $('#social_security2').numeric();
    //the autotab seems to have this issue
    $('#social_security2').numeric( {
        ichars:"_ "
    } );
    $('#social_security3').numeric();
    //the autotab seems to have this issue
    $('#social_security3').numeric( {
        ichars:"_ "
    } );
    $('#aba').numeric();
    $('#aba').numeric( {
        ichars:"_ "
    } );
    $('#account_number').numeric();
    $('#account_number').numeric( {
        ichars:"_ "
    } );
    $('#bank_name').alphanumeric( {
        allow: "-.'& "
    } );
    $('#bank_name').alphanumeric( {
        ichars:"_"
    } );
    $('#bank_tel1').numeric();
    //the autotab seems to have this issue
    $('#bank_tel1').numeric( {
        ichars:"_ "
    } );
    $('#bank_tel2').numeric();
    //the autotab seems to have this issue
    $('#bank_tel2').numeric( {
        ichars:"_ "
    } );
    $('#bank_tel3').numeric();
    //the autotab seems to have this issue
    $('#bank_tel3').numeric( {
        ichars:"_ "
    } );
    
    $('#pay_date_form').numeric( {
        allow: "/"
    } );
    $('#employer_name').alphanumeric( {
        allow: "-&#%+,'. "
    } );
    $('#employer_name').alphanumeric( {
        ichars: "_"
    } );
    $('#phone_work1').numeric();
    //the autotab seems to have this issue
    $('#phone_work1').numeric( {
        ichars:"_ "
    } );
    $('#phone_work2').numeric();
    //the autotab seems to have this issue
    $('#phone_work2').numeric( {
        ichars:"_ "
    } );
    $('#phone_work3').numeric();
    //the autotab seems to have this issue
    $('#phone_work3').numeric( {
        ichars:"_ "
    } );
    $('#phone_home1').numeric();
    //the autotab seems to have this issue
    $('#phone_home1').numeric( {
        ichars:"_ "
    } );
    $('#phone_home2').numeric();
    //the autotab seems to have this issue
    $('#phone_home2').numeric( {
        ichars:"_ "
    } );
    $('#phone_home3').numeric();
    //the autotab seems to have this issue
    $('#phone_home3').numeric( {
        ichars:"_"
    } );
    
    $('#drivers_license').alphanumeric( {
        allow: "- "
    } );
    $('#drivers_license').alphanumeric( {
        ichars: "_"
    } );
    $('#employer_name').alphanumeric( {
        ichars: "_"
    } );
});
