



/* * * * * * * * * * * * *
 *   Utility Functions   *
 * * * * * * * * * * * * */

// String.startsWith implementation
function String_startsWith(testStr)
{
	if (this.length < testStr.length)
		return false;
	else if (this.length == testStr.length)
		return ((this == testStr) ? true : false);
	else {
		temp = this.substring(0, testStr.length);
		return ((temp == testStr) ? true : false);
	}
}


// String.endsWith implementation
function String_endsWith(testStr)
{
	if (this.length < testStr.length)
		return false;
	else if (this.length == testStr.length)
		return ((this == testStr) ? true : false);
	else {
		temp = this.substring(this.length - testStr.length);
		return ((temp == testStr) ? true : false);
	}
}


// attach implementation functions to methods
String.prototype.startsWith = String_startsWith;
String.prototype.endsWith = String_endsWith;