﻿//Cleans all text siblings to an element (needed in Firefox\Opera when using lastChild, firstChild etc).
function CleanElement(element) {
    if (element == null) return 0;
    var node = element.firstChild;
    while (node != null) {
        var tmp = node.nextSibling;
        if (node.nodeName == '#text') {
            element.removeChild(node);
        }
        node = tmp;
    }
}  
