/**
       * Copyright (C) 2002-6 Kai Hoebold <kai@netzhaut-design.de>
       *
       * This program is free software; you can redistribute it and/or modify
       * it under the terms of the GNU General Public License as published by
       * the Free Software Foundation; either version 2 of the License, or
       * (at your option) any later version.
       *
       * This program is distributed in the hope that it will be useful,
       * but WITHOUT ANY WARRANTY; without even the implied warranty of
       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
       * GNU General Public License for more details.
       *
       * You should have received a copy of the GNU General Public License
       * along with this program; if not, write to the Free Software
       * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

function Controlletti()
{
 var FN="form_belegung";
var NN=new Array("name","str","plz","ort","von","bis");
var DT=new Array("von","bis");
var Z1=new Array("tel","fax");
var Z2=new Array("an","ab","anzw","anzm","anzwb","anzmb","plz");
var EM=new Array("mail");
 var okay=true,c=document[FN],x=true,p=0,a="",z1="0123456789.-/ +",z2="0123456789: ",fehler="",w;
 for(var i=0;i<c.length-3;i++)c.elements[i].style.background="#fff";
 for(var i=0;i<NN.length;i++)if(c[NN[i]].value.length<4){okay=false;c[NN[i]].style.background="#FF7875";fehler=c[NN[i]];break;}
 if(okay)for(var i=0;i<DT.length;i++){w=c[DT[i]].value;if(w.length!=10||w.charAt(2)!="."||w.charAt(5)!="."){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<DT.length;i++){p=0;w=c[DT[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1)&&(z1.indexOf(a)<11);p++;}if(!x){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<DT.length;i++){w=c[DT[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1);p++;}if(!x){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<Z1.length;i++){p=0;w=c[Z1[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1);p++;}if(!x){okay=false;c[Z1[i]].style.background="#FF7875";fehler=c[Z1[i]];break;}}
 if(okay)for(var i=0;i<Z2.length;i++){p=0;w=c[Z2[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z2.indexOf(a)!=-1);p++;}if(!x){okay=false;c[Z2[i]].style.background="#FF7875";fehler=c[Z2[i]];break;}}
 if(okay)for(var i=0;i<EM.length;i++){var at_pos=c[EM[i]].value.indexOf("@");var point_pos=c[EM[i]].value.substring(at_pos,c[EM[i]].value.length).indexOf(".");if((at_pos<2||point_pos<3)&&c[EM[i]].value.length!=0){okay=false;c[EM[i]].style.background="#FF7875";fehler=c[EM[i]];break;}}
 if(!okay)alert("Bitte überprüfen Sie Ihre Eingabe in dem rot markiertem Feld.");
 else 
 {
	if(c['check'].checked!=true)
	{
		okay=false;alert("Bitte bestätigen Sie, dass sie die Hinweise zum Rücktrittsrecht gelesen haben!");;fehler=c['check'];
	}
 }
 if(!okay)fehler.focus();
 return okay
}

function Controlletti2()
{
 var FN="form_event";
 var NN=new Array("hl","anm","von","zeit");
 var Z1=new Array("von","bis");
 var Z2=new Array("zeit");
 var EM=new Array("mail");
 var okay=true,c=document[FN],x=true,p=0,a="",z1="0123456789.-/ +",z2="0123456789: ",fehler="",w;
 for(var i=0;i<c.length-3;i++)c.elements[i].style.background="#fff";
 for(var i=0;i<NN.length;i++)if(c[NN[i]].value.length<4){okay=false;c[NN[i]].style.background="#FF7875";fehler=c[NN[i]];break;}
 if(okay)for(var i=0;i<DT.length;i++){w=c[DT[i]].value;if(w.length!=10||w.charAt(2)!="."||w.charAt(5)!="."){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<DT.length;i++){p=0;w=c[DT[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1)&&(z1.indexOf(a)<11);p++;}if(!x){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<DT.length;i++){w=c[DT[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1);p++;}if(!x){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<Z1.length;i++){p=0;w=c[Z1[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1);p++;}if(!x){okay=false;c[Z1[i]].style.background="#FF7875";fehler=c[Z1[i]];break;}}
 if(okay)for(var i=0;i<Z2.length;i++){p=0;w=c[Z2[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z2.indexOf(a)!=-1);p++;}if(!x){okay=false;c[Z2[i]].style.background="#FF7875";fehler=c[Z2[i]];break;}}
 if(okay)for(var i=0;i<EM.length;i++){var at_pos=c[EM[i]].value.indexOf("@");var point_pos=c[EM[i]].value.substring(at_pos,c[EM[i]].value.length).indexOf(".");if((at_pos<2||point_pos<3)&&c[EM[i]].value.length!=0){okay=false;c[EM[i]].style.background="#FF7875";fehler=c[EM[i]];break;}}
 if(!okay)alert("Bitte überprüfen Sie Ihre Eingabe in dem rot markiertem Feld.");
 if(!okay)fehler.focus();
 return okay
}

function Controlletti3()
{
 var FN="form_belegung";
var NN=new Array("name","str","plz","ort","von");
var DT=new Array("von");
var Z1=new Array("tel","fax");
var Z2=new Array("plz");
var EM=new Array("mail");
 var okay=true,c=document[FN],x=true,p=0,a="",z1="0123456789.-/ +",z2="0123456789: ",fehler="",w;
 for(var i=0;i<c.length-3;i++)c.elements[i].style.background="#fff";
 for(var i=0;i<NN.length;i++)if(c[NN[i]].value.length<4){okay=false;c[NN[i]].style.background="#FF7875";fehler=c[NN[i]];break;}
 if(okay)for(var i=0;i<DT.length;i++){w=c[DT[i]].value;if(w.length!=10||w.charAt(2)!="."||w.charAt(5)!="."){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<DT.length;i++){p=0;w=c[DT[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1)&&(z1.indexOf(a)<11);p++;}if(!x){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<DT.length;i++){w=c[DT[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1);p++;}if(!x){okay=false;c[DT[i]].style.background="#FF7875";fehler=c[DT[i]];break;}}
 if(okay)for(var i=0;i<Z1.length;i++){p=0;w=c[Z1[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z1.indexOf(a)!=-1);p++;}if(!x){okay=false;c[Z1[i]].style.background="#FF7875";fehler=c[Z1[i]];break;}}
 if(okay)for(var i=0;i<Z2.length;i++){p=0;w=c[Z2[i]].value;while(x&&(p<w.length)){a=w.charAt(p);x=(z2.indexOf(a)!=-1);p++;}if(!x){okay=false;c[Z2[i]].style.background="#FF7875";fehler=c[Z2[i]];break;}}
 if(okay)for(var i=0;i<EM.length;i++){var at_pos=c[EM[i]].value.indexOf("@");var point_pos=c[EM[i]].value.substring(at_pos,c[EM[i]].value.length).indexOf(".");if((at_pos<2||point_pos<3)&&c[EM[i]].value.length!=0){okay=false;c[EM[i]].style.background="#FF7875";fehler=c[EM[i]];break;}}
 if(!okay)alert("Bitte überprüfen Sie Ihre Eingabe in dem rot markiertem Feld.");
 if(!okay)fehler.focus();
 return okay
}

function del(id,hl)
{
 c=confirm("Soll der Eintrag mit dem Titel \n\n"+hl+"\n\nwirklich gelöscht werden?");
 if(c)c=confirm("Der Eintrag kann jetzt mit [OK] endgültig gelöscht werden.");
 if(c)self.location.href="deletit.php?tab=2&id="+id;
}

function popup(dat,br,ho)
{
 window.open(dat,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+br+',height='+ho+',top=0,left=0')
}
