<!--
function setGeo() {
  var now = new Date();
  var diff = now.getTimezoneOffset();
  if (diff > 270) {
    var Geo = "Au";
  }
  else if (diff < -90) {
    var Geo = "US";
  }
  else {
    var Geo = "EU";
  };
}
function sitePrices() {
//  var sPrices = new Array(60,90,120,150,200);
  var sPrices = new Array(40,60,80,100);
  var fx = new Array(1,1.4,2.5);
  var crncySym = new Array("GB£","US$","AU$");
  var crncyIx = document.crncy.currency.selectedIndex;
//document.write(this.crncy.currency);
  for(var i = 0; i < sPrices.length; i++) {
    txtPrice = crncySym[crncyIx] + (sPrices[i] * fx[crncyIx]) + "<BR>";
    document.write(txtPrice);
  }
}
function hostPrices() {
  var hPricesM = new Array(5,10,1);
  var hPricesY = new Array(55,110,10);
  var fx = new Array(1,1.4,2.5);
  var crncySym = new Array("GB£","US$","AU$");
  var crncyIx = document.crncy.currency.selectedIndex;
  for(var i = 0; i < hPricesM.length; i++) {
    txtPrice = crncySym[crncyIx] + (hPricesM[i] * fx[crncyIx]) + "/mth or " + crncySym[crncyIx] + (hPricesY[i] * fx[crncyIx]) + "/yr<BR>";
    document.write(txtPrice);
  }
}
function getPages() {
  var ret = 0, pgs = document.sitereq.pages;
  for (i = 0; i < pgs.length; i++) {
    if (pgs.options[i].selected) {
      ret = pgs.options[i].value;
      break;
    };
  };
  return ret;
}
function freeSite() {
  userPrompt(getPages());
}
function userPrompt(pages) {
  var typ = 0, fls = document.sitereq.files;
  for (j = 0; j < fls.length; j++) {
    if (fls[j].checked) {
      typ = fls[j].value;
      break;
    };
  };
  for (i = 1; i <= pages; i++) {
    //  display text field for page title
    document.write('<TR><TD VALIGN=TOP><INPUT NAME=t' + i + ' TYPE=text SIZE=10 VALUE=Page' + i + '></TD>');
    //  display either fileupload or textarea field dependent on radio button "files"
    if (typ == 1) {
      document.write('<TD COLSPAN=2><INPUT TYPE=file NAME=c' + i + '></TD></TR>');
    }
    else {
      document.write('<TD COLSPAN=2><TEXTAREA NAME=c' + i + ' COLS=50 ROWS=3></TEXTAREA></TD></TR>');
    };
  };
}
function valForm() {
  var f = document.sitereq;
  var fld = "", errs = "", others = "", val = "", fname = "", pgs = 0, msg = "";
  val = f.email.value;
  if (isEmpty(val)) {
    errs += '  Email\n';
  }
  else {
    if (!isEmail(val)) {
      others += '  Invalid Email address\n';
    };
  };
  val = f.sitename.value;
  if (isEmpty(val)) {
    errs += '  Site Name\n';
  }
  pgs = getPages();
  for (var j = 0; j < f.length; j++) {
    var e = f.elements[j];
    for (i = 1; i <= pgs; i++) {
      t = "t" + i;
      c = "c" + i;
      if (e.name == t) {
        if (isEmpty(e.value)) {
          errs += '  Title ' + i + '\n';
        };
        break;
      };
      if (e.name == c) {
        if (isEmpty(e.value)) {
          errs += '  Content ' + i + '\n';
        };
        break;
      };
    };
  };
  if (others > "") {
    msg += "The following problems exist\n" + others + "\n";
  };
  if (errs > "") {
    msg += "The following empty fields must be completed:\n" + errs + "\n";
  };
  if (msg > "") {
    alert(msg);
    return false;
  }
  else {
    var terms = "By clicking the <OK> button you agree to be bound by the Terms & Conditions of the Licence Agreement [www.aroof.net/P16.htm].  If you not agree to the terms of the Licence Agreement, click the <CANCEL> button.\n"
    return confirm(terms);
  };
}
function isEmpty(value) {
  // 1 = true i.e. IS empty
  if ((value == '') || (value == null)) {
    return true;
  }
  else {
    return false;
  };
}
function isEmail(value) {
  // 1 = true i.e. IS email
  var s = value;
  if (s.indexOf('@') == s.lastIndexOf('@')) {
    return true;
  }
  else {
    return false;
  };
}
// -->
