$(document).ready(function(e){
	//bgslide
	$(function() {
		cbpBGSlideshow.init();
	});

	/*tabs
	//add active class to the first li
	$('.des-menu li:first').addClass('active');
		
	//hide all content classes.
	$('.content').hide();
	
	//show only first div content
	$('.content:first').show();
	
	//add the click function
	$('.des-menu li').click(function(){

		//remove active class from previous li
        $('.des-menu li').removeClass('active');

		//add active class to the active li.
        $(this).addClass('active');
		//hide all content classes
        $(".content").hide();
		
		//find the href attribute of the active tab
        var activeTab = $(this).find("a").attr("href");
		
		//fade in the content of active tab
		$(activeTab).fadeIn(1000);
        
		return false;
	});*/

	//menu main
	$('.load').on('click', function(e){
		e.preventDefault();
		var targetDiv = $($(this).attr('href'));
		if(!targetDiv.is(':visible')){
			$('.main-show').fadeOut(600);
			targetDiv.fadeIn();
		}else{
			$('.main-show').fadeOut(600);
		}
	});
	$('#main-destination, #cbp-bislideshow, .main-right').on('click', function(e){
				$('#main-destination').fadeOut(600);
			});
	$('#travel-style, #cbp-bislideshow, .main-right').on('click', function(e){
				$('#travel-style').fadeOut(600);
			});
	

	$('.close').on('click', function(){
		$('.main-show').fadeOut(600);
	});
	$('.b-close').on('click', function(){
		$('.high-ex').slideUp(600);
	});

	//high light
	$('.high').on('click', function(e){
		e.preventDefault();
		var targetDiv = $($(this).attr('href'));
		if(!targetDiv.is(':visible')){
			$('.high-ex').slideUp(600);
			targetDiv.slideDown();
		}else{
			$('.high-ex').slideUp(600);
		}
	});

	//scrolltop
	$(window).scroll(function(){
		if ($(this).scrollTop() > 100) {
			$('.scrollup').fadeIn();
			$('.b-down').fadeOut();
		} else {
			$('.scrollup').fadeOut();
			$('.b-down').fadeIn();
		}
	}); 

	

	$('.b-down').click(function(){
  	  $("html, body").animate({ scrollTop: $(window).height()}, 600);
  	  return false;
  	});

  	//slide show
  	$('#imageGallery').lightSlider({
      gallery:true,
      item:1,
      vertical:true,
      verticalHeight:295,
      vThumbWidth:50,
      thumbItem:7,
      thumbMargin:4,
      slideMargin:0,
      speed: 1000,
      auto:true,
      pause: 4000,
        loop:true
    }); 

    //tab 

    $('.toggl').on('click', function(e){
		e.preventDefault();
		var targetDiv = $($(this).attr('href'));
		if(!targetDiv.is(':visible')){
			$('.toggle-content').slideUp(600);
			targetDiv.slideDown(600);
		}else{
			$('.toggle-content').slideUp(600);
		}
	});

	//datepicker
	$('#datepicker-example7-start').Zebra_DatePicker({
	  direction: true,
	  pair: $('#datepicker-example7-end')
	});

	$('#datepicker-example7-end').Zebra_DatePicker({
	  direction: 1
	});
	$('#datepicker-example11').Zebra_DatePicker({
    format: 'm Y'   //  note that because there's no day in the format
                    //  users will not be able to select a day!
	});
	$('#show-arrival').hide();
	$('#pickup').change(function(){
		if($('#pickup').val()=='1'){
			$('#show-arrival').slideToggle();
		}else{
			$('#show-arrival').slideToggle();
		}
	});

});


