
	function get(name_control){
    	if (eval("document.form1." + name_control + ".value") == "")
			return false;
	    else
			return true;
	}
	
	function getCustomerAreaForm(name_control){
    	if (eval("document.CustomerAreaForm." + name_control + ".value") == "")
			return false;
	    else
			return true;
	}

	function checklogin(){
		
		if (getCustomerAreaForm('user') == false){
	   		alert('Sorry, field User is mandatory');
			document.CustomerAreaForm.user.focus();
			return;
		}
		if (getCustomerAreaForm('password') == false){
	   		alert('Sorry, field Password is mandatory');
			document.CustomerAreaForm.password.focus();
			return;
		}
		else
			document.CustomerAreaForm.submit();
	}
	
	function checkemail(str_email){
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (filter.test(str_email))
			testresults=true
		else
			testresults=false
		return (testresults)
	}

	function check(){
		
		if (get('company') == false){
	   		alert('Sorry, field Company is mandatory');
			document.form1.company.focus();
			return;
		}
		if (get('name') == false){
	   		alert('Sorry, field Name is mandatory');
			document.form1.name.focus();
			return;
		}
		if (get('surname') == false){
	   		alert('Sorry, field Surname is mandatory');
			document.form1.surname.focus();
			return;
		}
		if (get('phone') == false){
	   		alert('Sorry, field Phone is mandatory.');
			document.form1.phone.focus();
			return;
		}
		if (get('email') == false){
	   		alert('Sorry, field Email is mandatory.');
			document.form1.email.focus();
			return;
		}
		else
		{	var email=document.form1.email.value;
			if (checkemail(email) == false){
				alert('Please input a valid email address!')
				document.form1.email.focus();
				return;
			}
		}
		
		if (get('problem')== false){
	   		alert('Sorry, field Problem Description is mandatory.');
			document.form1.problem.focus();
			return;
		}
		else{
			document.form1.submit();
		}
		return;
	}

