function test(){

	for (var i=0; i < document.formCatalog.paytype.length; i++){
	   if (document.formCatalog.paytype[i].checked)
	      {
	      var rad_val = document.formCatalog.paytype[i].value;
	      }
	}

	if(rad_val=='undefined'){
		alert('Please choose the payment method');
		return;
	}

}


/*
	controllo i campi del form per verificare la correttezza delle info
	ed il tipo di dato inserito nei campi
*/

function checkForm(lang){

	var companyname;
	//var person;
	//var telephone;
	var email;
	var address;
	var city;
	var zipcode;
	var provincestate;
	var country;
	//var additionalrequest;
	var rad_val='';
	
	companyname=document.getElementById('companyname').value;
	//person=document.getElementById('person').value;
	//telephone=document.getElementById('telephone').value;
	email=document.getElementById('email').value;
	address=document.getElementById('address').value;
	city=document.getElementById('city').value;
	zipcode=document.getElementById('zipcode').value;
	provincestate=document.getElementById('provincestate').value;
	country=document.getElementById('country').value;
	//additionalrequest=document.getElementById('additionalrequest').value;
	
	if(trim(companyname)==''){
		alert('Please check your Company Name field');	
		document.getElementById('companyname').focus();
		return;
	}
	
	if(checkEmail(email)==1){
		alert('Please check the Email field');	
		document.getElementById('email').focus();
		return;
	}

	if(trim(address)==1){
		alert('Please check the Address field');	
		document.getElementById('address').focus();
		return;
	}

	if(trim(city)==1){
		alert('Please check the City field');	
		document.getElementById('city').focus();
		return;
	}
	
	if(trim(zipcode)==1){
		alert('Please check the Zip Code field');	
		document.getElementById('zipcode').focus();
		return;
	}

	if(trim(provincestate)==1){
		alert('Please check the Province / State field');	
		document.getElementById('provincestate').focus();
		return;
	}

	if(country==''){
		alert('Please check the Country field');	
		document.getElementById('country').focus();
		return;
	}

	
	for (var i=0; i < document.formCatalog.paytype.length; i++){
	   if (document.formCatalog.paytype[i].checked)
	      {
	      var rad_val = document.formCatalog.paytype[i].value;
	      }
	}

	if((rad_val=='') || (rad_val=='undefined') ){
		alert('Please choose the payment method');
		return;
	}
	
	document.formCatalog.submit();

}
