function validation_control()
{
if(!emptyCheck(document.contactbox.name.value))
	{
	alert('Please fill in name field');
	return false;
	}
if(!isEmail(document.contactbox.email.value))
	{
	alert('Please fill in correct e-mail address');
	return false;
	}
if(!emptyCheck(document.contactbox.company.value))
	{
	alert('Please fill in company field');
	return false;
	}
if(!emptyCheck(document.contactbox.country.value))
	{
	alert('Please fill in country field');
	return false;
	}
if(!emptyCheck(document.contactbox.message.value))
	{
	alert('Please fill in message field');
	return false;
	}
}

function validate_training()
{
if (!document.forms[1].elements[2].value) {alert("Please fill in name field"); return false;}
if (!document.forms[1].elements[3].value) {alert("Please fill in company field"); return false;}
if (!isEmail(document.forms[1].elements[4].value))
	{alert('Please fill in correct e-mail address');return false;}
if (!document.forms[1].elements[5].value) {alert("Please fill in language field"); return false;}
document.forms[1].submit();
}

function emptyCheck(element)
	{
	    if(element=="") { return false; }
	    else { return true; }
	}

function isEmail(s) {
       var sign = s.indexOf("@");
       if (sign < 1) {
          return false;
       } else {
          var point = s.substring(sign).indexOf(".");
          if (point < 2) {
             return false;
          } else {
             return true;
          }
       }
    }