﻿/* 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.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);
}

function CreateFlash(url, width, height)
{
	var flash = '';
	flash += '<object type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '">';
	flash += '	<param name="movie" value="' + url + '" />';
	flash += '	<param name="allowScriptAccess" value="always" />';
	flash += '	<param name="quality" value="autohigh" />';
	flash += '	<param name="wmode" value="window" />';
	flash += '	<param name="bgcolor" value="#ffffff" />';
	flash += '	<param name="scale" value="noscale" />';
	flash += '	<param name="menu" value="false" />';
	flash += '	<img src="/assets/images/blank.gif" width="' + width + '" height="' + height + '" alt="" />';
	flash += '</object>';
	return flash;
}

function WriteFlash(url, width, height)
{
	document.write(CreateFlash(url, width, height));
}