
function check_email(e) {

	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

	for(i=0; i < e.length ;i++)
		if(ok.indexOf(e.charAt(i))<0)
			return (false);

	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two))
		return (-1);		
	}
}

function ProfileCheck() {

	f=document.appform
	
	if (f.fullname.value=="" || f.fullname.value.length<4) {
		alert("Please enter your full name.")
		f.fullname.focus()
		return false
	}

	if (f.email.value=="" || !check_email(f.email.value)) {
		alert("The 'Email Address' field must contain a valid email address.")
		f.email.focus()
		return false
	}
	
	if (f.phone.value=="" || f.address.value.length<6) {
		alert("The 'Contact Phone' field must contain a valid phone number.")
		f.phone.focus()
		return false
	}
	
	if (f.address.value=="" || f.address.value.length<8) {
		alert("The 'Postal Address' field must contain a valid postal address.")
		f.address.focus()
		return false
	}
	
	f.email.disabled=false
	f.submit.disabled=true
	f.reset.disabled=true
}

function abrows(toggle) {
	var control;
	if (document.getElementById && (control = document.getElementById('ab')) && control.style)
		control.style.display = (toggle == 1) ? '' : 'none';
}

function abshow() {
	alert(document.getElementById('ab').style.display);
	document.getElementById('ab').style.display='inline-table';
}