/**
*
*  Firefox 2 Fix for AJAX
*  // Pelle
*
* Syntax: ff2bug.fix(String)  returnerar en "fixad" sträng. 
*
**/

var ff2bug = {

	// public method for encoding
	fix : function (string) {
		return this._encode(string);
	},

	megafix : function (string) {
		return this._megacode(string);
	},

	// private method for encoding
	_encode : function (string) {

		string = string.replace(/&aring;/gm,"&#229;");
		string = string.replace(/&auml;/gm,"&#228;");
		string = string.replace(/&ouml;/gm,"&#246;");
		string = string.replace(/&Aring;/gm,"&#197;");
		string = string.replace(/&Auml;/gm,"&#196;");
		string = string.replace(/&Ouml;/gm,"&#214;");
		string = string.replace(/&nbsp;/gm,"&#160;");
		string = string.replace(/&amp;/gm,"&#38;");
		string = string.replace(/&quot;/gm,"\"");

		return string;
	},

	// private method for megacoding
	_megacode : function (string) {

		string = string.replace(/<html.*fmt\">/igm,"");
		string = string.replace(/.*<\/head>/igm,"");
		string = string.replace(/<\/html>/igm,"");

		return string;
	}
}