if(typeof testserver == "undefined")
{
	var testserver = 'false';
}

function _stopse( qs )
{	
	var nok = true;
	
	if(typeof(isCarsearch) != "undefined")
	{
		if(isCarsearch) 
		{
			searchStoped = true;
			_sfinish(1);
		}
		else
		{
			nok = false;
		}
	}
	else
	{
		nok = false;
	}
	if(nok == false)
	{
		_showhide2( parent,'search_change',1 );
		_showhide2( parent,'search_change1',0 );
		window.clearInterval(loop);
		_sfinish( 1 );
	}
	
}
function _sfinish( stop )
{	
	//<!--############## kommentiere aaukommentiertes ein und umekehrt
	$('progresspagecontent').style.display = "none";
	$('changebuttondiv').style.display = "inline";
	$('newprogresspage').style.backgroundImage = "url()";
	//ende der Anweisung	
	//$('progresspage').style.display = "none";
	//$('sortanimation').style.display = "none";
	
	_showhide2( 0,'waiting',0 );
	getData2('price');
	if(testserver == 'true') //Farealert TestserverAddOn
	{
		$('ftgrey').style.display = "none";
		$('ftclose').style.display = "inline";
	}	
	
	_showhide2( parent,'search_change',1 );
	_showhide2( parent,'search_change1',0 );
}
function _modifyse( qs )
{
	document.msf.submit();
}
function _newse( qs )
{
	window.location.href = '?';
}
function _displayphoto( fotoid, fotocount )
{
	for (i=0; i<fotocount; i++) $('foto_'+i).style.display = 'none';
	$('foto_'+fotoid).style.display = '';
}
function _changeTab( tabid, resultid )
{
	var tab = new Array();
	tab[0] = 'detailscontainer';
	tab[1] = 'fotocontainer';
	tab[2] = 'mapcontainer';
	tab[3] = 'companycontainer';

	if (tabid == 0 ) $('tabbar').className = 'detailstab4_1';
	if (tabid == 1 ) $('tabbar').className = 'detailstab4_2';
	if (tabid == 2 ) $('tabbar').className = 'detailstab4_3';
	if (tabid == 3 ) $('tabbar').className = 'detailstab4_4';
	
	for (i=0; i<tab.length; i++) $(tab[i]+resultid).style.display = 'none';
	$(tab[tabid]+resultid).style.display = '';
}
function _checkPage( page, resultid )
{
	if (page == 'map'){	
		initializedetails(undefined, undefined, resultid);			
	}
}

// Function to hide the checkfelix Special
function _hidespecial( )
{
	h = 0;
	if (bookingspecial == 'true') h += 63;
	if (hrsspecial	   == 'true') h += 63;
	if (nhspecial	   == 'true') h += 63;
	if (athspecial	   == 'true') h += 63;
	
	if (h == 0)
	{
		showspecial = false;
		//$('special').style.display = 'none';
		new Effect.BlindUp('special', {duration: 0.5});
	}
	else $('special').style.height = h+'px';
	
	tempH = $('resultlistcontainer').offsetHeight;
	$('resultlist').style.height = (tempH-h)+'px';
}
function _checkpoistatus()
{
	poivalue = $('poi_dd').value;
	if (poivalue == "other")
	{
		$('poidd').style.display = "none";
		$('poitxt').style.display = "";
		$('poitxt').focus();
		
		$('address').style.fontWeight = "normal";
		$('address').style.color = "#BFBFBF";
	}
	else
	{
		var exp = /(.+)\|(.+)/;
		exp.exec(poivalue);
		var point = new GLatLng(RegExp.$1, RegExp.$2);

		if (actmarker) actmarker.remove();
		var marker = new GMarker(point);
		actmarker = marker;

		map.addOverlay(marker);
		targetaddress = marker.getLatLng();

		map.setCenter(point);
		//colorActSort('sortdistance');

		getData2(actsort);
		if (citycenter) citycenter.hide();
	}
}
function _showpoidd()
{
	$('poidd').style.display = "";
	$('poitxt').style.display = "none";
	$('poidd').focus();
	$('poi_dd').selectedIndex = 1;
}
function _poiblur()
{
	a = $('address');
	if (a.value == '') a.value = ov;
}
function _poifocus()
{
	ov = $('address').value;
	$('address').value = '';
	$('address').style.fontWeight = "bold";
	$('address').style.color = "#000000";
}
function _poiblur2()
{
	a = $('cartype');
	if (a.value == '') a.value = ov;
}
function _poifocus2()
{
	ov = $('cartype').value;
	$('cartype').value = '';
	$('cartype').style.fontWeight = "bold";
	$('cartype').style.color = "#000000";
}
function _poisearch(lang, cityname, countryname)
{
	pageTracker._trackPageview('/hotelsuche/'+lang+'/filterbydistance.html');
	if ($('address').value == citycentert) getData2('citycenter');
	else sv = $('address').value;
	showAddress(sv + ' ' + cityname + ' ' + countryname );
	return false;
}

function unSelectFilter (whichone)
{
	for (i=0; i<$(whichone+'container').childNodes.length; i++)
	{
		if (typeof $(whichone+'filter'+i) != "undefined") $(whichone+'filter'+i).checked = false;
	}
	getData2 (actsort);
}
function resetFilter (whichone)
{
	if ($('reset_'+whichone) != null) $('reset_'+whichone).hide();
	for (i=0; i<$(whichone+'container').childNodes.length; i++)
	{
		if (typeof $(whichone+'filter'+i) != "undefined") $(whichone+'filter'+i).checked = true;
	}
	getData2 (actsort);
}

function changeResultType (value)
{

	if (value == 'active') depret = true;
 	else
	{
		uncheck();	// uncheck1();
		depret = false;
		test = 0;
		resetDR = true;
		depretReturn = false;
		// showfavourites = false;
	}

	getData2();
	_track ('flugsuche', 'depret', value);
}
