function init(){
  var inp = document.getElementsByTagName('input');
  var txt = document.getElementsByTagName('textarea');
  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')
      }
    }
  }
  for(var i = 0; i < txt.length; i++) {
    if(txt[i].type == 'textarea') {
      txt[i].setAttribute('rel',txt[i].defaultValue)
      txt[i].onfocus = function() {
        if(this.value == this.getAttribute('rel')) {
          this.value = '';
        } else {
          return false;
        }
      }
      txt[i].onblur = function() {
        if(this.value == '') {
          this.value = this.getAttribute('rel');
        } else {
          return false;
        }
      }
      txt[i].ondblclick = function() {
        this.value = this.getAttribute('rel')
      }
    }
  }
}
if(document.childNodes) {
  window.onload = init
}
/* IE fix for html5 */
document.createElement("article");
document.createElement("footer");
document.createElement("header");
document.createElement("hgroup");
document.createElement("nav");

