$(document).ready(function () {	
	//Tab Events
	$(".tab_content").hide(); //Hide all content
	$("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() {
		$("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
		return false;
	});
	
});


// Goto URl Function- drop down on chnage
function dropDownURL(fieldname,rootURL){
	var dropdown = document.getElementById(fieldname);
	function onCatChange() {				
		location.href = rootURL + "/?" + dropdown.options[dropdown.selectedIndex].value;
		
	}
	dropdown.onchange = onCatChange;
}

//Book now Date Piccker
$(function() {
	$( "#start_date" ).datepicker();
	$( "#end_date" ).datepicker();
});

function bookNow_make_blank(){
	if(document.getElementById("start_date").value == "Planned start date"){
		document.getElementById("start_date").value = "";
	}
	
}

function bookNowEnd_make_blank(){		
	if(document.getElementById("end_date").value == "Planned end date"){
		document.getElementById("end_date").value = "";
	}
}

function bookNow_make_bck(){
	if(document.getElementById("booknow_date").value == ""){
		document.getElementById("booknow_date").value = "Planned start date";
	}
	
}

function bookNowEnd_make_bck(){	
	if(document.getElementById("end_date").value == ""){
		document.getElementById("end_date").value = "Planned end date";
	}
}

/// Only Number function
function isNumberKey(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57))
	return false;

 return true;
}


