<!-- Hide script from old browsers

       function showmenu(elmnt)
       {
          document.getElementById(elmnt).style.visibility="visible"
       }

       function hidemenu(elmnt)
       {
         document.getElementById(elmnt).style.visibility="hidden"
       }


        leftPos = 0
        if (screen)
        {
                leftPos = screen.width - 600
        }

        leftPosA = 0
        if (screen)
        {
                leftPosA = screen.width - 300
        }


        function newWindow(placeit) {
                bioWindow = window.open( placeit, 'bioWin', 'width=600,height=500, left='+leftPos+', top=0, scrollbars=yes')
                bioWindow.focus()

        }
         function newWindow2(placeit) {
                bioWindow = window.open( placeit, 'bioWin', 'width=300,height=200, left='+leftPosA+', top=0, scrollbars=yes')
                bioWindow.focus()

        }

        function checkForm(passForm) {
        //List of special not allowed characters: 
        var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?"; 
     
        //make sure they entered their first name
                if (document.myForm.first.value == "") {
                alert ("Please enter your first name.")
                document.myForm.first.focus()
                return false
                }
        //Make sure they do not enter special chars in the first name field
           for (var i = 0; i < document.myForm.first.value.length; i++) {
               if (iChars.indexOf(document.myForm.first.value.charAt(i)) != -1) {
               alert ("The first name field has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.first.focus()
               return false;
               }
            }
      


        //make sure they entered their last name
                if (document.myForm.last.value == "") {
                alert ("Please enter your last name.")
                document.myForm.last.focus()
                return false
                }
         //Make sure they do not enter special chars in the last name field
           for (var i = 0; i < document.myForm.last.value.length; i++) {
               if (iChars.indexOf(document.myForm.last.value.charAt(i)) != -1) {
               alert ("The city last name has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.last.focus()
               return false;
               }
            }
   

         //make sure they entered their institution
                if (document.myForm.inst.value == "") {
                alert ("Please enter your institution.")
                document.myForm.inst.focus()
                return false
                }
         //Make sure they do not enter special chars in the inst field
           for (var i = 0; i < document.myForm.inst.value.length; i++) {
               if (iChars.indexOf(document.myForm.inst.value.charAt(i)) != -1) {
               alert ("The institution field has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.inst.focus()
               return false;
               }
            }

 

         //make sure they entered their city
                if (document.myForm.city.value == "") {
                alert ("Please enter your city.")
                document.myForm.city.focus()
                return false
                }
          //Make sure they do not enter special chars in the state field
           for (var i = 0; i < document.myForm.city.value.length; i++) {
               if (iChars.indexOf(document.myForm.city.value.charAt(i)) != -1) {
               alert ("The city field has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.city.focus()
               return false;
               }
            }


         //make sure they entered their state/province
                if (document.myForm.state.value == "") {
                alert ("Please enter your state or province.")
                document.myForm.state.focus()
                return false
                }
         //Make sure they do not enter special chars in the state field
           for (var i = 0; i < document.myForm.state.value.length; i++) {
               if (iChars.indexOf(document.myForm.state.value.charAt(i)) != -1) {
               alert ("The state field has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.state.focus()
               return false;
               }
            }



        //make sure they entered their country
                if (document.myForm.country.value == "") {
                alert ("Please enter your country.")
                document.myForm.country.focus()
                return false
                }
        //Make sure they do not enter special chars in the country field
           for (var i = 0; i < document.myForm.country.value.length; i++) {
               if (iChars.indexOf(document.myForm.country.value.charAt(i)) != -1) {
               alert ("The country field has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.country.focus()
               return false;
               }
            }


         //make sure they entered their e-mail
                if (document.myForm.email.value == "") {
                alert ("Please enter your E-mail.")
                document.myForm.email.focus()
                return false
                }
          //make sure they entered a valid e-mail
                number = document.myForm.email.value.indexOf("@")
                if (number == -1) {
                alert ("Please enter a valid E-mail address.")
                return false
                }
  
  
        //make sure they entered their login
                if (document.myForm.login.value == "") {
                alert ("Please enter your login.")
                document.myForm.login.focus()
                return false
                }
        //Make sure they do not enter special chars in the comment field
           for (var i = 0; i < document.myForm.login.value.length; i++) {
               if (iChars.indexOf(document.myForm.login.value.charAt(i)) != -1) {
               alert ("The login field has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.login.focus()
               return false;
               }
            }


       //make sure they entered a comment line
                if (document.myForm.comment.value == "") {
                alert ("Please enter your reason for signing up for CDAAC Data Access in the Comment box.")
                document.myForm.comment.focus()
                return false
                }

       //Make sure they do not enter special chars in the comment field
           for (var i = 0; i < document.myForm.comment.value.length; i++) {
  	       if (iChars.indexOf(document.myForm.comment.value.charAt(i)) != -1) {
  	       alert ("The comment field has special characters. \nThese are not allowed.\n Please remove them and try again.");
               document.myForm.comment.focus()
  	       return false;
  	       }
            }  


       //make sure both passwords are the same
                if (passForm.passwd1.value == "")
                {
                   alert("You must enter a password")
                   passForm.passwd1.focus()
                   return false
                }
                if (passForm.passwd1.value != passForm.passwd2.value)
                {
                   alert("Entered passwords did not match")
                   passForm.passwd1.focus()
                   passForm.passwd1.select()
                   return false
                }
        return true

        }

        // End hiding script from old browsers -->

