
    /* formfunctions.js */

        var newwindow;
        function hglpopglossarywindow(url) {
            newwindow=window.open(url,'Glossary','height=400,width=350, resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
            if (window.focus) {newwindow.focus()}
        }
        function hglpopmessagewindow(url) {
            newwindow=window.open(url, 'HGL','height=400,width=350, resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
            if (window.focus) {newwindow.focus()}
        }
        function hglpopHelpmessagewindow(url) {
            newwindow=window.open(url, 'HGL','height=400,width=550, resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
            if (window.focus) {newwindow.focus()}
        }
        function hglsponsorswindow(url) {
            newwindow=window.open(url, 'HGL','height=200,width=450, resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
            if (window.focus) {newwindow.focus()}
        }
        function hglFullwindow(url) {
            newwindow=window.open(url, 'HGL','height=700,width=850, resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
            if (window.focus) {newwindow.focus()}
        }
        function hglFeedbackWindow(url) {
            newwindow=window.open(url, 'HGLFeedback','height=550,width=550, resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
            if (window.focus) {newwindow.focus()}
        }
        function hglFindPlacekWindow(url) {
            newwindow=window.open(url, 'FindPlace','height=550,width=550, resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
            if (window.focus) {newwindow.focus()}
        }

   /* -------------------------------------------------------
          Do not allow some characters into the form entry.
      ------------------------------------------------------- */
      
   //var mikExp = /[!-:;'?<>.,$\\@\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;
   var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

   function dodacheck(val) {
    var strPass = val.value;
    var strLength = strPass.length;
    var lchar = val.value.charAt((strLength) - 1);
     if(lchar.search(mikExp) != -1) {
      var tst = val.value.substring(0, (strLength) - 1);
      val.value = tst;
      alert("Sorry, but " + lchar + " is an invalid search character!\n");
     }
   }

   function checkempty(val) {
    var strPass = val.value;
    var strLength = strPass.length;
      if(strLength < 2) {
        alert("You did not enter a valid search term!\n");
      }
   }
   
   function doanothercheck(form) {
	if(form.value.length < 1) {
	    alert("Please enter some text.");
	    return false;
	}
	
	if(form.value.search(mikExp) == -1) {
	   alert("Input is correct.");
	   return false;
	} else {
	   alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ = | \n\r\n\r are not allowed in this field.\n");
	   form.select();
	   form.focus();
	   return false;
	}
	   alert("Input is correct.");
	   return false;
   }
   
