function testinvoice(wert) {
  if (wert == "e.g. RomNIC-061231-1234") {
    alert("Please correct the Invoice Number.");
    document.vorgabe.invoice.focus();
    return false;
  }
  else if (wert == "") {
    alert("Please enter the Invoice Number.");
    document.vorgabe.invoice.focus();
    return false;
  }
  else {
    return true;
  }
}
function testzahl(wert) {
 if (wert < 17 || isNaN(wert)) {
    alert("Please correct the Amount.");
    document.vorgabe.amount.focus();
    return false;
  }
  return true;
}
function testterm(wert) {
 if (wert == "") {
    alert("Please enter the Registration Term.");
    document.vorgabe.term.focus();
    return false;
  }
  return true;
}
function testdomain(wert) {
 if (wert == "") {
    alert("Please enter the Domain Name (or a Ref.-Number).");
    document.vorgabe.domain.focus();
    return false;
  }
  return true;
}

function gopaypal() {
  document.vorgabe.amount.value =
document.vorgabe.amount.value.replace(/,/,".");
  document.vorgabe.amount.value = Math.abs(document.vorgabe.amount.value);
  if (testzahl(document.vorgabe.amount.value) &&
testinvoice(document.vorgabe.invoice.value) &&
testterm(document.vorgabe.term.value) &&
testdomain(document.vorgabe.domain.value)) {
    document.paypal.action="https://www.paypal.com/cgi-bin/webscr";
    document.paypal.amount.value=document.vorgabe.amount.value;
    document.paypal.item_name.value="Invoice No.: "+document.vorgabe.invoice.value+" for Domain: "+document.vorgabe.domain.value+" ("+document.vorgabe.term.value+" Years)";
    document.paypal.submit();
    return true;
  }
  return false;
}
