$(document).ready(function(){
    $("input:text, textarea, input:password").each(function(){
        if(this.value == '')
            this.value = this.title;
    });
    $("input:text, textarea, input:password").focus(function(){
        if(this.value == this.title)
            this.value = '';
    });
    $("input:text, textarea, input:password").blur(function(){
        if(this.value == '')
            this.value = this.title;
    });
    $("input:image, input:button, input:submit").click(function(){
      var elements = this.form.elements;
      var length = elements.length;
      for (i = 0; i < length; i++) {
        actualElement = elements[i];
        if(actualElement.type =='text' || actualElement.type =='textarea' || actualElement.type =='password' ){
          if(actualElement.value == actualElement.title && actualElement.title != ''){
            actualElement.value='';
          }
        }
      }
    });
});