﻿/* String Functions */

String.prototype.contains = function(s) { return this.indexOf(s) >= 0 ? true : false; }
String.prototype.endsWith = function(s) { var reg = new RegExp(s + "$"); return reg.test(this); }
String.prototype.startsWith = function(s) { return (this.match("^" + s) == s) }
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }
String.prototype.replaceAll = function(strTarget, strSubString)
{
	var strText = this;
	var intIndexOfMatch = strText.indexOf(strTarget);
	while (intIndexOfMatch != -1)
	{
		strText = strText.replace(strTarget, strSubString);
		intIndexOfMatch = strText.indexOf(strTarget);
	}
	return (strText);
}



// Create Flash object
function Flash()
{

}

Flash.movie = function (movieName)
{
	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		return window[movieName];
	}
	else
	{
		return document[movieName];
	}
}

Flash.send = function (movie, data)
{
	var result = movie.asFunc(data);
	return true;
}
