$(document).ready(function() {
     
	 $('a#scroll').smoothScroll({
        afterScroll: function() {
          /* location.hash = this.hash; */
        }
      });
	  
	  //$('#datepicker').datepicker({ beforeShowDay: noWeekendsOrHolidays, minDate: new Date, minDate: "+1"});
	  $("#datepicker1").datepicker({
                showAnim: 'drop',
                showOn: 'both',
				dateFormat: "yy-mm-dd",
				minDate: new Date, minDate: "+1",
                buttonImage: '_img/icons/calendar.png',
                buttonImageOnly: true
		});

		$("#datepicker2").datepicker({
                showAnim: 'drop',
                showOn: 'both',
				dateFormat: "yy-mm-dd",
				minDate: new Date, minDate: "+1",
                buttonImage: '_img/icons/calendar.png',
                buttonImageOnly: true
		});

	  
	  $("#accordion").accordion({ header: "h2" });
	 // $('#datepicker').datepicker({ beforeShowDay: noWeekendsOrHolidays, minDate: new Date, minDate: "+1"});
	  $('#tabs2').tabs();


	  $('.subhead ul li a').smoothScroll();
	  $('h3 a#scroll').smoothScroll();
	  
	  $("#content-all-wrap #main-col").hide();
	  $("#content-all-wrap #main-col").fadeIn('slow');
	  
	  $("#akamai #side-col").hide();
	  $("#akamai #side-col").slideDown('slow');


		
	
	$("#nav-services-pop").hide();
	$("#nav-services-pop").slideDown();
	// Tabs
				$('#tabs').tabs();
	

	//how to book mechanism
	
	$('#x-close').click(function () {
		//$('#top-message').hide();
		$('#top-message').fadeThenSlideToggle('500');
		$('.top-element').fadeThenSlideToggle('500');
		//$('.align #book-alert').show();
	});
	
	$('#fadein').hide();
	$('#kiroku').hide();
	$('#bookbook').click(function () {
		$('#mybooking').fadeIn();
		$('#header').animate({
			opacity: 0.8,
			top: '-=60',
		}, 100, function() {
		// Animation complete.
		});
		$('#content-all-wrap, #thefooter, .affiliations').animate({
			opacity: 0.4,
			top: '+=10',
		}, 100, function() {
		// Animation complete.
		});
		$('a#logo').hide();
		$('#fadein').fadeIn('50');
		$('#kiroku').show();
	});
	
	$('#fadein').hide();
	$('#kiroku').hide();
	$('a.editinfo').click(function () {
		$('#mybooking').fadeIn();
		$('#header').animate({
			opacity: 0.8,
			top: '-=60',
		}, 100, function() {
		// Animation complete.
		});
		$('#content-all-wrap, #thefooter, .affiliations').animate({
			opacity: 0.4,
			top: '+=10',
		}, 100, function() {
		// Animation complete.
		});
		$('a#logo').hide();
		$('#fadein').fadeIn('50');
		$('#kiroku').show();
	});
		
		
		
	
	
	$('#mybooking a.close').click(function () {
		$('#mybooking').hide();
		$('#header').animate({
			opacity: 1,
			top: '0',
		}, 100, function() {
		// Animation complete.
		});
		$('#content-all-wrap, #thefooter, .affiliations').animate({
			opacity: 1,
			top: '0',
		}, 100, function() {
		// Animation complete.
		});
		$('a#logo').show();
		$('#fadein').hide();
		$('#kiroku').hide();
	});
	
	/*photogallery*/
	
	$('#capt').cycle({ 
			fx:     'fade', 
			timeout: 200

		});
		
		
		
	$('#slideshow2 img:first').fadeIn(1000, function() {
        //$('#slideshow').cycle('fast');
		$('#slideshow2').cycle({ 
			fx:     'scrollHorz', 
			timeout: 5000
		});
    });

	
	/*featurelist*/
	$.featureList(
				$("#tabs li a"),
				$("#output li"), {
					start_item	:	0,
					transition_interval : 4000
				}
			);

			/*
			
			// Alternative

			
			$('#tabs li a').featureList({
				output			:	'#output li',
				start_item		:	1
			});

			*/
	/*transitions*/
	$('#slideshowHolder').jqFancyTransitions({ width: 498, height: 218 });

	/*prettyphoto*/
	$("a[rel^='prettyPhoto']").prettyPhoto();

	
	/*toggle*/
	$('#toggle-view li').click(function () {

		var text = $(this).children('p');

		if (text.is(':hidden')) {
			text.slideDown('200');
			$(this).children('span').html('-');		
		} else {
			text.slideUp('200');
			$(this).children('span').html('+');		
		}
		
	});


});