function displayBackContent(height) {
	url = 'includes/displayBackContent.php';
	params = 'height='+height;
	new Ajax.Updater(
		'displayBackContent',
		url,
		{
			parameters: params
		}
	);
}
function WindowLoad(){
	/*
		Example 1 Description:
		The DateChooser will close 200 milliseconds after mouseout.
		It will show 10 pixels to the right of, and 10 pixels above the click.
		It will call the FunctionEx1() function (below) when updated.
		Instead of using setLink() or setIcon(), so it attaches an event handler to 'datelinkex1' in the markup.
	*/

	var ndExample1 = document.getElementById('datechooserex1');
	ndExample1.DateChooser = new DateChooser();

	// Check if the browser has fully loaded the DateChooser object, and supports it.
	if (!ndExample1.DateChooser.display)
	{
		return false;
	}

	ndExample1.DateChooser.setCloseTime(200);
	ndExample1.DateChooser.setXOffset(10);
	ndExample1.DateChooser.setYOffset(-10);
	ndExample1.DateChooser.setUpdateFunction(FunctionEx1);
	document.getElementById('datelinkex1').onclick = ndExample1.DateChooser.display;
	
	
	var ndExample2 = document.getElementById('datechooserex2');
	ndExample2.DateChooser = new DateChooser();

	// Check if the browser has fully loaded the DateChooser object, and supports it.
	if (!ndExample2.DateChooser.display)
	{
		return false;
	}

	ndExample2.DateChooser.setCloseTime(200);
	ndExample2.DateChooser.setXOffset(10);
	ndExample2.DateChooser.setYOffset(-10);
	ndExample2.DateChooser.setUpdateFunction(FunctionEx2);
	document.getElementById('datelinkex2').onclick = ndExample2.DateChooser.display;
}
function submitLogIn(place){
	if (!place){
		var place = "";
	}
	if ($F("username"+place) == ''){
		document.getElementById("errorUsername"+place).style.display = "block";
		return false;
	}
	else {
		document.getElementById("errorUsername"+place).style.display = "none";
	}
	if ($F("password"+place) == ''){
		document.getElementById("errorPassword"+place).style.display = "block";
		return false;
	}
	else {
		document.getElementById("errorPassword"+place).style.display = "none";
	}
	
	var username = $F("username"+place);
	var password = $F("password"+place);
	url    = "includes/auth_actions.php";
	params = "username="+username+"&password="+password;
	new Ajax.Request(
		url,
		{
			method: 'post',
			parameters: params,
			onComplete: function (response) {
				if (response.responseText == 'true') {
					if (place){
						window.location = '?Page=home';
						return false;
					}
					document.getElementById("error"+place).style.display = "none";
					displayAuth();
					window.location = '?Page=home';
				} else {
					document.getElementById("error"+place).style.display = "block";
				}
			}
		}
	);
}
function reservationSubmit(){
	if ($F("dateinputex1") ||
		$F("dateinputex2") ||
		$F("nights_no") ||
		$F("fullName") ||
		$F("phone") ||
		$F("email")) {
		document.getElementById("sendReservation").submit();
	}
	else {
		alert("Va rugam completati toate campurile !");
	}
}
