<!--

// Validation Starts Here!
function Validate()
{
	var sTextValue;
	var bFailed;
	var sEmailValue;
	var sErrorMessage = '';
	var i, j;

	//MICROSOFT VALIDATION!
	if (navigator.appName != 'Netscape')
	{
		//Make all Cells in Contact_Info table gray
		for (i=1; i<16; i++)
		{
			
			for (j=0; j<document.all.tabCustData.rows(i).cells.length; j++)		
			{
				document.all.tabCustData.rows(i).cells(j).bgColor = '#FFFFFF';
			}
		}
			
		//Checking the first block of required textboxes prior to the States Listbox
		for (i=1; i<4; i++)
		{
			if (i == 2)
			{
				i = i + 1
			}
			
			sTextValue = document.GuestForm.elements[i].value;
			if (sTextValue.length < 1)
			{
				for (j=0; j<document.all.tabCustData.rows(i+3).cells.length; j++)		
				{
					document.all.tabCustData.rows(i+3).cells(j).bgColor = '#FFFF99';
				}
				bFailed = true;
			}
		}
		if (bFailed == true)
		{
			sErrorMessage = 'The form could not be submitted due to the following: ';
			sErrorMessage = sErrorMessage + '\nA required field or fields on the form have not been filled in.';
            		sErrorMessage = sErrorMessage + '\nThe field or fields not filled in are highlighted.'; 
		}
		
		//Checking the e-mail address for validity..
		sEmailValue = document.GuestForm.GuestEmailAddress.value;
		if (sEmailValue.search("@") < 0 || sEmailValue.search(".") < 0)
		{
			if (sErrorMessage.length < 1)
			{
				sErrorMessage = 'The form could not be submitted due to the following: ';
				sErrorMessage = sErrorMessage + '\nThe E-Mail Address entered is invalid.  Please re-enter'
			}
			else
			{
				sErrorMessage = sErrorMessage + '\nThe E-Mail Address entered is invalid.  Please re-enter'
			}
			
			if (navigator.appName != 'Netscape')
			{
				for (j=0; j<document.all.tabCustData.rows(7).cells.length; j++)		
				{
					document.all.tabCustData.rows(7).cells(j).bgColor = '#FFFF99';
				}
			}
		}
	}
	else   //NETSCAPE VALIDATION!!!
	{
		//Checking the first block of required textboxes prior to the E-Mail Address textbox
		sTextValue = document.GuestForm.GuestFirstName.value;
		if (sTextValue.length < 1)
		{
			sErrorMessage = 'The form could not be submitted due to the following: ';
			sErrorMessage = sErrorMessage + '\nThe First Name field has no value entered.  Please re-enter';
		}
			
		sTextValue = document.GuestForm.GuestLastName.value;
		if (sTextValue.length < 1)
		{
			if (sErrorMessage.length < 1)
			{
				sErrorMessage = 'The form could not be submitted due to the following: ';
				sErrorMessage = sErrorMessage + '\nThe Last Name field has no value entered.  Please re-enter';
			}
			else
			{
				sErrorMessage = sErrorMessage + '\nThe Last Name field has no value entered.  Please re-enter';
			}
		}
	}
		
	//--------------------------------------------
	//Check the UserID and Password textboxes
	//--------------------------------------------
	sTextValue = document.GuestForm.NirvanaID.value;
	
	if (sTextValue.length < 1)
	{
		if (sErrorMessage.length < 1)
		{
			sError_Messaage = 'The form could not be submitted due to the following:  '
			sErrorMessage = sErrorMessage + '\nThe Nirvana ID field has no value entered. Please re-enter.';
		}
		else
		{
			sErrorMessage = sErrorMessage + '\nThe Nirvana ID field has no value entered. Please re-enter.';
		}
		
		//Highlight row Microsoft Only!!
		if (navigator.appName != 'Netscape')
		{
			for (j=0; j<document.all.tabCustData.rows(11).cells.length; j++)		
			{
				document.all.tabCustData.rows(11).cells(j).bgColor = '#FFFF99';
			}
		}	
	}

	sTextValue = document.GuestForm.NirvanaPW.value;

	if (sTextValue.length < 1)
	{
		if (sErrorMessage.length < 1)
		{
			sError_Messaage = 'The form could not be submitted due to the following:  '
			sErrorMessage = sErrorMessage + '\nThe Nirvana Password field has no value entered. Please re-enter.';
		}
		else
		{
			sErrorMessage = sErrorMessage + '\nThe Nirvana Password field has no value entered. Please re-enter.';
		}
		
		//Highlight row Microsoft Only!!
		if (navigator.appName != 'Netscape')
		{
			for (j=0; j<document.all.tabCustData.rows(12).cells.length; j++)		
			{
				document.all.tabCustData.rows(12).cells(j).bgColor = '#FFFF99';
			}
		}	
	}

	sTextValue = document.GuestForm.NirvanaPWTwo.value;

	if (sTextValue.length < 1)
	{
		if (sErrorMessage.length < 1)
		{
			sError_Messaage = 'The form could not be submitted due to the following:  '
			sErrorMessage = sErrorMessage + '\nThe Password Re-entry field has no value entered. Please re-enter.';
		}
		else
		{
			sErrorMessage = sErrorMessage + '\nThe Password Re-entry field has no value entered. Please re-enter.';
		}
		
		//Highlight row Microsoft Only!!
		if (navigator.appName != 'Netscape')
		{
			for (j=0; j<document.all.tabCustData.rows(13).cells.length; j++)		
			{
				document.all.tabCustData.rows(13).cells(j).bgColor = '#FFFF99';
			}
		}
	}

	//Compare password values
	if (document.GuestForm.NirvanaPW.value != document.GuestForm.NirvanaPWTwo.value)
	{
		if (sErrorMessage.length < 1)
		{
			sErrorMessage = 'The form could not be submitted due to the following:  '
			sErrorMessage = sErrorMessage + '\nThe Password and Re-entry field do not match. Please re-enter.';
		}
		else
		{
			sErrorMessage = sErrorMessage + '\nThe Password and Re-entry field do not match. Please re-enter.';
		}
		//Highlight second row Microsoft Only!!
		if (navigator.appName != 'Netscape')
		{
			for (j=0; j<document.all.tabCustData.rows(12).cells.length; j++)		
			{
				document.all.tabCustData.rows(12).cells(j).bgColor = '#FFFF99';
			}
	
			for (j=0; j<document.all.tabCustData.rows(13).cells.length; j++)		
			{
				document.all.tabCustData.rows(13).cells(j).bgColor = '#FFFF99';
			}
		}		
	}

	//Submit Form or Not?
	if (sErrorMessage.length > 1)
	{
		//Sorry, redo!
		alert(sErrorMessage); 
		return false;
	}
	else
	{
		//Success!
		return true;
	}	
	
}
//-->