var btnSend = new Image();
var btnSendHover = new Image();
btnSend.src = '../imagesNew/btnSendOff.gif';
btnSendHover.src = '../imagesNew/btnSendOn.gif';
function validateForm() {
	
	var objForm = document.frmSrcGuide;
	var error = 1;
	if (objForm.contName.value=='') {
		inlineMsg('contName','Please enter',1,'contName',1);
	}else if (objForm.company.value=='') {
		inlineMsg('company','Please enter',1,'company',1);
	}else if (objForm.contEmail.value=='') {
		inlineMsg('contEmail','Please enter',1,'contEmail',1);
	}else if (checkEmail(objForm.contEmail.value)==false) {
		inlineMsg('contEmail','Please enter a valid email',1,'contEmail',1);
	// }
	// else if(objForm.emesupport.checked==false && objForm.matsupport.checked==false && objForm.workParents.checked==false && objForm.workCarer.checked==false && objForm.relocation.checked==false && objForm.coaching.checked==false && objForm.other_int.checked==false){
		// inlineMsg('emesupportError','Please select',1,'emesupportError',1);
	}else if (objForm.other_int.checked==true) {
		if (objForm.interested_other.value=='') {
			inlineMsg('interested_other','Please enter',1,'interested_other',1);
		}else{
			error = 0;	
		}
	}else if (objForm.about_us.value=='-----------------------------------' || objForm.about_us.value=='Please select') {
		inlineMsg('about_us','Please select',1,'about_us',1);
	}else if (objForm.about_us.value=='Other') {
		if (objForm.about_us_other.value=='') {
			inlineMsg('about_us_other','Please enter',1,'about_us_other',1);
		}else{
			error = 0;	
		}
	}else{
		error = 0;
	}
	
	if (error==1) {
		return false;
	}else{
		
		error = 0;
		
		if (objForm.about_us.value=='-----------------------------------' || objForm.about_us.value=='Please select') {
			inlineMsg('about_us','Please select',1,'about_us',1);
			error = 1;
		}else if (objForm.about_us.value=='Other') {
			if (objForm.about_us_other.value=='') {
				inlineMsg('about_us_other','Please enter',1,'about_us_other',1);
				error = 1;
			}else{
				error = 0;	
			}
		}
		
		// if (error==0) {
			// if (objForm.randcode.value=='') {
				// inlineMsg('randcode','Security Number cannot be left blank',1,'randcode',1);
				// error = 1;
			// }else{
				// error = 0;
			// }
		// }
		
		
		if (error==0) {
			document.frmSrcGuide.submit();
		}
	}

}
function checkEmail(fieldValue){
	var chkAt = fieldValue.indexOf("@");
	var chkDot= fieldValue.indexOf(".");
	var chkHack= fieldValue.indexOf("@.");
	var chkHackA= fieldValue.indexOf(".@");

	if((chkAt >= 0) && (chkDot >= 0) && (chkHack == -1) && (chkHackA == -1) ) {
		return true;
	}
	return false;
}
