// JavaScript Document
function validateform(){
	try{
		var errmsg;
		var msg = '';
		var IsFocus = false;
		var error = getRawObject('error');
		var progress = getRawObject('progress');
		var reply = getRawObject('frmcreate');
		var title = getRawObject('selTitle').value;
		var fname = getRawObject('txtFName');
		var lname = getRawObject('txtLName');
		var jobtitle = getRawObject('txtJobTitle');
		var company = getRawObject('txtCompany');
		var email = getRawObject('txtEmail');
		var phone = getRawObject('txtPhone');
		var product = getRawObject('txtProduct');
		var reqlist = getRawObject('txtListOfReq');
		var otherinfo = getRawObject('txtOtherInfo');
		var frm = arguments[0];
		if(fname.value.length == 0){
			msg += "Please enter your firstname<br />";
			IsFocus = true;
			fname.focus();
		}
		if(fname.value != '' && !containsblanks(fname)){
			msg += "Please firstname must not contain blank<br />";
			if(!IsFocus){
				IsFocus = true;
				fname.focus();
				fname.select();
			}
		}
		if(lname.value.length == 0){
			msg += "Please enter your lastname<br />";
			if(!IsFocus){
				IsFocus = true;
				lname.focus();
			}
		}
		if(lname.value != '' && !containsblanks(lname)){
			msg += "Please lastname must not contain blank<br />";
			if(!IsFocus){
				IsFocus = true;
				lname.focus();
				lname.select();
			}
		}
		if(jobtitle.value.length == 0){
			msg += "Please enter your job title<br />";
			if(!IsFocus){
				IsFocus = true;
				jobtitle.focus();
			}
		}
		if(company.value.length == 0){
			msg += "Please enter your company<br />";
			if(!IsFocus){
				IsFocus = true;
				company.focus();
			}
		}
		if(email.value.length == 0){
			msg += "Please enter your email address<br />";
			if(!IsFocus){
				IsFocus = true;
				email.focus();
			}
		}
		if(email.value != '' && !validate(constValues.regEmail, email.value)){
			msg += "Please enter a valid email address<br />";
			if(!IsFocus){
				IsFocus = true;
				email.focus();
				email.select();
			}
		}
		if(phone.value.length == 0){
			msg += "Please phone field must not be empty<br />";
			if(!IsFocus){
				IsFocus = true;
				phone.focus();
			}
		}
		if(product.value == ''){
			msg += "Please the product/service field must not be empty<br />";
			if(!IsFocus){
				IsFocus = true;
				product.focus();
			}
		}
		if(reqlist.value.length == 0){
			msg += "Please list your stand requirement<br />";
			if(!IsFocus){
				IsFocus = true;
				reqlist.focus();
			}
		}
		if(otherinfo.value.length == 0){
			msg += "Please enter the additional information<br />";
			if(!IsFocus){
				IsFocus = true;
				otherinfo.focus();
			}
		}
		if(msg.length > 0){
			errmsg = constValues.errmsg + msg + "</div>";
			setObjState(error, true, true);
			setObjError(error, errmsg);
			return false;
		}
		setObjState(error, false, false);
		frm.submit();
		return true;
		
	}
	catch(e){
		alert(e.name + ' ' + e.message);
		return false;
	}
}
