function updateFees() {
    //zakladny poplatok
    $price = '35';
    
    $priceTextField = document.getElementsByName('price');
    $priceTextField = $priceTextField[0];

    $feesRadioGroup = document.getElementsByName('fees');
    
    if ($feesRadioGroup[0].checked) {
        $price = '98';
    }

    if ($feesRadioGroup[1].checked) {
        $price = '65';
    }

    $priceTextField.value = $price;
}

function showWork($work) {
    $workContainer = document.getElementById('b_work_'+$work);
    $workContainer.style.display = "block";

    if ($work > 1) {
        $removeLink = document.getElementById('hide_link_'+($work-1));
        $removeLink.style.display = 'none';
    }

    $addLink = document.getElementById('show_link_'+$work);
    $addLink.style.display = 'none';

    $cont_work = document.getElementsByName('cont_work_'+$work);
    $cont_work[0].value = 2;
}

function hideWork($work) {
    // hide container
    $workContainer = document.getElementById('b_work_'+$work);
    $workContainer.style.display = "none";

    //clear all fields
    $workTitle = document.getElementsByName('work_title_'+$work);
    $workTitle[0].value = '';

    $workDescription = document.getElementsByName('work_description_'+$work);
    $workDescription[0].value = '';

    $workType = document.getElementsByName('work_type_'+$work);
    for ($i = 0; $i < $workType.length; $i++) {
        $workType[$i].checked = false;
    }

    $area = document.getElementsByName('area_'+$work+'[]');
    for ($i = 0; $i < $area.length; $i++) {
        $area[$i].checked = false;
    }

    $specialNeeds = document.getElementsByName('special_needs_'+$work);
    $specialNeeds[0].value = '';

    //show links
    if ($work > 1) {
        $removeLink = document.getElementById('hide_link_'+($work-1));
        $removeLink.style.display = 'inline';
    }

    $addLink = document.getElementById('show_link_'+$work);
    $addLink.style.display = 'inline';

    $cont_work = document.getElementsByName('cont_work_'+$work);
    $cont_work[0].value = 1;
}
