function age_changed()
{
    $('junior').setStyle('display','none');
    $('commercial').setStyle('display','none');
    $('screen').setStyle('display','none');
    $('presenter').setStyle('display','none');
//    $('professional').setStyle('display','none');
    var age = parseInt($('age_id').value);
    if (age >= 3 && age < 8)
    {
        $('junior').setStyle('display','');        
    }
    if (age >= 8)
    {
        $('commercial').setStyle('display','');
        $('screen').setStyle('display','');
    }
    if (age >= 16)
    {
        $('presenter').setStyle('display','');
  //      $('professional').setStyle('display','');
    }
}

function calculate_total()
{
    var total = 0;
    if ($('seeking_1').checked) total += 57.2;    
    if ($('seeking_2').checked) total += 57.2;
    if ($('seeking_3').checked) total += 57.2;
    if ($('seeking_4').checked) total += 57.2;

    if ($('talent_1').checked) total += 220;    
    if ($('talent_2').checked) total += 220;
    if ($('talent_3').checked) total += 220;
    if ($('talent_4').checked) total += 220;    

    $('overall_total').innerHTML = '<h2>$'+total.toFixed(2)+'</h2>';
    $('payment_amount_id').value = total;
}

function calculate_age()
{
    var age = '';
    var birth_year = $('year_of_birth_id').value;
    if (birth_year != '' && birth_year > 1900)
    {
        age = date_for_age_year - birth_year;
    }

    var birth_month = $('birthday_month_id').value;
    if (birth_month != '')
    {
        if (birth_month > parseInt(date_for_age_month)) age--;
        if (birth_month == parseInt(date_for_age_month))
        {
            var birth_day = $('birthday_day_id').value;
            if (birth_day != '')
            {
                if (birth_day > parseInt(date_for_age_day)) age--;
            }
        }
    }

    if (age != '')
    {
        $('age_id').value = age;
        age_changed();
    }
}

function copy_names()
{
    if ($('as_above').checked)
    {
        $('submitting_name_id').value = $('entrants_name_id').value;
        $('submitting_last_name_id').value = $('entrants_last_name_id').value;
        $('entrants_relationship_id').value = 'self';
    }
}

function representation_changed()
{
    if ($('representation_id').value == 'No') $('agency_name_row').setStyle('display','');
    else $('agency_name_row').setStyle('display','none');
}