
function NewsForm() {
  document.write(
    '<form method = "post" action = "/other/submit.pl" onSubmit = ' +
    '"return CheckSubscription(this.Mail.value);"><p style = ' +
    '"text-align: right; margin: 1.4em 1.5em 0em 1em; color: #333;">' +
    'Our&#160;monthly&#160;news:<br>' +
    '<input name = "Source" type = "hidden" value = "Web-site"><input ' +
    'name = "Action" type = "hidden" value = "Newsletter subscription">' +
    '<input style = "background-color: #eee;" name = "Mail" ' +
    'value = "e-mail" size = "14" class = "ff" onFocus = "value = \'\'"><br>' +
    '<input name = "Submit" type = "submit" value = " Go!" class = "ff">' +
    '</form>'
  );
}

function FeedbackForm() {
  document.write(
    '<form method = "post" action = "/other/submit.pl" onSubmit = ' +
    '"return CheckFeedback(this.Mail.value);"><table>' +
    '<input name = "Source" type = "hidden" value = "Web-site">' +
    '<tr><td class = "fc"><b>E-mail</b></td>' +
    '<td class = "fc"><input name = "Mail" size = "25" class = "ff">' +
    '</td></tr><tr><td class = "fc">Action</td>' +
    '<td class = "fc"><select name = "Action" class = "ff">' +
    '<option>Help request<option>Suggestion for improvement' +
    '<option>Testimonial or review<option>Bug report<option>Other' +
    '</select></td></tr>' +
    '<tr><td class = "fc">Product</td>' +
    '<td class = "fc"><select name = "Product" class = "ff">' +
    '<option>Other<option>MyFiles<option>Backup<option>Coolbase' +
    '</select></td></tr>' +
    '<tr><td class = "fc">Text</td><td class = "fc"><textarea ' +
    'name = "Text" rows = "7" cols = "70" wrap = "hard" class = "ff">' +
    '</textarea></td></tr>' +
    '<tr><td class = "fc"></td><td class = "fc">' +
    '<input name = "Submit" type = "submit" value = "Submit" class = "ff">' +
    '</td></tr></table></form>'
   );
}

function LastUpdated() {
  document.write("Last updated: October 2, 2010.");
//  if (document.getElementsByTagName) {
//    s = document.getElementsByTagName("h1")[0].firstChild.nodeValue;
//    document.title = "Argentum - " + s;
//  }
  if (document.getElementById) {
    s = document.getElementById("headline").firstChild.nodeValue;
    s = s.charAt(0).toUpperCase() + s.slice(1) + "!";
    window.status = s;
  }
  e = (document.body.clientWidth - 1000) / 24;
  if (e > 4) {
    document.body.style.marginLeft = Math.round(e / 7).toString() + "em";
    document.body.style.marginRight = Math.round(e * 6 / 7).toString() + "em";
  }
}

function EmailCorrect(m)
  {return (m.indexOf("@") != -1 && m.indexOf(".") != -1);}

function CheckFeedback(mail) {
  if (!EmailCorrect(mail)) return confirm(
    "Your e-mail address appears to be incorrect. " +
    "We may not be able to send you a reply. Do you want to proceed?"
  );
}

function CheckSubscription(mail) {
  if (!EmailCorrect(mail)) return confirm
    ("Your e-mail address appears to be incorrect. Do you want to proceed?");
}

function Email(e) {
  document.write('<span class = "email">' + e + '&#64;argentuma.com' + '</span>');
}
