function emailHide(email, domain, display) {
 document.write('<a href=' + 'mail' + 'to:' + email + '@' + domain + '>' + display + '</a>');
}

function openHelp(theURL){
	var help=window.open(theURL,'help','width=275,height=125,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,');
	help.focus();
}


function toggle ( targetId ) {
	if (document.getElementById) {
		target = document.getElementById( targetId );
				if (target.style.display == 'none') {
						target.style.display = '';
				} else {
					target.style.display = 'none';
				}
	}
}

function sendToFriend() {
	$('sendP1').style.display = 'none';
	$('sendDiv').style.display = '';
}

function sendFriend() {
	var email = $('emailFormInput');
	if (!isEmail(email.value)) {
		alert('Please enter a valid email address');
		email.focus();
		return false;
	}
	var name = $('nameFormInput');
	if (!trim(name.value)) {
		alert('Please enter your friends name');
		name.focus();
		return false;
	}
	
	new Ajax.Updater('updateDiv', '/sendfriend.htm', {evalScripts:true, parameters:Form.serialize('sendForm')})
	return false;
}

function sendToEditor() {
	$('editorP1').style.display = 'none';
	$('editorDiv').style.display = '';
}

function sendEditor() {
	var message = $('editorMessage');
	if (!trim(message.value)) {
		alert('Please enter your message to the editor');
		message.focus();
		return false;
	}
	
	new Ajax.Updater('updateEditorDiv', '/sendeditor.htm', {evalScripts:true, parameters:Form.serialize('editorForm')})
	return false;
}

