// JavaScript Document

var clockID = 0;

function UpdateClock() {
   var hours;
   var minutes;
   
   woche = new Array("0","1");	//sprachen woche
   woche[0] = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag");
   woche[1] = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");

   monat = new Array("0","1");	//sprache monat
   monat[0] = new Array("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
   monat[1] = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

   if(clockID) { clearTimeout(clockID); clockID  = 0 }

   var tDate = new Date();
   
   if(tDate.getHours()<10) hours = "0" + tDate.getHours();
   else hours=tDate.getHours();
   
   if(tDate.getMinutes()<10) minutes="0" + tDate.getMinutes();
   else minutes=tDate.getMinutes();
      
   document.theClock.theTime.value = hours + ":" + minutes;
   document.theClock.theDay.value = woche[lang][tDate.getDay()] + ",";
   var yy = tDate.getFullYear();
   yy = yy.toString().substring(2, 4);

   //if (yy>2000) {yy=yy-2000;}
   //if (yy<10) {yy="0"+yy;}
   document.theClock.theDate.value = tDate.getDate() + ". " + monat[lang][tDate.getMonth()] +" "+yy;
   clockID = setTimeout("UpdateClock()", 30000);
}

function StartClock() { clockID = setTimeout("UpdateClock()", 100); }
function KillClock() {
	if(clockID) { clearTimeout(clockID); clockID  = 0 }
}

function openKidsClub(lng) {
	kidsclub = window.open('/site/index.php?id=25&L='+lng,'','copyhistory=no,directories=no,width=1011,height=675,top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no');
	//kidsclub.focus();
}

function changelang() {
	var langISO=['DE','EN'];
	d=document.sprachauswahl.L;
if (parent.frames[1].document.getElementById('reload')==null){
var link = parent.location.href;
var p= link.indexOf("L=");
if (p!= -1) {link=link.substring(0,p-1);}
link += "&L="+d.selectedIndex;
parent.location.href=link;

} else {
	parent.frames[1].document.getElementById('reload').value=langISO[d.selectedIndex];
	parent.frames[1].document.forms[0].submit();
	parent.frames[0].document.forms[0].submit();
}
}


function isEmail2(who) {
   var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
   return(email.test(who));
}

function NlFormCheck() {
	ret=false;
	if(isEmail2(document.getElementById("email").value)) {	
		ret=true; 
		document.getElementById("mail").style.color="black";
		}
	else {
		document.getElementById("mail").style.color="red";
		}
		
	if(document.getElementById("vorname").value!='') {	
		document.getElementById("orname").style.color="black";
		}
	else {
		ret=false;
		document.getElementById("orname").style.color="red";
		}
		
	if(document.getElementById("nachname").value!='') {	
		document.getElementById("achname").style.color="black";
		}
	else {
		ret=false;
		document.getElementById("achname").style.color="red";
		}
		
	if(document.getElementById("bekantgabe").checked==true) {	
		document.getElementById("ekantgabe").style.color="black";
		}
	else {
		ret=false;
		document.getElementById("ekantgabe").style.color="red";
		}
		
	if(ret==false) document.getElementById("errormsg").style.visibility="visible";
		
	return ret;
}

function SwFormCheck() {
	ret=false;
	if(isEmail2(document.getElementById("email").value)) {	
		ret=true; 
		document.getElementById("mail").style.color="black";
		}
	else {
		document.getElementById("mail").style.color="red";
		}
		
	if(document.getElementById("name").value!='') {	
		document.getElementById("ame").style.color="black";
		}
	else {
		ret=false;
		document.getElementById("ame").style.color="red";
		}
		
	if(document.getElementById("vorgangsnummer").value!='') {	
		document.getElementById("organgsnummer").style.color="black";
		}
	else {
		ret=false;
		document.getElementById("organgsnummer").style.color="red";
		}

		
	if(ret==false) document.getElementById("errormsg").style.visibility="visible";
		
	return ret;
}

function makeLangMenuFunction(){
	var object_language=document.getElementById('languageSelectionMenu');
	object_language.onmouseover=function() {
		this.className="open";
	}
	object_language.onmouseout=function() {
		this.className='';
	}
}

function schliessePromo(){
	document.getElementById('FlashPromoFlaeche').style.display='none';
}

