// JavaScript Document
function ajaxvalidate(form_id) {
	var f_object = form_id.elements;
	for (var i=0; i < f_object.length; i++ ) {
		if (f_object[i].name != '') {
			// verify state
			if(f_object[i].value == "none") {
				alert("Choose a State");
				return false;
			}
			// end state
			// verify email
			if(f_object[i].name == "email" || f_object[i].name == "colleague1email") {
 			validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  			strEmail = f_object[i].value;
   			// search email text for regular exp matches
    		if (strEmail.search(validRegExp) == -1)  {
      			alert('A valid e-mail address is required.\nPlease amend and retry');
				 f_object[i].style.border = '2px solid #ff0000';
				 f_object[i].style.background = '#ffddfa';
				 f_object[i].focus();
      			return false;
    		} 
			}
			// end email
			if ( f_object[i].alt == 1) { 
				ret = validate_value(f_object[i]);
				if(ret == false) return false;
			}
		}
	}
	document.form.submit()
}

//request.send(param);

function validate_value(y){
	if(y.value==''){
		alert('Please fill the following field!');
		y.style.border = '2px solid #ff0000';
		y.style.background = '#ffddfa';
		y.focus();
		return false;
	}
return true;
}
