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