// JavaScript Document
var de_actions = new Array();
function de_pageStart()
{
	for(var i = 0; i < de_actions.length; i++)
	{
		switch(de_actions[i])
		{
			case'registerConfermation':
				hurra_alert("Vielen Dank für Ihre Anmeldung zum Newsletter!", "Besuchen Sie uns auch auf <a href='http://www.facebook.com/camping.woerthersee' target='_blank'>www.facebook.com/camping.woerthersee</a><br /><br />Ihr Campingplatz Klagenfurt am Wörthersee Team!", "");
				break;
			case'unregisterConfermation':
				hurra_alert("Ihre Abmeldung wurde bestätigt!", "Ihr Campingplatz Klagenfurt am Wörthersee Team!", "");
				break;
			default:
				break;
		}
	}
}
hurra_registerOnLoad(de_pageStart);

////
// Kalkulator Einstellungen
////
var preisOrtstaxe = 1.5;
var preisUmweltgebuehr = 3.5;

var Seasons = new Array
(
	new Season
	(
		1,
		'Vor-/Nachsaison',
		new Array
		(
		 	new SeasonDuration(418,527),
		 	new SeasonDuration(910,930)
		),
		
		preisStellPlatz = 8.9,
		preisStellPlatz_80_100 = 8.9,
		preisStellPlatz_ueber_100 = 8.9,
		preisZeltplatz = 7,
		preisZusaetzlichesAuto = 6.0,
		
		preisErwachsen = 5.5,
		preisJugend = 5.5,
		preisKind = 2.9,
		preisKleinkind = 0,
		
		preisHund = 2.8
	),
	new Season
	(
	 	2,
		'Zwischensaison',
		new Array
		(
		 	new SeasonDuration(528,624),
		 	new SeasonDuration(827,909)
		),
		
		preisStellPlatz = 9.3,
		preisStellPlatz_80_100 = 10.8,
		preisStellPlatz_ueber_100 = 12.3,
		preisZeltplatz = 7.4,
		preisZusaetzlichesAuto = 6.0,
		
		preisErwachsen = 6.8,
		preisJugend = 6.8,
		preisKind = 3.9,
		preisKleinkind = 0,
		
		preisHund = 2.8
	),
	new Season
	(
	 	3,
		'Hauptsaison',
		new Array
		(
		 	new SeasonDuration(625,826)
		),
		
		preisStellPlatz = 9.9,
		preisStellPlatz_80_100 = 11.4,
		preisStellPlatz_ueber_100 = 12.9,
		preisZeltplatz = 8,
		preisZusaetzlichesAuto = 6.0,
		
		preisErwachsen = 8.5,
		preisJugend = 8.5,
		preisKind = 4.9,
		preisKleinkind = 0,
		
		preisHund = 2.8
	)
);
var Stellplaetze = new Array
(
	new Stellplatz(1, 'Stellplatz (Standard, inkl. Strom)', 0),
	new Stellplatz(2, 'Stellplatz (80m² - 100m², inkl. Strom)', 1),
	new Stellplatz(3, 'Stellplatz (über 100m², inkl. Strom)', 2),
	new Stellplatz(4, 'Zeltplatz (ohne PKW, ohne Strom)', 3)
);


////
// Newsletteranmeldung
////
function open_newsletter_form(menuPontId, menuPointName, language, category)
{
	//var mailText = document.getElementById('newsletter_outer_mail').value;
	var mailText = '';
	var html = '';
	
	html += '<h1>Bleiben Sie am Laufenden!</h1>';
	html += '<h2>Der Campingplatz Klagenfurt am Wörthersee Newsletter</h2>';
	html += 	'<div>';
	html += 		'<div class="reservation_form_container">';
	html += 			'<div class="reservation_form_title">Anrede:<select id="nl_salutation"><option value=""></option><option value="Frau">Frau</option><option value="Herr">Herr</option></select></div>';
	html +=				'<div class="reservation_form_title">Vorname:<input id="nl_firstname"  type="text" /></div>';
	html += 			'<div class="reservation_form_title">Nachname:<input id="nl_lastname" type="text" /></div>';
	html += 			'<div class="reservation_form_title">Email:<input id="nl_email" type="text" value="'+mailText+'" /></div>';
	html += 			'<div class="reservation_form_title">Aktion:<select id="nl_actionType"><option value="register">anmelden</option><option value="unregister">abmelden</option></select></div>';
	html += 		'</div>';
	html += 		'<div class="clear_both">&nbsp;</div>';
	html += 		'<div class="reservation_form_bttn_line">';
	html +=				'<a href="javascript:void(send_newsletter_form_request(\''+menuPontId+'\',\''+menuPointName+'\',\''+language+'\',\''+category+'\'))" class="submit_button">» Jetzt anmelden</a>';
	html += 			'<div class="clear_both">&nbsp;</div>';
	html += 		'</div>';
	html += 	'</div>';
	
	//html += '<div class="clear_both">&nbsp;</div>';
	hurra_create_2ndWindow(385, html);	
	return true;
}
////
// Newsletter absenden
////
var globalNewsletterActionType;
function send_newsletter_form_request(menuPontId, menuPointName, language, category)
{
	postVars = "pass=caws"
	postVars += "&menuPointId="+menuPontId+"&menuPointName="+menuPointName+"&Language="+language+"&Category="+category;
	errorReport = '';
	
	var salutation = document.getElementById('nl_salutation');
	if(!hurra_check_length(salutation.value, 2))
	{
		errorReport += "Bitte füllen Sie das Feld Anrede aus!<br />";
	}
	postVars += "&Anrede="+salutation.value;
	
	var firstname = document.getElementById('nl_firstname');
	if(!hurra_check_length(firstname.value, 2))
	{
		errorReport += "Bitte füllen Sie das Feld Vorame aus!<br />";
	}
	postVars += "&Vorname="+firstname.value;

	var lastname = document.getElementById('nl_lastname');
	if(!hurra_check_length(lastname.value, 2))
	{
		errorReport += "Bitte füllen Sie das Feld Nachname aus!<br />";
	}
	postVars += "&Nachname="+lastname.value;
	
	var email = document.getElementById('nl_email');
	if(!hurra_check_length(email.value, 2))
	{
		errorReport += "Bitte füllen Sie das Feld Email aus!<br />";
	}
	else if(!hurra_check_mail(email.value))
	{
		errorReport += "Bitte füllen Sie das Feld Email korrekt aus!<br />";
	}
	postVars += "&Email="+email.value;

	var actionType = document.getElementById('nl_actionType');
	postVars += "&ActionType="+actionType.value;
	globalNewsletterActionType = actionType.value;
	
	if(errorReport.length > 0)
	{
		hurra_alert("Achtung", errorReport, "");
		return false;	
	}
	postVars += "&submit=newsletter";
	request = new Http(
		"submit.php",
		null,
		'POST',
		postVars,
		['Content-Type', 'application/x-www-form-urlencoded']
	);
	request.onreadyst = function()
	{
		if (requestQue.List[0].req.readyState == 4)
		{
			if (requestQue.List[0].req.status == 200)
			{
				//document.getElementById('newsletter_outer_mail').value = '';
				switch(globalNewsletterActionType)
				{
					case 'register':
						hurra_alert("Vielen Dank für Ihre Newsletteranmeldung!", "Sie erhalten in kürze eine Email mit einem Link zur Bestätigung.<br />Ihr Campingplatz Klagenfurt am Wörthersee Team!", "hurra_unlockPage_firstLevel()");
						break;
					case 'unregister':
						hurra_alert("Ihre Newsletterabmeldung!", "Sie erhalten in kürze eine Email mit einem Link zur Bestätigung.<br />Ihr Campingplatz Klagenfurt am Wörthersee Team!", "hurra_unlockPage_firstLevel()");
						break;
				}
				requestQue.requExecuted();
			}
			else
			{
				requestQue.requExecuted();
			}
		}
	}
	requestQue.add(request);
}

////
// Anfrageformular
////

////
// Formatiert Zahl für Kalkulator
////
function formatZahl(zahl, k)
{
	return zahl.toFixed(k);
}


////
// Klasse Saison mit Start und Endzeiten sowie saisonabhängigen Preisen
////
function Season(id, name, Durations, preisStellPlatz, preisStellPlatz_80_100, preisStellPlatz_ueber_100, preisZeltplatz, preisZusaetzlichesAuto, preisErwachsen, preisJugend, preisKind, preisKleinkind, preisHund)
{
	this.id = id;
	this.name = name;
	this.Durations = Durations;
	
	this.preisStellPlatz = preisStellPlatz;
	this.preisStellPlatz_80_100 = preisStellPlatz_80_100;
	this.preisStellPlatz_ueber_100 = preisStellPlatz_ueber_100;
	this.preisZeltplatz = preisZeltplatz;
	this.PlatzPreisListe = new Array(this.preisStellPlatz, this.preisStellPlatz_80_100, this.preisStellPlatz_ueber_100, this.preisZeltplatz)
	
	this.preisZusaetzlichesAuto = preisZusaetzlichesAuto;
	
	this.preisErwachsen = preisErwachsen;
	this.preisJugend = preisJugend;
	this.preisKind = preisKind;
	this.preisKleinkind = preisKleinkind;
	
	this.preisHund = preisHund;
	
	this.bookingDays = 0;
	// Parameter day: (Monat*100) + Tag
	this.add_bookingDay = function(day)
	{
		for(var i = 0; i < this.Durations.length; i++)
		{
			if(day >= this.Durations[i].start && day <= this.Durations[i].end)
			{
				this.bookingDays++;
				return true;
			}
		}
		return false;
	}
	// Parameter day: (Monat*100) + Tag
	this.check_bookingDay = function(day)
	{
		for(var i = 0; i < this.Durations.length; i++)
		{
			if(day >= this.Durations[i].start && day <= this.Durations[i].end)
			{
				return true;
			}
		}
		return false;
	}
}
////
// Klasse Saisondauer mit Start und Endzeit / Monat*100 + Tag -> Jahre werden nicht berücksichtigt
////
function SeasonDuration(start, end)
{
	// Format: (Monat*100)+Tage
	this.start = start;
	this.end = end;
} 
////
// Klasse Stellplatz
///
function Stellplatz(id, name, saisonPreisListPos)
{
	this.id = id;
	this.name = name;
	this.saisonPreisListPos = saisonPreisListPos;
}

////
// Globale Variablen mit Defaultwerten
////
var calcMailContent = new Array();
var numUrlaubsTage = 0;
var Stellplatz;

var numErwachsen = 0;
var numJugend = 0;
var numKind = 0;
var numKleinkind = 0;

var numHund = 0;

var totalStellplatz = 0;

var totalErwachsen = 0;
var totalJugend = 0;
var totalKind = 0;
var totalKleinkind = 0;

var totalHund = 0;
var totalOrtstaxe = 0;
var totalUmweltgebuehr = 0;

var totalPreis = 0;

////
// Funktion gibt Tag im Format (Monta*100)+Tag zurück
////
function format_date_2_calcDay(day)
{
	var Day = parseInt(day.getDate());
	//Monatszählung beginnt bei 0, deshalb +1
	var Month = parseInt(day.getMonth())+1;
	return parseInt((Month * 100) + Day);
}
////
// Funktion ordnet Tag einer Saison zu
// Parameter day: (Monat*100) + Tag
////
function add_bookingDay_2_season(day)
{
	for(var i = 0; i < Seasons.length; i++)
	{
		if(Seasons[i].add_bookingDay(day) == true)
		{
			return true;
		}
	}
	return false;
}
////
// Funktion überprüft ob Tag einer Saison zuordenbar ist
// Parameter day: (Monat*100) + Tag
////
function check_bookingDay_in_season(day)
{
	for(var i = 0; i < Seasons.length; i++)
	{
		if(Seasons[i].check_bookingDay(day) == true)
		{
			return true;
		}
	}
	return false;
}
////
// Funktion ordnet Tag einer Saison zu
////
function set_season_days(BookingStart, daysDiff)
{
	//Löschen früherer Berechnungen
	for(var i = 0; i < Seasons.length; i++)
	{
		Seasons[i].bookingDays = 0;
	}
	//alert(daysDiff);
	for(var i = 0; i < daysDiff; i++)
	{
		var newDay = new Date();
		newDay.setTime((BookingStart.getTime() + (i * 24 * 60 * 60 * 1000)));
		
		var AddDay = format_date_2_calcDay(newDay);
		add_bookingDay_2_season(AddDay);
	}
}
////
// Löst Kalkulation aus und alert Fehlermeldung selbst
////
function calculate_requirement_with_error()
{
	var error = do_calculate_requirement(true);
	if(error.length > 0)
	{
		hurra_alert("Achtung", error, "");
	}
	return error;
}
////
// Löst Kalkulation aus und gibt Fehlermeldung per return weiter
////
function calculate_requirement()
{
	var error = do_calculate_requirement(false);
	return error;
}
////
// Kalkulationsprogramm
////
function do_calculate_requirement(returnError)
{
	calcMailContent = new Array()
	numUrlaubsTage = 0;
	Stellplatz = null;
	
	totalStellplatz = 0;
	
	totalErwachsen = 0;
	totalJugend = 0;
	totalKind = 0;
	totalKleinkind = 0;
	
	totalHund = 0;
	totalOrtstaxe = 0;
	totalUmweltgebuehr = preisUmweltgebuehr;
	
	totalPreis = 0;	
	
	
	var errorMessage = '';
	
	//Buchungstermin
	var arrivelString = document.getElementById('ar_bookingArrivelField').value;
	if(arrivelString.length > 0)
	{
		var ArrivalDate = new Date();
		ArrivalDate.setHours(0,0,0,0);
		ArrivalDate.setDate(parseInt(arrivelString.substring(0,2)*1));
		ArrivalDate.setMonth(parseInt(arrivelString.substring(3,5)*1)-1);
		ArrivalDate.setFullYear(parseInt(arrivelString.substring(6,10)*1));
	}
	else
	{
		errorMessage += 'Bitte füllen Sie das Feld Ankunft aus!<br>';
	}
	
	var departureString = document.getElementById('ar_bookingDepartureField').value;
	if(departureString.length > 0)
	{
		var DepartureDate = new Date();
		DepartureDate.setHours(0,0,0,0);
		DepartureDate.setDate(parseInt(departureString.substring(0,2)*1));
		DepartureDate.setMonth(parseInt(departureString.substring(3,5)*1)-1);
		DepartureDate.setFullYear(parseInt(departureString.substring(6,10)*1));
	}
	else
	{
		errorMessage += 'Bitte füllen Sie das Feld Abreise aus!<br>';
	}
	
	if(arrivelString.length > 0 && departureString.length > 0)
	{
		var diffTime = DepartureDate.getTime() - ArrivalDate.getTime();
		numUrlaubsTage = Math.ceil(diffTime / 1000 / 60 / 60 / 24);
		
		if(!check_bookingDay_in_season(format_date_2_calcDay(ArrivalDate)))
		{
			errorMessage += 'Ihre Ankunft befindet sich außerhalb der Saison!<br>';
		}
		if(!check_bookingDay_in_season(format_date_2_calcDay(DepartureDate)))
		{
			errorMessage += 'Ihre Abreise befindet sich außerhalb der Saison!<br>';
		}
		if(numUrlaubsTage <= 0)
		{
			errorMessage += 'Ihre Buchungsdauer ergibt 0 Tage! Bitte überprüfen Sie die Felder Ankunft und Abreise!<br>';
		}
		if(numUrlaubsTage > 0)
		{
			set_season_days(ArrivalDate, numUrlaubsTage);
		}
	}
	
	//Stellplatztyp
	var foundStellplatzId = document.getElementById('ar_stellplatz').options[document.getElementById('ar_stellplatz').selectedIndex].value;
	var foundStellplatz = false;
	var stellplatzName = '';
	for(var i = 0; i < Stellplaetze.length; i++)
	{
		if(Stellplaetze[i].id == foundStellplatzId)
		{
			Stellplatz = Stellplaetze[i];
			foundStellplatz = true;
			break;			
		}
	}
	if(foundStellplatz)
	{
		stellplatzName = Stellplatz.name;
	}
	else
	{
		errorMessage += 'Bitte wählen Sie einen Stellplatz aus!<br>';
	}
	
	//Saisonbeschreibung
	var saisonString = '';
	for(var i = 0; i < Seasons.length; i++)
	{
		if(Seasons[i].bookingDays > 0)
		{
			if(saisonString.length > 0)
			{
				saisonString += ', ';
			}
			if(Seasons[i].bookingDays == 1)
			{
				saisonString += Seasons[i].bookingDays+' Tag '+Seasons[i].name;
			}
			else
			{
				saisonString += Seasons[i].bookingDays+' Tage '+Seasons[i].name;
			}
		}
	}
	
	numErwachsen = document.getElementById('ar_num_erwachsen').value;
	numJugend = document.getElementById('ar_num_jugend').value;
	numKind = document.getElementById('ar_num_kind').value;
	numKleinkind = document.getElementById('ar_num_kleinkind').value;
	numHund = document.getElementById('ar_num_hund').value;
	
	if((numErwachsen <= 0 && numJugend <= 0 && numKind <= 0 && numKleinkind <= 0)  || ( isNaN(numErwachsen) || isNaN(numJugend) || isNaN(numKind) || isNaN(numKleinkind)))
	{
		errorMessage += 'Bitte geben Sie die Anzahl der Urlaubspersonen an! Schreiben Sie in die Felder nur Ziffern!<br>';
	}
	if(errorMessage.length <= 0)
	{
		for(var i = 0; i < Seasons.length; i++)
		{
			if(Seasons[i].bookingDays > 0)
			{
				totalStellplatz += (Seasons[i].bookingDays * Seasons[i].PlatzPreisListe[Stellplatz.saisonPreisListPos]);
				
				if(numErwachsen > 0)
				{
					totalErwachsen += numErwachsen * Seasons[i].bookingDays * Seasons[i].preisErwachsen;
					totalOrtstaxe += numErwachsen * Seasons[i].bookingDays * preisOrtstaxe;
				}
				if(numJugend > 0)
				{
					totalJugend += numJugend * Seasons[i].bookingDays * Seasons[i].preisJugend;
				}
				if(numKind > 0)
				{
					totalKind += numKind * Seasons[i].bookingDays * Seasons[i].preisKind;
				}
				if(numKleinkind > 0)
				{
					totalKleinkind += numKleinkind * Seasons[i].bookingDays * Seasons[i].preisKleinkind;
				}
				if(numHund > 0)
				{
					totalHund += numHund * Seasons[i].bookingDays * Seasons[i].preisHund;
				}
			}
		}
		totalPreis = totalStellplatz + totalErwachsen + totalJugend + totalKind + totalKleinkind + totalHund + totalOrtstaxe + totalUmweltgebuehr;
		
		//Urlaubsbeschreibung
		document.getElementById('calc_booking_desc_cont').innerHTML = 'von '+arrivelString+' bis '+ departureString+'<br>'+saisonString;
		calcMailContent.push('von '+arrivelString+' bis '+ departureString+'\r\n'+saisonString);
		
		//Stellplatz
		document.getElementById('calc_platz_desc').innerHTML = stellplatzName;
		document.getElementById('calc_platz').innerHTML = formatZahl(totalStellplatz,2)+' €';
		calcMailContent.push(stellplatzName+' '+formatZahl(totalStellplatz,2)+' €');
		
		document.getElementById('calc_erwachsen_desc').innerHTML = numErwachsen+' ';
		document.getElementById('calc_erwachsen').innerHTML = formatZahl(totalErwachsen,2)+' €';
		calcMailContent.push(numErwachsen+' Erwachsen: '+formatZahl(totalErwachsen,2)+' €');
		
		document.getElementById('calc_jugend_desc').innerHTML = numJugend+' ';
		document.getElementById('calc_jugend').innerHTML = formatZahl(totalJugend,2)+' €';
		calcMailContent.push(numJugend+' Jugendliche: '+formatZahl(totalJugend,2)+' €');
		
		document.getElementById('calc_kind_desc').innerHTML = numKind+' ';
		document.getElementById('calc_kind').innerHTML = formatZahl(totalKind,2)+' €';
		calcMailContent.push(numKind+' Kinder: '+formatZahl(totalKind,2)+' €');
		
		document.getElementById('calc_kleinkind_desc').innerHTML = numKleinkind+' ';
		document.getElementById('calc_kleinkind').innerHTML = formatZahl(totalKleinkind,2)+' €';
		calcMailContent.push(numKleinkind+' Kleinkinder: '+formatZahl(totalKleinkind,2)+' €');
		
		document.getElementById('calc_hund_desc').innerHTML = numHund+' ';
		document.getElementById('calc_hund').innerHTML = formatZahl(totalHund,2)+' €';
		calcMailContent.push(numHund+' Hunde: '+formatZahl(totalHund,2)+' €');

		document.getElementById('calc_umwelt').innerHTML = formatZahl(totalUmweltgebuehr,2)+' €';
		calcMailContent.push('Umweltgebühr: '+formatZahl(totalUmweltgebuehr,2)+' €');
		
		document.getElementById('calc_ortstax').innerHTML = formatZahl(totalOrtstaxe,2)+' €';
		calcMailContent.push('Ortstaxe: '+formatZahl(totalOrtstaxe,2)+' €');
		
		document.getElementById('calc_total').innerHTML = formatZahl(totalPreis,2)+' €';
		calcMailContent.push('Gesamt: '+formatZahl(totalPreis,2)+' €');
		
		document.getElementById('reservation_form_calculation_description').style.display = 'none';
		document.getElementById('reservation_form_calculation_container').style.display = 'block';
	}
	else
	{
		document.getElementById('reservation_form_calculation_container').style.display = 'none';
		document.getElementById('reservation_form_calculation_description').style.display = 'block';
	}
	//alert(errorMessage);
	return errorMessage;
}

////
// Alternative da onChange beim Datumsfeld nicht funktioniert um Kalkulator anzupassen
////
function close_dateField()
{
	calculate_requirement();
	var errorMessage = '';
	
	if(this.id == 'ar_bookingArrivelField' || this.id == 'ar_bookingDepartureField')
	{
		//Buchungstermin
		var arrivelString = document.getElementById('ar_bookingArrivelField').value;
		if(arrivelString.length > 0)
		{
			var ArrivalDate = new Date();
			ArrivalDate.setHours(0,0,0,0);
			ArrivalDate.setDate(parseInt(arrivelString.substring(0,2)*1));
			ArrivalDate.setMonth(parseInt(arrivelString.substring(3,5)*1)-1);
			ArrivalDate.setFullYear(parseInt(arrivelString.substring(6,10)*1));
		}
	
		var departureString = document.getElementById('ar_bookingDepartureField').value;
		if(departureString.length > 0)
		{
			var DepartureDate = new Date();
			DepartureDate.setHours(0,0,0,0);
			DepartureDate.setDate(parseInt(departureString.substring(0,2)*1));
			DepartureDate.setMonth(parseInt(departureString.substring(3,5)*1)-1);
			DepartureDate.setFullYear(parseInt(departureString.substring(6,10)*1));
		}
		
		var numTage = 0;
		if(arrivelString.length > 0 && departureString.length > 0)
		{
			var diffTime = DepartureDate.getTime() - ArrivalDate.getTime();
			numTage = Math.ceil(diffTime / 1000 / 60 / 60 / 24);			
		}

		switch(this.id)
		{
			default:
				break;
			case'ar_bookingArrivelField':
				if(!check_bookingDay_in_season(format_date_2_calcDay(ArrivalDate)))
				{
					errorMessage += 'Ihre Ankunft befindet sich außerhalb der Saison!<br>';
				}
				else if(document.getElementById('ar_bookingDepartureField').value == '' || numTage <= 0)
				{
					document.getElementById('ar_bookingDepartureField').value = this.value;
				}
				break;
			case'ar_bookingDepartureField':
				if(!check_bookingDay_in_season(format_date_2_calcDay(DepartureDate)))
				{
					errorMessage += 'Ihre Abreise befindet sich außerhalb der Saison!<br>';
				}
				else if(document.getElementById('ar_bookingArrivelField').value == '' || numTage <= 0)
				{
					document.getElementById('ar_bookingArrivelField').value = this.value;
				}
				break;
		}
		if(errorMessage.length > 0)
		{
			hurra_alert("Achtung", errorMessage, "");
		}
	}	
}
////
// Hilfsfunktionen für Drop down
////
function return_day_option()
{
	html = '';
	for(var i = 1; i < 32; i++)
	{
		if(i < 10)
		{
			value = '0'+i;
		}
		else
		{
			value = i;
		}
		html += '<option value="'+value+'">'+value+'</option>';
	}
	return html;
}
function return_month_option()
{
	html = '';
	for(var i = 1; i < 13; i++)
	{
		if(i < 10)
		{
			value = '0'+i;
		}
		else
		{
			value = i;
		}
		html += '<option value="'+value+'">'+value+'</option>';
	}
	return html;
}
function return_year_option()
{
	var d = new Date();
	var curr_year = d.getFullYear();
	html = '';
	for(var i = curr_year; i >= curr_year-100; i--)
	{
		html += '<option value="'+i+'">'+i+'</option>';
	}
	return html;
}
function return_country_option()
{
	html = '';
	html += '<option value=""></option>';
	html += '<option value="A">Österreich</option>';
	html += '<option value="">----</option>';
	html += '<option value="D">Deutschland</option>';
	html += '<option value="I">Italien</option>';
	html += '<option value="NL">Niederlande</option>';
	html += '<option value="">----</option>';
	html += '<option value="Albanien">Albanien</option>';
	html += '<option value="Argentinien">Argentinien</option>';
	html += '<option value="Armenien">Armenien</option>';
	html += '<option value="Aserbaidschan">Aserbaidschan</option>';
	html += '<option value="Australien">Australien</option>';
	html += '<option value="Belgien">Belgien</option>';
	html += '<option value="Bosnien und Herzegowina">Bosnien und Herzegowina</option>';
	html += '<option value="Brasilien">Brasilien</option>';
	html += '<option value="Bulgarien">Bulgarien</option>';
	html += '<option value="China">China</option>';
	html += '<option value="Dänemark">Dänemark</option>';
	html += '<option value="Estland">Estland</option>';
	html += '<option value="Färöer">Färöer</option>';
	html += '<option value="Finnland">Finnland</option>';
	html += '<option value="Frankreich">Frankreich</option>';
	html += '<option value="Georgien">Georgien</option>';
	html += '<option value="Griechenland">Griechenland</option>';
	html += '<option value="Grönland">Grönland</option>';
	html += '<option value="Großbritannien">Großbritannien</option>';
	html += '<option value="Hongkong">Hongkong</option>';
	html += '<option value="Indien">Indien</option>';
	html += '<option value="Irland">Irland</option>';
	html += '<option value="Island">Island</option>';
	html += '<option value="Israel">Israel</option>';
	html += '<option value="Japan">Japan</option>';
	html += '<option value="Kanada">Kanada</option>';
	html += '<option value="Kasachstan">Kasachstan</option>';
	html += '<option value="Kroatien">Kroatien</option>';
	html += '<option value="Lettland">Lettland</option>';
	html += '<option value="Liechtenstein">Liechtenstein</option>';
	html += '<option value="Litauen">Litauen</option>';
	html += '<option value="Luxemburg">Luxemburg</option>';
	html += '<option value="Malta">Malta</option>';
	html += '<option value="Mauritius">Mauritius</option>';
	html += '<option value="Mazedonien">Mazedonien</option>';
	html += '<option value="Moldawien">Moldawien</option>';
	html += '<option value="Monaco">Monaco</option>';
	html += '<option value="Norwegen">Norwegen</option>';
	html += '<option value="Polen">Polen</option>';
	html += '<option value="Portugal">Portugal</option>';
	html += '<option value="Rumänien">Rumänien</option>';
	html += '<option value="Russland">Russland</option>';
	html += '<option value="San Marino">San Marino</option>';
	html += '<option value="Schweden">Schweden</option>';
	html += '<option value="Schweiz">Schweiz</option>';
	html += '<option value="Serbien und Montenegro">Serbien und Montenegro</option>';
	html += '<option value="Slowakei">Slowakei</option>';
	html += '<option value="Slowenien">Slowenien</option>';
	html += '<option value="Spanien">Spanien</option>';
	html += '<option value="Tschechische Republik">Tschechische Republik</option>';
	html += '<option value="Türkei">Türkei</option>';
	html += '<option value="Ukraine">Ukraine</option>';
	html += '<option value="Ungarn">Ungarn</option>';
	html += '<option value="Usbekistan">Usbekistan</option>';
	html += '<option value="Vatikanstadt">Vatikanstadt</option>';
	html += '<option value="Vereinigte Staaten von Amerika">Vereinigte Staaten von Amerika</option>';
	html += '<option value="Weißrussland">Weißrussland</option>';
	html += '<option value="Zypern">Zypern</option>';
	html += '<option value="">----</option>';
	html += '<option value="anderes">anderes</option>';
	
	return html;
}
////
// Wechsel zwischen Anfrage und Reservierung in der Formularanzeige
////
function change_reservation_type(obj)
{
	switch(obj.id)
	{
		case'select_anfrage':
			obj.src = 'pix/reservationform/de_anfrage_select.gif';
			document.getElementById('anfrage_container').style.display = "block";
			document.getElementById('select_reservierung').src = 'pix/reservationform/de_reservierung_unselect.gif';
			document.getElementById('reservierung_container').style.display = "none";
			break;
		case'select_reservierung':
			obj.src = 'pix/reservationform/de_reservierung_select.gif';
			document.getElementById('reservierung_container').style.display = "block";
			document.getElementById('select_anfrage').src = 'pix/reservationform/de_anfrage_unselect.gif';
			document.getElementById('anfrage_container').style.display = "none";
			break;
	}
}
var globalReservationType;

////
// Anfrageformular HTML
////
function open_requirement_form(menuPontId, menuPointName, language, category)
{
	var html = '';
	
	html += '<h1 style="margin-bottom:10px;">Ihr Urlaub am Wörthersee!</h1>';
	//
	// linker Formularinhalt -> Formularfelder
	//
	html += '<div id="reservation_form_outer_left_container">';
	html += '<h2>Gerne können Sie auch telefonisch unter +43 (0) 463 287810 anfragen.</h2>'; 
	// Formblock 1
	html += 	'<div class="reservation_form_container">';
	html += 		'<div class="reservation_form_title">Ankunft:<input value="" id="ar_bookingArrivelField" class="date_select" type="text" /></div>';
	html += 		'<div class="reservation_form_title">Abreise:<input value="" id="ar_bookingDepartureField" class="date_select" type="text" /></div>';
	html += 		'<div class="reservation_form_title">Erwachsene (> 16):<input onkeyup="calculate_requirement()" id="ar_num_erwachsen"  type="text" value="0" /></div>';
	html += 		'<div class="reservation_form_title">Jugendliche (13 - 15):<input onkeyup="calculate_requirement()" id="ar_num_jugend"  type="text" value="0" /></div>';
	html += 		'<div class="reservation_form_title">Kinder (4 - 12):<input onkeyup="calculate_requirement()" id="ar_num_kind"  type="text" value="0" /></div>';
	html += 		'<div class="reservation_form_title">Kleinkinder (0 - 3):<input onkeyup="calculate_requirement()" id="ar_num_kleinkind"  type="text" value="0" /></div>';
	//html += 		'<div class="reservation_form_title">Aufenthalt mit:<select id="ar_vehicle"><option value=""></option><option value="Wohnwagen">Wohnwagen</option><option value="Wohnmobil">Wohnmobil</option><option value="Zelt">Zelt</option><option value="Zelt und Auto">Zelt und Auto</option></select></div>';
	html += 	'</div>';
	html += 	'<div class="reservation_form_spacer">&nbsp;</div>';
	//Formblock 2
	html += 	'<div class="reservation_form_container">';
	//html += 		'<div class="reservation_form_title_ta" style="height:30px;">Ihr Wunschstellplatz:<br /><a target="_blank" href="module/helper/file_appendix/files/1_file.pdf">› Stellplatz-Plan</a><textarea style="height:30px;" id="ar_campground" ></textarea></div>';
	html += 		'<div class="reservation_form_title">Hunde:<input onkeyup="calculate_requirement()" id="ar_num_hund"  type="text" value="0" /></div>';
	html += 		'<div class="reservation_form_title">Stellplatz:<select onchange="calculate_requirement()" id="ar_stellplatz"><option value=""></option>';
	for(var i = 0; i < Stellplaetze.length; i++)
	{
		html += '<option value="'+Stellplaetze[i].id+'">'+Stellplaetze[i].name+'</option>';
	}
	html += '</select></div>';
	html += 		'<div class="reservation_form_title_ta">Anmerkung/Wünsche:<textarea id="ar_message" ></textarea></div>';
	html += 	'</div>';
	html += 	'<div class="clear_both">&nbsp;</div>';
	html += 	'<div class="reservation_form_type_container">';
	html += 		'<span><strong>Nächster Schritt, bitte wählen Sie:</strong></span>';
	html += 		'<img onclick="change_reservation_type(this)" id="select_anfrage" src="pix/reservationform/de_anfrage_unselect.gif" alt="" />';
	html += 		'<img onclick="change_reservation_type(this)" id="select_reservierung" src="pix/reservationform/de_reservierung_unselect.gif" alt="" />';
	html += 		'<div class="clear_both">&nbsp;</div>';
	html += 	'</div>';
	////
	// Anfrage
	////
	html += 	'<div id="anfrage_container">';
	html += 		'<div class="reservation_form_container">';
	html += 			'<div class="reservation_form_title">Anrede:<select id="a_salutation"><option value=""></option><option value="Frau">Frau</option><option value="Herr">Herr</option></select></div>';
	html +=				'<div class="reservation_form_title">Vorname:<input id="a_firstname"  type="text" /></div>';
	html += 			'<div class="reservation_form_title">Nachname:<input id="a_lastname" type="text" /></div>';
	html += 		'</div>';
	html += 		'<div class="reservation_form_spacer">&nbsp;</div>';
	html += 		'<div class="reservation_form_container">';
	//html += 			'<div class="reservation_form_title">Land:<input id="a_country" type="text"/></div>';

	html += '<div class="reservation_form_title">Land:';
	html += '<select id="a_country">';
	html += return_country_option();
	html += '</select>';
	html += '</div>';
	
	html += 			'<div class="reservation_form_title">Email:<input id="a_email" type="text" /></div>';
	html += 			'<div class="reservation_form_title">Telefon:<input id="a_phone" type="text" /></div>';
	html += 		'</div>';
	html += 		'<div class="clear_both">&nbsp;</div>';
	html += 		'<div class="reservation_form_bttn_line">';
	html +=				'<a href="javascript:void(send_reservation_form_request__(\'Anfrage\',\''+menuPontId+'\',\''+menuPointName+'\',\''+language+'\',\''+category+'\'))" class="submit_button">» Jetzt unverbindlich anfragen</a>';
	html += 			'<div class="reservation_form_newsletter_container">';
	html += 				'<input type="checkbox" id="ar_get_newsletter" checked="checked" name="a_get_newsletter" />';
	html += 				'<label for="a_get_newsletter">Newsletter abonnieren und Neuigkeiten erfahren</label>';
	html += 			'</div>';
	html += 			'<div class="clear_both">&nbsp;</div>';
	html += 		'</div>';
	html += 	'</div>';
	////
	// Reservierung
	////
	html += 	'<div id="reservierung_container">';
	html += 		'<div class="reservation_form_container">';
	html += 			'<div class="reservation_form_title">Anrede:<select id="r_salutation"><option value=""></option><option value="Frau">Frau</option><option value="Herr">Herr</option></select></div>';
	html += 			'<div class="reservation_form_title">Vorname:<input id="r_firstname"  type="text" /></div>';
	html += 			'<div class="reservation_form_title">Nachname:<input id="r_lastname" type="text" /></div>';
//	html += 			'<div class="reservation_form_title">Geburtsdatum:<input id="r_birthdate" type="text" /></div>';
	
	html += '<div class="reservation_form_title">Geburtsdatum:';
	html += '<select id="r_day" class="day">';
	html += '<option value="">Tag</option>';
	html += return_day_option();
	html += '</select>';
	html += '<select id="r_month" class="month">';
	html += '<option value="">Monat</option>';
	html += return_month_option();
	html += '</select>';
	html += '<select id="r_year" class="year">';
	html += '<option value="">Jahr</option>';
	html += return_year_option();
	html += '</select>';
	html += '</div>';
	
	html += 			'<div class="reservation_form_title">Email:<input id="r_email" type="text" /></div>';
	html += 		'</div>';
	html += 		'<div class="reservation_form_spacer">&nbsp;</div>';
	html += 		'<div class="reservation_form_container">';
	html += 			'<div class="reservation_form_title">Telefon:<input id="r_phone" type="text" /></div>';
	html += 			'<div class="reservation_form_title">Straße:<input id="r_street" type="text" /></div>';
	html += 			'<div class="reservation_form_title">PLZ:<input id="r_zip" type="text" /></div>';
	html += 			'<div class="reservation_form_title">Ort:<input id="r_city" type="text" /></div>';
//	html += 			'<div class="reservation_form_title">Land:<input id="r_country" type="text" /></div>';

	html += '<div class="reservation_form_title">Land:';
	html += '<select id="r_country">';
	html += return_country_option();
	html += '</select>';
	html += '</div>';

	html += 		'</div>';
	html += 		'<div class="clear_both">&nbsp;</div>';
	html += 		'<div class="reservation_form_bttn_line">';
	html += 			'<input style="vertical-align:middle" type="checkbox" id="r_agb_read" name="r_agb_read" /> <span style="vertical-align:middle; font-size:11px;">Ich habe die <a href="aut_de_xhtml-33-agbs.php" target="_blank" style="vertical-align:middle; font-size:11px;">AGBs</a> gelesen und akzeptiert</span>';
	html +=				'<a href="javascript:void(send_reservation_form_request__(\'Reservierung\',\''+menuPontId+'\',\''+menuPointName+'\',\''+language+'\',\''+category+'\'))" class="submit_button">» Jetzt reservieren</a>';
	html += 			'<div class="reservation_form_newsletter_container">';
	html += 				'<input type="checkbox" checked="checked" id="r_get_newsletter" name="r_get_newsletter" />';
	html += 				'<label for="ar_get_newsletter">Newsletter abonnieren und Neuigkeiten erfahren</label>';
	html += 			'</div>';
	html += 			'<div class="clear_both">&nbsp;</div>';
	html += 		'</div>';
	html += 	'</div>';	
	html += '</div>';
	
	// 
	// rechter Formularinhalt Werbung
	//
	html += '<div id="reservation_form_outer_right_container">';
	
	html += '<h2>unverbindliche Preiskalkulation</h2>';

	html += '<div id="reservation_form_calculation_description">';
	html += '<div class="reservation_form_container">';
	html += '<div class="reservation_form_calculation_description_text">Füllen Sie links alle Felder aus und berechnen Sie Ihre Campinggebühren!</div>';
	html +=	'<a href="javascript:void(calculate_requirement_with_error())" class="submit_button">» Jetzt berechnen</a>';
	html += '<div class="clear_both">&nbsp;</div>';
	html += '<div class="reservation_form_price_list_link_container"><a href="aut_de_xhtml-7-preise.php" target="_blank">» zur Preisliste</a></div>';
	html += '</div>';
	html += '</div>';
	
	html += '<div id="reservation_form_calculation_container">';
	html += '<div class="reservation_form_container">';
	
	html += '<div id="calc_booking_desc_cont" class="calc_pos"></div>';
	html += '<div class="calc_sep"></div>';
	
	html += '<div class="calc_title">Stellplatzgebühren</div>';
	html += '<div id="calc_platz_cont" class="calc_pos"><div id="calc_platz_desc"></div><span id="calc_platz"></span></div>';
	html += '<div class="calc_sep"></div>';
	
	html += '<div class="calc_title">Personengebühren</div>';
	html += '<div id="calc_erwachsen_cont" class="calc_pos"><div id="calc_erwachsen_desc"></div>Erwachsene (> 16)<span id="calc_erwachsen"></span></div>';
	html += '<div id="calc_jugend_cont" class="calc_pos"><div id="calc_jugend_desc"></div>Jugendliche (13 - 15)<span id="calc_jugend"></span></div>';
	html += '<div id="calc_kind_cont" class="calc_pos"><div id="calc_kind_desc"></div>Kinder (4 - 12)<span id="calc_kind"></span></div>';
	html += '<div id="calc_kleinkind_cont" class="calc_pos"><div id="calc_kleinkind_desc"></div>Kleinkinder (0 - 3)<span id="calc_kleinkind"></span></div>';
	html += '<div class="calc_sep"></div>';
	
	html += '<div class="calc_title">Abgaben</div>';
	html += '<div id="calc_hund_cont" class="calc_pos"><div id="calc_hund_desc"></div>Hunde<span id="calc_hund"></span></div>';
	html += '<div id="calc_ortstax_cont" class="calc_pos">Ortstaxe<span id="calc_ortstax"></span></div>';
	html += '<div id="calc_umwelt_cont" class="calc_pos">Umweltgebühr<span id="calc_umwelt"></span></div>';
	html += '<div class="calc_sep"></div>';
	
	html += '<div id="calc_total_cont" class="calc_result">Summe*<span id="calc_total"></span></div>';
	
	html += '<div class="calc_small_sub">* Irrtum und Darstellungsfehler vorbehalten.</div>';
	html += '<div class="reservation_form_price_list_link_container"><a href="aut_de_xhtml-7-preise.php" target="_blank">» zur Preisliste</a></div>';
	html += '</div>';
	html += '</div>';
	//html += '<div class="clear_both">&nbsp;</div>';

	
	//html += '<img class="block" src="pix/default_form_contact.jpg" alt="15% Rabatt auf die erste Nacht!">';
	//html += '<a class="reservation_form_right_img_link" href="http://www.facebook.com/camping.woerthersee" target="_blank" ><img src="pix/aktionen/form_fb_link.gif" alt="Camping Klagenfurt Wörthersee auf Facebook"></a><br />';	
//	html += '<div class="reservation_form_newsletter_container">';
//	html += 	'<input type="checkbox" id="ar_is_fb_fan" name="ar_is_fb_fan" />';
//	html += 	'<label for="ar_is_fb_fan">Ja ich bin neuer Facebook-Fan</label>';
//	html += '</div>';
//	html += '<div class="clear_both">&nbsp;</div>';
//	html += '<div class="reservation_form_newsletter_container">';
//	html += 	'<input type="checkbox" checked="checked" id="ar_get_newsletter" name="ar_get_newsletter" />';
//	html += 	'<label for="ar_get_newsletter">Newsletter abonnieren und Neuigkeiten erfahren</label>';
//	html += '</div>';
//	html += '<div class="clear_both">&nbsp;</div>';
	html += '</div>';
	
	html += '<div class="clear_both">&nbsp;</div>';
	
	hurra_create_2ndWindow(990, html);
	
	////
	// Alternative da onChange nicht funktioniert um Kalkulator anzupassen
	////
	document.getElementById('ar_bookingDepartureField').close_dateField = close_dateField;
	document.getElementById('ar_bookingArrivelField').close_dateField = close_dateField;
	
	hurra_addEvent(document.getElementById('ar_bookingDepartureField'),'focus',change_time_date_field);
	hurra_addEvent(document.getElementById('ar_bookingArrivelField'),'focus',change_time_date_field);
	return true;
}
////
// Anfrageformular senden
////
function send_reservation_form_request__(type, menuPontId, menuPointName, language, category)
{
	globalReservationType = type;
	postVars = "pass=caws"
	postVars += "&Typ="+type+"&menuPointId="+menuPontId+"&menuPointName="+menuPointName+"&Language="+language+"&Category="+category;
	var errorReport = '';
	errorReport += calculate_requirement();
	var arrivel = document.getElementById('ar_bookingArrivelField');
//	if(!hurra_check_length(arrivel.value, 2))
//	{
//		errorReport += "Bitte füllen Sie das Feld Ankunft aus!<br />";
//	}
	postVars += "&Ankunft="+arrivel.value;

	var departure = document.getElementById('ar_bookingDepartureField');
//	if(!hurra_check_length(departure.value, 2))
//	{
//		errorReport += "Bitte füllen Sie das Feld Abreise aus!<br />";
//	}
	postVars += "&Abreise="+departure.value;

	var num_erwachsen = document.getElementById('ar_num_erwachsen');
	postVars += "&Anzahl Erwachsene="+num_erwachsen.value;

	var num_jugend = document.getElementById('ar_num_jugend');
	postVars += "&Anzahl Jugendliche="+num_jugend.value;

	var num_kind = document.getElementById('ar_num_kind');
	postVars += "&Anzahl Kinder="+num_kind.value;

	var num_kleinkind = document.getElementById('ar_num_kleinkind');
	postVars += "&Anzahl Kleinkinder="+num_kleinkind.value;

	var num_hund = document.getElementById('ar_num_hund');
	postVars += "&Anzahl Hunde="+num_hund.value;

	var stellplatz = document.getElementById('ar_stellplatz');
	//alert(vehicle.options[vehicle.selectedIndex].value);
//	if(!hurra_check_length(stellplatz.value, 1))
//	{
//		errorReport += "Bitte füllen Sie das Feld Stellplatz mit aus!<br />";
//	}
	postVars += "&Stellplatz="+stellplatz.options[stellplatz.selectedIndex].innerHTML;
	
	//var campground = document.getElementById('ar_campground');
//	if(!hurra_check_length(campground.value, 2))
//	{
//		errorReport += "Bitte füllen Sie das Feld Wunschstellplatz aus!<br />";
//	}
	//postVars += "&Wunschstellplatz="+campground.value;
	
	var message = document.getElementById('ar_message');
//	if(!hurra_check_length(message.value, 2))
//	{
//		errorReport += "Bitte füllen Sie das Feld Nachricht aus!<br />";
//	}
	postVars += "&Anmerkung und Wünsche="+message.value;
	
	switch(type)
	{
		case 'Anfrage':
			var salutation = document.getElementById('a_salutation');
			//alert(vehicle.options[vehicle.selectedIndex].value);
			if(!hurra_check_length(salutation.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Anrede aus!<br />";
			}
			postVars += "&Anrede="+salutation.value;
			var firstname = document.getElementById('a_firstname');
			if(!hurra_check_length(firstname.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Vorname aus!<br />";
			}
			postVars += "&Vorname="+firstname.value;
		
			var lastname = document.getElementById('a_lastname');
			if(!hurra_check_length(lastname.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Nachname aus!<br />";
			}
			postVars += "&Nachname="+lastname.value;
			
			var country = document.getElementById('a_country');
			if(!hurra_check_length(country.value, 1))
			{
				errorReport += "Bitte füllen Sie das Feld Land aus!<br />";
			}
			postVars += "&Land="+country.value;
		
			var email = document.getElementById('a_email');
			if(!hurra_check_length(email.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Email aus!<br />";
			}
			else if(!hurra_check_mail(email.value))
			{
				errorReport += "Bitte füllen Sie das Feld Email korrekt aus!<br />";
			}
			postVars += "&Email="+email.value;
		
			var phone = document.getElementById('a_phone');
			if(!hurra_check_length(phone.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Telefon aus!<br />";
			}
			postVars += "&Telefon="+phone.value;
			
			break;
		case 'Reservierung':
			var salutation = document.getElementById('r_salutation');
			//alert(vehicle.options[vehicle.selectedIndex].value);
			if(!hurra_check_length(salutation.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Anrede aus!<br />";
			}
			postVars += "&Anrede="+salutation.value;
			var firstname = document.getElementById('r_firstname');
			if(!hurra_check_length(firstname.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Vorname aus!<br />";
			}
			postVars += "&Vorname="+firstname.value;
		
			var lastname = document.getElementById('r_lastname');
			if(!hurra_check_length(lastname.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Nachname aus!<br />";
			}
			postVars += "&Nachname="+lastname.value;
			
			var birthdateDay = document.getElementById('r_day');
			var birthdateMonth = document.getElementById('r_month');
			var birthdateYear = document.getElementById('r_year');
			if(!hurra_check_length(birthdateDay.value, 1) || !hurra_check_length(birthdateMonth.value, 1) || !hurra_check_length(birthdateYear.value, 1))
			{
				errorReport += "Bitte füllen Sie das Feld Geburtsdatum aus!<br />";
			}
			postVars += "&Geburtsdatum="+birthdateDay.value+"."+birthdateMonth.value+"."+birthdateYear.value;

//			var birthdate = document.getElementById('r_birthdate');
//			if(!hurra_check_length(birthdate.value, 2))
//			{
//				errorReport += "Bitte füllen Sie das Feld Geburtsdatum aus!<br />";
//			}
//			postVars += "&Geburtsdatum="+birthdate.value;
			
			var email = document.getElementById('r_email');
			if(!hurra_check_length(email.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Email aus!<br />";
			}
			else if(!hurra_check_mail(email.value))
			{
				errorReport += "Bitte füllen Sie das Feld Email korrekt aus!<br />";
			}
			postVars += "&Email="+email.value;
		
			var phone = document.getElementById('r_phone');
			if(!hurra_check_length(phone.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Telefon aus!<br />";
			}
			postVars += "&Telefon="+phone.value;
			
			var street = document.getElementById('r_street');
			if(!hurra_check_length(street.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Straße aus!<br />";
			}
			postVars += "&Straße="+street.value;
		
			var zip = document.getElementById('r_zip');
			if(!hurra_check_length(zip.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld PLZ aus!<br />";
			}
			postVars += "&PLZ="+zip.value;
		
			var city = document.getElementById('r_city');
			if(!hurra_check_length(city.value, 2))
			{
				errorReport += "Bitte füllen Sie das Feld Ort aus!<br />";
			}
			postVars += "&Ort="+city.value;
		
			var country = document.getElementById('r_country');
			if(!hurra_check_length(country.value, 1))
			{
				errorReport += "Bitte füllen Sie das Feld Land aus!<br />";
			}
			postVars += "&Land="+country.value;
			if(document.getElementById('r_agb_read').checked == true)
			{
				postVars += "&AGBs gelesen=Ja";
			}
			else
			{
				errorReport += "Sie müssen die AGBs lesen und akzeptieren!<br />";
				postVars += "&AGBs gelesen=Nein";
			}
			
			break;
	}
	var kalkulation = '';
	for(var i = 0; i < calcMailContent.length; i++)
	{
		kalkulation += '\r\n'+calcMailContent[i];
	}
	postVars += "&Kalkulation="+kalkulation;
	
//	if(document.getElementById('ar_is_fb_fan').checked == true)
//	{
//		postVars += "&Facebookfan=Ja";
//	}
//	else
//	{
//		postVars += "&Facebookfan=Nein";
//	}
	if(document.getElementById('ar_get_newsletter').checked == true)
	{
		postVars += "&Newsletter=Ja";
	}
	else
	{
		postVars += "&Newsletter=Nein";
	}
	
	if(errorReport.length > 0)
	{
		hurra_alert("Achtung", errorReport, "");
		return false;	
	}
	postVars += "&submit=anfrage";
//	hurra_alert("Postvars", postVars, "");
//	return;
	request = new Http(
		"submit.php",
		null,
		'POST',
		postVars,
		['Content-Type', 'application/x-www-form-urlencoded']
	);
	request.onreadyst = function()
	{
		if (requestQue.List[0].req.readyState == 4)
		{
			if (requestQue.List[0].req.status == 200)
			{
				//alert(requestQue.List[0].req.responseText);
				switch(globalReservationType)
				{
					case 'Anfrage':
						hurra_alert("Vielen Dank für Ihre Anfrage!", "Wir werden diese umgehend bearbeiten und uns bei Ihnen melden.<br />Ihr Campingplatz Klagenfurt am Wörthersee Team!", "hurra_unlockPage_firstLevel()");
						break;
					case 'Reservierung':
						hurra_alert("Vielen Dank für Ihre Reservierung!", "Wir werden diese umgehend bearbeiten und uns bei Ihnen melden.<br />Ihr Campingplatz Klagenfurt am Wörthersee Team!", "hurra_unlockPage_firstLevel()");
						break;
				}
				
				requestQue.requExecuted();
			}
			else
			{
				requestQue.requExecuted();
			}
		}
	}
	requestQue.add(request);
}


