//	This file contains various functions used to verify field contents
//  and actions such as deleting a record

// ---- [Public] This function will validate the format of an e-mail address
function ValidateEmail(address)	
	{	
		var invalid_chars = " /:,;"						// invalid character list
		var i											// counter
		var atPos										// character position
		var	badChar										// one of the invalid characters
		var PeriodPos									// character position
		
		if (address == "")
			{											// cannot be empty
				return false
			}

		for (i=0; i < invalid_chars.length; i++)		// loop through list of bad characters
			{
				badChar = invalid_chars.charAt(i);	
				if (address.indexOf(badChar, 0) > -1)	
					{
						return false
					}
			}

		atPos = address.indexOf("@",1)					// must be at least one "@"
		
		if (atPos == -1)
			{
				return false							// not found - error
			}
			
		if (address.indexOf("@", atPos + 1) != -1)			// email may only contain one "@"
			{
				return false
			}
		
		PeriodPos = address.indexOf(".", atPos)			// must contain at least one "." after the "@"
		if (PeriodPos == -1) 
			{
				return false
			}
			
		if (PeriodPos+3 > address.length)				// 2 chars past "." are required
			{
				return false
			}
		
		return true
	}	
//
//
//
//
// ---- [Public] This function verify the user really wants to delete the specified item
//				 If the answer is YES then control is passed to URL
function pbVerifyDelete(url, item)	
	{
		if (confirm('Do you really wish to delete this ' + item + '?'))
		 	{
			document.location=url;
			}
		return
	}
//
//
//
//
// ---- [Public] This function strips leading and trailing blanks, <CR>, and <LF>
//
	function Trim(s) {
		// Remove leading spaces and carriage returns
	  
		while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))	{
			s = s.substring(1,s.length);
		}

		// Remove trailing spaces and carriage returns

		while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))	{
			s = s.substring(0,s.length-1);
		}

		return s;
	}
//
//
//
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

function rld() {
document.location.reload()
}
//-->
//
// END