// Toggle Function
function toggle(obj) {
	if (obj.style.display == "none") {
		obj.style.display = "";
	} else {
		obj.style.display = "none";
	}
}



// Pop Up Image Window
// function PopupPic(sPicURL, sPicTitle) {
// 	window.open('image.html?'+sPicURL+'&'+sPicTitle, 'imagePopUp', 'resizable=1,width=20,height=20');
// }
function showImage(whichOne) {
	if (document.getElementById('sideImage')) {
		document.getElementById('sideImage').src = 'images/' + whichOne + '.jpg';
	}
}

function bb_set_date(){
	
	var today = new Date();
	var month = today.getMonth() + 1;
	var bb_dateFrom_day = document.getElementById("bb_dateFrom_day");
	var bb_dateFrom_month = document.getElementById("bb_dateFrom_month");
		try
  	{

	if(today.getDate()<10){
		bb_dateFrom_day.value = '0' + today.getDate();
	}else{
		bb_dateFrom_day.value = today.getDate();
	}

	if(month<10){
		month = '0' + month;
	}
	
	var value = today.getFullYear() + "-" + month;
	bb_dateFrom_month.value = value;
	}
	catch(err)
  	{
  	}
}

window.onload = bb_set_date;


// Banner-ad
$(document).ready(function() {
	
	if ($('#promo-ad').length > 0) {
		$('#promo-ad').css('display', 'block');
		$('#promo-ad').cycle({ 
	    	speed:       300, 
	    	timeout:     3000,  
	   		pagerEvent: 'mouseover', 
	    	pauseOnPagerHover: true  
		});
		
		$('#promo-ad').hover (
			function() { 
				$('#promo-ad').cycle('pause');
			}, 
			function() {
				$('#promo-ad').cycle('resume');
			}
		);	
		
	}
});

$(document).ready(function() {
	
	if ($('#gallery-images').length > 0) {
		$('#gallery-images').css('display', 'block');
		$('#gallery-images').cycle({ 
	    	speed:       300, 
	    	timeout:     3000, 
	    	pager:      '#gallery-pager', 
	   		pagerEvent: 'mouseover', 
	    	pauseOnPagerHover: true  
		});
		$('#gallery-pager').css('display', 'block');
		
		
		$('#gallery-images').hover (
			function() { 
				$('#gallery').cycle('pause');
			}, 
			function() {
				$('#gallery').cycle('resume');
			}
		);
	}
});


$(document).ready(function() {

$("#bb_submit").click(function() {
							   					   
var start_date = $("#bb_dateFrom_month").attr("value") + "-" +  $("#bb_dateFrom_day").attr("value");

$("#bb_dateFrom_month").attr("disabled", "disabled");
$("#bb_dateFrom_day").attr("disabled", "disabled");

$("#start_date").attr("value", start_date);

document.getElementById('bb_check_availability').submit();
							   });
});




