function is_ns_4()
 {
  if(navigator.appVersion.substring(0,1) == "4" && navigator.appName =='Netscape')
   return true;
  else
   return false;
 }



// function to display msg´s in the status-window from the Browser
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; 
  if(d.images)
  	{ 	if(!d.MM_p) 
  		d.MM_p=new Array();
    	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
    		if (a[i].indexOf("#")!=0){ 
			d.MM_p[j]=new Image; 
			d.MM_p[j++].src=a[i];
			}
	}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
  	if ((x=MM_findObj(a[i]))!=null)
	{
	document.MM_sr[j++]=x; 
		if(!x.oSrc) 
		x.oSrc=x.src; 
		x.src=a[i+2];
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;
  if(!d)
  d=document; 
  	if((p=n.indexOf("?"))>0&&parent.frames.length)
	{
    d=parent.frames[n.substring(p+1)].document;
	n=n.substring(0,p);
	}
  	if(!(x=d[n])&&d.all) 
	x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
	x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
	x=MM_findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) 
	x=d.getElementById(n); 
	return x;
}
function movelayer() {
    if (document.layers) {
        document.layers['help'].pageY = window.pageYOffset;
    }
    else if (document.all) {
        document.all['help'].style.posTop = document.body.scrollTop;
    }
    setTimeout('movelayer()',100);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

// returns the browser-typ (NS=Netscape,IE=Internet explorer, opera=Opera, unknown = any other)
function what_browser()
 {
  if(navigator.appName=="Netscape")
   return ('NS');
  else if(navigator.appName=="Microsoft Internet Explorer")
   return ('IE');
  else if(navigator.appName=="Opera")
   return('opera');
  else
   return('unknown'); 
 }


// returns the browser-version in format x.x
function what_browser_version()
 {
  return navigator.appVersion.substring(0,3);
 }


function make_empty(name)
{
	return name.value = "";
} 

var submitcount=0;

function check_mail_form()
 {
  var errormsg="";
  var str="";
  if(document.forms.mailform.vorname.value=="")
   { errormsg +="Das Feld Vorname muss ausgefüllt werden.\n"; }
  if(document.forms.mailform.nachname.value=="")
   { errormsg +="Das Feld Nachname muss ausgefüllt werden.\n"; }
  if(document.forms.mailform.nachricht.value=="")
   { errormsg +="Das Feld Nachricht muss ausgefüllt werden.\n"; }
  if(document.forms.mailform.email.value=="")
   { errormsg +="Das Feld Email muss ausgefüllt werden.\n"; }
  if(errormsg=='')
   {
    if (submitcount == 0)
     {
      submitcount = 1;
      document.forms.mailform.submit();
      return true;
     } else {
      alert("Ihre Anfrage wird gerade beantwortet, dies kann je nach Verbindungsgeschwindigkeit einige Sekunden dauern.");
      return false;
     }
   }
  else
   {
    alert('Folgende Fehler sind beim Ausfüllen des Formulars aufgetreten:\n\n'+errormsg);
    return false;
   }
 }

function validate(email)
 {
  if(email.length < 6){return false;}
	if(email.indexOf(" ") != -1){return false;}
	if(email.indexOf("ä") != -1){return false;}
	if(email.indexOf("ö") != -1){return false;}
	if(email.indexOf("&uuml;") != -1){return false;}
	if(email.indexOf("ß") != -1){return false;}
	if(email.indexOf("@") < 1){return false;}
	if(email.indexOf(".") < 1){return false;}
	if((email.length - 2) <= (email.lastIndexOf("."))){return false;}
	if((email.length - 2) <= (email.lastIndexOf("@"))){return false;}
	if(!(email.substr((email.lastIndexOf("@")+1)).lastIndexOf("."))){return false;}
	return true;
 }

function check_newsletter_form()
 {
  if(validate(document.forms.newsletterform.email.value))
   {
    document.forms.newsletterform.submit();
    return true;
   } else {
    alert("Bitte füllen sie das Feld 'E-Mail' korrekt aus!");
   }
}

function change_lang(id,currentlang,site)
 {
  var chain = parent.menu.location.search;
  one = chain.replace(/^\?/, "");
  var two = one.split("&");
  var three = '';

  for(var i=0;i<two.length;++i)
   {
    if(!two[i].match(/^lang_id=/) && !two[i].match(/^\?lang_id=/))
     three += two[i]+'&';
   }

  if(three !='')
   three += 'lang_id='+id;
  else
   three += '?lang_id='+id;
  //alert('one='+chain+' two='+two+' three='+three);
  parent.menu.location.href = 'menu.php?'+three;
 }

function do_search(f)
 {
  var one = parent.menu.location.search;	
  var two = one.split("&");
   for(i=0;i<two.length;++i)
    {
     if(two[i].match(/^lang_id=/))
      {
       f.action='main.php?'+two[i]+"&do=search";
       f.submit();
      } else if(two[i].match(/^\?lang_id=/)) {
       f.action='main.php'+two[i]+"&do=search";
       f.submit();
      }
    }
 }

function goto_main()
 {
  var one = parent.menu.location.search;
  var two = one.split("&");
   for(i=0;i<two.length;++i)
    {
     if(two[i].match(/^lang_id=/))
      {
       parent.main.location.href='main.php?'+two[i];
      } else if(two[i].match(/^\?lang_id=/)) {
       parent.main.location.href='main.php'+two[i];
      }
    }
 }

function goto_content_from_right(menu_id)
 {
  var one = parent.menu.location.search;
  var two = one.split("&");
   for(i=0;i<two.length;++i)
    {
     if(two[i].match(/^lang_id=/))
      {
       parent.menu.location.href='menu.php?menu='+menu_id+'&'+two[i];
      } else if(two[i].match(/^\?lang_id=/)) {
       var three = two[i].substring(1,999);
       parent.menu.location.href='menu.php?menu='+menu_id+'&'+three;
      }
    }
 }

/* 	Menü MouseOver,Out Effekte Anfang */

//	menuIcon: Variable für jeweiligen img name="menuicon" in menu.php
//	menuDivID: Variable für jeweilige div id="menudivid" in menu.php
//	div ist immer so gross wie die jeweilige td, in der der MenuLink sitzt und sorgt
//	dafür dass auf die gesamte Zellenbreite der MouseOver Effekt wirkt,
//	nicht nur beim MouseOver auf den jeweiligen Text des Links

function MenuOver(menuIcon,menuDivID)
{
document.images[menuIcon].src = "images/menu_icon02.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url(images/transp_menulinkbg.gif)";
if (document.all)
document.getElementById(menuDivID).style.cursor = "hand";
}
function MenuOut(menuIcon)
{
document.images[menuIcon].src = "images/menu_icon01.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url()";
}
function MenuOut_Sel(menuIcon)
{
document.images[menuIcon].src = "images/menu_icon03.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url()";
}


//	menusubIcon: Variable für jeweiligen img name="menusubicon" in menu.php
//	menusubDivID: Variable für jeweilige div id="menusubdivid" in menu.php
//	div ist immer so gross wie die jeweilige td, in der der SubMenuLink sitzt und sorgt
//	dafür dass auf die gesamte Zellenbreite der MouseOver Effekt wirkt,
//	nicht nur beim MouseOver auf den jeweiligen Text des Links

function MenuSubOver(menusubIcon,menusubDivID)
{
document.images[menusubIcon].src = "images/menusub_icon02.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url(images/transp_menulinkbg.gif)";
if (document.all)
document.getElementById(menusubDivID).style.cursor = "hand";
}

function MenuSubOut(menusubIcon)
{
document.images[menusubIcon].src = "images/menusub_icon01.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url()";
}

function MenuSubOut_Sel(menusubIcon)
{
document.images[menusubIcon].src = "images/menusub_icon03.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url()";
}


//	menusubsub1Icon: Variable für jeweiligen img name="menusub1icon" in menu.php
//	menusubsub2Icon: Variable für jeweiligen img name="menusub2icon" in menu.php
//	menusubsubDivID: Variable für jeweilige div id="menusubdivid" in menu.php
//	div ist immer so gross wie die jeweilige td, in der der SubSubMenuLink sitzt und sorgt
//	dafür dass auf die gesamte Zellenbreite der MouseOver Effekt wirkt,
//	nicht nur beim MouseOver auf den jeweiligen Text des Links

function MenuSubSubOver(menusubsub1Icon,menusubsub2Icon,menusubsubDivID)
{
document.images[menusubsub1Icon].src = "images/menusubsub_icon02.gif";
document.images[menusubsub2Icon].src = "images/menusubsub1_icon02.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url(images/transp_menulinkbg.gif)";
if (document.all)
document.getElementById(menusubsubDivID).style.cursor = "hand";
}

function MenuSubSubOut(menusubsub1Icon,menusubsub2Icon)
{
document.images[menusubsub1Icon].src = "images/menusubsub_icon01.gif";
document.images[menusubsub2Icon].src = "images/menusubsub1_icon01.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url()";
}

function MenuSubSubOut_Sel(menusubsub1Icon,menusubsub2Icon)
{
document.images[menusubsub1Icon].src = "images/menusubsub_icon03.gif";
document.images[menusubsub2Icon].src = "images/menusubsub1_icon03.gif";
//document.getElementById(menuDivID).style.backgroundColor = "#000000";
//document.getElementById(menuDivID).style.backgroundImage = "url()";
}
/* Menü MouseOver,Out Effekte Ende */




/* Newsletter Button MouseOver Funktion */

function colorChgStd()
{
   	document.getElementById("NewsButton").style.color = "#003399";
	document.getElementById("NewsButton").style.cursor = "auto";
}
function colorChgOver()
{
    document.getElementById("NewsButton").style.color = "#000000";
	document.getElementById("NewsButton").style.cursor = "hand";
	document.getElementById("NewsButton").style.cursor = "pointer";
}

/* Newsletter Button MouseOver Funktion Ende */


/* Menü Rechts Icons MouseOver Funktion Anfang */

imgStd01 = new Image();	
imgStd01.src = "images/menu_right_icon01.gif"; 
imgOver01 = new Image();    
imgOver01.src = "images/menu_right_icon02.gif"; 
imgClick01 = new Image();    
imgClick01.src = "images/menu_right_icon03.gif"; 

imgStd02 = new Image();
imgStd02.src = "images/menu_right_icon01.gif";    
imgOver02 = new Image();
imgOver02.src = "images/menu_right_icon02.gif";
imgClick02 = new Image();    
imgClick02.src = "images/menu_right_icon03.gif"; 

function ImgMenuSwap(imgName,imgVar)
		{
		document.images[imgName].src = eval(imgVar + ".src");
		}

/* Menü Rechts Icons MouseOver Funktion Ende */



