
function Submit_tellafriend() {
	var output = '';
	if(document.form1.send_to1.value.length == 0){
		output += 'Please enter your friend\'s name 1\n';
	}
	if(document.form1.send_from.value.length == 0){
		output += 'Please specify your name\n';
	}
	var regexp = /[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}/;
	if(!document.form1.send_from_email.value.match(regexp)) {
		output += 'Your email address is not valid\n';
	} 
	var pair = false;
	for(var i=1;i<6;i++) {
		eval('if (document.form1.send_to' + i + '.value.length != 0 || document.form1.send_to_email' + i + '.value.length !=0) {if (document.form1.send_to' + i + '.value.length == 0) { output += "Please enter your friend\'s name " + i + "\\n";} if (!document.form1.send_to_email' + i + '.value.match(regexp)) { output += "Please enter a valid email address " + i + "\\n";}}');
	}
	
	if (output) {
		alert(output);
	}
	else {
		document.form1.update.value = "submmit"
		document.form1.submit();
	}
}

function Submit_tellafriend_validate() {
	var output = '';
	if(document.form1.send_to1.value.length == 0){
		output += 'Please enter your friend\'s name 1\n';
	}
	if(document.form1.send_from.value.length == 0){
		output += 'Please specify your name\n';
	}
	var regexp = /[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}/;
	if(!document.form1.send_from_email.value.match(regexp)) {
		output += 'Your email address is not valid\n';
	} 
	var pair = false;
	for(var i=1;i<6;i++) {
		eval('if (document.form1.send_to' + i + '.value.length != 0 || document.form1.send_to_email' + i + '.value.length !=0) {if (document.form1.send_to' + i + '.value.length == 0) { output += "Please enter your friend\'s name " + i + "\\n";} if (!document.form1.send_to_email' + i + '.value.match(regexp)) { output += "Please enter a valid email address " + i + "\\n";}}');
	}
	document.form1.update.value = "submmit"
	
	if(output){
		alert(output);
		return false;
	}
 	return true;
} 

function Submit_Send() {
	document.send_out.update.value = "send_out"
	document.send_out.submit();
} 

