function register()
{
    if( xGetElementById('company-name').value == '' )
    {
        alert("Please specify company name");
        xGetElementById('company-name').focus();
        return;
    }
    
    if( xGetElementById('company-email').value == '' )
    {
        alert("Please specify company email address");
        xGetElementById('company-email').focus();
        return;
    }
    else
    if( !isEmail(xGetElementById('company-email').value) )
    {
        alert("Invalid email address format!");
        xGetElementById('company-email').focus();
        return;
    }
    
    if( xGetElementById('login-password').value == '' )
    {
        alert("Please specify password");
        xGetElementById('login-password').focus();
        return;
    }
    
    if( xGetElementById('login-password-confirm').value == '' )
    {
        alert("Please specify password confirm");
        xGetElementById('login-password-confirm').focus();
        return;
    }
    
    if( xGetElementById('login-password').value != xGetElementById('login-password-confirm').value )
    {
        alert("Password and Password Confirm do not match!");
        xGetElementById('login-password').focus();
        return;
    }
    
    if( xGetElementById('company-email-confirm').value == '' )
    {
        alert("Please specify company email address confirm");
        xGetElementById('company-email-confirm').focus();
        return;
    }
    
    if( xGetElementById('company-email').value != xGetElementById('company-email-confirm').value )
    {
        alert("Sorry, email addresses do not match!");
        xGetElementById('company-email-confirm').focus();
        return;
    }
    
    if( xGetElementById('company-phone').value == '' )
    {
        alert("Please specify company phone number");
        xGetElementById('company-phone').focus();
        return;
    }
    
    if( xGetElementById('postal-address-1').value == '' )
    {
        alert("Please specify company address");
        xGetElementById('postal-address-1').focus();
        return;
    }
    
    xGetElementById('exec').value = 'register';
    
    var form = xGetElementById('registerForm');
    form.method = 'POST';
    form.submit();
}
