function get_variants(step, key, go)
{
	list_action(step, key, go)
	document.getElementById('boxLoadingScreenSrd').style.left = '326px';
	document.getElementById('boxLoadingScreenSrd').style.top = '150px';
	document.getElementById('loadingText').innerHTML = 'Verfügbare Angebote werden geladen...';
}

//
function bs_info_booking_flight(step, out, ret)
{
	document.form1.selected_out.value = out;
	document.form1.selected_return.value = ret;
	document.form1.step.value = step;
	document.form1.submit();
}


//
function step_action(step)
{
	//alert(step);
	set_step(step);
	//document.form1.submit();
	document.getElementById('boxLoadingScreenSrd').style.left = '326px';
	document.getElementById('boxLoadingScreenSrd').style.top = '150px';
	if(step == 11)
		document.getElementById('loadingText').innerHTML = 'Sie werden zur Buchung geleitet...';
	if(step == 32)
		document.getElementById('loadingText').innerHTML = 'Das Paket wird zu Ihrer Merkliste hinzugefügt...';	
	if(step == 35)
		document.getElementById('loadingText').innerHTML = 'Sie werden zur Buchung geleitet...';			
	document.form1.submit();
}


//
function close_direct_mode()
{
	if (window.opener) {
		if (window.opener.closed == true) {
			window.close();
		} else {
			window.opener.focus();
		}
	}
}


//
function reset_form(step)
{
	document.form1.reset.value = step;
	document.form1.submit();
}

//
function set_alternative_airport(airport, step)
{
	document.form1.alternative.value = airport;
	set_step(step);
	document.form1.submit();
}


//
function set_step(step)
{
	document.form1.step.value = step;
}


//
function set_pager(step, start)
{
	set_step(step);
	document.form1.start.value = start;
	document.form1.submit();
}


//
function list_action(step, key, go)
{
	set_step(step);
	document.form1.selected_obj.value = key;
	document.form1.cart_delete.value = 'false';
	set_start(go);
	//loadScreen('');
	document.form1.submit();
}


//
function cart_action(step, key, go, del)
{
	set_step(step);
	document.form1.selected_cart.value = key;
	document.form1.cart_delete.value = del;

	set_start(go);

	document.form1.submit();
}


//
function close_infowin()
{
	if (hotelinfowin && hotelinfowin.closed != true) {
		hotelinfowin.close();
	}

	if (printinfowin && printinfowin.closed != true) {
		printinfowin.close();
	}
}

// NOTE: needed to close hotelinfo if focus is on main window!
var printinfowin = false;
//
function popup_print(printurl)
{
  var url = printurl;
  printinfowin = window.open(url,'print', 'status=no,scrollbars=yes,width=530,height=600');
  printinfowin.focus();
}


function popup_open(theURL)
{
  window.open(theURL, 'popup', 'status=yes,scrollbars=yes,width=446,height=550');
}


// NOTE: needed to close hotelinfo if focus is on main window!
var hotelinfowin = false;

function popup_hotel_info(theURL)
{
  hotelinfowin = window.open(theURL, 'HOTELINFO', 'resizable=yes,status=yes,scrollbars=yes,width=635,height=550');
}

function set_start(go)
{
	if (go && go.length >= 1) {
		document.form1.start.value = go;
	} else {
		document.form1.start.value = 'false';
	}
}

//
function disable_vacancy_button()
{
	if (document.getElementById("vacancy_button")) {
		document.getElementById("vacancy_button").innerHTML  = '<img src="img/button/angebot_suchen_01.gif" alt="Angebote suchen" width="129" height="18" border="0">';
	}
}

//
function enable_vacancy_button()
{
	if (document.getElementById("vacancy_button")) {
		document.getElementById("vacancy_button").innerHTML  = '<a href="javascript:get_vacancy(\'2\');"><img src="img/button/angebot_suchen_01.gif" alt="Angebote suchen" width="129" height="18" border="0"></a>';
	}
}


//
function handle_children(dis)
{
	//var val = document.form1.children_travelers.options[document.form1.children_travelers.selectedIndex].value;
	var val = document.form1.children_travelers.value;
	var	max = 3;
	var a = true;
	var x, a, d, m, y;

	for(var i = 0; i < max; i++) {
		x = i + 1;

		d = 'children[' + i + '][DAY]';
		m = 'children[' + i + '][MONTH]';
		y = 'children[' + i + '][YEAR]';

		if (document.form1[d]) {

			if (i < val) {
				a = false;
			} else {
				a = true;
				document.form1[d].selectedIndex = 0;
				document.form1[m].selectedIndex = 0;
				document.form1[y].selectedIndex = 0;
			}

			if (dis == '1') {
				a = true;
			}

			document.form1[d].disabled = a;
			document.form1[m].disabled = a;
			document.form1[y].disabled = a;
		}
	}

	display_children(document.form1.children_travelers);

}


