/*
	Additional methods for Strings used in IGN scripts.

	*** IGN_Core.js must be executed prior to executing this script

	Author: OldManLink (Peter Hugosson-Miller)
	Creation date: 2004-07-02
	Version: 1.0
*/

String.prototype.markupPair = function(tag)
{/*
	Return a new copy of myself, with a tag pair pre- and postpended.
	If the tag contains an '=', the closing tag will have only the base tag
	name without the value.
	If tag is an empty String, return myself.
*/
	var tResult = this;
	if(tag != '')
	{
		tResult = '[' + tag + ']' + this;
		tResult += '[/' + ((tag +'=').split('='))[0] + ']';
	}

	return tResult;
}

String.prototype.markupPadded = function(padCount, padCharacter, invisible)
{/*
	Return a new copy of myself, with padding prepended.
	If <invisible> is true, add markup codes to the padding to make it
	invisible.
*/
	var tResult = '';
	for(var i = 0 ; i < padCount - this.length ; i++)
	{
		tResult += padCharacter;
	}

	if(invisible)
	{
		tResult = tResult.markupPair('color=#c1c2c9');
	}
	return tResult + this;
}


