  
  function MM_findObj(n, d) { //v4.01
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
  }
  /* Functions that swaps images. */
  function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
     if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  }
  function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  }

  /* Functions that handle preload. */
  function MM_preloadImages() { //v3.0
   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  }

  function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
  }

  function FP_swapImgRestore() {//v1.0
   var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {
    var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 
    doc.$imgSwaps=null; }
  }

  function FP_swapImg() {//v1.0
   var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
   n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
   elm.$src=elm.src; elm.src=args[n+1]; } }
  }

  function FP_preloadImgs() {//v1.0
   var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
   for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
  }

  function FP_getObjectByID(id,o) {//v1.0
   var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
   else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
   if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
   for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
   f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
   for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
   return null;
  }  

  // remove leading spaces
  function stringLeftTrim(s) {
          return (typeof(s) != "string") ? null : s.replace(/^ +/, "");
  }

  // remove trailing spaces
  function stringRightTrim(s) {
          return (typeof(s) != "string") ? null : s.replace(/ +$/, "");
  }

  // remove leading and trailing spaces
  function stringTrim(s) {
          return stringRightTrim(stringLeftTrim(s));
  }

  function isEmpty(field) {
          return (field == null || /^ *$/.test(field));
  }

  function isValidEmail(str) {
    // These comments use the following terms from RFC2822:
    // local-part, domain, domain-literal and dot-atom.
    // Does the address contain a local-part followed an @ followed by a domain?
    // Note the use of lastIndexOf to find the last @ in the address
    // since a valid email address may have a quoted @ in the local-part.
    // Does the domain name have at least two parts, i.e. at least one dot,
    // after the @? If not, is it a domain-literal?
    // This will accept some invalid email addresses
    // BUT it doesn't reject valid ones. 
    var atSym = str.lastIndexOf("@");
    if (atSym < 1) { return false; } // no local-part
    if (atSym == str.length - 1) { return false; } // no domain
    if (atSym > 64) { return false; } // there may only be 64 octets in the local-part
    if (str.length - atSym > 255) { return false; } // there may only be 255 octets in the domain

    // Is the domain plausible?
    var lastDot = str.lastIndexOf(".");
    // Check if it is a dot-atom such as example.com
    if (lastDot > atSym + 2 && lastDot < str.length - 2) { return true; }
    //  Check if could be a domain-literal.
    if (str.charAt(atSym + 1) == '[' &&  str.charAt(str.length - 1) == ']') { return true; }
    return false;

  }

  function isAlpha(field)
  {
    var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
    var temp;

    for (var i=0; i<field.length; i++) {
      temp = "" + field.substring(i, i+1);
      if (valid.indexOf(temp) == "-1") return false;
    }
    return true;
  }

  function validateform () {
    var name, email, errmsg, errflag;
    errmsg = "";
    errflag = false;

    name = stringTrim(document.form1.Name.value);
    email = stringTrim(document.form1.Email1.value);

    if (isEmpty(name) && isEmpty(email)) {
      errmsg = "Please fill in your First Name and Primary Email to Subscribe for Complimentary Online Training.";
    } else {
      if (isEmpty(name)) {
        errmsg = "Please fill in your First Name.";
      } else {
        if (! isAlpha(name) ) {
          errmsg = "Please fill in a valid First Name.";
        }
      }
      if (isEmpty(email)) {
        errmsg = "Please fill in your Email.";
      } else {
        if (! isValidEmail(email) ) {
          errmsg = "Please fill in a valid Email.";
        }
      }
    }

    if (isEmpty(errmsg)) {
      errflag = true;
    } else {
      alert(errmsg);
      errflag = false;
    }
    return errflag;

  }
  
  <!-- Original:  Lefteris Haritou --> 
  <!-- Web Site:  lef@writeme.com> www.geocities.com/~lef -->

  <!-- This script and many more are available free online at -->
  <!-- The JavaScript Source!! http://javascript.internet.com -->
  <!-- http://javascript.internet.com/passwords/password-pro-in.html#source -->

  <!-- Begin
  var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9","A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
  var pass=""
  var z=23;
  var y=28;
  var f= new Array();
  var K= new Array();
  for (x=0; x<10; x++){
  f[x]=x<<9
  f[x]+=23
  }
  for (x=10; x<36; x++){
  y=y<<1
  v= Math.sqrt(y)
  v = parseInt(v,16)
  v+=5
  f[x]=v
  y++
  }
  for (x=36; x<62; x++){
  z=z<<1
  v= Math.sqrt(z)
  v = parseInt(v,16)
  v+=74
  f[x]=v
  z++
  }
  var iCounter = 3 //How many retries
  function inc(){
  iCounter--
  if (iCounter > 0)
  {
  if (confirm("\nPassword is incorrect.\n\n\n\nRetry?"))
  Check()
  else
  alert('Password incorrect.');
  // history.go(-1);
  location.href='onlinetraining.php' //Cancel html file

  }
  else
  alert('Your three tries are up.  Access Denied.');
  // history.go(-1);
  location.href='onlinetraining.php' // 3 times incorrect html file

  }
  function Check() {
  pass = document.loginform.pwd.value;
  if(pass==null || pass==""){
  location.href='onlinetraining.php' }
  else{
  var lpass=(pass.length)+1
  for (l=1; l<lpass; l++){
  K[l]=pass.charAt(l)
  }
  var code=0;
  for (y=1; y<lpass; y++){
  for(x=0; x<62; x++){
  if (K[y]==base[x]){
  code+=f[x]
  code*=y
        }
     }
  }

  <!-- STEP TWO: Put access code here!  -->
  if (code==832700)    // code==[your access code]

  go()
  else
  inc()
     }
  }
  function go(){
  location.href=pass+".php";
  }
  // End -->


