/*
 * Extensions
 *
 * Extended properties and methods.
 */

window.isWindow = true;

location.redirect = function(sUrl, iSeconds, bMakeEntryInHistory)
{
	/*
	 * DESCRIPTION: Redirects user after iSeconds.
	 *
	 * USAGE: location.redirect(sUrl[, iSeconds[, bMakeEntryInHistory]]);
	 */
	iSeconds = isNaN(parseInt(iSeconds, 10)) ? 0 : parseInt(iSeconds, 10);
	bMakeEntryInHistory = Boolean(bMakeEntryInHistory);
	var f = bMakeEntryInHistory ? function(){location.href = sUrl;} : function(){location.replace(sUrl);};
	setTimeout(f, (iSeconds * 1000));
}

Array.prototype.isArray = true;

if (!Array.indexOf)
{
	Array.prototype.indexOf = function(v)
	{
		/*
		 * DESCRIPTION: Returns the first index at which a
		 *              given element can be found in the
		 *              array, or -1 if it is not present.
		 *
		 * COMMENT: This method can be removed once UAs support JS 1.6 /AndersR
		 */
		var r = -1;
		for (var i = 0, ilen = this.length; i < ilen; i++)
		{
			if (v === this[i])
			{
				r = i;
				break;
			}
		}
		return r;
	}
}

String.prototype.isString = true;
String.prototype.empty = '';