if (self.parent.frames.length != 0) {
  self.parent.location="./morse-generator.php";
}

function chkFormular() {
  var value = trim(document.myform.textbox_input.value);

  if (value.length == 0) {
    alert ('Empty text area. Please input some text!');
    document.myform.textbox_input.value="";
    return false;
  }
}

function trim(str, chars) {
  return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
  chars = chars || "\\s";
  return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
  chars = chars || "\\s";
  return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

