function showCountries(countryName, countryBorders) {
	document.getElementById(countryBorders).style.backgroundImage = 'url(/images/structure/background/navi2_bg.gif)';
	document.getElementById(countryBorders).style.fontWeight = 'bold';
	document.getElementById(countryName).style.display = 'block';
}

function hideBorders(countryName, countryBorders) {
	document.getElementById(countryBorders).style.backgroundImage = '';
	document.getElementById(countryBorders).style.fontWeight = 'normal';
	document.getElementById(countryName).style.display = 'none';	
}

function lockBorders(countryBorders) {
	document.getElementById(countryBorders).style.backgroundImage = 'url(/images/structure/background/navi2_bg.gif)';
	document.getElementById(countryBorders).style.fontWeight = 'bold';
	document.getElementById(countryBorders).style.color = '#ff9626';
}

function unlockBorders(countryBorders) {
	document.getElementById(countryBorders).style.backgroundImage = '';
	document.getElementById(countryBorders).style.fontWeight = 'normal';
	document.getElementById(countryBorders).style.color = '#666666';
}

function showLoadingContainer() {
	  loadingContainer = document.getElementById('mouseLoadingAnimation');
	  loadingContainer.style.display = "block";
	}


	function hideWidget() {
		document.getElementById('RatingWidget').style.display = 'none';
	}

	/* variable RatingDetailWidget-Anzeige */

	showContainer = null;
	 
	var XWert=0; 
	var YWert=0; //initialisiert die Variablen "x" und "y" global, so dass sie für jede Funktion existieren

	function updateRatingDetailWidgetDiv(e){
		showContainer = document.getElementById('RatingWidget');
		
	    if (showContainer) {
	    XWert = (document.all) ? window.event.x + showContainer.offsetParent.scrollLeft : e.pageX;
	    YWert = (document.all) ? window.event.y + showContainer.offsetParent.scrollTop : e.pageY;
	    	showContainer.style.left = (XWert + 20) + "px";
	    	showContainer.style.top  = (YWert + 20) + "px";
	   }
	}
	  
	function showRatingDetailWidgetDiv(id) {
	  showContainer = document.getElementById(id);
	  showContainer.style.display = "block";
	}
	 
	function hideRatingDetailWidgetDiv() {
	  showContainer.style.display = "none";
	}
	
	function echeck(str) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		
		if (str.indexOf(at)==-1){
			document.getElementById('emailError').style.display = 'block';
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   document.getElementById('emailError').style.display = 'block';
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    document.getElementById('emailError').style.display = 'block';
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    document.getElementById('emailError').style.display = 'block';
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    document.getElementById('emailError').style.display = 'block';
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    document.getElementById('emailError').style.display = 'block';
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    document.getElementById('emailError').style.display = 'block';
		    return false
		 }

		 document.getElementById('emailError').style.display = 'none';
 		 return true					
	}
	
	function nurZahlen(el)
	{
	  var val = el.value.replace(/[^\^,\d]/g, '');
	  el.value = val;
	}

	function nurZahlenPlusPunkt(el)
	{
	  var val = el.value.replace(/[^\^.\d]/g, '');
	  el.value = val;
	}

	function isValidTelephoneNumber(number) {
		 
		 for(i = 0; i < number.length; i++) {
		  currentChar = number.substring(i, i + 1);
		  //if(!isDigit(parseInt(currentChar)) && !isValidChar(currentChar) && (i > 0 && currentChar == "+")) {
		  if(!isDigit(parseInt(currentChar)) && !isValidChar(currentChar)) {
			  document.getElementById('phoneError').style.display = 'block';
		   return false;
		  }
		 }
		 document.getElementById('phoneError').style.display = 'none';
		 return true;
		}


		function isValidDate(date) {
		 for(i = 0; i < date.length; i++) {
		  currentChar = date.substring(i, i + 1);
		  if(!isDigit(parseInt(currentChar)) && currentChar != ".") {
		   return false;
		  }
		 }
		 return true;
		}

		function isValidChar(char) {
		 var validChars = "+/ ";
		 return (validChars.indexOf(char) >= 0);
		}

		function isDigit(char) {
		 var allowedChars = "0123456789";
		 return (allowedChars.indexOf(char) >= 0);
		}
		
		function scrollToNextWeek() {
			new Effect.ScrollTo('nextWeek');			
		}
		
		
function checkBirthday() {
	var day = document.getElementById('birthdateDay');
	var month = document.getElementById('birthdateMonth');
	var year = document.getElementById('birthdateYear');
	
	if(day.value == -1 || month.value == -1 || year.value == -1) {
		document.getElementById('registerInactive').style.display = 'block';
		document.getElementById('registerActive').style.display = 'none';
	} else {
		document.getElementById('registerInactive').style.display = 'none';
		document.getElementById('registerActive').style.display = 'block';
	}
	
}