	function parseHTMLToBB(txtObj)
	{
		var strValue = txtObj.value;
		strValue = strValue.replace(/<br>/gi,"[br]");
		strValue = strValue.replace(/<b>/gi,"[b]");
		strValue = strValue.replace(/<\/b>/gi,"[/b]");
		strValue = strValue.replace(/<u>/gi,"[u]");
		strValue = strValue.replace(/<\/u>/gi,"[/u]");
		strValue = strValue.replace(/<i>/gi,"[i]");
		strValue = strValue.replace(/<\/i>/gi,"[/i]");
		strValue = strValue.replace(/&nbsp;/gi,"[space]");
		
		strValue = strValue.replace(/<a href=/gi,"[url=");  // this one has to be first
		strValue = strValue.replace(/<a/gi,"[url");
		strValue = strValue.replace(/<\/a>/gi,"[/url]");

		strValue = strValue.replace(/<style>/gi,"[style]");
		strValue = strValue.replace(/<\/style>/gi,"[/style]");

		strValue = strValue.replace(/</gi,"[");

		strValue = strValue.replace(/<\//gi,"[/");
		strValue = strValue.replace(/\/>/gi,"/]");

		strValue = strValue.replace(/ < /gi," [lt] ");
		strValue = strValue.replace(/ > /gi," [gt] ");
		
		strValue = strValue.replace(/>/gi,"]");

		strValue = strValue.replace(/&#/gi,"[amp]#");

		txtObj.value = strValue;

	}

