$(function(){
	$('ul.sf-menu').superfish();
	$("a[rel='external']").addClass("external").click(function(){window.open(this.href);return false;});
	$("#book-description a").attr("rel", "noindex nofollow");
	$("#down-link a").attr("rel", "external noindex nofollow");
})

function isEmail(email)
{
	var filter=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	return filter.test(email);
}

function checkSubscribeForm()
{
	var your_email = document.getElementById('your_email');
	if (your_email.value == '') {
		alert('Please input your email address');
		your_email.focus();
		return false;
	}
	if (!isEmail(your_email.value)) {
		alert('Please input the correct email address');
		your_email.focus();
		return false;
	}
	document.getElementById('form_subscribe').submit();
}
