// =========================================================================================
// FlashAPI
// 
// Ryan Taylor
// October 16, 2006
// 
// API for communicating back and forth between the browser, JavaScript, and Flash.
// =========================================================================================
// 
// +          +          +          +          +          +          +          +          +
// 
// =========================================================================================

// Reference to the flash object.
var objFlash = document.getElementById('swf_file');

// =====================================================================================
// CHAT FUNCTIONS
// =====================================================================================


// =====================================================================================
// REGULAR EXPRESSION FUNCTIONS
// =====================================================================================

// ValidatePhone
// 
// ###-###-####
// ###.###.####
// 
// Tests a phone number against the formats shown above.
function ValidatePhone(strInput)
{
	// The regular expression to test the input against.
	var objRegExp = /^\d{3}(\-|\.)\d{3}(\-|\.)\d{4}/;
	
	// Return the test results.
	return objRegExp.test(strInput);
}

// ValidateEmail
// 
// X#@X#.XX
// X#@X#.XXX
// 
// Tests an email address against the formats shown above.
function ValidateEmail(strInput)
{
	// The regular expression to test the input against.
	//var objRegExp = /^\w+(@)\w+(\.){1}[a-z]{2,3}$/;
	var objRegExp = /^[\w\.\-]+(@)[\w\.\-]+(\.){1}[a-zA-Z]{2,4}$/;
	
	// Return the test results.
	return objRegExp.test(strInput);
}

// ValidateData
// 
// #-#-####
// #/#/####
// #.#.####
// ##-##-####
// ##/##/####
// ##.##.####
// 
// Teets a date against the formats shown above.
function ValidateData(strInput)
{
	// The regular expression to test the input against.
	var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/;
	
	// Return the test results.
	return objRegExp.test(strInput);
}