function initTabs() {
	$(".tab_content").hide(); //Hide all content
	if(location.hash != "") {
		var target = location.hash.split("#")[1]
		$(location.hash).show(); //Show first tab content
		$("ul.tabs li:has(a[href=#"+target+"])").addClass("active").show();
	} else {
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content
	}
	
	//On Click Event
	$("ul.tabs li").click(function(e) {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		e.preventDefault();
	});
}

		//page peel corner
		$("#pageflip").hover(function() {
		$("#pageflip img , .msg_block").stop()
			.animate({
				width: '188px', 
				height: '200px'
			}, 500); 
		} , function() {
		$("#pageflip img").stop() 
			.animate({
				width: '126px', 
				height: '133px'
			}, 220);
		$(".msg_block").stop() 
			.animate({
				width: '125px', 
				height: '127px'
			}, 200);
		});


$(document).ready(function() {
   //$('#slideshow').jqFancyTransitions({ effect: 'curtain', width: 820, height: 234 });
});

$(window).load(function() {
	initTabs();
	$('.tblrates tr:odd, .tblrates2 tr:odd').addClass('odd');
	$("#contentwrap-inner").hide().fadeIn(1000);
	$("#slideshow").nivoSlider({
		effect:'fade',
		pauseTime:4000,
		directionNav:false,
		controlNav:false
	});
	
	//date picker for reservation
	$('#arrivaldate').DatePicker({
		mode: 'single',
		format:'d-m-Y',
		date: $('#arrivaldate').val(),
		current: $('#arrivaldate').val(),
		starts: 1,
		position: 'r',
		onChange: function(formated, dates){
			$('#arrivaldate').val(formated);
			$('#arrivaldate').DatePickerHide();
		}
	});
	$('#departuredate').DatePicker({
		mode: 'single',
		format:'d-m-Y',
		date: $('#departuredate').val(),
		current: $('#departuredate').val(),
		starts: 1,
		position: 'r',
		onChange: function(formated, dates){
			$('#departuredate').val(formated);
			$('#departuredate').DatePickerHide();
		}
	});
});


