
/* Utility */
// whitespace characters
function isEmpty(thefield) {
	var re = /^\s{1,}$/g; //match white space i.e. space, tab, form-feed, etc.
	if ((thefield.value.length == 0) || (thefield.value == null) || ((thefield.value.search(re)) > -1)) {
		return true;
	}
	return false;
}
function isStringEmpty(thestring) {
	var re = /^\s{1,}$/g; //match white space i.e. space, tab, form-feed, etc.
	if ((thestring.length == 0) || (thestring == null) || ((thestring.search(re)) > -1)) {
		return true;
	}
	return false;
}

function emptyTree(rootNode){
	//alert('empty tree '+rootNode.text)
	rootNode.collapse()
	while (rootNode.childNodes.length>0) {
    	rootNode.eachChild(function(node){
    		if(node) {
    			node.remove();
    		}
    	});
	}
} 





