function validateAndSumbitHMSQuickSearch(){
	if (document.getElementById('datepicker').value == "" ){
        alert ( "Please select an arrival date" );
        valid = false;
    }
	else if (document.getElementById('datepicker2').value == "" ){
        alert ( "Please select a departure date" );
        valid = false;
    }
	else if (document.getElementById('datepicker').value.value ==document.getElementById('datepicker2').value){
        alert ( "The departure date can not be equal to the arrival date" );
        valid = false;
    }
	else if (document.getElementById('villa_group_type').value == "" ){
        alert ( "Please select a villa type" );
        valid = false;
    }
	else{
		document.getElementById('searchform').submit();
	}
}

function validateAndSumbitVMSQuickSearch(){
	if (document.getElementById('datepicker').value == "" ){
        alert ( "Please select an arrival date" );
        valid = false;
    }
	else if (document.getElementById('datepicker2').value == "" ){
        alert ( "Please select a departure date" );
        valid = false;
    }
	else if (document.getElementById('datepicker').value.value ==document.getElementById('datepicker2').value){
        alert ( "The departure date can not be equal to the arrival date" );
        valid = false;
    }
	else if (document.getElementById('car_group_type').value == "" ){
        alert ( "Please select a vehicle type" );
        valid = false;
    }
	else{
		document.getElementById('searchform').submit();
	}
}

jQuery(document).ready(function() {
	if (jQuery('ul#villaSpecsTabs').length) {
		//When page loads...
		
		jQuery(".tab_content").hide(); //Hide all content
		jQuery("ul#villaSpecsTabs li:first").addClass("active").show(); //Activate first tab
		jQuery(".tab_content:first").show(); //Show first tab content
	
		//On Click Event
		jQuery("ul#villaSpecsTabs li").click(function() {
	
			jQuery("ul#villaSpecsTabs li").removeClass("active"); //Remove any "active" class
			jQuery(this).addClass("active"); //Add "active" class to selected tab
			jQuery(".tab_content").hide(); //Hide all tab content
	
			var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
			jQuery(activeTab).fadeIn(); //Fade in the active ID content
			return false;
		});
	}
});
