function redirectUrls(){ // redirect google urls from old sitemap
if (top.location.pathname == "/main_m266_1_1.html") {
	top.location.pathname == "/content_m266_l1_1.html"
}
if (top.location.pathname == "/main_m265_1_1.html") {
	top.location.pathname == "/content_m265_l1_1.html"
}
if (top.location.pathname == "/index_content_1_1.html") {
	top.location.pathname == "/content_l1_1.html"
}
}

/*function is_ns_4() {
  if(navigator.appVersion.substring(0,1) == "4" && navigator.appName =='Netscape')
   return true;
  else
   return false;
}
*/
// StatusText
function MM_displayStatusMsg(msgStr) {
  status = msgStr;
  document.MM_returnValue = true;
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) {
  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 make_empty(name) { 
	return name.value = "";
} 

var submitcount=0;
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 ((document.forms.newsletterform.company) && (document.forms.newsletterform.company.value == "")) {
    alert("Bitte füllen sie das Feld \"Firma\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.surname) && (document.forms.newsletterform.surname.value == "")) {
    alert("Bitte füllen sie das Feld \"Nachname\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.firstname) && (document.forms.newsletterform.firstname.value == "")) {
    alert("Bitte füllen sie das Feld \"Vorname\" korrekt aus!");
  }
  else if ((validate(document.forms.newsletterform.email.value)) == false) {
    alert("Bitte füllen sie das Feld \"E-Mail\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.city) && (document.forms.newsletterform.city.value == "")) {
    alert("Bitte füllen sie das Feld \"Ort\" korrekt aus!");
  }
  else if ((document.forms.newsletterform.zip) && (document.forms.newsletterform.zip.value == "")) {
    alert("Bitte füllen sie das Feld \"PLZ\" korrekt aus!");
  }
  else if ( ((document.forms.newsletterform.nwsl1) && (document.forms.newsletterform.nwsl2)) && ((!document.forms.newsletterform.nwsl1.checked) && (!document.forms.newsletterform.nwsl2.checked)) ) {
    alert("Bitte wählen Sie mindestens eine Newsletter-Rubrik aus!");
  }
  else {
    document.forms.newsletterform.submit();
    return true;
  }
}

function change_lang(id,currentlang,site) {
	var frameset = new Array(parent.menu, parent.bottom);
	
	for(var i = 0, j = frameset.length; i < j; i++) {
		var query_string = String(frameset[i].location);
		var new_query_string = query_string.replace(/_l\d+/, "_l"+id);  
  	frameset[i].location.href=new_query_string;
	}
}


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&search="+f.searchbox.value;
      f.submit();
    }
    else if (two[i].match(/^\?lang_id=/)) {
      f.action='main.php'+two[i]+"&do=search&search="+f.searchbox.value;
      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;
     }
  }
}


function OperaResizeFix() { //Fix für style height:100% problem bei Opera
	browser = navigator.userAgent;
	opera = browser.search(/Opera/);
	
	if (opera != -1){
  	self.location.reload();
	}
}

/* Menü Rechts Links - Pfeil Icons MouseOver Funktion Ende */

function FrameReload(root) {
	if (top.location.href == this.location.href) {
		var vars = window.location.href;
		var file_name = String(vars.match(/[^\/]+$/));
		var g = file_name.replace(/^[A-Za-z]+/, 'index');
		//alert (root+'/index.php'+vars);
		top.location.href = root+"/"+g;
	}
}


