	function validate(current_form){
		var total_missing = 0;
		for (counter=0; counter<current_form.length; counter++){
			if ((current_form[counter].type == "text" || current_form[counter].type == "password") && current_form[counter].mandatory){
				if (its_empty(current_form[counter].value)){total_missing++;}
			}
		}
		if (total_missing>0){alert("Вы не заполнили все необходимые поля"); return false;}
		else{return true;}
	}

	function its_empty(string_value){
		if (string_value == "" || string_value == null){return true;}
		else {return false;}
	}
	
	function valid_email(email_address){
		if (email_address.length<5){return false;}
		at_location = email_address.indexOf("@");
		dot_location = email_address.LastIndexOf(".");
		if (at_location == -1 || dot_location == -1 || at_location>dot_location){return false;}
		if (at_location == 0){return false;}
		if (dot_location - at_location < 2){return false;}
		if (email_address.length - dot_location < 2){return false;}
		return true;
	}
	