function alertMessage() {
	alert (
			'The fields marked with\n'+
			'a * are required.\n' +
			'Please fill out these fields.' 
		);
	
}

function validateForm(form) {

	switch(form.id) {
		
	///////// STEP 0 ///////////////////////////
	/////////////////////////////////////////////

		case 'isClient':
			if (
			isClient.user_email.value == "" ||
			isClient.client_id.value == "" ){		
				alertMessage();
				return(false);
			}
		return(true);
		
	///////// STEP 1 ///////////////////////////
	/////////////////////////////////////////////

		case 'step1':
			if (
			step1.company_name.value == "" ||
			step1.company_address.value == "" ||
			step1.company_zipcode.value == "" ||
			step1.company_vat.value == "" ||		
			step1.company_city.value == "" ||
			step1.country_id.value == "" ){		
				alertMessage();
				return(false);
			}
		return(true);

	///////// STEP 2 ///////////////////////////
	/////////////////////////////////////////////

		case 'step2':
			if (
			step2.user_firstname.value == "" ||
			step2.user_lastname.value == "" ||
			step2.user_email.value == ""
			){		
				alertMessage();
				return(false);
			}
			// check radio button gender
			else if (step2.gender[0].checked == false && 
			step2.gender[1].checked == false){
				alertMessage();
				return(false);
			}
			
		return(true);
		
	///////// STEP 3 ///////////////////////////
	/////////////////////////////////////////////

		case 'step3':
			if ( step3.conditions.checked == false ){
				alert('Please read and accept \n'+
					  'the general terms \n'+
					  'and conditions');
				return(false);
			}
			else {
				document.getElementById('checkoutButton').style.display='none';
				document.getElementById('formUpdate').style.display='none';
				document.getElementById('formRowSubmit').innerHTML='<input style="margin-left: -150px;" type="button" value="One moment please. Sending..."/>';
				return(true);
			}
		
	///////// STEP 4 ///////////////////////////
	/////////////////////////////////////////////

		case 'step4':
			if (
			step4.user_firstname.value == "" ||
			step4.user_lastname.value == "" ||
			step4.user_email.value == "" ||
			step4.company_name.value == "" ||
			step4.company_address.value == "" ||
			step4.company_zipcode.value == "" ||
			step4.company_vat.value == "" ||		
			step4.company_city.value == "" ||
			step4.country_id.value == "" ){		
				alertMessage();
				return(false);
			}
			// check radio button gender
			else if (step4.gender[0].checked == false && 
			step4.gender[1].checked == false){
				alertMessage();
				return(false);
			}
			
		return(true);		


			//end of switch
	}	
}