function setdata(){
var error_obj=document.getElementById('error_handling');
if(error_obj.lastChild){(error_obj.removeChild(error_obj.lastChild));}

error_obj.appendChild(document.createElement('DIV'));
error_obj=error_obj.lastChild;

var FF;
var strelemente='';
FF=document.fo1.vonv.value;
if (FF !=""){
if(isNaN(FF)){
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert1));

document.fo1.vonv.select()
document.fo1.vonv.focus()
return false
}}
FF=document.fo1.bisv.value;
if(FF !=""){
if(isNaN(FF)){
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert1));
document.fo1.bisv.select()
document.fo1.bisv.focus()
return false}}

var userInput=document.fo1.extra1.value
if (userInput!=''){
if (userInput.match("%")  || userInput.match("\'") || userInput.match("\"") || userInput.match("=") || userInput.match("/") || userInput.match("insert")|| userInput.match("update")|| userInput.match("delete")|| userInput.match("select"))
{
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert2));
document.fo1.extra1.select()
document.fo1.extra1.focus()
return false;}}
if(document.fo1.extra2){
userInput=document.fo1.extra2.value
if(userInput!=''){
if (userInput.match("%")  || userInput.match("\'") || userInput.match("\"") || userInput.match("=") || userInput.match("/") || userInput.match("insert")|| userInput.match("update")|| userInput.match("delete")|| userInput.match("select"))
{
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert2));

document.fo1.extra2.select()
document.fo1.extra2.focus()
return false;}}}
if (document.fo1.vm1){
if (document.fo1.vm1.value!='n' && document.fo1.bm1.value!='n'){
var Today=new Date();
var vday = new Date();
var bday=new Date();
var vdays=new Date();
var bdays=new Date();

if (((document.fo1.vj1.value==2008 || document.fo1.vj1.value==2012) && document.fo1.vm1.value==1 && document.fo1.vt1.value >29) || (document.fo1.vm1.value=='1' && document.fo1.vt1.value > 28) || ((document.fo1.vm1.value =='3' || document.fo1.vm1.value =='5' || document.fo1.vm1.value =='8' || document.fo1.vm1.value =='10') 
&& document.fo1.vt1.value >30))
{
	
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert20));
document.fo1.vt1.focus();
return false;}
if (((document.fo1.bj1.value==2008 || document.fo1.bj1.value==2012) && document.fo1.bm1.value==1 && document.fo1.bt1.value >29)
|| (document.fo1.bm1.value=='1' && document.fo1.bt1.value > 28)
|| ((document.fo1.bm1.value =='3' || document.fo1.bm1.value =='5' || document.fo1.bm1.value =='8' || document.fo1.bm1.value =='10') && document.fo1.bt1.value >30))
{
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert20));
document.fo1.bt1.focus();
return false;}

vday.setYear(document.fo1.vj1.value);
vday.setMonth(document.fo1.vm1.value);
vday.setDate(document.fo1.vt1.value);

bday.setYear(document.fo1.bj1.value);
bday.setMonth(document.fo1.bm1.value);
bday.setDate(document.fo1.bt1.value);


if(Today > vday)
{
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert21));
document.fo1.vt1.focus();
return false;}
else if(bday < vday)
{
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert21));

document.fo1.bt1.focus();
return false;}
else if(document.fo1.vt1.value == document.fo1.bt1.value && document.fo1.vm1.value== document.fo1.bm1.value)
{
	
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert30));
document.fo1.bt1.focus();
return false;}

}

var days=document.fo1.dauer.value;
if(days !=''){
if(isNaN(days)){document.fo1.dauer.select();

error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert31));
return false;}
else if(days > 300){
	
error_obj.appendChild(document.createElement('DIV'));
error_obj.lastChild.style.color='red';
error_obj.lastChild.appendChild(document.createTextNode(alert32));
return false;}
 
return true;}
return true;}
else{return true;}}

function senden(){
if(setdata()){document.fo1.submit();}}

function Loeschen2(){
var n =1;
document.fo1.vonv.value = '';
document.fo1.bisv.value = '';
document.fo1.tl.options[0].selected = true;
document.fo1.vt1.options[0].selected = true;
document.fo1.vm1.options[0].selected = true;
document.fo1.vj1.options[0].selected = true;
document.fo1.bt1.options[0].selected = true;
document.fo1.bm1.options[0].selected = true;
document.fo1.bj1.options[0].selected = true;
document.fo1.dauer.value='';
while(n<10){document.fo1.rg.options[n].selected = false;n++;}
document.fo1.rg.options[0].selected = true;
n=1;
while(n<4){document.fo1.essen.options[n].selected = false;n++;}
n=1;
while(n<4){document.fo1.lg.options[n].selected = false;n++;}
document.fo1.lg.options[0].selected = true;

document.fo1.extra1.value='';
document.fo1.extra2.value='';


document.fo1.ez.options[0].selected='true';
document.fo1.dz.options[0].selected='true';
document.fo1.mz.options[0].selected='true';
document.fo1.ss.options[0].selected='true';


document.fo1.ml.value='0';
document.fo1.sem.value='0';
document.fo1.mu.value='0';
document.fo1.skiab.value='0';
document.fo1.skilang.value='0';
document.fo1.schsch.value='0';
document.fo1.eis.value='0';
document.fo1.rodel.value='0';
document.fo1.reit.value='0';
document.fo1.kl.value='0';
document.fo1.kk.value='0';
document.fo1.ttt.value='0';
document.fo1.mu.value='0';
document.fo1.kino.value='0';
document.fo1.disco.value='0';
document.fo1.sem.value='0';
document.fo1.wa.value='0';
document.fo1.fb.value='0';
document.fo1.wass.value='0';
document.fo1.gl.value='0';
document.fo1.bad.value='0';
document.fo1.WWW.value='0';
document.fo1.bike.value='0';
document.fo1.gy.value='0';
document.fo1.ml.value='0';
document.fo1.gesch.value='0';
document.fo1.steam.value='0';
document.fo1.back.value='0';
document.fo1.grill.value='0';
document.fo1.kuhl.value='0';
document.fo1.ref.value='0';
document.fo1.pizza.value='0';
document.fo1.pott.value='0';
document.fo1.brat.value='0';


document.fo1.ml.checked='';
document.fo1.sem.checked='';
document.fo1.mu.checked='';
document.fo1.skiab.checked='';
document.fo1.skilang.checked='';
document.fo1.schsch.checked='';
document.fo1.eis.checked='';
document.fo1.rodel.checked='';
document.fo1.reit.checked='';
document.fo1.kl.checked='';
document.fo1.kk.checked='';
document.fo1.ttt.checked='';
document.fo1.mu.checked='';
document.fo1.kino.checked='';
document.fo1.disco.checked='';
document.fo1.sem.checked='';
document.fo1.wa.checked='';
document.fo1.fb.checked='';
document.fo1.wass.checked='';
document.fo1.gl.checked='';
document.fo1.bad.checked='';
document.fo1.WWW.checked='';
document.fo1.bike.checked='';
document.fo1.gy.checked='';
document.fo1.ml.checked='';
document.fo1.gesch.checked='';
document.fo1.steam.checked='';
document.fo1.back.checked='';
document.fo1.grill.checked='';
document.fo1.kuhl.checked='';
document.fo1.ref.checked='';
document.fo1.pizza.checked='';
document.fo1.pott.checked='';
document.fo1.brat.checked='';
}

function changeval(obji)
{
if(obji.value=='' || obji.value=='0')
{obji.value=1}
else {obji.value='0'}
}
function changeon(objimg,o)
{objimg.src="../bilder/helpon.gif";
document.getElementById('span'+o).style.visibility="visible";}

function changeout(objimg,o)
{objimg.src="../bilder/helpout.gif";
document.getElementById('span'+o).style.visibility="hidden";}


