function showHideBooking(id){
	
	if(id!='rooms')
		$('#listrooms').hide();
	if(id!='adults')
		$('#listadults').hide();
	if(id!='children')
		$('#listchildren').hide();
	
	if($('#list'+id).css('display') =='none' ){
		$('#list'+id).show();
	}
	else{
		$('#list'+id).hide();
	}
}

function bookingUlValue(divid,value){
	$('#'+divid).html(value);
	var input = 'input'+divid;
	$('#'+input).val(value);
}

function hidelist(id){
	$('#'+id).hide();
}
function coordinate(id,value){
	if(id=='listarea'){
	$.ajax({
	  type: "GET",
	  url: "/booking/coordinate.php?value="+value,
	  success: function(response){
	  	bookingUlValue('property','');
	  	$('#'+'listproperty').html(response)
	 	 }
	 	});
	}
	if(id=='listproperty'){
		if(value=='DANAT RESORT JEBEL DHANNA'){
			$('#'+'area').html('JEBEL DHANNA')
		}
		if(value=='LIWA HOTEL'){
			$('#'+'area').html('LIWA')
		}
		if(value=='DHAFRA BEACH HOTEL'){
			$('#'+'area').html('JEBEL DHANNA')
		}
		if(value=='MIRFA HOTEL'){
			$('#'+'area').html('MIRFA')
		}
		if(value=='AL RAHA BEACH HOTEL'){
			$('#'+'area').html('ABU DHABI')
		}
	}

}

function displaytime(){
	var enddate = $('#checkOut').val();
	var startdate = $('#checkIn').val();

$.ajax({
	  type: "GET",
	  url: "/booking/datediff.php?startdate="+startdate+"&enddate="+enddate,
	  success: function(response){
	  	$('#'+'nights').val(response)
	 	 }
	 	});	
}
function displaytimeproperty(){
	var endpropertydate = $('#checkOut2').val();
	var startpropertydate = $('#checkIn1').val();
	
	$.ajax({
	  type: "GET",
	  url: "/booking/datediff.php?startdate="+startpropertydate+"&enddate="+endpropertydate,
	  success: function(response){
	  	$('#'+'nights1').val(response)
	 	 }
	 	});	
	
}

function changeAction(act){
	if(act ==1){
		document.bookingform.action='/booking/booknow.php';
	}
	if(act==0){
		document.bookingform.action='/booking/cancelnow.php';
	}
}

function changeActionProperty(act){
	
	if(act ==1){
		document.propertybooking.action='/properties/bookingapply.php';
	}
	if(act==0){
		document.propertybooking.action='/properties/cancelapply.php';
	}
}