$(document).ready(function() {
    setTimeout('submitForm();', 5000);
});

var iCount = 1;

function submitForm()
{
    var sSend      = $('#diabetes').val();
    var sInsurance = $('#insurance').val();
    var sFirst     = $('#firstname').val();
    var sLast      = $('#lastname').val();
    var sAddress   = $('#address').val();
    var sAddress2  = $('#address2').val();
    var sEmail     = $('#Email').val();
    var sCity      = $('#city').val();
    var sState     = $('#state').val();
    var sZip       = $('#zip').val();
    var sPhone1    = $('#phone1').val();
    var sPhone2    = $('#phone2').val();
    var sPhone3    = $('#phone3').val();
    var sBestTime  = $('#besttime').val();
    
    if
    (
        sFirst.length > 0 &&
        sPhone1.length > 0 &&
        sPhone2.length > 0 &&
        sPhone3.length > 0 &&
        iCount <= 20
    )
    {
        $.post
        (
            'processforma.php',
            {
                form_id   : FORM_ID,
                complete  : 'N',
                firstname : sFirst,
                lastname  : sLast,
                address   : sAddress,
                address2  : sAddress2,
                city      : sCity,
                state     : sState,
                zip       : sZip,
                phone1    : sPhone1,
                phone2    : sPhone2,
                phone3    : sPhone3,
                besttime  : sBestTime,
                email     : sEmail,
                Medicare  : '',
                Diabetes  : sSend,
                mobility  : '',
                hearing   : '',
                insurance : sInsurance,
            }
        );
        ++iCount;
    }
    
    setTimeout('submitForm();', 5000); 
}
