jQuery.fn.DefaultValue = function(text, cls){
    return this.each(function(){
        //Make sure we're dealing with text-based form fields
        if(this.type != 'text' && this.type != 'password' && this.type != 'textarea')
            return;
		
        //Store field reference
        var fld = $(this);
		
        //Set value initially if none are specified
        if(fld.val()=='') {
            fld.addClass(cls).val(text);
        } else {
            //Other value exists - ignore
            return;
        }
		
        //Remove values on focus
        fld.focus(function() {
            if(fld.val()==text || fld.val()=='') {
                $(this).removeClass(cls).val('');
            }
        });
		
        //Place values back on blur
        $(this).blur(function() {
            if(fld.val()==text || fld.val()=='') {
                $(this).addClass(cls).val(text);
            }
        });
		
        //Capture parent form submission
        //Remove field values that are still default
        fld.parents("form").each(function() {
            //Bind parent form submit
            fld.submit(function() {
                if(fld.val()==text) {
                    fld.val('');
                }
            });
        });
    });
};
