/* 
 * Reizen.php en html
 */

jQuery(document).ready(function(){
    //style tabel
    jQuery('.striped tr:even').css('background', '#dedede');
    jQuery('.striped tr:odd').css('background', '#ffffff');
    
    //reizen tabs
    jQuery('#reiscontent').children().hide();
    jQuery('#reiscontent').children('div').first().show();
    
    jQuery('.submenureizen li a').click(function(e){
        var name = jQuery(this).parent().attr('class');
        jQuery('#reiscontent').children().hide();
        jQuery('#' + name).show();
        e.preventDefault();
        return false;
    });
    //als er via php $smarty->assign('showBoekenTab', true); wordt meegegeven
    if(jQuery('#reiscontent').children('#showBoekenTab').size() > 0){
        //console.log('test');
        jQuery('.reisboeken a').trigger('click');
    }
    
    //boeking form aanpassen als het aantal kamers is ingesteld
    jQuery('#kamerselect').find('input[type=submit]').remove();
    jQuery('#kamerselect').find('select').change(function(){
        jQuery('#kamerselect').submit();
    });
    
    //links op titels van de hotels
    jQuery('.infoLink').each(function(){
        jQuery(this).parent().prevAll('h4:first').hover(function(){
            jQuery(this).css('cursor', 'pointer');
        });
        var _this = jQuery(this);
        jQuery(this).parent().prevAll('h4:first').click(function(){
            document.location.href = _this.attr('href');
        });
    });
    
    jQuery('#reisaanpassen').click(function(){
        jQuery('#reisbevestigaction').attr('value', 'aanpassen');
    });
    
    //geboortedata van de medepassagiers
    /*jQuery('.geb_dat').not(':first').hide();
    jQuery('.geb_dat').each(function(){
        jQuery(this).children(':last').append(' <a href="#" class="date_add">Voeg nog een geboortedatum toe.</a>')
        if(jQuery(this).find('.inputbox25').val() != ''){
            jQuery(this).show();
            jQuery(this).prev().find('.date_add').remove();
        }
    });
    jQuery('.date_add').click(function(e){
        jQuery(this).parent().parent().next().show();
        jQuery(this).remove();
        e.preventDefault();
        return false;
    });*/
});

