function checkemaildata(){
var re_email = /^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-\.]+\.([a-zA-Z]{2,3})$/;
var email = document.formlogin.EMAIL.value;
var passw1 = document.formlogin.PASSWORT.value;
var passw2 = document.formlogin.wpasswort.value;

var checked = true;

 if ((re_email.test(email))==false || email.length==0 ) {
		   alert("Die Syntax der Emailadresse ist falsch!");
		   checked = false;
		 }
	else if (passw1.length<5) {
		   alert("Das Passwort sollte eine Länge von mindestens 5  Ziffern haben!");
		   checked = false;
		 }
	else if (passw1!=passw2) {
		   alert("Die Passwörter sind nicht gleich!");
		   checked = false;
		 }


 if (checked) {
   document.formlogin.method = "post";
   document.formlogin.action = "login.php";
   document.formlogin.submit();
 }
 return checked;
}

function checkchangedata(){
var re_email = /^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-\.]+\.([a-zA-Z]{2,3})$/;
var email = document.formlogin.EMAIL.value;
var passw0 = document.formlogin.OPASSWORT.value;
var passw1 = document.formlogin.PASSWORT.value;
var passw2 = document.formlogin.wpasswort.value;

var checked = true;

 if ((re_email.test(email))==false || email.length==0 ) {
		   alert("Die Syntax der Emailadresse ist falsch!");
		   checked = false;
		 }
	else if (passw0.length>4){ 

		 if (passw1.length<5) {
		   alert("Das neue Passwort sollte eine Länge von mindestens 5  Ziffern haben!");
		   checked = false;
			 }
		else if (passw1!=passw2) {
		   alert("Die neuen Passwörter sind nicht gleich!");
		   checked = false;
			 }
		}


 if (checked) {
   document.formlogin.method = "post";
   document.formlogin.changeData.value = "1";
   document.formlogin.action = "login.php";
   document.formlogin.submit();
 }
 return checked;
}

function cancelchangedata(){

   document.formlogin.method = "post";
   document.formlogin.changeData.value = "0";
   document.formlogin.action = "login.php";
   document.formlogin.submit();

  return checked;
}


function checklogin(){
var passw = document.login.passwort.value;
var benutz = document.login.benutzer.value;

var checked = true;

if (benutz.length<5) {
		   alert("Der Benutzername ist zu kurz!");
		   checked = false;
		 }
	else if (passw.length<5) {
		   alert("Das Passwort ist zu kurz!");
		   checked = false;
		 }

 if (checked) {
   document.login.method = "post";
   document.login.action = "login.php";
   document.login.anmelden.value="1";
   document.login.submit();
 }
 return checked;
}

function checkkennung(){
var benutz = document.login.benutzer.value;

var checked = true;

if (benutz.length<5) {
		   alert("Der Benutzername ist zu kurz!");
		   checked = false;
		 }

 if (checked) {
   document.login.passwort.value="";
   document.login.anmelden.value="0";
   document.login.method = "post";
   document.login.action = "login.php";
   document.login.submit();
 }
 return checked;
}


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


function ChangeValue() {
  var i,p,v,dec1,dec2,obj,args=ChangeValue.arguments;

  if (args[1]==2) {
	dec1='hide';
	dec2='show';
	}
  if (args[1]==3) {
	dec1='show';
	dec2='show';
	}
  if (args[1]==1) {
	dec1='hide';
	dec2='hide';
	}

  for (i=3; i<(args.length); i+=1)
	{
	MM_showHideLayers('Layer_1_'+args[i],'',dec1);
	MM_showHideLayers('Layer_2_'+args[i],'',dec1);
	if (args[2]!=1) MM_showHideLayers('Layer_3_'+args[i],'',dec2);
	}

  v=3-args[1]+1;

  p=document.formlistung.elements['entscheid'+args[3]];
  
  if (args[2]==1 && v==2) 
	{
	p[v].checked=false;
	p[v].value='';

	p[3].checked=true;
	p[3].value=1;
	v=3;
	}
	
	
  for (i=4; i<(args.length); i+=1)
	{
	obj=document.formlistung.elements['entscheid'+args[i]];
	obj[v].checked=p[v].checked;
	obj[v].value=p[v].value;
	}

}

function ChangePrice() {
  var i,p,v,obj,args=ChangePrice.arguments;

  p=document.formlistung.elements[args[0]+args[1]];

  for (i=2; i<(args.length); i+=1)
	{
	obj=document.formlistung.elements[args[0]+args[i]];
	obj.value=p.value;
	}
}

function pinfo(para){
InfoProdukt=window.open('pinfo.php?'+para,'Produktinformation','width=970,height=550,menubar=0,toolbar=0,location=0,status=0,scrollbars=1,resizable');

if (InfoProdukt.opener == null) {
         InfoProdukt.opener = window;
     }

InfoProdukt.opener.name = "openerCloer"

}

function cpinfo(para){

InfoCPI=window.open('cpiinfo.php?'+para,'CPIInformation','width=970,height=550,menubar=0,toolbar=0,location=0,status=0,scrollbars=1,resizable');

}

function wuinfo(para){

InfoWU=window.open('wuinfo.php?'+para,'WUInformation','width=650,height=370,menubar=0,toolbar=0,location=0,status=0,scrollbars=1,resizable');

}


function SubmitClose(){
document.formlistung.submit();
window.close();
}


function allwin(a,b){

if (a=='FAQ') { FAQWindow=window.open('faq.php?uid='+b,'FAQInformation','width=670,height=500,menubar=0,toolbar=1,location=0,status=0,scrollbars=1,resizable=0');}

if (a=='Statistik') { StatWindow=window.open('statistik.php?uid='+b,'Statistik','width=690,height=500,menubar=0,toolbar=1,location=0,status=0,scrollbars=1,resizable=0');}

}
