$(document).ready(function(){	$("#nav1 td.lnx").hover(function() { $(this).addClass("lnxHov") },function() { $(this).removeClass("lnxHov") });		//$("#offersSpaceContainer2").css('display','none'); This needs to be loaded when the slider rendering have been finished ==> see further down	$('#otb #tabs2 li a').click(function(e){		$(this).parents('ul#tabs2').find('li').removeClass('act');		$(this).parent().addClass('act').removeClass('left');		e.preventDefault();		$(this).parent().prevAll().addClass('left');		//Get the index		index = $(this).attr("index");		$("#offersSpaceContainer1").css('display','none');		$("#offersSpaceContainer2").css('display','none');		$("#offersSpaceContainer" + (index)).css('display','block');	});   $('#etacountry, select#xettcountry, #car').selectBox({entries:"8"});    $('#etastation,  select#xettstation').selectBox({entries:"8", showDetails:true});        $('#check_code').click(function(){	// now toggle here because of cross browser issues,bubbleevents        if($(this).is(':checked'))		{			$('#codeOptional').slideDown();		} else {			$('#codeOptional').slideUp();		}    });	$('label[for="check_code"]').click(function(){		$('#codeOptional').slideToggle();	});	$('#ettcountry_ro a').click(function(e){			var xS = $(this).prevAll('select');		var d = $(this).parents('div:eq(0)');		//d.next().show();		d.replaceWith( xS );		xS.selectBox({entries:"8"});		$('#ettstation_ro a').trigger('click');		try{gCTR2changed = 0;}catch(e){}		e.preventDefault();	})	$('#ettstation_ro a').click(function(e){			var xS = $(this).prevAll('select');		var d = $(this).parents('div:eq(0)');		d.prevAll('.restrictStations').find('table').show();		x = $('input[name="restrictstationsSTA"]:checked').val();		$('#restrictstationsILC' + x ).attr('checked','checked');		//restrictstationsILC		d.replaceWith( xS );		xS.selectBox({entries:"8", showDetails:true});		e.preventDefault();	})	$('#cor_ro a').click(function(e){			var xS = $(this).prevAll('select');		var d = $(this).parents('div:eq(0)');		d.replaceWith( xS );		xS.selectBox({entries:"8", showDetails:false});		e.preventDefault();		$('#check_code').css({position:'relative'});	})	//== cargroup-selector	$('#cargroupSelector li a').click(function(e){		$(this).parents('ul').find('li').removeClass('act');		$(this).parent().addClass('act');		e.preventDefault();	})	// Offersspace 1	var api = $("div.#offersSpaceContent1").scrollable({		next:'#offersSpaceContainer1Next',		prev:'#offersSpaceContainer1Prev',		prevPage: '#offersSpaceBottomNavPrevLink1',		nextPage: '#offersSpaceBottomNavNextLink1',		api:true,		size:1,		speed:1000,		onSeek:function(){			this.getRoot().parents().find("#offersSpaceBottomPageCounter1").text(this.getPageIndex()+1);		}	});     	if( api ){	     if (api.getPageAmount() <= 1 ){	     	//alert('items:' + api.getItems().length + "anzeigemenge:" + api.getSize())			$("#offersSpaceBottomNavNextLink1").addClass("disabled")			api.getRoot().parents('.sliderContainer').find(".sliderNext").hide();		}  		api.getRoot().parents().find("#offersSpaceBottomPageCounter1").text(api.getPageIndex()+1);		api.getRoot().parents().find("#offersSpaceBottomPageCounterTotal1").text(api.getPageAmount());	}    // Offersspace 2	var api2 = $("div.#offersSpaceContent2").scrollable({		next:'#offersSpaceContainer2Next',		prev:'#offersSpaceContainer2Prev',		prevPage: '#offersSpaceBottomNavPrevLink2',		nextPage: '#offersSpaceBottomNavNextLink2',		api:true,		speed:1000,		size:1,		onSeek:function(){			this.getRoot().parents('.sliderContainer').find("#offersSpaceBottomPageCounter2").text(this.getPageIndex()+1);		}	});		if( api2){	     if (api2.getPageAmount() <= 1 ) {			$("#offersSpaceBottomNavNextLink2").addClass("disabled")			api2.getRoot().parents('.sliderContainer').find(".sliderNext").hide();		}		api2.getRoot().parents().find("#offersSpaceBottomPageCounter2").text(api2.getPageIndex()+1);		api2.getRoot().parents().find("#offersSpaceBottomPageCounterTotal2").text(api2.getPageAmount());	 }    // ReasonSpace  	var api_reason = $("div.#reasonSpaceContainer").scrollable({		next: '#reasonSpaceContainerNext',		prev: '#reasonSpaceContainerPrev',		api:true,		clickable:false,		size:3,		onSeek:function(){			if(this.getIndex() == 0) $("#reasonSpaceBottomNavPrevLink").addClass("disabled");			else  $("#reasonSpaceBottomNavPrevLink").removeClass("disabled");        	        if (this.getIndex() >= this.getSize() - this.getConf().size) $("#reasonSpaceBottomNavNextLink").addClass("disabled");	        else  $("#reasonSpaceBottomNavNextLink").removeClass("disabled");	    }    });    	if(api_reason)	{		//       	if (api_reason.getItems().length <= api_reason.getSize() ){        	if (api_reason.getPageAmount() <= 1 ){			$("#reasonSpaceBottomNavNextLink").addClass("disabled")			$('#reasonSpaceContainer').find(".sliderNext").hide();		}        			$("#reasonSpaceBottomNavPrevLink").click(function(){			api_reason.prev();		});		$("#reasonSpaceBottomNavNextLink").click(function(){			api_reason.next();		});	}            // LocationSpace  var api3 = $("div.#locations").scrollable({    prevPage: '#locationSpaceBottomNavPrevLink',    nextPage: '#locationSpaceBottomNavNextLink',    api:true,    size:1,    onSeek:function(){        this.getRoot().siblings().find(".pageCounter").text(this.getPageIndex()+1);    }    });    if( api3){    api3.getRoot().siblings().find(".pageCounter").text(api3.getPageIndex()+1);    api3.getRoot().siblings().find(".pageCounterTotal").text(api3.getPageAmount());      }		// == styling for offer und reasonspace    $('.cts').before('<div class="container c305t"></div>');    $('.cts').after('<div class="container c305b"></div>');    $('.cts').addClass('ccb c305');    $('.cts').removeClass('container');    $('.ctm').before('<div class="container c630t"></div>');    $('.ctm').after('<div class="container c630b"></div>');    $('.ctm').addClass('ccb c630');    $('.ctm').removeClass('container');    $('.ctl').before('<div class="container c955t"></div>');    $('.ctl').after('<div class="container c955b"></div>');    $('.ctl').addClass('ccb c955');    $('.ctl').removeClass('container');    $('.container.cl').before('<div class="container c955t"></div>');    $('.container.cl').after('<div class="container c955b"></div>');    $('.container.cl').addClass('ccb c955');    $('.container.cl').removeClass('container');				/* == STEP 2 == */	//== cargroup-selector	$('#cargroupSelector li a').click(function(e){		sel = $(this);		sel.parents('ul').find('li').removeClass('act');		sel.parent().addClass('act');		sel_cg = sel.attr('href').split('#')[1];		if( !(sel_cg == 'all') )		{			$('.cargroup:not(.not' + sel_cg+')').show();			$('.not' + sel_cg ).fadeOut();		}		else		{			$('.cargroup').show();		}		e.preventDefault();	})	//== price	$('.cg_details img').click(function(){		var pp = $(this).parents('.cargroup').find('td.pp');		var pr = $(this).parents('.cargroup').find('td.pr');		if( pp.length ) {			pp.trigger('click');		} else {			pr.trigger('click');		}	})			$('.cg_price td.pr, .cg_price td.pp').click(function(){		if( !$(this).find('input').length ) {			return;		}		var cell = $(this);		var cell_class = cell.attr('class');				$('.pr, .pp').removeClass('active').removeClass('inactive').find('input').removeAttr('checked');		cell.addClass("active" ).removeClass('inactive');		cell.siblings('td').removeClass('active').addClass('inactive')		cell.find('input').attr('checked', 'checked');				var cg_extras = $(this).parents('.cargroup').find('.cg_extras');		$('.cg_extras').hide();		if( !cg_extras.find('.loading').length && !(cg_extras.is(':visible')) )		{			$('.cg_extras').slideUp();						$('#addextras').appendTo( cg_extras.find('.addextras') ).show();			var xrf = cg_extras.find('.addextras').next().empty().addClass("inclusions");			try{console.log(xrf.html())}catch(e){}						cg_extras.show(); // ie fix, please leave.			cg_extras.find('select').hide();			cg_extras.css({position:'relative'}).slideDown().append(				'<div class="loading" style="background-color:#ccc;opacity:0.7;filter:alpha(opacity=70);position:absolute;top:10px;bottom:10px;left:10px;z-index:1001;width:576px;float:left;"></div>' + 				'<div class="loading" style="padding:2em;text-align:center;background-color:#fff;position:absolute;top:30px;right:50px;width:452px;z-index:1002;">'+					'<div class="subh" style="text-align:center;padding-bottom:2em;">' + gWaitText + '</div>'+					"<div>"+ gWaitImageURL  +"</div>"+  				'</div>'			);			if ( $.browser.msie &&  $.browser.version < 6.5 ) // IE6 FIX			{				cg_extras.find('.loading:first').height( cg_extras.height()-20-50 ).css({left:"-5px"})			}		}		// needs to be 		var cargrp = cell.parents('div.cargroup').attr('id');		var reqcg = cargrp.split('_')[1];		    reqcg = reqcg.toUpperCase();		var rate = poaPrices[ cargrp ].rat;		/* AJAX-Request for extras  */		cg_extras.find('.exclusions').remove();		$.get(			inclusionUrl + "&RAT=" + rate + "&GRP=" + reqcg,			function(data){				//try{console.log(data)}catch(e){}				cg_extras.find('.inclusions').replaceWith('<div>' + (data) + '</div>').slideDown(); //old call, do not remove				//cg_extras.find('.inclusions').html(data);				//cg_extras.find('.continue').before( data );				if ( $.browser.msie &&  $.browser.version < 6.5 )				{					cg_extras.find('.loading:first').height( cg_extras.height()-20-50 ).css({left:"-5px"})				}				window.setTimeout("	$('.loading').remove();$('.cg_extras select:hidden').show()	", 2000);			},"html"		)				if( cell.parents('div.cargroup').find('.pr.active').length )		{			$( '#' + cargrp + " .continue .par").hide();			$( '#' + cargrp + " .continue .par2").show();				} else {			$( '#' + cargrp + " .continue .par2").hide();			$( '#' + cargrp + " .continue .par").show();		}		/*				// -- CALL recalculate SE in Form ReservationStep2 --*/			recalculateSEPrice( $('#ADDR'), "");						});			if( typeof( openSingleCGWithPrice) != "undefined" && typeof( openSingleCGIndex ) != "undefined"  ) {		if ( openSingleCGWithPrice == "POA" )		{			$('.cargroup:eq('+ openSingleCGIndex+ ') .cg_price td.pr').trigger('click');		}		if ( openSingleCGWithPrice == "PP" )		{			$('.cargroup:eq(' + openSingleCGIndex + ') .cg_price td.pp').trigger('click');		}	}	// == local information toggle	$('a#sli').click(		function(){			link = $(this);			$('#sli_det').slideToggle('',function(){				link.toggleClass('down');			});			link.find('.show, .hide').toggle();			return false;		}	);			$('a#sfr').click(		function(){					link = $(this);			$('#sfr_det').slideToggle('',function(){				link.toggleClass('down');			});			link.find('.show, .hide').toggle();			return false;		}	);			/* JS HOVER TOOLTIPS ( FIX FOR IE6 ) */	$('.info').live('mouseover', function(){		xBodyWidth = $('body').width() - 30;				var off = $(this).offset();		var txt = $(this).find('.txt')		txt2 = txt.clone()		txt2.appendTo('body');		if( off.left + 210 > xBodyWidth )		{			$(this).removeClass('info_hover').addClass('info_left_hover');			txt2.css({				position: 'absolute',				top: off.top - 15,				left: off.left - 212,				display: 'block'			});					}else{			$(this).addClass('info_hover');			txt2.css({				position: 'absolute',				top: off.top - 15,				left: off.left + 26,				display: 'block'			});		}							})	$('.info').live('mouseout',function(){		$(this).removeClass('info_hover').removeClass('info_left_hover');		$('body > .txt').remove();	})	$('body > .txt').mouseover(		function(e){			e.preventDefault();		}	)					/* JS HOVER TOOLTIPS for details ( FIX FOR IE6 ) */	$('.details input, .details select').focus(		function(){			$(this).next('span.details_infow').addClass('details_infow_hover');			var off= $(this).parents('td').offset();					var txt = $(this).next('span.details_infow')			txt2 = txt.clone().appendTo('body');			txt2.css({				position: 'absolute',				top: off.top - 10,				left: off.left + 183,				display:'block'			});					})		$('.details input, .details select').blur(		function(){			$(this).next().removeClass('details_infow_hover');			$('body > .details_infow').remove();		}	)			/* fix for ie for step 2*/	$('.continue a.bb').hover(		function(){			$(this).find('span').css({				color:'#ff9800',				backgroundPosition: 'left -30px'			})		},		function(){			$(this).find('span').css({				color:'#fff',				backgroundPosition: 'left 0px'			})				}	)	$('.upgrade a.bs').hover(		function(){			$(this).find('span').css({				color:'#00338d',				backgroundPosition: 'left -22px'			})		},		function(){			$(this).find('span').css({				color:'#ff9800',				backgroundPosition: 'left 0px'			})				}	)})/*==== NORMAL JS FUNCTIONS AFTER HERE ====*//* QUICKBOOKING FUNCTIONS FOR Iq-SHARE and IBE*/function adjustETT(iDay, iMonth, iYear , iSep, iDiff){	var xF = document.forms[0];	var Day = Number( iDay );	var Month = Number( iMonth );	var Year = Number( iYear );	var Diff = iDiff ;	var Stop = 31;		if( Month==4 ||Month==6 || Month==9 || Month==11 )  {		--Stop;		xxx = "Month = 4,6,9,oder 11";	}	if(Month==2){		Stop =28;		xxx = "Month = 2";		if(Year%4==0) Stop++;		if(Year%100==0) Stop--;		if(Year%400==0) Stop++;	}	if ((Day + Diff) > Stop){		if (Month == 12){			var  xMonth = 1  + '';			var xDay =  Day + Diff - Stop   + '';   			var xYear = Year+1 ;		}		else{			var xMonth = Month+1   + '';			var xDay =  Day + Diff - Stop   + '';			var xYear = Year  ;		}	}	else{		xMonth = Month   + '';		xDay = Day + Diff   + '';		xYear = Year  ;	}	if( xMonth.length == 1) 		xMonth = '0' + xMonth;	if( xDay.length == 1) 		xDay = '0' + xDay;	var xNewDate = gDateFormat.replace(/dd/ , xDay).replace(/mm/ , xMonth).replace(/yy/g , xYear);	$('input[name="ettDate"]').val( xNewDate );}function loadCarGroups( iURL,  iSTA, iDefaultGRP ){	gSelectedSTA = iSTA;	$.get( iURL + '&STA=' + gSelectedSTA +  '&RAN=' + Math.random() , 		function(data){			toggleCarGroups( data , iDefaultGRP);			}		);}function setReturnLocation( iSTA ){	if( gILCchanged == false){		var 	xSelectILC = $('#ettstation');		$('#ettstationTXT').text( $('#etastation').find('option:selected').text());		xSelectILC.val( $('#etastation').val() );		xSelectILC = xSelectILC.parent();		xSelectILC.find( '.display' ).text( xSelectILC.find('option:selected').text());	}}function toggleCarGroups( iXMLOutput , iDefault ){	var xSelectGRP = $('#car');	xHTML= '';	xLbl = $( '#PleaseSelectGRP' ).val();	 	if( iXMLOutput.search(/^ERROR/) == -1)	{		var xSelected = false;				var xTextArray;		var xLocList = unescape(decodeURI(iXMLOutput.replace( /\n/, ""))).split('~'); 		xHTML += '<option value="">' + xLbl + '</option>';		for( var i=0; i<xLocList.length; i++)		{			xTextArray = xLocList[i].split('|');						if( xTextArray[1] == iDefault){				xHTML += '<option value="' + xTextArray[1] + '" selected="selected">' + xTextArray[0] + '</option>';				xDefaultFound = true;			}			else				xHTML += '<option value="' + xTextArray[1] + '">' + xTextArray[0] + '</option>';		}		}	xSelectGRP.html( xHTML);	xSelectGRP = xSelectGRP.parent();	xSelectGRP.find( '.display' ).text( xSelectGRP.find('option:selected').text());}function loadLocationDetailsData( iXMLOutput ){ 	if( iXMLOutput.search(/^ERROR/) == -1)	{		var xSelected = false;				var xHTML = '';		var xAllLocationsListEntry ='';		var xMenmonicCode = '';		var xDetails = '';		var xAllLocationsList = unescape(decodeURI(iXMLOutput.replace( /\n/, "") )).split('~'); 		// go through the list and write data into object		//=========================================================================		for( var xCounter = 0; xCounter < xAllLocationsList.length; xCounter++)			{			xAllLocationsListEntry = xAllLocationsList[xCounter].split('$A$');	// left from $A$ = label and value, right from $A$ = 1 if airport stat			xMenmonicCode = xAllLocationsListEntry[0];			xDetails =  xAllLocationsListEntry[1];			stationDetails[ xMenmonicCode ] =  xDetails ;		}	} }function wrapError( _elem, _message ){	if( $( _elem ).parents('.errWrapper').length )	{		$('.qb_errordiv .qb_top_error').append( '<div class="errCt">' + _message + '</div>' );		return;	}	$( _elem ).parents('.select_replace, table').wrap('<div class="errWrapper"></div>').parent().append('<div class="errMessage">'+ _message +'</span>')	$('.qb_errordiv .qb_top_error').append( '<div class="errCt">' + _message + '</div>' );}function wrapErrorInner( _elem, _message ){	if( $( _elem ).parents('.errWrapper').length )	{		$('.qb_errordiv .qb_top_error').append( '<div class="errCt">' + _message + '</div>' );		return;	}	$( _elem ).wrap('<div class="errWrapper"></div>').parent().append('<div class="errMessage">'+ _message +'</span>')	$('.qb_errordiv .qb_top_error').append( '<div class="errCt">' + _message + '</div>' );}function removeError( _elem ){	var dd = $( _elem ).parents('.select_replace, table, td');	$( _elem ).parents('.errWrapper').replaceWith(dd);}function removeErrorInner( _elem ){	var dd = $( _elem );	$( _elem ).parents('.errWrapper').replaceWith(dd);}validate = function(){	$('.errCt').remove();	$('.qb_errordiv').hide()	var ret = true;	/*  PICKUP VALIDATION */	if( 	$('#etacountry').val() == "" 	) {wrapError( '#etacountry', gErrMSG01 );		ret = false;	}else (removeError('#etacountry') )		/*  COR VALIDATION */	if( 	$('#cor').val() == "" 	) {wrapError( '#cor', gErrMSG08 );		ret = false;	}else (removeError('#cor') )	if( 	$('#etastation').val() == "" 	) {wrapError( '#etastation', gErrMSG01 );		ret = false;	} else (removeError('#etastation') )	/* DATE VALIDATION */	var etaDate = $('#etaDate').datepicker('getDate' );		etaDate.setHours( $('#etatimehour').val() );		etaDate.setMinutes( $('#etatimeminute').val() );	var ettDate = $('#ettDate').datepicker('getDate' );		ettDate.setHours( $('#etttimehour').val() );		ettDate.setMinutes( $('#etttimeminute').val() );	var dateDiff = ettDate - etaDate;	if( dateDiff <= 0  )	{		wrapErrorInner( '.date:has(#ettDate)' , gErrMSG03  );		$('#ettDate').parents('.errWrapper').css({marginTop:"15px"});		$('#ettDate').parents('table').css({marginTop:"16px"});		ret = false;	} else {removeErrorInner('.date:has(#ettDate)') }	if( $('#dropoffLocationSec .select_replace').length )	{		$('#dropoffLocationSec .select_replace select').each(			function() 			{				if( $(this).val() == '' ) 				{					wrapError( ( '#' + $(this).attr('id') ), gErrMSG02 );				}			}		)	} 	if( $('#check_code').is(':checked') )	{		bcd = $('#bcd').val();		testBCD = /\b([a-zA-Z][0-9]{6})\b/;		if( $('#bcd').length && bcd != "" &&  !testBCD.test( bcd ) )		{			wrapErrorInner( '#bcd' , gErrMSG04  );			ret = false;		} //else (removeErrorInner('#bcd') )		bcn = $('#bcn').val();		testBCN = /\b([a-zA-Z0-9]{6})\b/;		if( $('#bcn').length && bcn != "" && !testBCN.test( bcn ) )		{			wrapErrorInner( '#bcn' , gErrMSG06  );			ret = false;		}else (removeErrorInner('#bcn') )		removeErrorInner('#code_surname')		removeErrorInner('#bcn')		if(  $('#bcn').length && bcn != "" && $('#code_surname').val() == "" )		{			wrapErrorInner( '#code_surname' , gErrMSG05  );			ret = false;		}		if(  $('#bcn').length && bcn == "" && $('#code_surname').val() != "" )	{			wrapErrorInner( '#bcn' , gErrMSG07  );			ret = false;		}	}	if( $('#car').parents('.select_replace:visible').length )	{		if( gIsCarMandatory && ($('#car').val() == "") )		{			wrapError( '#car', gErrMSG09 );			ret = false;		}	}	if(ret == false)	{		$('.qb_errordiv').show();	}	return ret;}function toggleFilteredLocations( iXMLOutput, iType, iCrossBorder, iDefault, iName, iCountry ){//	try{console.log(//		 ","+ iType +","+ iCrossBorder +","+ iDefault +","+ iName +","+ iCountry//	)}catch(e){}	//alert('START TOOGLE LOCATION');	ReturnLocationFixed = false;	var xTargetItemSTA = document.getElementById( 'etastation' );	var xTargetItemILC = document.getElementById( 'ettstation');	 		if( iXMLOutput.search(/^ERROR/) == -1)		{			var xSelected = false;					var yAir = 0;			var yFav = 0;			var yFavAir = 0;			var yFavDown = 0;			var yDow = 0;			var xDefaultFound = false;			var Default = ''; 			var xTextArray;			var xHTML = ''; 			var xAllLocationsList = new Array();			var xAllLocationsListEntry = new Array();			var xFavList = new Array();			var xFavListComplete = new Array();			var xFavListCompleteAir = new Array();			var xFavListCompleteDown = new Array();			var xAirportListComplete = new Array();			var xDowntownListComplete = new Array(); 			var xFav = $( '#CookieStations' );			xFavList = xFav.val().split('~');  			var xAllLocationsList = unescape(decodeURI(iXMLOutput.replace( /\n/, "") )).split('~');  			// go through the list and write airport staions and downtown stations into different lists			//=========================================================================			for( var xCounter = 1; xCounter < xAllLocationsList.length; xCounter++)	// the 1st entry is always '- - - - - - | -1' . 1st value is written by AjaxWebServices agent			{				xAllLocationsListEntry = xAllLocationsList[xCounter].split('$A$');	// left from $A$ = label and value, right from $A$ = 1 if airport stat				var xLocList = xAllLocationsListEntry[0]; 				if( xLocList != '' )				{					var xAirportFlag = 0; 					if( xAllLocationsListEntry[1] && (xAllLocationsListEntry[1] == '1') )						xAirportFlag = 1;									if( xAirportFlag )	// >>> write airport stations into a list ============						{						xAirportListComplete[yAir] = xLocList ;		//array with airport stations						yAir++;												// >>> write favorits into a list airport only ============						xTextArray = xLocList.split('|');						for( var c=0; c<xFavList.length; c++)						{								if( xTextArray[1] == xFavList[c] )							{								xFavListCompleteAir[yFavAir]= xLocList;	//array with favorit stations								yFavAir++;							}						}																	}									else			// >>> write downtown stations into a list ============					{						xDowntownListComplete[yDow] = xLocList ;	//array with favorit stations						yDow++;												// >>> write favorits into a list downtown only ============						xTextArray = xLocList.split('|');						for( var c=0; c<xFavList.length; c++)						{								if( xTextArray[1] == xFavList[c] )							{								xFavListCompleteDown[yFavDown]= xLocList;	//array with favorit stations								yFavDown++;							}						}					} 					// >>> write favorits into a list ============					xTextArray = xLocList.split('|');					for( var c=0; c<xFavList.length; c++)					{							if( xTextArray[1] == xFavList[c] )						{							xFavListComplete[yFav]= xLocList;	//array with favorit stations							yFav++;						}					}				}			}						//+++ assign correct list of favorites +++++++++++++++++++++++++++++++			if( iType=='a')				xFavListComplete = xFavListCompleteAir;			else if( iType=='c')				xFavListComplete = xFavListCompleteDown;			 			// go through all lists and write stations into the fields			//========================================================================= 			xLbl = $( '#PleaseSelectSTA' ).val();			xHTML += '<option value="">' + xLbl  + '</option>';						// >>> write FAVORITS into stations fields ============			if( xFavListComplete.length > 0 )			{				xLbl = $( '#FavoriteLocations' ).val();	// headline Favorits				xHTML += '<optgroup label="' + xLbl + '">';				for( var i=0; i< xFavListComplete.length; i++){					xTextArray = xFavListComplete[i].split('|');															if( xTextArray[1] == iDefault){						xHTML += '<option value="' + xTextArray[1] + '" selected="selected">' + xTextArray[0] + '</option>';						xDefaultFound = true;					}					else						xHTML += '<option value="' + xTextArray[1] + '">' + xTextArray[0] + '</option>';				}				xHTML += '</optgroup>';			} 				// >>> write Airports into stations fields ============			if( xAirportListComplete.length > 0 )			{				if( iType == 'ALL' | ( iType == 'a'  & xFavListComplete.length > 0 ) ){					xLbl = $( '#AirportLocations' ).val();	// headline Airports					xHTML += '<optgroup label="' + xLbl + '">';				}				if( iType == 'a' || iType == 'ALL'){					for( var i=0; i< xAirportListComplete.length; i++){						xTextArray = xAirportListComplete[i].split('|');						if( xTextArray[1] == iDefault && xDefaultFound == false){							xHTML += '<option value="' + xTextArray[1] + '" selected="selected">' + xTextArray[0] + '</option>';							xDefaultFound = true;						}						else							xHTML += '<option value="' + xTextArray[1] + '">' + xTextArray[0] + '</option>';					}				} 				if( iType == 'ALL' | ( iType == 'a'  & xFavListComplete.length > 0 )){					xHTML += '</optgroup>';				}			}			else{				if( iType == 'a' )					xHTML += '<optgroup label="' + gTxtNoAirportLoc  + '">' + '</optgroup>';			}			 			// >>> write Downtowns into stations fields ============			if( xDowntownListComplete.length > 0 )			{				if( iType == 'ALL' | ( iType == 'c'  & xFavListComplete.length > 0 )) {					xLbl = $( '#DowntownLocations' ).val();	// headline Downtown					xHTML += '<optgroup label="' + xLbl + '">';				}				if( iType == 'c' || iType == 'ALL'){					for( var i=0; i< xDowntownListComplete.length; i++){						xTextArray = xDowntownListComplete[i].split('|');						if( xTextArray[1] == iDefault && xDefaultFound == false){							xHTML += '<option value="' + xTextArray[1] + '" selected="selected">' + xTextArray[0] + '</option>';							xDefaultFound = true;						}						else							xHTML += '<option value="' + xTextArray[1] + '">' + xTextArray[0] + '</option>';					}				} 				if( iType == 'ALL' | ( iType == 'c'  & xFavListComplete.length > 0 )){					xHTML += '</optgroup>';				}			}			else{				if( iType == 'c' )					xHTML += '<optgroup label="' + gTxtNoCityLoc  + '">' + '</optgroup>';			} 			var xSelectSTA = $('#etastation');			var xSelectILC = $('#ettstation');								if( iName == 'etacountry') {							xSelectSTA.html( xHTML);				xSelectSTA = xSelectSTA.parent();				xSelectSTA.find( '.display' ).text( xSelectSTA.find('option:selected').text());				if( gCTR2changed == 0 )				{					xSelectILC.html( xHTML);					xSelectILC = xSelectILC.parent();					xSelectILC.find( '.display' ).text( xSelectILC.find('option:selected').text());														$('#ettcountryTXT').text( $('#etacountry').find('option:selected').text());					$('#ettcountry').parent().find('.display').text( $('#etacountry').find('option:selected').text());											$('#ettcountry').val( $('#etacountry').find('option:selected').val() );									if( xDefaultFound == true)						$('#ettstationTXT').text( xSelectILC.find('option:selected').text());					else						$('#ettstationTXT').text( '...');				}								// US / CA with lenght = 4 --> DropOff-Options change								if( gSelectedCountry.length == 4 && gUSCAcrossBorderAllowed && !gCrossBorderActive  )								{									$('#ettcountry_ro').show().find('a').trigger('click');									$('.select_replace:has(#ettcountry)').show(); // alt. if ettcountry has been activated								}								//else									//	$('.select_replace:has(#ettcountry)').hide();			}	 			else if( iName == 'ettcountry') { 							xSelectILC.html( xHTML);				xSelectILC = xSelectILC.parent();				xSelectILC.find( '.display' ).text( xSelectILC.find('option:selected').text());				$('#ettcountryTXT').text( $('#ettcountry').find('option:selected').text());				//$('#ettcountry').val( $('#etacountry').find('option:selected').val() );				if( xDefaultFound == true)					$('#ettstationTXT').text( xSelectILC.find('option:selected').text());				else					$('#ettstationTXT').text( '...');			} 		}}