//---pfad zur Regionsdatei
/*var pfad_TTREGS='http://images.traveltainment.de/booking/cache/430700/654/'+cacheFiles_654[1];
var pfad_TTREGS_erde='http://images.traveltainment.de/booking/cache/430700/653/'+cacheFiles_653[1];*/

//---pfad zur Veranstalter + Termindatei Datei
/*var pfad_TTVAT='http://images.traveltainment.de/booking/cache/430700/654/'+cacheFiles_654[0];
var pfad_TTVAT_erde='http://images.traveltainment.de/booking/cache/430700/653/'+cacheFiles_653[0];*/

var TTAFH = new Array("Nord;NORD","Süd;SUED","West;WEST","Ost;OST","Amsterdam (NL);AMS","Basel (CH);BSL","Basel/Mulhouse/Freiburg (CH);MLH","Berlin-Schönefeld;SXF","Berlin-Tegel;TXF","Bremen;BRE","Dortmund;DTM","Dresden;DRS","Düsseldorf;DUS",
"Eindhoven (NL);EIN","Erfurt;ERF","Frankfurt;FRA","Friedrichshafen;FDH","Graz (A);GRZ","Groningen (NL);GRQ","Hamburg;HAM","Hannover;HAJ","Karlsruhe/Baden-Baden;FKB",
"Köln/Bonn;CGN","Leipzig/Halle;LEJ","Linz (A);LNZ","Luxemburg (L);LUX","Maastricht (NL);MST","Memmingen;FMM","München;MUC","Münster/Osnabrück;FMO","Nürnberg;NUE","Paderborn;PAD",
"Rostock;ROS","Saarbrücken;SCN","Salzburg (A);SZG","Stuttgart;STR","Weeze;WEZ","Wien (A);VIE","Zürich (CH);ZRH");

var TTRD = new Array("beliebig;-1","1 Woche;6_7","2 Wochen;6_14","3 Wochen;6_21","1-4 Tage;9","5-8 Tage;10","9-12 Tage;7","13-15 Tage;3","16-22 Tage;12","mehr als 22 Tage;13");

var TTThemen = new Array("beliebig;","Ski;1_10","Urlaub in Deutschland;1_11","Urlaub in Österreich;1_16","Urlaub in den Bergen;1_1","Badeurlaub an Nord-& Ostsee;1_13","Badeurlaub am Mittelmeer;1_14","Badeurlaub in der Ferne;1_15","Familienurlaub;1_3","Wellness;1_12","Städtereisen;1_4");

var TTTravelers = new Array("1 Pers.;1","2 Pers.;2","3 Pers.;3","4 Pers.;4", "5 Pers.;5", "6 Pers.;6");
var TTChildren = new Array("< 2 J.;1","2 J.;2","3 J.;3","4 J.;4","5 J.;5","6 J.;6","7 J.;7","8 J.;8","9 J.;9","10 J.;10","11 J.;11","12 J.;12","13 J.;13","14 J.;14","15 J.;15","16 J.;16");
var TTPrice = new Array("beliebig;-1","bis 350,-;8_350","bis 500,-;8_500","bis 750,-;8_750","bis 1000,-;8_1000");

var TTVeranstalter = '';
var TTRegionen = '';
var TTRegionenErde = '';
var TTTermin_min = '';
var TTTermin_min_erde = '';
var TTTermin_max = '';
var TTTermin_max_erde = '';
var countryListText = '';
var regionListText = '';
var airportListText = '';
var durationListText = '';
var countries = new Array();
var countryMap = new Array();
var countriesErde = new Array();
var countryErdeMap = new Array();
var tmpCountries = new Array();
var countryCount = 0;
var countryCountErde = 0;
var regions = new Array();
var regionsErde = new Array();
var tmpRegions = new Array();
var regionCount = 0;
var regionCountErde = 0;
var tmpCount = 0;
var airports = new Array();
var airportCount = 0;
var airportsE = new Array();
var airportECount = 0;
var durations = new Array();
var themen = new Array();
var travelers = new Array();
var children = new Array();
var listDivider = 2;
var maxElements = 15;
var maxCols = 3;

var ulsearch 	= new Array("Aegypten",	"Oesterreich");
var ulreplace 	= new Array("Ägypten",	"Österreich");

var panel = '';
var ttpanel = '';

function localDate(timestamp)
{
  var dt = new Date(timestamp * 1000);
  return dt;
}

//---Funktion zum dynamischen Einbinden der Regionsdatei
function incFile(pfad){
	var script = document.createElement('script');
	script.type= "text/javascript";
	script.src = pfad;
	document.getElementsByTagName("head")[0].appendChild(script);
}

//---Funktion zum Ersetzen bestimmter strings
function str_replace(search, replace, subject) {
    return subject.split(search).join(replace);
}

function initTTpanel() {
	if(isStartPanel) {
		$.ajax({
		  url: 'ttpanel.html',
		  success: function(data) {
			ttpanel = data;
		  }
		});
		$.ajax({
		  url: 'panel.html',
		  success: function(data) {
			panel = data;
		  }
		});
	}
	for(var Region in TTRegionen) {
		for (var i=0; i<ulreplace.length; i++) {
			TTRegionen[Region] = TTRegionen[Region].replace(ulsearch[i], ulreplace[i]);
		}
		countrySplit = TTRegionen[Region].split("|");
		if(countrySplit[1]==countrySplit[2] && countrySplit[3]==countrySplit[2]) {
			countryCount++;
			countries[countryCount] = new Object();
			countries[countryCount]['id'] = countrySplit[2];
			countries[countryCount]['name'] = countrySplit[0];
			countries[countryCount]['regions'] = new Object();
			countryMap[countrySplit[2]] = countrySplit[0];
		}
	}
	for(var Region in TTRegionen) {
		countrySplit = TTRegionen[Region].split("|");
		if(countrySplit[1]!=countrySplit[2] && countrySplit[3]!=countrySplit[2]) {
			regionCount++;
			regions[regionCount] = new Object();
			regions[regionCount]['id'] = countrySplit[1];
			regions[regionCount]['id2'] = countrySplit[3];
			regions[regionCount]['name'] = countrySplit[0];
			regions[regionCount]['parent'] = countrySplit[2];
			regions[regionCount]['parentName'] = countryMap[countrySplit[2]];
		}
	}
	for(var Region in TTRegionenErde) {
		for (var i=0; i<ulreplace.length; i++) {
			TTRegionenErde[Region] = TTRegionenErde[Region].replace(ulsearch[i], ulreplace[i]);
		}
		countrySplit = TTRegionenErde[Region].split("|");
		if(countrySplit[1]==countrySplit[2] && countrySplit[3]==countrySplit[2]) {
			countryCountErde++;
			countriesErde[countryCountErde] = new Object();
			countriesErde[countryCountErde]['id'] = countrySplit[2];
			countriesErde[countryCountErde]['name'] = countrySplit[0];
			countriesErde[countryCountErde]['regions'] = new Object();
			countryErdeMap[countrySplit[2]] = countrySplit[0];
		}
	}
	for(var Region in TTRegionenErde) {
		countrySplit = TTRegionenErde[Region].split("|");
		if(countrySplit[1]!=countrySplit[2] && countrySplit[3]!=countrySplit[2]) {
			regionCountErde++;
			regionsErde[regionCountErde] = new Object();
			regionsErde[regionCountErde]['id'] = countrySplit[1];
			regionsErde[regionCountErde]['id2'] = countrySplit[3];
			regionsErde[regionCountErde]['name'] = countrySplit[0];
			regionsErde[regionCountErde]['parent'] = countrySplit[2];
			regionsErde[regionCountErde]['parentName'] = countryErdeMap[countrySplit[2]];
		}
	}
	for(var Region in regions) {
		for(var Country in countries) {
			if(regions[Region]['parent']==countries[Country]['id']) {
				if(typeof(countries[Country]['regionsCount'])=='undefined') countries[Country]['regionsCount'] = 0;
				countries[Country]['regionsCount'] = countries[Country]['regionsCount']+1;
				countries[Country]['regions'][regions[Region]['id']] = new Object();
				countries[Country]['regions'][regions[Region]['id']]['id'] = regions[Region]['id'];
				countries[Country]['regions'][regions[Region]['id']]['id2'] = regions[Region]['id2'];
				countries[Country]['regions'][regions[Region]['id']]['name'] = regions[Region]['name'];
				countries[Country]['regions'][regions[Region]['id']]['parent'] = regions[Region]['parent'];
				countries[Country]['regions'][regions[Region]['id']]['parentName'] = countries[Country]['name'];
			}
		}
	}
	for(var Region in regionsErde) {
		for(var Country in countriesErde) {
			if(regionsErde[Region]['parent']==countriesErde[Country]['id']) {
				if(typeof(countriesErde[Country]['regionsCount'])=='undefined') countriesErde[Country]['regionsCount'] = 0;
				countriesErde[Country]['regionsCount'] = countriesErde[Country]['regionsCount']+1;
				countriesErde[Country]['regions'][regionsErde[Region]['id']] = new Object();
				countriesErde[Country]['regions'][regionsErde[Region]['id']]['id'] = regionsErde[Region]['id'];
				countriesErde[Country]['regions'][regionsErde[Region]['id']]['id2'] = regionsErde[Region]['id2'];
				countriesErde[Country]['regions'][regionsErde[Region]['id']]['name'] = regionsErde[Region]['name'];
				countriesErde[Country]['regions'][regionsErde[Region]['id']]['parent'] = regionsErde[Region]['parent'];
				countriesErde[Country]['regions'][regionsErde[Region]['id']]['parentName'] = countriesErde[Country]['name'];
			}
		}
	}
	
	for(var Airport in TTAFH) {
		airportSplit = TTAFH[Airport].split(";");
		if(airportSplit[0].search(/\([A-Z]{1,2}\)/)=='-1') {
			airportCount++;
			airports[airportCount] = new Object();
			airports[airportCount]['id'] = airportSplit[1];
			airports[airportCount]['name'] = airportSplit[0];
		} else {
			airportECount++;
			airportsE[airportECount] = new Object();
			airportsE[airportECount]['id'] = airportSplit[1];
			airportsE[airportECount]['name'] = airportSplit[0];
		}
	}
	
	for(var Dauer in TTRD) {
		dauerSplit = TTRD[Dauer].split(";");
		durations[dauerSplit[0]] = new Object();
		durations[dauerSplit[0]]['id'] = dauerSplit[1];
		durations[dauerSplit[0]]['txt'] = dauerSplit[0];
	}
	
	for(var Thema in TTThemen) {
		themaSplit = TTThemen[Thema].split(";");
		themen[themaSplit[0]] = new Object();
		themen[themaSplit[0]]['id'] = themaSplit[1];
		themen[themaSplit[0]]['txt'] = themaSplit[0];
	}
	
	for(var Traveler in TTTravelers) {
		travelerSplit = TTTravelers[Traveler].split(";");
		travelers[travelerSplit[0]] = new Object();
		travelers[travelerSplit[0]]['id'] = travelerSplit[1];
		travelers[travelerSplit[0]]['txt'] = travelerSplit[0];
		if(travelerSplit[1]=='1') travelers[travelerSplit[0]]['txt_long'] = travelers[travelerSplit[0]]['txt'].replace("Pers.", "Person");
		else travelers[travelerSplit[0]]['txt_long'] = travelers[travelerSplit[0]]['txt'].replace("Pers.", "Personen");
	}
	
	for(var Child in TTChildren) {
		childrenSplit = TTChildren[Child].split(";");
		children[childrenSplit[0]] = new Object();
		children[childrenSplit[0]]['id'] = childrenSplit[1];
		children[childrenSplit[0]]['txt'] = childrenSplit[0];
		children[childrenSplit[0]]['txt_long'] = children[childrenSplit[0]]['txt'].replace("J.", "Jahre");
	}
	
}

function getTTCountries() {
	if(travelType=='PH') {
		tmpCountries = countriesErde;
		tmpCount = countryCountErde+1;
	} else {
		tmpCountries = countries;
		tmpCount = countryCount+1;
	}
	var currentCount = 1;
	var currentCountry = document.getElementById('arv_country').value;
	var countryListClass = '';
	var maxCountryElements = maxElements;
	countryListText = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Reiseziel</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" />';
	if(tmpCount>maxElements*maxCols) {
		countryListText += '<div style="height:350px;width:245px;display:block;overflow:auto;"><ul class="flyOutList" style="width:210px;margin-right:0;">';
		maxCountryElements = tmpCount;
	} else {
		countryListText += '<div style="display:block;"><ul class="flyOutList" style="width:175px;display:block;">';
		maxCountryElements = Math.ceil(tmpCount/maxCols);
	}
	if(currentCountry=='-1') {
		countryListText += '<li class="first"><a href="javascript:setCountry(\'-1\',\'Alle Reiseziele\')" style="background-color:#e1f0f6">Alle Reiseziele</a></li>';
	} else {
		countryListText += '<li class="first"><a href="javascript:setCountry(\'-1\',\'Alle Reiseziele\')">Alle Reiseziele</a></li>';
	}
	currentCount++;
	for(var Country in tmpCountries) {
		if(countryListClass=='first') {
			countryListText += '<li class="first">';
			countryListClass = '';
		} else countryListText += '<li>';
		if(currentCountry==tmpCountries[Country]['id']) {
			countryListText += '<a href="javascript:setCountry(\''+tmpCountries[Country]['id']+'\',\''+tmpCountries[Country]['name']+'\')" style="background-color:#e1f0f6">'+tmpCountries[Country]['name']+'</a></li>';
		} else {
			countryListText += '<a href="javascript:setCountry(\''+tmpCountries[Country]['id']+'\',\''+tmpCountries[Country]['name']+'\')">'+tmpCountries[Country]['name']+'</a></li>';
		}
		if(currentCount%maxCountryElements == 0 && currentCount<tmpCount) {
			countryListText += '</ul><ul class="flyOutList" style=" width:175px;">';
			countryListClass = 'first';
		} else {
			countryListClass = '';
		}
		currentCount++;
	}
	countryListText += '</ul><br class="clear" />';
	return countryListText;
}

function getTTRegions(choosenCountry) {
	if(travelType=='PH') {
		tmpCountries = countriesErde;
		tmpRegions = regionsErde;
		tmpCount = regionCountErde+1;
	} else {
		tmpCountries = countries;
		tmpRegions = regions;
		tmpCount = regionCount+1;
	}
	var currentCount = 1;
	var choosenRegion = document.getElementById('arv_airport').value;
	var regionListClass = '';
	var maxRegionElements = maxElements;
	regionListText = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Reiseregion</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" />';
	if(tmpCount>maxElements*maxCols && (typeof(choosenCountry)=='undefined' || choosenCountry=='' || choosenCountry=='-1')) {
		regionListText += '<div style="height:350px;width:245px;display:block;overflow:auto;"><ul class="flyOutList" style="width:210px;margin-right:0;">';
		maxRegionElements = tmpCount;
	} else {
		regionListText += '<div style="display:block;"><ul class="flyOutList" style="width:175px;display:block;">';
	}
	if(choosenRegion=='-1') {
		regionListText += '<li class="first"><a href="javascript:setArvAirport(\'-1\',\'Alle Reiseregionen\')" style="background-color:#e1f0f6">Alle Reiseregionen</a></li>';
	} else {
		regionListText += '<li class="first"><a href="javascript:setArvAirport(\'-1\',\'Alle Reiseregionen\')">Alle Reiseregionen</a></li>';
	}
	if(typeof(choosenCountry)!='undefined' && choosenCountry!='-1' && choosenCountry!='') {
		for(var Country in tmpCountries) {
			if(tmpCountries[Country]['id']==choosenCountry) {
				for(var Region in tmpCountries[Country]['regions']) {
					currentCount++;
					if(regionListClass=='first') {
						regionListText += '<li class="first">';
						regionListClass = '';
					} else regionListText += '<li>';
					if(choosenRegion==tmpCountries[Country]['regions'][Region]['id']) {
						regionListText += '<a href="javascript:setArvAirport(\''+tmpCountries[Country]['regions'][Region]['id']+'\',\''+tmpCountries[Country]['regions'][Region]['name']+'\')" style="width:172px;background-color:#e1f0f6">'+tmpCountries[Country]['regions'][Region]['name']+'</a></li>';
					} else {
						regionListText += '<a href="javascript:setArvAirport(\''+tmpCountries[Country]['regions'][Region]['id']+'\',\''+tmpCountries[Country]['regions'][Region]['name']+'\')" style="width:172px;">'+tmpCountries[Country]['regions'][Region]['name']+'</a></li>';
					}
					if(currentCount%maxRegionElements == 0) {
						regionListText += '</ul><ul class="flyOutList" style=" width:175px;">';
						regionListClass = 'first';
					} else {
						regionListClass = '';
					}
				}
				break;
			}
		}
	} else if(typeof(choosenCountry)=='undefined' || choosenCountry=='' || choosenCountry=='-1') {
		for(var Region in tmpRegions) {
			if(regionListClass=='first') {
				regionListText += '<li class="first">';
				regionListClass = '';
			} else regionListText += '<li>';
			if(choosenRegion==tmpRegions[Region]['id']) {
				regionListText += '<a href="javascript:setArvAirport(\''+tmpRegions[Region]['id']+'\',\''+tmpRegions[Region]['name']+'\',\''+tmpRegions[Region]['id2']+'\',\''+tmpRegions[Region]['parent']+'\',\''+tmpRegions[Region]['parentName']+'\')" style="width:207px;background-color:#e1f0f6">'+tmpRegions[Region]['name']+'</a></li>';
			} else {
				regionListText += '<a href="javascript:setArvAirport(\''+tmpRegions[Region]['id']+'\',\''+tmpRegions[Region]['name']+'\',\''+tmpRegions[Region]['id2']+'\',\''+tmpRegions[Region]['parent']+'\',\''+tmpRegions[Region]['parentName']+'\')" style="width:207px;">'+tmpRegions[Region]['name']+'</a></li>';
			}
			/*if(currentCount%maxRegionElements == 0) {
				regionListText += '</ul><ul class="flyOutList" style=" width:175px;">';
				regionListClass = 'first';
			} else {
				regionListClass = '';
			}*/
			currentCount++;
		}
	}
	regionListText += '</div>';
	regionListText += '</ul><br class="clear" />';
	return regionListText;
}

function getTTAirports() {
	var currentCount = 1;
	var choosenAirport = document.getElementById('dpt_airport').value;
	airportListText = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Abflughafen</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" />';
	airportListText += '<div class="clearfix" style="margin-bottom:3px;"><hr/></div><br class="clear" />';
	if(choosenAirport=='-1' || choosenAirport=='') {
		airportListText += '<input type="checkbox" checked="checked" name="airportCheckboxes" onclick="toggleAirports(this)" id="noAirport" value="-1" />';
		airportListText += '<label for="noAirport" id="noAirportLabel" style="color:#0c83b7">Beliebiger Abflughafen</label><br class="clear" />';
	} else {
		airportListText += '<input type="checkbox" name="airportCheckboxes" onclick="toggleAirports(this)" id="noAirport" value="-1" />';
		airportListText += '<label for="noAirport" id="noAirportLabel">Beliebiger Abflughafen</label><br class="clear" />';
	}
	airportListText += '<p class="dptAirportHead">Deutsche Abflughäfen</p><br class="clear" /><div class="flyOutList" style="width:190px;">';
	for(var Airport in airports) {
		if(choosenAirport.indexOf(airports[Airport]['id'])!='-1') {
			airportListText += '<input type="checkbox" checked="checked" name="airportCheckboxes" onclick="toggleAirports(this)" id="airport'+airports[Airport]['id']+'" value="'+airports[Airport]['id']+'" />';
			airportListText += '<label for="airport'+airports[Airport]['id']+'" id="airport'+airports[Airport]['id']+'Label" style="color:#0c83b7">'+airports[Airport]['name']+'</label><br class="clear" />';
		} else {
			airportListText += '<input type="checkbox" name="airportCheckboxes" onclick="toggleAirports(this)" id="airport'+airports[Airport]['id']+'" value="'+airports[Airport]['id']+'" />';
			airportListText += '<label for="airport'+airports[Airport]['id']+'" id="airport'+airports[Airport]['id']+'Label">'+airports[Airport]['name']+'</label><br class="clear" />';
		}
		if(currentCount%9 == 0) {
			airportListText += '</div><div class="flyOutList" style=" width:190px;">';
		}
		currentCount++;
	}
	airportListText += '</div><br class="clear" />';
	currentCount = 1;
	airportListText += '<p class="dptAirportHeadE">Europäische Abflughäfen</p><br class="clear" /><div class="flyOutList" style="width:190px;">';
	for(var Airport in airportsE) {
		if(choosenAirport.indexOf(airportsE[Airport]['id'])!='-1') {
			airportListText += '<input type="checkbox" checked="checked" name="airportCheckboxes" onclick="toggleAirports(this)" id="airport'+airportsE[Airport]['id']+'" value="'+airportsE[Airport]['id']+'" />';
			airportListText += '<label for="airport'+airportsE[Airport]['id']+'" id="airport'+airportsE[Airport]['id']+'Label" style="color:#0c83b7">'+airportsE[Airport]['name']+'</label><br class="clear" />';
		} else {
			airportListText += '<input type="checkbox" name="airportCheckboxes" onclick="toggleAirports(this)" id="airport'+airportsE[Airport]['id']+'" value="'+airportsE[Airport]['id']+'" />';
			airportListText += '<label for="airport'+airportsE[Airport]['id']+'" id="airport'+airportsE[Airport]['id']+'Label">'+airportsE[Airport]['name']+'</label><br class="clear" />';
		}
		if(currentCount%4 == 0) {
			airportListText += '</div><div class="flyOutList" style=" width:190px;">';
		}
		currentCount++;
	}
	airportListText += '</div><br class="clear" />';
	airportListText += '<div style="float:right;margin-top:10px;margin-right:10px;text-align:right;width:155px; color:#0C83B7"><a href="javascript:setTTAirport();" style="display:block;height:20px;padding-right:25px;padding-top:1px;color:#0C83B7;background:transparent url(/css/images/btn/btnArrow.gif) right top no-repeat;" title="Auswahl übernehmen">Auswahl übernehmen</a></div><br class="clear" />';
	return airportListText;
}

function getBudget(){
	var price = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Reisebudget pro Person</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" /><ul class="flyOutList" style="width:210px;margin-right:0;">';
	var currentBudget = document.getElementById('budget').value;
	for(key in TTPrice){
		var entry = TTPrice[key].split(";");
		if(entry[1]==-1) var li_class = ' class="first"';
		else var li_class = '';
		if(entry[1] == currentBudget) {
			price += '<li'+li_class+'><a href="javascript:setBudget(\''+entry[0]+'\', \''+entry[1]+'\')" style="width:207px;background-color:#e1f0f6;">'+entry[0]+'</a></li>';
		} else {
			price += '<li'+li_class+'><a href="javascript:setBudget(\''+entry[0]+'\', \''+entry[1]+'\')" style="width:207px;">'+entry[0]+'</a></li>';
		}
	}
	price += '</ul><br class="clear" />';
	setElementPosition('formText_budget', 'panelFlyOut', -6, 0);
	if(showFlyOut('formText_budget', 240)){
		$("#flyOutCt").html(price);		
	}
}
function setBudget(name, value){
	document.getElementById('budget').value = value;
	document.getElementById('budgetText').value = name;
	document.getElementById('formText_budget').innerHTML = 	name;
	closeFlyOut();
}

function toggleAirports(obj) {
	var airportName = '';
	var airportLabel = '';
	document.getElementById(obj.id+'Label').style.color = '#0c83b7';
	if(obj.value=='-1') {
		var checkboxSet = document.getElementsByName('airportCheckboxes');
		for(var i=0;i<checkboxSet.length;i++) {
			if(checkboxSet[i].checked && checkboxSet[i].value!='-1') {
				airportName = "airport"+checkboxSet[i].value;
				airportLabel = "airport"+checkboxSet[i].value+"Label";
				document.getElementById(airportName).checked = false;
				document.getElementById(airportLabel).style.color = '';
			}
		}
	} else {
		document.getElementById('noAirport').checked = false;
		document.getElementById('noAirportLabel').style.color = '';
	}
}

function setTTAirport() {
	var airportValues = '';
	if(document.getElementById('noAirport').checked) {
		document.getElementById('dpt_airport').value = '-1';
		document.getElementById('dpt_airportText').value = 'Beliebiger Abflughafen';
		document.getElementById('formText_dpt_airport').innerHTML = 'Beliebiger Abflughafen';
		document.getElementById('isAuto').value = '0';
	} else {
		var airportCounter = 0;
		var checkboxSet = document.getElementsByName('airportCheckboxes');
		for(var i=0;i<checkboxSet.length;i++) {
			if(checkboxSet[i].checked == true) {
				airportValues += checkboxSet[i].value+",";
				airportCounter++;
			}
		}
		if(airportCounter!=0 && airportCounter>1) {
			document.getElementById('dpt_airport').value = airportValues;
			document.getElementById('dpt_airportText').value = 'Mehrfachauswahl';
			document.getElementById('formText_dpt_airport').innerHTML = 'Mehrfachauswahl';
			document.getElementById('formText_dpt_airport').className = 'valueSet';
			document.getElementById('isAuto').value = '0';
		} else if(airportCounter==1) {
			for(var Item in airports) {
				if(airports[Item]['id']==airportValues.substring(0,airportValues.length-1)) {
					var tmpAirportName = airports[Item]['name'];
					break;
				}
			}
			if(typeof(tmpAirportName)=='undefined') {
				for(var Item in airportsE) {
					if(airportsE[Item]['id']==airportValues.substring(0,airportValues.length-1)) {
						var tmpAirportName = airportsE[Item]['name'];
						break;
					}
				}
			}
			document.getElementById('dpt_airport').value = airportValues;
			document.getElementById('dpt_airportText').value = tmpAirportName.toString().substring(0,20);
			document.getElementById('formText_dpt_airport').innerHTML = tmpAirportName.toString().substring(0,20);
			document.getElementById('formText_dpt_airport').className = 'valueSet';
			document.getElementById('isAuto').value = '0';
		}
	}
	closeFlyOut();
}

function getTTDurations() {
	var currentCount = 1;
	var currentTravelDays = document.getElementById('travel_days').value;
	durationListText = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Reisedauer</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" /><ul class="flyOutList" style="width:110px;">';
	for(var Duration in durations) {
		if(currentCount==1 || currentCount==5) var li_class = ' class="first"';
		else var li_class = '';
		if(currentTravelDays==durations[Duration]['id']) {
			durationListText += '<li'+li_class+'><a href="javascript:setTravelDays(\''+durations[Duration]['id']+'\',\''+durations[Duration]['txt']+'\')" style="background-color:#e1f0f6">'+durations[Duration]['txt']+'</a></li>';
		} else {
			durationListText += '<li'+li_class+'><a href="javascript:setTravelDays(\''+durations[Duration]['id']+'\',\''+durations[Duration]['txt']+'\')">'+durations[Duration]['txt']+'</a></li>';
		}
		if(currentCount == 4) {
			durationListText += '</ul><ul class="flyOutList" style="width:110px;">';
		}
		currentCount++;
	}
	durationListText += '</ul><br class="clear" />';
	return durationListText;
}

function getTTThemen() {
	var currentCount = 1;
	var currentThema = document.getElementById('themen').value;
	themenListText = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Thema</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" /><ul class="flyOutList" style="width:180px;">';
	for(var Thema in themen) {
		if(currentThema==themen[Thema]['id']) {
			themenListText += '<li><a href="javascript:setPhThemen(\''+themen[Thema]['id']+'\',\''+themen[Thema]['txt']+'\')" style="background-color:#e1f0f6">'+themen[Thema]['txt']+'</a></li>';
		} else {
			themenListText += '<li><a href="javascript:setPhThemen(\''+themen[Thema]['id']+'\',\''+themen[Thema]['txt']+'\')">'+themen[Thema]['txt']+'</a></li>';
		}
		if(currentCount == 6) {
			themenListText += '</ul><ul class="flyOutList" style="width:180px;">';
		}
		currentCount++;
	}
	themenListText += '</ul><br class="clear" />';
	return themenListText;
}

function getTTTravelers() {
	var currentCount = 1;
	var currentTravelers = document.getElementById('travelers').value;
	var maxTravelers = (travelType=='PH') ? '6' : '6';
	travelersListText = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Erwachsene</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" />';
	travelersListText += '<div class="clearfix" style="margin-bottom:3px;"><hr/></div><br class="clear" />';
	travelersListText += '<p style="width:260px;float:left;">Bei mehr als '+maxTravelers+' Teilnehmern erstellt Ihnen unser <a href="/service-hilfe/kontakt/reiseberatung.php" class="laufTxt" title="Reiseberatung" target="_blank">Online-Service-Center</a> gerne ein individuelles Angebot. Kinder unter 2 Jahren werden dabei nicht als Reiseteilnehmer gezählt und reisen umsonst.</p><br class="clear" /><ul class="flyOutList" style="width:100px;">';
	for(var Traveler in travelers) {
		if(currentCount%3 != 0 ) var li_class = ' class="first"';
		else var li_class = '';
		if(currentTravelers==travelers[Traveler]['id']) {
			travelersListText += '<li'+li_class+'><a href="javascript:setTravelers(\''+travelers[Traveler]['id']+'\',\''+travelers[Traveler]['txt']+'\')" style="background-color:#e1f0f6">'+travelers[Traveler]['txt_long']+'</a></li>';
		} else {
			travelersListText += '<li'+li_class+'><a href="javascript:setTravelers(\''+travelers[Traveler]['id']+'\',\''+travelers[Traveler]['txt']+'\')">'+travelers[Traveler]['txt_long']+'</a></li>';
		}
		if(currentCount%3 == 0 ) {
			travelersListText += '</ul><ul class="flyOutList" style="width:100px;">';
		}
		currentCount++;
	}
	travelersListText += '</ul><br class="clear" />';
	return travelersListText;
}

function getTTAge(childId) {
	var currentCount = 1;
	var currentAge = document.getElementById('child'+childId+'Age').value;
	childListText = '<p style="width:auto;float:left;font-size:16px;font-weight:bold;">Alter Kind '+childId+'</p><a href="javascript:void(0);" onclick="closeFlyOut();" class="closeFlyOut">x</a><br class="clear" />';
	childListText += '<div class="clearfix" style="margin-bottom:3px;"><hr/></div><br class="clear" />';
	childListText += '<p style="width:260px;float:left;">Bitte geben Sie das Alter Ihres Kindes<br /><strong>bei Reiseantritt</strong> an!<br />Bei Buchungswünschen mit mehr als 3 Kindern erstellt Ihnen unser<br /><a href="/service-hilfe/kontakt/reiseberatung.php" class="laufTxt" title="Reiseberatung" target="_blank">Online-Service-Center</a> gerne ein individuelles Angebot.</p><br class="clear" />';
	childListText += '<ul class="flyOutList" style="width:85%;margin-bottom:5px;"><li class="first"><a href="javascript:setChildAge(\''+childId+'\',\'\',\'Kind '+childId+'\')">Eingabe zurücksetzen</a></li></ul><br class="clear" />';
	childListText += '<ul class="flyOutList" style="width:100px;">';
	for(var Child in children) {
		if(currentCount==1 || currentCount==9) var li_class = ' class="first"';
		else var li_class = '';
		if(currentAge==children[Child]['id']) {
			childListText += '<li'+li_class+'><a href="javascript:setChildAge(\''+childId+'\',\''+children[Child]['id']+'\',\''+children[Child]['txt']+'\')" style="background-color:#e1f0f6">'+children[Child]['txt_long']+'</a></li>';
		} else {
			childListText += '<li'+li_class+'><a href="javascript:setChildAge(\''+childId+'\',\''+children[Child]['id']+'\',\''+children[Child]['txt']+'\')">'+children[Child]['txt_long']+'</a></li>';
		}
		if(currentCount == 8) {
			childListText += '</ul><ul class="flyOutList" style="width:100px;">';
		}
		currentCount++;
	}
	childListText += '</ul><br class="clear" />';
	return childListText;
}

//---Ueberpruefung, ob Regionen/Termine/VA's geladen werden konnten
function TTCACHE(){
	//alert(TTAFH);
	if(typeof(window['TTREGS_654'])=='undefined' || typeof(window['arrMarke_654'])=='undefined' || typeof(window['TTREGS_653'])=='undefined'){
		window.setTimeout("TTCACHE()",20);
		return;
	}
	TTRegionen = TTREGS_654;
	TTRegionenErde = TTREGS_653;
	TTVeranstalter = arrMarke_654;
	TTTermin_min = termin_min_654;
	TTTermin_max = termin_max_654;
	TTTermin_min_erde = termin_min_653;
	TTTermin_max_erde = termin_max_653;
	TTTermin_min = localDate(TTTermin_min);
	TTTermin_max = localDate(TTTermin_max);
	TTTermin_min_erde = localDate(TTTermin_min_erde);
	TTTermin_max_erde = localDate(TTTermin_max_erde);
	initTTpanel();
}
/*
incFile(pfad_TTREGS);
incFile(pfad_TTREGS_erde);
incFile(pfad_TTVAT);
incFile(pfad_TTVAT_erde);
*/
