	function addNode(el,text){
		var childEl = document.createElement("div");
		el.appendChild(childEl);
		var txtNode = document.creatTextNode(text);
		childEl.appendChild(txtNode);
	}
	function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	function clearText(thefield){
		if (thefield.defaultValue==thefield.value) thefield.value = "";
	}
	function restoreText(thefield,originalText){
		if (thefield.value=="") thefield.value = originalText;
	}
	function clearStyle(thefield){
		if (thefield.defaultValue==thefield.value) thefield.value = "";
	}
	function checkEmail(){
		var emailFormat=/^(?:[\w\d]+\.?)+@(?:(?:[\w\d]\-?)+\.)+\w{2,4}$/; //regular expression defining email
		if (document.login.username.value.search(emailFormat)==-1) //if match failed
		//addNode(navBar,"Please enter valid email address");
		alert("Please enter a valid email address.");
	}
	function checkPasswordLength(){
		var fieldlimits=/^(\d*[A-Za-z0-9]\d*){3,15}$/; //regular expression defining limits
		if (document.login.username.value.search(fieldlimits)==-1) //if match failed
		alert("Password must be 3-15 letters long");
	}