/* javascript */
var Klub300 = {
	init: function() {
		Klub300.gallery.setup();
		Klub300.contact_form.setup();

        //$($.date_input.initialize);
	},
	gallery: {
		setup: function() {
			$('.gallery-large ul li').hide();
			$('.gallery-thumbs .thumbs ul li a').click(Klub300.gallery.thumb_click);
			$('.gallery-thumbs .thumbs ul li:first a').click();

			$('.just-gallery-thumbs .thumbs ul li a').click(Klub300.gallery.thumb_click);
			$('.just-gallery-thumbs .thumbs ul li:first a').click();
		},
		thumb_click: function() {
			var id = $(this).parent().attr('id').replace('small', 'large');
			$('.gallery-large ul li').hide();
			$('#'+id).show();   
		}
	},

  contact_form: {
    setup: function (){
      Klub300.contact_form.hide_items();
      $('.reservation .radio input').click(Klub300.contact_form.radio_click);
      $('.reservation .radio #reservation_activity_bowling').click();
      $('#reservation_date').datepick({dateFormat: 'dd.mm.yy', useThemeRoller: true});
    },
    radio_click: function(){
      var id = $(this).attr('id').replace('reservation_activity_', '');
      $('.reservation .non_general').show();
      if('general' == id){
        $('.reservation .non_general').hide();
      }
      Klub300.contact_form.hide_items();
      $('.reservation .'+id).show();
    },
    hide_items: function(){
      $('.reservation .bowling').hide();
      $('.reservation .restaurant').hide();
      $('.reservation .billiards').hide();
      $('.reservation .rent').hide();
    }
  }
};

$().ready(function() {
	if ($('.thumbs ul').length > 0) {
            $('.thumbs ul').imageSlider();
        }
	Klub300.init();
        $(".lightbox").lightbox({
            fitToScreen: true,
            imageClickClose: false,
            disableNavbarLinks: true
        });
});

$('#keyvisual_list').ready(function(){
	$('#keyvisual_list').vitlaj({appear: 'fadeIn', disappear: 'fadeOut', speed: 2000, wait: 5000,manual_switch:'.paging a'});
});