function show_error(message){
    alert(message);
}
function check_form(){     
    tbodies = $('signup_holder').getElementsByTagName('TBODY')
    for(var i=0; i < tbodies.length; i++)
        tbodies[i].className = '';
    if($('horse_name')){
        if($('horse_name') && $F('horse_name') == ''){
            show_error(signup_errors.short_horse);
            $('horse_name').focus();
            return false;
        }
        if($('horse_breed').selectedIndex == 0){
            show_error(signup_errors.no_breed);
            $('horse_breed').focus();
            return false;
        }                        
        return true;
    }else {
    
        if($('user_login') && $F('user_login').length < 3){            
            show_error(signup_errors.short_login);
            $('user_login').focus();
            return false;
        }
        
        if($('user_password') && $F('user_password').length < 7){            
            show_error(signup_errors.short_password);
            $('user_password').focus();
            return false;
        }
        
        if($('user_password') && ( $F('user_password') != $F('password_confirmation') )){
            show_error(signup_errors.password_mismatch);
            $('user_password').focus();
            return false;
        }
    
        if($('user_email') && $F('user_email').length < 4){
            show_error(signup_errors.short_email);
            $('user_email').focus();
            return false;
        }
    
        if($('user_country') && $('user_country').selectedIndex == 0){
            show_error(signup_errors.invalid_country)
            $('user_country').focus();
            return false
        }
            
           
        if($('user_date_of_birth_1i').selectedIndex == 0){
            show_error(signup_errors.invalid_year)
            $('user_date_of_birth_1i').focus();
            return false
        }
        if($('user_date_of_birth_2i').selectedIndex == 0){
            show_error(signup_errors.invalid_month)
            $('user_date_of_birth_2i').focus();
            return false
        }
        if($('user_date_of_birth_3i').selectedIndex == 0){
            show_error(signup_errors.invalid_day)
            $('user_date_of_birth_3i').focus();
            return false
        }
    }
    return true;
}