function writeDom ( string ) {
	var path = document;
	while ( path.lastChild ) {
		if ( path.lastChild.nodeType === 1 ) {
			path = path.lastChild;
		} else break;
	}
	path.parentNode.insertBefore( stringToDOM( string ), path );
}
document.writeDom=writeDom;

function replaceLastNode ( string ) {
	var path = document;
	while ( path.lastChild ) {
		if ( path.lastChild.nodeType === 1 ) {
			path = path.lastChild;
		} else break;
	}
	while ( path.previousSibling ) {
		path = path.previousSibling;
		if ( path.nodeType === 1 ) break;
	}
	path.parentNode.replaceChild( stringToDOM( string ), path );
}
document.replaceLastNode=replaceLastNode;
