function CheckAction(theform) {
  var theaction = theform.getElementsByTagName('select')[0].value;

  if (theaction == 'none') {
    return false;
  } else if (theaction == 'del') {
    return confirm('Are you sure you wish to delete?');
  }

  return true;
}

function isBlank(str) {
	for (var i=0; i < str.length; i++) {
	  var thechar = str.charAt(i);
		// check for space, tab and enter
		if ((thechar != " ") && (thechar != "\t") && (thechar != "\n")) { 
			return false;
		}
	}
  return true;
}

function CheckEditForm(theform) {
  var theowner = theform.getElementsByTagName('input')[3].value;
  var theemail = theform.getElementsByTagName('input')[4].value;
  var thenick = theform.getElementsByTagName('input')[5].value;
  var thehost = theform.getElementsByTagName('input')[6].value;
  var thenotes = theform.getElementsByTagName('textarea')[0].value;

  if (isBlank(theowner)) {
    alert('field owner can\'t be blank...');
    return false;
  } else if (isBlank(theemail)) {
    alert('field email can\'t be blank...');
    return false;
  } else if (isBlank(thehost)) {
    alert('field host can\'t be blank...');
    return false;
  }

  return true;
}