<!--Begin
//function saada(submitForm) collects data from forms "customer" and "plans", puts data into "submitForm" and sends them by e-mail
var months=new Array(13);
months[1]="Januar";
months[2]="Februar";
months[3]="M&auml;rz";
months[4]="April";
months[5]="Mai";
months[6]="Juni";
months[7]="Juli";
months[8]="August";
months[9]="September";
months[10]="Oktober";
months[11]="November";
months[12]="Dezember";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var aasta=time.getYear();
if (navigator.appName == "Netscape")
aasta=1900 + aasta;
if (navigator.userAgent.indexOf("Opera") >= 0)
aasta = 1900 + aasta;
var kuupaev=lmonth + ' ' + date + ',&nbsp;' + aasta;
function saada(submitForm){
document.submitForm.Name.value=document.customer.name.value;
document.submitForm.Address.value=document.customer.address.value;
document.submitForm.Floor.value=document.customer.floor.value;
document.submitForm.Zip_Code.value=document.customer.zip.value;
//document.submitForm.Town.value=document.customer.town.value;
document.submitForm.Telephone.value=document.customer.phone.value;
//document.submitForm.Cellular.value=document.customer.cellular.value;
//document.submitForm.Fax.value=document.customer.fax.value;
document.submitForm.Email.value=document.customer.email.value;
document.submitForm.Source.value=document.customer.source.value;
document.submitForm.Sent.value=kuupaev;
document.submitForm.Templating_date.value=document.customer.date.value;
document.submitForm.Granite.value=document.form_1.brand[document.form_1.brand.selectedIndex].value;
document.submitForm.Pieces.value=document.plans.pieces.value;
document.submitForm.Length_1.value=document.plans.length_1.value;
document.submitForm.Width_1.value=document.plans.width_1.value;
document.submitForm.Length_2.value=document.plans.length_2.value;
document.submitForm.Width_2.value=document.plans.width_2.value;
document.submitForm.Length_3.value=document.plans.length_3.value;
document.submitForm.Width_3.value=document.plans.width_3.value;
document.submitForm.Length_4.value=document.plans.length_4.value;
document.submitForm.Width_4.value=document.plans.width_4.value;
document.submitForm.Length_5.value=document.plans.length_5.value;
document.submitForm.Width_5.value=document.plans.width_5.value;
document.submitForm.Length_6.value=document.plans.length_6.value;
document.submitForm.Width_6.value=document.plans.width_6.value;
document.submitForm.Length_7.value=document.plans.length_7.value;
document.submitForm.Width_7.value=document.plans.width_7.value;
document.submitForm.Straight_straight.value=document.plans.straight.value;
document.submitForm.Straight_halfrounded.value=document.plans.halfrounded.value;
document.submitForm.Straight_rounded.value=document.plans.rounded.value;
document.submitForm.Curved_straight.value=document.plans.straight_c.value;
document.submitForm.Curved_halfrounded.value=document.plans.halfrounded_c.value;
document.submitForm.Curved_rounded.value=document.plans.rounded_c.value;
document.submitForm.CornersA.value=document.plans.roundcornera.value;
document.submitForm.CornersB.value=document.plans.roundcornerb.value;
document.submitForm.Inset_sink.value=document.plans.standard.value;
document.submitForm.Flushfit_sink.value=document.plans.flushfit.value;
document.submitForm.Undermounted_sink.value=document.plans.under.value;
document.submitForm.Underup_mounted_sink.value=document.plans.underup.value;

document.submitForm.Sink_1.value=document.form_2.allas1[document.form_2.allas1.selectedIndex].text;
document.submitForm.Sink_2.value=document.form_2.allas2[document.form_2.allas2.selectedIndex].text;
document.submitForm.Sink_3.value=document.form_2.allas3[document.form_2.allas3.selectedIndex].text;

document.submitForm.Hinta_1.value=document.form_2.hinta1.value;
document.submitForm.Hinta_2.value=document.form_2.hinta2.value;
document.submitForm.Hinta_3.value=document.form_2.hinta3.value;

document.submitForm.Hob_1.value=document.plans.hob_1.value;
document.submitForm.Hob_2.value=document.plans.hob_2.value;
document.submitForm.Taphole.value=document.plans.taphole.value;
document.submitForm.Drainergrooves.value=document.form_2.draininggroove.value;
document.submitForm.Splashback_width_1.value=document.plans.splashwidth_1.value;
document.submitForm.Splashback_length_1.value=document.plans.splashlength_1.value;
document.submitForm.Splashback_width_2.value=document.plans.splashwidth_2.value;
document.submitForm.Splashback_length_2.value=document.plans.splashlength_2.value;
document.submitForm.Splashback_width_3.value=document.plans.splashwidth_3.value;
document.submitForm.Splashback_length_3.value=document.plans.splashlength_3.value;
document.submitForm.Templating.value=document.plans.templating.value;
document.submitForm.Fitting.value=document.plans.fitting.value;
document.submitForm.Fit.value=document.plans.fit.value;
document.submitForm.TotalCost.value=document.plans.estimate.value;
//forbid manual messing with the "Quote" field (deleting or changing the total cost)
if (document.plans.brand.value!=document.form_1.brand[document.form_1.brand.selectedIndex].value||
document.plans.pieces.value!=document.form_2.pieces.value||
document.plans.length_1.value!=document.form_2.length_1.value||
document.plans.width_1.value!=document.form_2.width_1.value||
document.plans.length_2.value!=document.form_2.length_2.value||
document.plans.width_2.value!=document.form_2.width_2.value||
document.plans.length_3.value!=document.form_2.length_3.value||
document.plans.width_3.value!=document.form_2.width_3.value||
document.plans.length_4.value!=document.form_2.length_4.value||
document.plans.width_4.value!=document.form_2.width_4.value||
document.plans.length_5.value!=document.form_2.length_5.value||
document.plans.width_5.value!=document.form_2.width_5.value||
document.plans.length_6.value!=document.form_2.length_6.value||
document.plans.width_6.value!=document.form_2.width_6.value||
document.plans.length_7.value!=document.form_2.length_7.value||
document.plans.width_7.value!=document.form_2.width_7.value||
document.plans.straight.value!=document.form_2.straight.value||
document.plans.halfrounded.value!=document.form_2.halfrounded.value||
document.plans.rounded.value!=document.form_2.rounded.value||
document.plans.straight_c.value!=document.form_2.straight_c.value||
document.plans.halfrounded_c.value!=document.form_2.halfrounded_c.value||
document.plans.rounded_c.value!=document.form_2.rounded_c.value||
document.plans.roundcornera.value!=document.form_2.roundcornera.value||
document.plans.roundcornerb.value!=document.form_2.roundcornerb.value||
document.plans.standard.value!=document.form_2.standard.value||
document.plans.flushfit.value!=document.form_2.flushfit.value||
document.plans.under.value!=document.form_2.under.value||
document.plans.underup.value!=document.form_2.underup.value||
document.plans.hinta1.value!=document.form_2.hinta1.value||
document.plans.hinta2.value!=document.form_2.hinta2.value||
document.plans.hinta3.value!=document.form_2.hinta3.value||
document.plans.hob_1.value!=document.form_2.hob_1.value||
document.plans.hob_2.value!=document.form_2.hob_2.value||
document.plans.taphole.value!=document.form_2.taphole.value||
document.plans.draininggroove.value!=document.form_2.draininggroove.value||
document.plans.splashwidth_1.value!=document.form_2.splashwidth_1.value||
document.plans.splashlength_1.value!=document.form_2.splashlength_1.value||
document.plans.splashwidth_2.value!=document.form_2.splashwidth_2.value||
document.plans.splashlength_2.value!=document.form_2.splashlength_2.value||
document.plans.splashwidth_3.value!=document.form_2.splashwidth_3.value||
document.plans.splashlength_3.value!=document.form_2.splashlength_3.value){
alert("Bitte klicken Sie an die Schaltfläche \"Preis\"!");
return (false);
}
if (document.plans.estimate.value=="" || document.plans.estimate.value=="0"){
alert("Bitte klicken Sie an die Schaltfläche \"Preis\"!");
return (false);
}
if (document.plans.estimate.value != document.plans.check.value){
//alert("You have manually changed the \"Quote\" field.\n Click on \"Quote\" button again");
document.plans.estimate.value=document.plans.check.value;
//document.plans.estimate.focus();
//return(false);
}
if (document.form_2.length_1.value=="" || document.form_2.length_1.value=="0"|| document.form_2.width_1.value==""|| document.form_2.width_1.value=="0"){
alert("Bitte überprüfen Sie das alle Felden sind korrekt eingegeben!");
return(false);
}
//validate the user data
//validate name
if (document.submitForm.Name.value ==""){
alert("Bitte geben Sie ihr Name ein!");
document.customer.name.focus();
return (false);
}
//validate address
if (document.submitForm.Address.value ==""){
alert("Bitte geben Sei ihre Adresse ein!");
document.customer.address.focus();
return (false);
}
//validate floor
if (document.submitForm.Floor.value ==""){
alert("Bitte geben Sei ihre Etage ein!");
document.customer.floor.focus();
return (false);
}
//validate ZIP code
if (document.submitForm.Zip_Code.value ==""){
alert("Bitte geben Sie PLZ und Stadt ein!");
document.customer.zip.focus();
return (false);
}
//validate telephone number
if (document.submitForm.Telephone.value ==""){
alert("Bitte geben Sie ihre Telefonnummer ein!");
document.customer.phone.focus();
return (false);
}
var checkStr = document.customer.phone.value;
var prsVal = parseFloat(checkStr);
if (isNaN(prsVal)) 
  {
    alert("Bitte nur Zahlen in das Feld \"Telefon\" eingeben!");
    document.customer.phone.focus();
    return (false);
  }	
//validate e-mail address
var email=document.customer.email.value;
invalidChars = "/:,;"
if (email == ""){         //email can't be empty
alert("Bitte geben Sie Ihre E-Mail-Adresse ein!");
document.customer.email.focus();
return false
}
for (i=0; i<invalidChars.length;i++){         //does the users input contain any invalid characters?
badChar = invalidChars.charAt(i)
if (email.indexOf(badChar,0) > -1){
alert("Bitte keine unzulässigen Zeichen in Ihrer E-Mail-Adresse verwenden!");
document.customer.email.focus();
return false
}
}
atPos = email.indexOf("@",1)         //there has to be a @ symbol 
if (atPos == -1){
alert("In Ihrer E-Mail-Adresse muß ein \@ -Symbol geben! ");
document.customer.email.focus();
return false
}
if (email.indexOf("@",atPos+1) != -1){         //only one @ symbol 
alert("Bitte nur ein \@-Symbol!");
document.customer.email.focus();
return false
}
periodPos = email.indexOf(".",atPos)
if (periodPos == -1){         //and at least one "." after the @ sign
alert("Nach @-Zeichen muß mindestens ein \".\" sein!");
document.customer.email.focus();
return false
}
if (periodPos+3 > email.length){         //must be at least two characters after the "."
alert("Nach \"\.\" müssen mindestens 2 Buchstaben sein!")
document.customer.email.focus();
return false;
}
//validate reference
if (document.submitForm.Source.value ==""){
alert("Bitte Wahlen Sei ihre Quelle!");
document.customer.source.focus();
return (false);
}
//submit the validated "submitForm" to "mailsender.asp"
document.submitForm.submit();
return true;
}
//-- End>
