function btnPreview(frm)
{	if(frm.Title.value.length == 0)
	{	alert("Title value is required"); return; }
	if(frm.Description.value.length < 5)
	{	alert("Description of event is required"); return; }
	
	var strWebSite
	strWebSite = frm.Website.value.toLowerCase();
	if(strWebSite.indexOf("http",0) > -1)
	{	alert("Only include www. in the URL, not http://"); return; }
	
	if(frm.Venue.value.length < 3)
	{	alert("Venue where the event is being held is required"); return; }
	if(frm.Location.value.length < 2)
	{	alert("Location value is required"); return; }
	if(frm.ContactName1.value.length < 2)
	{	alert("A contact name is required"); return; }
	if(form.ContactPhone1.value.length < 8)
	{	alert("Contact Phone number is required."); return; }
	
	if(frm.ContactEmail1.value.length > 6)
	{	var strEmail
		strEmail = frm.ContactEmail1.value.toLowerCase();
		if(strEmail.indexOf("@",0) == -1)
		{	alert("Invalid Email Address for first contact"); return; }
	}
	
	if(frm.ContactName2.value.length != 0)
	{	if(frm.ContactPhone2.value.length < 8)
		{	alert("Contact Phone number for Contact is required"); return; }
	}
	
	if(frm.ContactEmail2.value.length > 6 )
	{	strEmail = frm.ContactEmail2.value.toLowerCase();
		if(strEmail.indexOf("@",0) == -1)
		{	alert("Invalid Email for second contact"); return; }
	}
	
		
	frm.submit();
}

function btnSendMail(frm)
{
	if(frm.From.value.length < 2)
	{	alert("From value is required"); return; }
	if(frm.Phone.value.length < 8 && frm.Email.value.length < 7)
	{	alert("Please enter either a Phone Number or Email Address"); return; }
	if(frm.Body.value.length < 10)
	{	alert("Please enter a Message"); return; }
	
	frm.submit();
}

function TextLength(num, item)
{	if(num == 0) num = 256
	document.all.charcount.innerText = item.value.length;
	document.all.charstatus.style.color= "#000000";
	if(item.value.length >= num)
	{	document.all.charstatus.style.color='#FF0000';
		alert("Too many characters");
	}
}