function check_email(email) {
	return email.match(/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i);
}

function href(destination) {
	location.assign(destination);
}

var viewportWidth;
var viewportHeight;

if (typeof window.innerWidth != 'undefined') {
	viewportWidth = window.innerWidth;
	viewportHeight = window.innerHeight;
} else if (typeof document.documentElement != 'undefined'
		&& typeof document.documentElement.clientWidth != 'undefined'
		&& document.documentElement.clientWidth != 0) {
	viewportWidth = document.documentElement.clientWidth;
	viewportHeight = document.documentElement.clientHeight;
} else {
	viewportWidth = document.getElementsByTagName('body')[0].clientWidth;
	viewportHeight = document.getElementsByTagName('body')[0].clientHeight;
}

Cufon.replace('h1');

$(document).ready(function(){

	Cufon.now();
			
	$('#innerrighttop').click(function(){
		href('/pages/paramahansa-yogananda');
	});
	
	$('#innerrightcaption').click(function(){
		href('/pages/paramahansa-yogananda');
	});
	
	$('#top_link_home').click(function(){
		href('/');
		return false;
	});
	
	if (viewportWidth <= 1024) {
		$('#container').width(980); // was: 1090
		$('#content').width(552); // was: 662
		$('#left').css({marginLeft: -767}); // was: -877
		$('#logo').attr('src','/resources/design/logo.png,502,102'); // was: 612,125
		$('#logo').css({paddingTop: 25}); // was: 14
		$('.map').width(450); // was: 540
	}
	
	$('#logo').show();
	$('#container').show();
	
});

$(window).load(function(){

	$('#innerlefttop').cycle({
		fx: 'fade',
		speed: 1600,
		timeout: 4000
	});
	
	$('#innerrighttop').cycle({
		fx: 'fade',
		speed: 2000,
		timeout: 5000,
		delay: 2000
	});
	
});

