	/**
	 * focus on field 
	 * @return void(0)
	 */
	function setFocus(aField) {
		document.frm_login_youth[aField].focus();
	}

	/**
	 * check field is empty or not  
	 * @return Boolean;
	 */
	function isEmpty(aTextField) {
		if ((document.frm_login_youth[aTextField].value.length==0) || (document.frm_login_youth[aTextField].value==null)) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * check space  
	 * @return Boolean;
	 */
	function trim(str_key) {
		str_key = rtrim(str_key);
		str_key = ltrim(str_key);
		return str_key;
	}

	/**
	 * function to right trim a string
	 * @return Boolean;
	 */
	function rtrim(str_key) {
		while (str_key.charAt(str_key.length-1)==" ") {
			str_key=str_key.substr(0,str_key.length-1);
		}	
		return str_key;
	}


	/**
	 * function to left trim a string
	 * @return Boolean;
	 */
	function ltrim(str_key) {
		while (str_key.charAt ==" ") {
			str_key=str_key.substr(1);
		}	
		return str_key;
	}

	
	/**
	 * check spacial character validation
	 * @param String elem
	 * @return Boolean;
	 */
	function isAlphabet(elem) {  
		  var alphaExp = /^[a-zA-Z0-9 ]+$/;  
		  if (elem.match(alphaExp)) {  
			   return true;  
		  } else {  
			 return false;  
		  }  
	 }

	/**
	 * client side validation
	 * @return Boolean;
	 */
	function check_validate() {
		obj			= document.frm_login_youth;
		first_name	= trim(obj.first_name.value);
		password	= trim(obj.password.value);
		if (isEmpty("first_name")) {
			alert("Please enter the User Name.");
			setFocus("first_name");
			return false;
		}
		if (isAlphabet(first_name) == false) {
			alert("Invalid User Name.");
			setFocus("first_name");
			return false;
		}
		if (isEmpty("password")) {
			alert("Please enter the password.");
			setFocus("password");
			return false;
		}
			
		return true;
	}

	function openyouthpopup(){
		//win3 = window.open("", "Window3", "width=350,left=350,top=200,height=180,scrollbars=no,menubar=no,status=no,resizable=no,toolbar=no,minimize=no,maximize=no,dialog=yes,modal=yes");
		//win3.document.writeln("<h2 style='font-size:14px; padding-top:50px; text-align:center; width:100%'>To retrieve your password, please ask your teacher.</h2>"); 
	jQuery("#showhidebox").show();
	}
	

	function closeyouthpopup(){
		jQuery("#showhidebox").hide();
	}