function toggleLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

	function formSubmit(frm)
		{
			valid = checkEmail(frm.txtSender.value);
			if (valid==1)
				{
					valid = checkEmail(frm.txtReceiver.value);
				}
			if (valid==1)
				{
					msg = frm.txtMessage.value;
					
					if (msg.length > 200){
							message = "Your message is " + msg.length + " characters long. It cannot exceed 200 characters";
							valid = 0;
					}
					
					if (msg.indexOf("<")==1 || msg.indexOf(">")==1) {
						message = "Your message contains HTML tags. Please revise your message.";									   
						valid = 0;
					}
				}
			else
				{
					message = "You have entered an invalid email address. Separate multiple recipients with a comma.";
				}
			if (valid==1)
				{
					// SUBMIT
					frm.hidPagetitle.value = document.title;
					frm.submit();
				}
			else
				{
					alert(message);
				}
		}

function checkEmail(addr)
	{
		good = 1;
		if (addr.indexOf("@")==-1 || addr.indexOf(".")==-1)
			{
				good = 0;
			}
		if (addr.length < 8)
			{
				good = 0;
			}
		if (addr.indexOf(";")>-1)
			{
				good = 0;
			}
		if (addr.indexOf("<")==1 || addr.indexOf(">")==1)
			{
				good = 0;
			}
		
		return good;
	}