function regValid() {

    var Temp     = document.regform.email 
    var AtSym    = Temp.value.indexOf('@')
    var Period   = Temp.value.lastIndexOf('.')
    var Space    = Temp.value.indexOf(' ')
    var Length   = Temp.value.length - 1   


// first name

 				if (document.regform.f_name.value == "") 
			{
				alert("Please enter your first name here.");
				document.regform.f_name.focus();
				return false;
			}
			
// lastname
			
			 	if (document.regform.l_name.value == "") 
			{
				alert("Please enter your last name here.");
				document.regform.l_name.focus();
				return false;
			}
				
// email	
			
             if ((AtSym < 1) || (Period <= AtSym+1) ||  (Period == Length ) || (Space  != -1)) 
 
    {  
	alert("You have entered an improperly formatted email address. \n It should be in the format 'you@yourbiz.com'.");
	Temp.focus();
	return false;
	}

	
		
//affilation
	
 		if (document.regform.affiliation.value == "") 
			{
				alert("Please enter your professional affilation here.");
				document.regform.affiliation.focus();
				return false;
			}	
			
//city
if (document.regform.city.value == "") 
			{
				alert("Please enter your city here.");
				document.regform.city.focus();
				return false;
			}	
					
			
//country

yrCountry = document.regform.country_id.selectedIndex
	
 		if (document.regform.country_id.options[yrCountry].value == "" )
			{
				alert("Please select your country from the list.");
					document.regform.country_id.focus();
				return false;
			}	
			
			
		

//how did you hear

yrHear = document.regform.referral_type_id.selectedIndex
	
 		if (document.regform.referral_type_id.options[yrHear].value == "" )
			{
				alert("Please tell us how you heard about us.");
				document.regform.referral_type_id.focus();
				return false;
			}	
				
	}	
