var fields = new Array();
fields.push(new Array("txt","#first_name","Please enter your first name"));
fields.push(new Array("txt","#last_name","Please enter your last name"));
fields.push(new Array("mail","#email_address_c","Please enter a correct email"));
fields.push(new Array("mail2","#email_address_c","Please enter the same adresse"));
fields.push(new Array('txt','#phone_home','Please enter your phone number'));
fields.push(new Array('txt','#country_c','Please enter your country'));
fields.push(new Array('txt','#product_c','Please select a product'));
fields.push(new Array('txt','#destination_c','Please select a destination'));
fields.push(new Array('txt','#arrival_c','Please enter an arrival date'));
fields.push(new Array('txt','#departure_c','Please enter an departure date'));
fields.push(new Array('txt','#adults_c','Please enter the number of adults'));
fields.push(new Array('#type_of_group_c','Please select you type of group'));

$(document).ready(function(){
	$('#arrival_c').datepicker({
		dateFormat: 'dd-mm-yy',
		firstDay: 1 ,
		constrainInput: true,
		showOn: 'both',
		buttonImage: '/images/calendar.png',
		buttonImageOnly: true
	});
	$('#departure_c').datepicker({
		dateFormat: 'dd-mm-yy',
		firstDay: 1,
		constrainInput: true,
		showOn: 'both',
		buttonImage: '/images/calendar.png',
		buttonImageOnly: true
	});
	$('#arrival_c').change( function() {
		$('#departure_c').datepicker('setDate' , new Date($('#arrival_c').datepicker( 'getDate' ).getTime() + 86400000));
	});
	
	$('#product_c').change(function(){

		switch($('#product_c').val()){
		
			case "hotel_ticket":
				$('#Apartment').hide();
				$('#locTicketHotel').show();
				$('#locHotel').hide();
				$('#hotelOptions').show();
			break;
			
			case "hotel":
				$('#Apartment').hide();
				$('#locTicketHotel').hide();
				$('#locHotel').show();
				$('#hotelOptions').show();
			break;
				
			case "apartment":
				$('#Apartment').show();
				$('#locTicketHotel').hide();
				$('#hotelOptions').hide();
				$('#locHotel').hide();
				$('#hotel').hide();
				$('#a1_c').val(0);
				$('#c1_c').val(0);
				$('#cage1_c').val("");
				$('#a2_c').val(0);
				$('#c2_c').val(0);
				$('#cage2_c').val("");
			break;
			
			case "ticket":
				$('#Apartment').hide();
				$('#locTicketHotel').hide();
				$('#hotelOptions').hide();
				$('#locHotel').hide();
				$('#hotel').hide();
				$('#a1_c').val(0);
				$('#c1_c').val(0);
				$('#cage1_c').val("");
				$('#a2_c').val(0);
				$('#c2_c').val(0);
				$('#cage2_c').val("");
			break;
			default:
				$('#Apartment').hide();
				$('#hotelOptions').hide();
				$('#hotel').hide();
				$('#locTicketHotel').hide();
				break;
		}
		
	});
});

