function calculate()
{	
	var unitVar = document.Form1.unit_txt;
	var priceVar = document.Form1.price_txt;
		
	if(unitVar == null)	
		return;
	
	if(!isValid(unitVar.value))
		return;	
		
	var temp = unitVar.value.replace(",", ".");		
	temp = eval(temp) * 22 + 2.5;	
	priceVar.value = temp.toFixed(2);
}
function calculate2()
{	
	var unitVar = document.Form1.unit_txt;
	var priceVar = document.Form1.price_txt;
		
	if(unitVar == null)	
		return;
	
	if(!isValid(unitVar.value))
		return;	
		
	var temp = unitVar.value.replace(",", ".");		
	temp = eval(temp) * 18.5 + 2.5;	
	priceVar.value = temp.toFixed(2);
}
function isValid(str)
{
	var pattern = /^\d+.?\d*$/;
	return str.match(pattern)==null ? false : true;
}
function validateBuchbestellung ($array)
{
   var i = 0;
   var msg = '';
   for (i;i<$array.length;++i)
   {
     xname = $array[i]
     if (xname == 'unit_txt') {msg += 'Bitte geben Sie die gewünschte Stückzahl Ihrer Bestellung an.\n';}
     if (xname == 'lastname') {msg += 'Bitte Name ausfüllen.\n';}
     if (xname == 'firstname') {msg += 'Bitte Vorname ausfüllen.\n';}
     if (xname == 'street') {msg += 'Bitte Straße ausfüllen.\n';}
     if (xname == 'zip') {msg += 'Bitte PLZ ausfüllen.\n';}
     if (xname == 'city') {msg += 'Bitte Ort ausfüllen.\n';}
     if (xname == 'email') {msg += 'Bitte E-Mail ausfüllen.\n';}
   }
   alert(msg);
}
