 $(document).ready(function(){
	new Image().src = '/image/btn_send_down.png';
	
	if (document.getElementById('emailit')) {
		var submit_image = document.getElementById('emailit');
		submit_image.onmousedown = function(){this.src = '/image/btn_send_down.png';};
		submit_image.onmouseup = function(){this.src = '/image/btn_send_up.png';};
	}
	if (document.getElementById('emailpage')) {
		var email_form = document.getElementById('emailpage');
		email_form.onsubmit = function(){
			submit_image.disabled = true;
			emailPage(this);
			return false;
		};
	}
 });

function emailPage(form) {
	var name = form.yourname.value;
	var email = form.emailto.value;
	var url = encodeURIComponent(form.currenturl.value);
	sendRequest('/emailto.php?yourname=' + name + '&emailto=' + email + '&currenturl=' + url, emailtoResponse);
}

function emailtoResponse(req) {
	alert(req.responseText);
	var submit_image = document.getElementById('emailit');
	submit_image.disabled = false;
}