﻿//add class "Watermark" to your textbox
//fill in the title attribute with whatever you want to show up as the watermark

    var watermarkClass = "textBoxWaterMark";

    function searchboxBlurHandler(elem) {
        $(elem).each(function() {
	        if($(this).val().length == 0 || $(this).val() == $(this).attr('title'))
	            $(this).addClass(watermarkClass).val($(elem).attr('title'));
	        else $(this).removeClass(watermarkClass);
        });
    }

    function searchboxFocusHandler(elem) {
        $(elem).filter(function() {
	        return $(this).val() == $(this).attr('title');
        }).removeClass(watermarkClass).val("");
    }
    
    

    $(document).ready(function() {
        // Call the blur handler to set the default style
    	
        $(".Watermark").each(function (i) {
            searchboxBlurHandler(this);
        	
            $(this).blur(function() {
	            searchboxBlurHandler(this);
            });
        	
            $(this).focus(function() {
	            searchboxFocusHandler(this);
            });
    	
        });               
        
    });   