
function submitform () {

  document._xclick.invoice.value=geninvoiceno();
  document._xclick.submit();
}

function geninvoiceno () {

  var currentTime = new Date();

  var year = currentTime.getFullYear();
  var month = currentTime.getMonth()+1;
  var date = currentTime.getDate();
  var hour = currentTime.getHours();
  var minutes = currentTime.getMinutes();
  var seconds = currentTime.getSeconds();

  invoice = "MA" + year;

  if (month < 10)
    invoice = invoice + "0" + month;
  else
    invoice = invoice + month;

  if (date < 10)
    invoice = invoice + "0" + date;
  else
    invoice = invoice + date;

  if (hour < 10)
    invoice = invoice + "0" + hour;
  else
    invoice = invoice + hour;

  if (minutes < 10)
    invoice = invoice + "0" + minutes;
  else
    invoice = invoice + minutes;

  if (seconds < 10)
    invoice = invoice + "0" + seconds;
  else
    invoice = invoice + seconds;

  return (invoice);
}

