function ValidateEmail() {
	var email = document.getElementById('email').value;

	if (IsValidEmail(email)) {
		return true;
	}
	
	if (typeof(window['myShow']) != "undefined")
		window.myShow.pause();
		
	var mb_id = document.getElementById('mb_inline');
	mb_id.innerHTML = '<h2 class="Blue">Please try again!</h2><p>An incomplete or invalid email address was submitted.</p><p>&nbsp;</p><p>Please enter a valid email and try again.</p>';
	Mediabox.open('#mb_inline', '', '500 175');
	
	return false;
}
function LightboxEmail(t) {
	if (typeof(window['myShow']) != "undefined")
		window.myShow.pause();

	var email = document.getElementById('email').value;

	if (!IsValidEmail(email)) {
		var mb_id = document.getElementById('mb_inline');
		mb_id.innerHTML = '<h2 class="Blue">Please try again!</h2><p>An incomplete or invalid email address was submitted.</p><p>&nbsp;</p><p>Please enter a valid email and try again.</p>';
		Mediabox.open('#mb_inline', '', '500 175');
	}
	else
		Mediabox.open('email.php?t=' + t + '&e=' + email, '', '500 175');
}
function LightboxPage(p) {
	if (typeof(window['myShow']) != "undefined")
		window.myShow.pause();

	Mediabox.open(p, '', '700 525');
}
function LightboxMap() {
	if (typeof(window['myShow']) != "undefined")
		window.myShow.pause();

	var mb_id = document.getElementById('mb_inline');
	mb_id.innerHTML = '<iframe width="600" height="550" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=15+Ceylon+Street+Nunawading,+3131&amp;aq=&amp;sll=-37.823887,145.099869&amp;sspn=0.360141,0.528717&amp;ie=UTF8&amp;hq=&amp;hnear=15+Ceylon+St,+Nunawading+Victoria+3131,+Australia&amp;ll=-37.819911,145.165458&amp;spn=0.02373,0.036478&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe>';
	Mediabox.open('#mb_inline', '', '600 550');
}


function IsValidEmail(email) {
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	return filter.test(email);
}
