function book(site){

	if(site == 1){

		date_d_dep = $('#dep1 div:first-child').html();
		montextd = $('#dep1 div:first-child').next().html();
		date_y_dep = $('#dep1 div:first-child').next().next().html();
		
		date_d = $('#arr1 div:first-child').html();
		montext = $('#arr1 div:first-child').next().html();
		date_y = $('#arr1 div:first-child').next().next().html();
	
		if(montext == 'January') date_m = '01';
		if(montext == 'February') date_m = '02';
		if(montext == 'March') date_m = '03';
		if(montext == 'April') date_m = '04';
		if(montext == 'May') date_m = '05';
		if(montext == 'June') date_m = '06';
		if(montext == 'July') date_m = '07';
		if(montext == 'August') date_m = '08';
		if(montext == 'September') date_m = '09';
		if(montext == 'October') date_m = '10';
		if(montext == 'November') date_m = '11';
		if(montext == 'December') date_m = '12';
		
		if(montextd == 'January') date_m_dep = '01';
		if(montextd == 'February') date_m_dep = '02';
		if(montextd == 'March') date_m_dep = '03';
		if(montextd == 'April') date_m_dep = '04';
		if(montextd == 'May') date_m_dep = '05';
		if(montextd == 'June') date_m_dep = '06';
		if(montextd == 'July') date_m_dep = '07';
		if(montextd == 'August') date_m_dep = '08';
		if(montextd == 'September') date_m_dep = '09';
		if(montextd == 'October') date_m_dep = '10';
		if(montextd == 'November') date_m_dep = '11';
		if(montextd == 'December') date_m_dep = '12';
		
		
		//alert(date_d +'|'+ date_m +'|'+ date_y);
		//alert(date_d_dep +'|'+ date_m_dep +'|'+ date_y_dep);
		
		
		arr = date_d + '/' + date_m + '/' + date_y;
		dep = date_d_dep + '/' + date_m_dep + '/' + date_y_dep;

		window.open('https://gc.synxis.com/?Hotel=16164&Chain=5375&locale=de&arrive=' + arr + '&depart=' + dep);
		
	} else {
	
		date_d_dep = $('#dep5 div:first-child').html();
		montextd = $('#dep5 div:first-child').next().html();
		date_y_dep = $('#dep5 div:first-child').next().next().html();
		
		date_d = $('#arr5 div:first-child').html();
		montext = $('#arr5 div:first-child').next().html();
		date_y = $('#arr5 div:first-child').next().next().html();
	
		if(montext == 'January') date_m = '01';
		if(montext == 'February') date_m = '02';
		if(montext == 'March') date_m = '03';
		if(montext == 'April') date_m = '04';
		if(montext == 'May') date_m = '05';
		if(montext == 'June') date_m = '06';
		if(montext == 'July') date_m = '07';
		if(montext == 'August') date_m = '08';
		if(montext == 'September') date_m = '09';
		if(montext == 'October') date_m = '10';
		if(montext == 'November') date_m = '11';
		if(montext == 'December') date_m = '12';
		
		if(montextd == 'January') date_m_dep = '01';
		if(montextd == 'February') date_m_dep = '02';
		if(montextd == 'March') date_m_dep = '03';
		if(montextd == 'April') date_m_dep = '04';
		if(montextd == 'May') date_m_dep = '05';
		if(montextd == 'June') date_m_dep = '06';
		if(montextd == 'July') date_m_dep = '07';
		if(montextd == 'August') date_m_dep = '08';
		if(montextd == 'September') date_m_dep = '09';
		if(montextd == 'October') date_m_dep = '10';
		if(montextd == 'November') date_m_dep = '11';
		if(montextd == 'December') date_m_dep = '12';
		
		
		//alert(date_d +'|'+ date_m +'|'+ date_y);
		//alert(date_d_dep +'|'+ date_m_dep +'|'+ date_y_dep);
		
		
		arr = date_d + '/' + date_m + '/' + date_y;
		dep = date_d_dep + '/' + date_m_dep + '/' + date_y_dep;

		window.open('https://gc.synxis.com/?Hotel=16164&Chain=5375&locale=de&arrive=' + arr + '&depart=' + dep);
	}

	

}


function changeDate(site, state){
	
	if(site == 1 && state == 'arr'){
		$('#arr1 div:first-child').html($('#day_arr1').val().substring(0,2));
		$('#arr1 div:first-child').next().html($('#day_arr1').val().substring(0,$('#day_arr1').val().length-5).substring(3));
		$('#arr1 div:first-child').next().next().html($('#day_arr1').val().substr($('#day_arr1').val().length - 4, 4));
	}
	
	if(site == 1 && state == 'dep'){
		$('#dep1 div:first-child').html($('#day_dep1').val().substring(0,2));
		$('#dep1 div:first-child').next().html($('#day_dep1').val().substring(0,$('#day_dep1').val().length-5).substring(3));
		$('#dep1 div:first-child').next().next().html($('#day_dep1').val().substr($('#day_dep1').val().length - 4, 4));
	}
	
	if(site == 5 && state == 'arr'){
		$('#arr5 div:first-child').html($('#day_arr5').val().substring(0,2));
		$('#arr5 div:first-child').next().html($('#day_arr5').val().substring(0,$('#day_arr5').val().length-5).substring(3));
		$('#arr5 div:first-child').next().next().html($('#day_arr5').val().substr($('#day_arr5').val().length - 4, 4));
	}
	
	if(site == 5 && state == 'dep'){
		$('#dep5 div:first-child').html($('#day_dep5').val().substring(0,2));
		$('#dep5 div:first-child').next().html($('#day_dep5').val().substring(0,$('#day_dep5').val().length-5).substring(3));
		$('#dep5 div:first-child').next().next().html($('#day_dep5').val().substr($('#day_dep5').val().length - 4, 4));
	}
	
}
