
var FormElements = new Array('contact_message', 'contact_name', 'contact_email', 'contact_country' );

function disableSubmit()
{
    // disables the submit button
    //document.getElementById( 'contact_submit' ).disabled = true;
}

function checkForm()
{
    // we've got a few controls to look at
    
    var element;
    var success = true;
    
    for ( element in FormElements )
    {
        if ( document.getElementById( FormElements[element] ) )
        {
            if ( document.getElementById( FormElements[element] ).value.length < 2 )
            {
                success = false;
                document.getElementById( FormElements[element] ).style.background="yellow";
            }
        }
        else
            alert( FormElements[element] + ' has no properties!' );
    }
    
    if ( success == false )
        alert( "Please fill out the entire form.  Thanks!" );
    
    return success;
}