function init(){
    var inp = document.getElementsByTagName('input');
    for(var i = 0; i < inp.length; i++) {
        if(inp[i].type == 'text') {
            inp[i].setAttribute('rel',inp[i].defaultValue)
            inp[i].onfocus = function() {
                if(this.value == this.getAttribute('rel')) {
                    this.value = '';
                } else {
                    return false;
                }
            }
            inp[i].onblur = function() {
                if(this.value == '') {
                    this.value = this.getAttribute('rel');
                } else {
                    return false;
                }
            }
            inp[i].ondblclick = function() {
                this.value = this.getAttribute('rel')
            }
        }
    }
	
	var t_txtarea = document.getElementById('t_txtarea');
	t_txtarea.setAttribute('rel1',t_txtarea.defaultValue)
    t_txtarea.onfocus = function(){
        if (t_txtarea.value == t_txtarea.getAttribute('rel1')) {
            t_txtarea.value = '';
        }
    }	
	t_txtarea.onblur = function(){
        if(t_txtarea.value == '') {
            t_txtarea.value = t_txtarea.getAttribute('rel1');
	        } else {
	            return false;
	        }
	   }
    }
	
if(document.childNodes) {
    window.onload = init
}
