function validate_form (obj_form) {
	obj_form.first_name.value = trim ( obj_form.first_name.value );
	obj_form.last_name.value = trim ( obj_form.last_name.value );
/*
	obj_form.address.value = trim ( obj_form.address.value );
	obj_form.address2.value = trim ( obj_form.address2.value );
	obj_form.city.value = trim ( obj_form.city.value );
	obj_form.zip.value = trim ( obj_form.zip.value );
	obj_form.email.value = trim ( obj_form.email.value );
	obj_form.phone.value = trim ( obj_form.phone.value );
	obj_form.password.value = trim ( obj_form.password.value );
	obj_form.password2.value = trim ( obj_form.password2.value );
*/
/*
	if ( obj_form.name_title.selectedIndex==0 ) {
		obj_form.name_title.focus ();
		alert ( "Name Title is a required field." );
		return false;
	}
*/
	if ( obj_form.first_name.value == "" ) {	
		obj_form.first_name.focus ();
		alert ( "First name is a required field." );
		return false;
	}
	if ( obj_form.last_name.value == "" ) {	
		obj_form.last_name.focus ();
		alert ( "Last name is a required field." );
		return false;
	}
/*
	if ( obj_form.address.value == "" ) {	
		obj_form.address.focus ();
		alert ( "Address is a required field." );
		return false;
	}
	if ( obj_form.city.value == "" ) {	
		obj_form.city.focus ();
		alert ( "City is a required field." );
		return false;
	}
	if ( obj_form.zip.value == "" ) {	
		obj_form.zip.focus ();
		alert ( "Zip/Postal code is a required field." );
		return false;
	}
	if ( obj_form.country [ 0 ].selected ) {
		obj_form.country.focus ();
		alert ( "Country is a required field." );
		return false;
	}
	if ( obj_form.country [ 1 ].selected ) {	
		if ( obj_form.state [ 0 ].selected ) {	
			obj_form.state.focus ();
			alert ( "State is a required field." );
			return false;
		}
	} else if ( obj_form.country [ 2 ].selected ) {	
		if ( obj_form.province [ 0 ].selected ) {	
			obj_form.province.focus ();
			alert ( "Province is a required field." );
			return false;
		}
	} else if(obj_form.jsoff) {
		if ( obj_form.state[ 0 ].selected ) {
			obj_form.stateprovince.focus ();
			alert ( "State/Province is a required field." );
			return false;
		}
		if ( obj_form.state[ 54 ].selected ) {
			obj_form.stateprovince.focus ();
			alert ( "State/Province is a required field." );
			return false;
		}
	}
	if ( obj_form.gender[ 0 ].selected ) {
		obj_form.gender.focus ();
		alert ( "Gender is a required field." );
		return false;
	}
	if ( obj_form.age[ 0 ].selected ) {
		obj_form.age.focus ();
		alert ( "Age is a required field." );
		return false;
	}
*/
	if ( obj_form.email.value == "" ) {	
		obj_form.email.focus ();
		alert ( "E-mail is a required field." );
		return false;
	}
	if ( !isEmail(obj_form.email.value)) {	
		obj_form.email.focus ();
		alert ( "You must type in a valid Email address." );
		return false;
	}
/*
	if ( obj_form.phone.value == '' ) {
		obj_form.phone.focus ();
		alert ( "Phone Number is a requred field." );
		return false;
	}
	if ( !isPhoneNumber(obj_form.phone.value) ) {
		obj_form.phone.focus ();
		alert ( "You must enter a valid phone number." );
		return false;
	}
	if(obj_form.mode.value == "add") {
		if ( obj_form.password.value == "" ) {	
			obj_form.password.focus ();
			alert ( "Password is a required field." );
			return false;
		}
	}
	if(obj_form.password.value.length>0) {
		if(obj_form.password.value.length<4) {
			obj_form.password.focus ();
			alert ( "Your password must be at least 4 characters long." );
			return false;
		} else if ( obj_form.password2.value == "" ) {	
			obj_form.password2.focus ();
			alert ( "Please confirm your password." );
			return false;
		}
	}
	if ( obj_form.password.value != obj_form.password2.value ) {	
		obj_form.password.value = "";
		obj_form.password2.value = "";
		obj_form.password.focus ();
		alert ( "Your password confirmation does not match your password.\n\nPlease re-enter your password and password confirmation." );
		return false;
	}
	return true;
*/
}

function checkCountry(obj) {
/*
	var state_name = document.getElementById('state_name');
	var state_options = document.getElementById('state_options');
	var prov_name = document.getElementById('prov_name');
	var prov_options = document.getElementById('prov_options');
	
	
	var state_star = document.getElementById('state_star');
	//prov_options.style.visibility = 'visible';
	if ( obj.options[obj.selectedIndex].value == "USA" ) {	
		//alert('in1');
		prov_options.style.visibility = "hidden";
		prov_name.style.visibility = "hidden";
		prov_options.style.position = "absolute";
		prov_name.style.position = "absolute";
		
		state_star.style.visibility = "visible";
		
		state_name.style.visibility = "visible";
		state_name.style.position = "static";
		state_options.style.visibility = "visible";
		state_options.style.position = "static";
	} else { 
		if ( obj.options[obj.selectedIndex].value == "CAN" ) {	
			
			state_name.style.visibility = "hidden";
			state_options.style.visibility = "hidden";
			state_name.style.position = "absolute";
			state_options.style.position = "absolute";
			
			prov_name.style.visibility = "visible";
			prov_options.style.visibility = "visible";
			prov_name.style.position = "static";
			prov_options.style.position = "static";
			state_star.style.visibility = "visible";
		} else { 
			//alert('in3');
			prov_name.style.visibility = "hidden";
			prov_options.style.visibility = "hidden";
			prov_options.style.position = "absolute";
			prov_name.style.position = "absolute";
			
			state_name.style.visibility = "hidden";
			state_options.style.visibility = "hidden";
			state_options.style.position = "absolute";
			state_name.style.position = "absolute";
			state_star.style.visibility = "hidden";
		}
	}
*/
}

function init() {
/*
	checkCountry(document.consumer.country);
*/
}
