/**
 * @author his90
 */

function SendVForm(){
    var msgbox = 'AddStatus';
    var actionurl = siteurl + '/ajax.php?p=send_vform';
    var formbox = 'VForm';
    if ($('Name').value.length == 0 || $('Name').value.length < 4) {
        $('Name').focus();
        $('Name').style.backgroundColor = '#ffcc00';
        $('Name').style.border = '1px solid #f30';
        goTo('Name');
        return false;
    }
    else {
        $('Name').style.backgroundColor = '';
        $('Name').style.border = '';
    }//end if
    if ($('Amount').value.length == 0 || $('Amount').value.length < 1 || $('Amount').value == '0') {
        $('Amount').focus();
        $('Amount').style.backgroundColor = '#ffcc00';
        $('Amount').style.border = '1px solid #f30';
        goTo('Amount');
        return false;
    }
    else {
        $('Amount').style.backgroundColor = '';
        $('Amount').style.border = '';
    }//end if
    if ($('Agent').value.length == 0 || $('Agent').value.length < 2) {
        $('Agent').focus();
        $('Agent').style.backgroundColor = '#ffcc00';
        $('Agent').style.border = '1px solid #f30';
        goTo('Agent');
        return false;
    }
    else {
        $('Agent').style.backgroundColor = '';
        $('Agent').style.border = '';
    }//end if
    if ($('Tel').value.length == 0 && $('Cell').value.length == 0) {
        $('Tel').focus();
        $('Tel').style.backgroundColor = '#ffcc00';
        $('Tel').style.border = '1px solid #f30';
        goTo('Tel');
        return false;
    }
    else {
        $('Tel').style.backgroundColor = '';
        $('Tel').style.border = '';
    }//end if
	
	
	
    new Effect.Appear(msgbox);
    ajax = new Ajax.Updater(msgbox, actionurl, {
        method: 'post',
        parameters: Form.serialize(formbox),
        onComplete: function(){
            new Effect.Appear(msgbox);
        },
        asynchronous: true,
        evalScripts: true
    });
};

