function popUpWindow(helpnum,helpheight) 
{
  window.open("help"+helpnum+".htm","Window2","status=no,height=770,width=770,resizable=yes,left=100,top=100,scrollbars=yes");
}

function checknum(field) {
  var valid = "0123456789"
  var ok = "yes";
  var temp;
  for (var i=0; i<field.value.length; i++) {
    temp = "" + field.value.substring(i, i+1);
    if (valid.indexOf(temp) == "-1") ok = "no";
  }
  if (ok == "no") {
    alert("Invalid entry! Please enter only a full number of pounds, with no pound sign, no spaces and no pence");
    field.focus();
    field.select();
  }
}

function checkint(field) {
  var valid = "0123456789"
  var ok = "yes";
  var temp;
  for (var i=0; i<field.value.length; i++) {
    temp = "" + field.value.substring(i, i+1);
    if (valid.indexOf(temp) == "-1") ok = "no";
  }
  if (ok == "no") {
    alert("Invalid entry! Please enter only a whole number with no other characters");
    field.focus();
    field.select();
  }
}

function checklen(field,maxlen) {
  var ok = 1;
  var intLen = field.value.length;
  if (intLen > maxlen) {
    alert("You have typed more than the maximum permitted \n number of characters in the field. \n Maximum allowed (inc. spaces):\t " + maxlen + "\n Current total (inc. spaces): \t" + intLen + "\n Please delete part of the entry.");
    field.focus();
  }
}

function checkfloat(field) {
	if (isNaN(field.value)) {
	    alert("Invalid entry!\n You may only enter a number here.");
	    setTimeout(function(){field.focus()}, 10);
	    field.select();
	}
}

function checkyear(field) {
  var valid = "0123456789"
  var ok = "yes";
  var temp;
  for (var i=0; i<field.value.length; i++) {
    temp = "" + field.value.substring(i, i+1);
    if (valid.indexOf(temp) == "-1") ok = "no";
  }
  var intLen = field.value.length;
  if (intLen > 4) ok = "no";
  if (intLen < 4) ok = "no";
  if (ok == "no") {
    alert("Invalid entry! Please enter a full year value from 1000 to 9999");
    field.focus();
    field.select();
  }
}



