// hack for innerHTML IE6 bug with list elements
// bug reporting & feedback: johno@host.sk
// THIS VERSION WORKS ONLY WITH NON-NESTED LISTS !!!

function fixInnerHTML(code) {

	// fix it only in IE
	if ((document.all) && (navigator.appVersion.indexOf("MSIE") != -1)) {

			re = new RegExp("<LI");
			while (re.test(code)) {
				code = code.replace(re, "</LI><li");
			}

			re = new RegExp("<UL>\r\n</LI>");
			while (re.test(code)) {
				code = code.replace(re, "<UL>");
			}

			re = new RegExp("<OL>\r\n</LI>");
			while (re.test(code)) {
				code = code.replace(re, "<OL>");
			}

			re = new RegExp("<li");
			while (re.test(code)) {
				code = code.replace(re, "<LI");
			}

                        
	}
	return code;
}

/*

Problem description:
--------------------

Sample XHTML code

<ul id="myID">
	<li>one</li>
	<li>two</li>
	<li>three</li>
</ul>

Now we call code = document.getElementById("myID").innerHTML
and the 'damn' IE will return

<ul id="myID">
	<li>one
	<li>two
	<li>three</li>
</ul>

This is not so bad (IE itself can handle this code correctly) while we don't 
want to parse returned value by another script that requires valid XHTML code.
That's just the right place for my fixInnerHTML() function.

text = fixInnerHTML(text); // this should make it

*/


