//
// MK Core JS Library
// v0.1
// $Revision: 193 $
// $Date: 2008-01-12 01:14:35 -0800 (Sat, 12 Jan 2008) $
// Copyright 2008 Musaul Karim. All rights reserved
// http://mk.vftw.com
// 


// Standard Prototypes

// Trim function prototype for strings
String.prototype.trim = function () { return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"); };

// Find function prototype for arrays
Array.prototype.find = function(item, startAt)
{
	if (typeof item === 'object')
	{
		return -1;
	}	

	if (startAt > -1 && startAt < this.length)
	{
		for (var i = startAt; i < this.length; ++i)
		{
			var testval = this[i];
			if (this[i] == item)
			{
				return i;
			}
		}

		// not found!
		return -1;
	}
	else
	{
		return -1;
	}
}

