function chcolor(myElement){
	
	var myColorContent;
	myColorContent="#EBEBE8";
	
	
	var myColorWelcome = new Array();
	myColorWelcome["tza_"]="#1B8692";
	myColorWelcome["agit_"]="#D4380E";
	myColorWelcome["tra_"]="#122656";

	
	var num;
	num = myElement.id.substring(myElement.id.length-1,myElement.id.length);
	var box;
	box = myElement.id.substring(0,myElement.id.indexOf("_")+1);
		
	var actColor;
	actColor=document.getElementById(myElement.id).style.backgroundColor;

		(actColor)?myColorContent="":myColorContent=myColorContent;
		(actColor)?myColorFont=myColorWelcome[box]:myColorFont=myColorContent;
		(actColor)?myColorWelcome="":myColorWelcome=myColorWelcome[box];
		(actColor)?myImg="fileadmin/images/start_pfeile_"+box+"off.gif":myImg="fileadmin/images/start_pfeile_on.gif";	
		(actColor)?myCursor="":myCursor="hand";
		
		document.getElementById(String(box+'content'+num)).style.backgroundColor = myColorContent;
		document.getElementById(String(box+'welcome'+num+'_lk')).style.color = myColorFont;
		document.getElementById(String(box+'welcome_img'+num)).src= myImg;
		document.getElementById(String(box+'welcome'+num)).style.backgroundColor = myColorWelcome;
    try{	
    document.getElementsByTagName("body").item(0).style.setAttribute("cursor",myCursor,false);
   }catch(e){}
}

function go(myElement){
var myPages = new Array();
	myPages["tza_"]="index.php?id=191";
	myPages["agit_"]="index.php?id=161";
	myPages["tra_"]="index.php?id=109";
                myPages["1"]="";
                myPages["2"]="&L=1";


var box;
	box = myElement.id.substring(0,myElement.id.indexOf("_")+1);
var lan;
                lan = myElement.id.substring(myElement.id.length-1,myElement.id.length);


document.location.href=myPages[box]+myPages[lan];

}

function checkEmail(email){
	  var proto  = "(mailto:)?";
	  var usr    = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";
	  var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";
	  var regex  = "^" + proto + "?" + usr + "\@" + domain + "$";
	  var rgx    = new RegExp(regex);
	  return rgx.exec(email) ? true : false;
	}



function checkInput(form){
                                 try{
		letteritemail = document[form].letteritemail.value;
		}catch(e){}
		
		
		
		try{
		if(document[form].letteritoption2.value.length==0) {
			document[form].letteritoption2.focus();
			alert ("Bitte geben Sie Ihren Voramen ein.");
			return;		
		}
		}catch(e){}
		
		
		
			try{
		if(document[form].letteritoption3.value.length==0) {
			document[form].letteritoption3.focus();
			alert ("Bitte geben Sie Ihren Namen ein.");
			return;		
		}
		}catch(e){}
		
	
		
		
		try{
		if(document[form].letteritemail.value.length==0) {
			document[form].letteritemail.focus();
			alert ("Bitte geben Sie Ihre Email-Adresse ein.");
			return;		
		}
		else if (!checkEmail(letteritemail)) {
			document[form].letteritemail.focus();
			alert("Dies ist keine gültige E-Mail-Adresse.");
			return;
		}
		}catch(e){}

		document[form].submit();


}




function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
try{
window.attachEvent("onload", correctPNG);
}catch(e){}

