function is_valid_email(field) {
	var good;
	var goodEmail = field.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.aero)|(\.asia)|(\.biz)|(\.cat)|(\.coop)|(\.info)|(\.int)|(\.jobs)|(\.mobi)|(\.museum)|(\.name)|(\.pro)|(\.tel)|(\.travel)|(\..{2,2}))$)\b/gi);
	if (goodEmail){
   		return true;
	}
	return false;
}

function checkEmail(field, msg) {
	if (!is_valid_email(field)) {
		alert(msg);
		return false;
	}
	return true;
}

function checkEmail2(field, fieldId, msg) {
	if (!is_valid_email(field)) {
		alert(msg);
		document.getElementById(fieldId).focus();
		return false;
	}
	return true;
}

function toggleDiv(div_ref, div2_ref)
{
	hza = document.getElementById(div_ref);
	hzb = document.getElementById(div2_ref);
	but = document.getElementById('but_func');
	piv = document.getElementById("login_id");

	if (hza.style.display == 'block')
	{
		hza.style.display = 'none';
		hzb.style.display = 'block';
		but.className = "inv_a_friend";
	}
	else
	{
		hza.style.display = 'block';
		hzb.style.display = 'none';
		if (piv.className == "my_area text_login") but.className = "back_to_my_oztralia";
		else but.className = "back_to_login";
	}
}