/*
 * $Id: html.js 45 2009-09-27 07:19:26Z wru $
 */

function CHtml ()
{
}

CHtml.SetInnerHTML = function (theelement, thenewvalue)
{
	if (typeof (theelement.innerHTML) != 'undefined')
		theelement.innerHTML = thenewvalue;
	else {
		var range = document.createRange ();
		range.selectNodeContents (theelement);
		range.deleteContents ();
		theelement.appendChild (range.createContextualFragment (thenewvalue));
	}
}

CHtml.SetOuterHTML = function (theelement, thenewvalue)
{
	if (typeof (theelement.outerHTML) != 'undefined')
		theelement.outerHTML = thenewvalue;
	else {
		var range = document.createRange ();
		range.setStartBefore (theelement);
		theelement.parentNode.replaceChild (range.createContextualFragment (thenewvalue), theelement);
	}
}
