function isDataValid(formname){	if(!formname.optAgree[0].checked){		alert('You must agree with the terms and condition of use.')		return false;	}		if(isEmpty(formname.PersonLastName.value)){		alert('Please enter your Last name.')		return false;	}	if(isEmpty(formname.PersonFirstName.value)){		alert('Please enter your First name.')		return false;	}		if(isEmpty(formname.Organisation.value)){		alert('Please enter company name.')		return false;	}		if(isEmpty(formname.PersonJobTitle.value)){		alert('Please enter your job title.')		return false;	}		if(isEmpty(formname.OrgEmail.value)){		alert('Please enter your email address.')		return false;	}else{		if(!IsEmail(formname.OrgEmail.value)){			alert('Invalid email address')			return false;		}	}		if(isEmpty(formname.PersonPassword.value)){		alert('Please enter preferred password.')		return false;	}else{		if(formname.PersonPassword.value != formname.PersonConfirmPass.value){			alert('The password doesn\'t match.')			return false;		}	}		if(formname.OrgCountry.selectedIndex ==0){		alert('Please select country.')		return false;	}	/*	if(isEmpty(formname.Reason.value)){		alert('Please state your reason of using the gallery.')		return false;	}*/	if(isEmpty(formname.Eventname.value)){		alert('Please enter the event name.')		return false;	}/*		if(isEmpty(formname.contactPerson.value)){		alert('Please key in the contact person.')		return false;	}*/	if(isEmpty(formname.validationcode.value)){		alert('Please enter validation code.')		return false;	}	return true;}function submitForm(formname){	if(isDataValid(formname)){		var paramsqry =buildQuery(formname);			//alert(paramsqry)		makeHTTPReq("register_insert.php",paramsqry,"","divresult");	}}function updateProfile(formname){	if(confirm('Are you sure you want to save changes?')){		var paramsqry =buildQuery(formname);			paramsqry += '&action=update'		makeHTTPReq("update_rec.php",paramsqry,"","divresult");		document.getElementById('divprogress').innerHTML ='';		myoption();	}}function emailSendNow(valu,opt){			paramsqry = '&WebReg='+valu+'&action=email&opt=' + opt;		makeHTTPReq("update_rec.php",paramsqry,"","");		document.getElementById('divprogress').innerHTML ='';}function getvalidkey(){		makeHTTPReq("../validator/image.php","","divvalid","divvalid");}function myoption(){	var opt = document.getElementById('Approved').value;		if(opt =='1'){		document.getElementById('notifybutton').disabled = false;		document.getElementById('notifybutton2').disabled = true;	}else if(opt =='2'){		document.getElementById('notifybutton').disabled = true;		document.getElementById('notifybutton2').disabled = false;	}}
