function formCheck(formobj, fieldRequired, fieldDescription, lang){
	var alertMsg = "Please fill the following fields:\n";
	if (lang == "ru") alertMsg	= "Ïîæàëóéñòà çàïîëíèòå ñëåäóþùèå ïîëÿ:\n";
	else if (lang == "lt") alertMsg	= "Praðome uþpildyti sekanèius laukeliusÿ:\n";

	var l_Msg = alertMsg.length;

	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
      	case "select-one":
	        if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
						alertMsg += " - " + fieldDescription[i] + "\n";
	        }
	        break;
	      case "select-multiple":
	        if (obj.selectedIndex == -1){
	        	alertMsg += " - " + fieldDescription[i] + "\n";
	        }
	        break;
	      case "text":
	      case "textarea":
	        if (obj.value == null || obj.value == "" || spaces(obj.value)){
						alertMsg += " - " + fieldDescription[i] + "\n";
	        }
	        break;
				default:
			}
			/////////////////////////////////
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}
	if (alertMsg.length == l_Msg) {
		return false;
	} else{
		return alertMsg;
//		return false;
	}
}

function spaces(str) {
//	alert(".zZ");
	for (var i = 0; i < str.length; i++){
		if (str.charAt(i) != ' ' && str.charAt(i) != ' ') {
			return false;
		}
	}
//		alert(".zZ");
	return true;
}
