function bookingFormInitJS() {
	$('#contactRequest').bind("change", function() {
  		showOrHideOnSelect(this,1,'.munich');
  		showOrHideOnSelect(this,2,'.ingol');
  		showOrHideOnSelect(this,3,'.ingol');
	});

	$('#contactAttention').bind("change", function(){
  		showOrHideOnSelect(this,10,'.hdygu');
	});

	$('#contactVisit').bind("change",function() {
		showOrHideOnSelect(this,2,'.visitdate');
	});


	$('#contactRB').bind("change", function(){
  		preventDateNonsens();
	});

	// check what to show or hide initial
	showOrHideOnSelect($('#contactRequest'),1,'.munich');
	showOrHideOnSelect($('#contactAttention'),10,'.hdygu');
	showOrHideOnSelect($('#contactVisit'),2,'.visitdate');
	// this function prevents date nonsens
	preventDateNonsens();
}

function contactFormInitJS() {
	$('#contactSubject').bind("change",function() {
		showOrHideOnSelect(this,2,'.tech');
	});
	showOrHideOnSelect($('#contactSubject'),2,'.tech');
}

function preventDateNonsens() {
	if($('#contactRB').val()>=$('#contactRE').val()) {
		$('#contactRE').children().remove();
		var first = parseInt($('#contactRB').val());
		first += 7;
		for(i=1;i<=6;i++) {
			first--;
			if(i==1) {
				var child = '<option value="'+first+'">'+first+'</option>';
			} else {
				var child = '<option value="'+first+'">'+first+'</option>';
			}
			$('#contactRE').prepend(child);
		}
	}
}


function showOrHideOnSelect(obj,val_to_be,elm) {
	var val_in_fact = $(obj).val();
	if(val_to_be==val_in_fact) {
		$(elm).show();
	} else {
		$(elm).hide();
	}
}