window.onload=function(){	 
	 
    if (document.getElementById('password')){
    	clearOnLoad();
    }

    /**
     * void clearEmptyTags
     *
     * Removes empty tags from WYSIWYG content.
     */
    function clearEmptyTags(tagName) {
        var tags, i, tag, children, parent;
        tags = document.getElementsByTagName(tagName);
        for (i = 0; i < tags.length; i++) {
            tag = tags[i];
            parent = tag.parentNode;
            children = tag.childNodes;
            
            if (children.length > 1) {
                // Has more than one child.
                continue;
            }

            if (children.length == 0 || (children.length == 1
                && children[0].nodeType == 3
                && children[0].nodeValue == "")) {
                parent.removeChild(tag);
            }
        }
    }

    clearEmptyTags('p');
    clearEmptyTags('div');
}

function resetField(f) {
	if (f.value == '') {
		f.className = 'resetField_'+f.id ;
	}
}	
		
function clearOnLoad(){
	var fld = document.getElementById('password');
	if (fld.value != '') {
		fld.className = 'currentField' ;
	}
}