function parameterAuslesen(ID)
{
myURL = window.location.search;
Start= myURL.indexOf("?");
if (Start==-1) {return("");}
qString = myURL.substr(Start,myURL.length-Start);
Start= qString.indexOf(ID+"=");
if (Start==-1) {return("");}
Start = Start+ID.length+1;
qString = qString.substr(Start,qString.length-Start);
if (qString.indexOf("&")!=-1) {qString=qString.substr(0,qString.indexOf("&"));}
return(qString);
}

function disableRadioButtonsByName(name){
	wellnessRankingRadios = new Array();
	wellnessRankingRadios = document.getElementsByName(name);
	for(var i=0; i<wellnessRankingRadios.length ;i++){
		wellnessRankingRadios[i].disabled=true;
		wellnessRankingRadios[i].checked=false;
	}
}

function enableRadioButtonsByName(name){
	wellnessRankingRadios = new Array();
	wellnessRankingRadios = document.getElementsByName(name);
	for(var i=0; i<wellnessRankingRadios.length ;i++)
		wellnessRankingRadios[i].disabled=false;
}

function disableTexareasByName(name){
	document.getElementsByName(name)[0].value='';
	document.getElementsByName(name)[0].disabled=true;
}

function enableTexareasByName(name){
	document.getElementsByName(name)[0].disabled=false;
}

function showSatellite(path, param, winType) {

	var width 		= 381;
	var height 		= 290;
	var pageName 	= "helpsat";
	var scroll		= "no";

	if (winType == "small"){
		height 		= 178;
		width 		= 381;
		pageName = "helpsatSmall";
	}
	else if (winType == "large"){
		height 		= 481;
		width 		= 400;
		scroll 		= "yes";
		pageName 	= "helpsatLarge";
	}

	link 			= path + pageName + ".jsp?" + param;

	var win 		= window.open(link, "", "menubar=no, toolbar=no, width="+width+", height="+height+", scrollbars="+scroll+", resizable=no");
	win.focus();
	return false;
}

function openHelpSatellite(myUrl, myName, foo, mySize){
    var width 		= 0;
	var height 		= 0;
	var scroll		= "";

	if (mySize == "small"){
        width 	= 391;
        height 	= 215;
		scroll  = "no"
		myUrl     = myUrl + "&size=small";
	} else if(mySize == "medium"){
	    width 	= 391;
	    height 	= 315;
	    scroll  = "no"
	    myUrl     = myUrl + "&size=medium";
	} else if(mySize == "large"){
        width 	= 410;
        height 	= 521;
		scroll  = "yes";
		myUrl     = myUrl + "&size=large";
	} else{
	    alert("unsupported windowSize");
	    return false;
	}
	return openSatellite(myUrl, myName, width, height, scroll);
}

function openSatellite(url, myName, width, height, scrollbar){
    var win = window.open(url, myName, "menubar=no, toolbar=no, width="+width+", height="+height+", scrollbars="+scrollbar+", resizable=no");
    win.resizeTo(width,height);
	win.focus();
	return false;
}

function closeWindow() {
	parent.window.close();
	return true;
}

function showLink(myString)
{
	document.write(myString);
}

function loadInParent(hrsUrl){
                opener.location.href = hrsUrl;
                self.close();
            }

function synchronizeFormField(source, target, target2) {
	var targetField = document.getElementById(target);
	if (targetField != null) {
		targetField.value = source.value;
	}
	if (target2 != null) {
		var targetField2 = document.getElementById(target2);
		if (targetField2 != null) {
			targetField2.value = source.value;
		}
	}
}

function checkPopup(url) {
	if(window.opener) {
		if (window.opener.name == 'mainFrame') {
			if (url != null) {
				window.opener.parent.location.href=url;
			}
		}
		else {
			if (url != null) {
				window.opener.location.href=url;
			}
		}
		self.close();
	}
}

function noTooltips(x){
	openHelpSatellite(x, "noTooltip", "foo", "medium");
}

function openPrintView(link) {
	window.open(link, "", "menubar=yes, toolbar=no, width=700, height=580, scrollbars=yes, resizable=no");
}

function openPrintViewLarge(link) {
	window.open(link, "", "menubar=yes, toolbar=no, width=840, height=580, scrollbars=yes, resizable=no");
}

function popExclusivePrice(URL,_width,_height,_left,_top){
	var pop=window.open(URL,'exclusivePrice','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,fullscreen=0,width=_width,height=_height,top=_top,left=_left');
	pop.resizeTo(_width,_height);
	pop.focus();
	return false;
}

function openWinners (URL) {
	var pop=window.open(URL,'winners','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,fullscreen=0,width=365,height=605,top=10,left=10');
	pop.focus();
}

function openFlashPopup(flashFile, width, height) {
	var pop=window.open('showPage.do?page=flashPopup&flashFile='+flashFile+'&width='+width+'&height='+height,'flash','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,fullscreen=0,width='+width+',height='+height+',top=50,left=50');
	pop.focus();
	return false;
}

function checkpopup() {

  if (Math.random() <= 0.02) {
    if (document.cookie.indexOf("survey=true") == -1) {
        document.cookie="survey=true;path=/;Expires=Sat,20 Nov 2005 12:00:00 UTC";
		var win=window.open("http://www.eresult.de/umfragen/hrs/index.php","","height=630, width=820, left=10, top=10,toolbar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=1");
		win.blur()
		window.focus()
    }
  }
}0

function toggleComparisonVisibility(whichElement,whichHeadline) {
	var thisElement = document.getElementById(whichElement);
	var thisHeadline = document.getElementById(whichHeadline);
	if(thisElement.style.display == "block" || thisElement.style.display == 0){
		thisElement.style.display = "none";
		thisHeadline.style.backgroundImage = "url(images/ic_comparisonToggle_inaktiv.gif)";
	} else {
		thisElement.style.display = "";
		thisHeadline.style.backgroundImage = "url(images/ic_comparisonToggle_aktiv.gif)";
	}

}



function showLandingNewsletterTeaser (url, whichDestination) {
	for (i = 0; i < document.getElementById('landingNewsletterSelect').length; ++i)
		if (document.getElementById('landingNewsletterSelect').options[i].selected == true)
		  whichDestination = document.getElementById('landingNewsletterSelect').options[i].value;
	document.location.href=url+"&page="+whichDestination;
}




window.onload = function() {

	if(document.getElementById('hotelComparison')) {
		document.getElementById('hotelRating').style.display = 'none';
		document.getElementById('hotelInfo').style.display = 'none';
		document.getElementById('hotelDistances').style.display = 'none';
		document.getElementById('hotelAmmenities').style.display = 'none';
		document.getElementById('roomAmmenities').style.display = 'none';
		document.getElementById('hotelService').style.display = 'none';
		document.getElementById('hotelCredits').style.display = 'none';

	}
	
	
}






