function jmenoskupiny(str_) {
		/*alert(str_);*/
		var hid = document.getElementById("hindenid");
		/*alert(hid);*/
		hid.value=str_;
	}


function validate_form(formular) {
  try {
    // kvuli captcha je zde skip_validation
	  if (skip_validation) {
		  return true;
	  }
	} catch(e) {
	
	var inputs = formular.elements;
    var error = -1; //-1 = OK, jinak index prvniho chybneho inputu
    var tp,val,errorMsg = "";
    for (var i = 0; i < inputs.length; i++) {
		if (inputs[i].nodeName.toLowerCase() == 'textarea') {
			tp = 'text';
		} else if (inputs[i].nodeName.toLowerCase() == 'select') {
			tp = 'select';
		} else {
			tp = inputs[i].type;
		}
		mailRegExp = new RegExp('^[^@]{2,}@[_a-zA-Z0-9\.\-]{2,}\.[a-zA-Z]{2,4}$');
    	switch (tp) {
			case 'checkbox':
				if (inputs[i].className.match('mandatory') && !inputs[i].checked) {
					if (error == -1) {error = i;}
					errorMsg += "Please, fill in "+inputs[i].title+". \n";
				}
			case 'password':
			case 'file':
			case 'text':
				if (inputs[i].nodeName.toLowerCase() == 'textarea') {
				    val = inputs[i].innerHTML;
				} else {
				    val = inputs[i].value;
				}
				if (inputs[i].className.match('mandatory') && (inputs[i].value == '')) {
            		if (error == -1) {error = i;}
					errorMsg += "Please, fill in "+inputs[i].title+". \n";
        		}
        		if (inputs[i].className.match('email') && (inputs[i].value != '') && (!inputs[i].value.match(mailRegExp))) {
					if (error == -1) {error = i;}
            		errorMsg += "Please, fill in correct email."+"\n";
        		}
        		if (inputs[i].className.match('number') && (inputs[i].value != '') && (!inputs[i].value.match("^[0-9]+$"))) {
					if (error == -1) {error = i;}
            		errorMsg += "Please, fill in number."+"\n";
        		}
			case 'select':
			    if (inputs[i].className.match('mandatory') && (inputs[i].selectedIndex == 0)) {
            		if (error == -1) {error = i;}
					errorMsg += "Please, fill in "+inputs[i].title+". \n";
				}
        }
    }
    if (error != -1) {
    	alert(errorMsg);
        inputs[error].focus();
        return false;
    } else {
		return true;
	}

	}
}

