// function to validate 'send to friend' form fields

function checkShareForm() {
	if (document.getElementById('recipient').value.length < 1) {
		window.alert("Please provide your friend's e-mail address.");
		return false;
	}
	if (document.getElementById('email').value.length < 1) {
		window.alert("Please provide your e-mail address.");
		return false;
	}
	if (document.getElementById('From').value.length < 1) {
		window.alert("Please provide your name.");
		return false;
	}
	else return true;
}

//-- script to send message
function closeShareLayer() {
	if (checkShareForm(document.sendtofriend)) {
		document.sendtofriend.body.value = 'I thought you might want to check this out: ' + location.href;
		document.sendtofriend.redirect.value = location.href + '?emailsent=y';
		document.getElementById('share').className = 'hide';
	}
}


// script to check if message was sent and display thank you
function checkShareMessageSent() {
	if (document.location.href.indexOf('emailsent') != -1) {
		document.getElementById('thanksShare').className = 'showForm';
	}
}
	
