function ie_fix()
{
	var check_form = function(check_array)
    {
        if(!LiveValidation.massValidate(check_array))
        {
            return false;
        }
        return true;
    }
    //live validation code
    var first_name = new LiveValidation('first_name');
    var last_name = new LiveValidation('last_name');
    var phone = new LiveValidation('phone');
    var email = new LiveValidation('email');

    first_name.add(Validate.Presence, {failureMessage: ' '});
    last_name.add(Validate.Presence, {failureMessage: ' '});
    phone.add(Validate.Presence, {failureMessage: ' '});
    email.add(Validate.Presence, {failureMessage: ' '});
    email.add(Validate.Email);

    var inital_validation = new Array(first_name, last_name, phone, email);
    //check_form(inital_validation);

    $('#reward_request').submit(function(event)
    {
        if(!check_form(inital_validation))
        {
            event.preventDefault();
            var missing = '';

            $('#reward_request input[@type!=submit]').each(function()
            {
                if($(this).text() == '' && $(this).attr('name') != 'process' && $(this).attr('name') != 'customer_ids[]')
                {
                    var temp = $(this).attr('name');
                    temp.replace('_', ' ');//not working
                    missing += "\n" + temp;
                }
            });

            alert('Fill All Required Fields' + missing);
        }
        else
        {
            $('#reward_request').submit();
        }
    });


    $('td a.reward').each(function()
    {
        $(this).cluetip({local: true});
    });

    //add the customer ids section to the form

    $('#customer_ids').click(function()
    {
        //get the parent element to append to
        var parent_td = $('#customer_ids').parent()
        var html = 'Add Customer ID: <input type="text" name="customer_ids[]" />';

        $(parent_td).append(html);

        //let give focus to the newly added input box
        $('input:last').focus();
    });

    //enable submit when all required field filled correctly
    $('#reward_request input[@type!=submit]').each(function()
    {
        $(this).keyup(function()
        {
            check_form(inital_validation);
        });

        $(this).change(function()
        {
            check_form(inital_validation);
        });
    });
};

$(document).ready(function()
{
    setTimeout('ie_fix()', 5000);
});
