﻿// JScript File

function getForm()
{
	return document.aspnetForm; 
}
function ValidateFormContact()
{

	var strError = '';
	
	var f= getForm();
	
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$fname.value) == "")
	{
		strError += '*First Name\n'	;	
	}	
	
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$lname.value) == "")
	{
		strError += '*Last Name\n'	;	
	}
	if(!ValidateEmailFormat(f.ctl00$ctl00$cpMain$cpContent$tbEmail.value))
	{
		strError += '*Email Address\n'	;	
	}
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$ddlSubject.value) == "")
	{
		strError += '*Subject\n'	;	
	}
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$tbText.value) == "")
	{
		strError += '*Text\n'	;	
	}
	if (strError!="")
	{
		alert("To proceed please enter or correct following required information:\n\n" + strError);
		return false;
	}
	else
	{
	    return true
	}

}
function ValidateFormBook()
{
	var strError = '';
	
	var f= getForm();
	
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$bookFName.value) == "")
	{
		strError += '*First Name\n'	;	
	}	
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$bookLName.value) == "")
	{
		strError += '*Last Name\n'	;	
	}
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$bookPhone.value) == "")
	{
		strError += '*Phone\n'	;	
	}
	if(!ValidateEmailFormat(f.ctl00$ctl00$cpMain$cpContent$bookEmail.value))
	{
		strError += '*Email Address\n'	;	
	}
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$bookDate.value) == "")
	{
		strError += '*Event Date\n'	;	
	}
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$ddlEventType.value) == "")
	{
		strError += '*Event Type\n'	;	
	}
	if(Trim(f.ctl00$ctl00$cpMain$cpContent$desc.value) == "")
	{
		strError += '*Description\n'	;	
	}
	if (strError!="")
	{
		alert("To proceed please enter or correct following required information:\n\n" + strError);
		return false;
	}
	else
	{
	    return true
	}

}

