function rTd(th){
    return th.parent().next().find('td');
}
function cnfImg(){
    var parentTag = $('#confTable .active').get(0);
    if(parentTag){
        var cls = parentTag.className.replace('tmava ','').replace(' active','');
        $('#confRight p.'+cls).show();
    }
}
$(document).ready(function() {
    $("#roomsTable td").hide();
    $("#roomsTable td.space").show();
    rTd($('#roomsTable th.active')).show();
    $("#roomsTable th").click(
        function(){
            rTd($('#roomsTable th.active')).removeClass('active').hide();
            $('#roomsTable th.active').removeClass('active');
            $(this).addClass('active');
            rTd($(this)).addClass('active').show();
        }
        );
    $('#gallery a,a.showImage').lightBox({
        overlayOpacity: 0.6,
        imageLoading: '/images/lightbox-ico-loading.gif',
        imageBtnClose: '/images/lightbox-btn-close.gif',
        imageBtnPrev: '/images/lightbox-btn-next.gif',
        imageBtnNext: '/images/lightbox-btn-next.gif',
        containerResizeSpeed: 350
    });
    $("#confRight p").hide();
    cnfImg();
    $("#confTable th").mouseover(function(){
        $("#confRight p").hide();
        $('#confTable .active').removeClass('active');
        var parentTag = $(this).parent().get(0);
        var cls = parentTag.className.replace('tmava ','');
        $(this).parent().addClass('active');
        $('#confRight p.'+cls).show();
    });
    $('#gMap').hide();
    $('#showMap').click(function(){
        $('#gMap').toggle();
        $('#gMap').html('<iframe width="485" scrolling="no" height="480" frameborder="0" align="center" src="http://www.bookassist.com/conduit/bookassist.do?action=map&amp;hotel_id=1507&amp;service_model=2&amp;guide_id=802&amp;ca=center&amp;dw=485&amp;cb=FEF5D8&amp;tabs=no&amp;bp='+escape(top.location.href)+'"></iframe>');
        return false;
    });
    $(".fTime input").clockpick(
    {
        useBgiframe: true,
        military: true
    });
    $(".fDate input").datepicker({
        dateFormat: 'dd. mm. yy'
    });

});
