/*
 * ToggleFormText
 *
 * Author:   Grzegorz Frydrychowicz
 * E-mail:   grzegorz.frydrychowicz@gmail.com
 * Date:     16-11-2007

Modified by BALU
Date: 31.03.2009
*/

var toggle = function(){

    $("input:text, textarea").each(function(){
        
            this.value = this.title;
    });
    $("input:text, textarea").focus(function(){
        if(this.value == this.title)
            this.value = '';
    });
    $("input:text, textarea").blur(function(){
        if(this.value == '')
            this.value = this.title;
    });
    $("input:image, input:button, input:submit").click(function(){
        $(this.form.elements).each(function(){
            if(this.type =='text' || this.type =='textarea'){
                if(this.value == this.title && this.title != ''){
                    this.value='';
                }
            }
        });
    });
}