﻿$(document).ready(function() {
    $(".wmark").each(function(i) {
        var beginStyle = ($(this).attr("style")) ? $(this).attr("style") : "";
        if ($(this).val() == "")
            $(this).attr("style", "color: #bbb;" + beginStyle).val($(this).attr("title"));

        $(this).bind("focus", function(e) {
            if ($(this).val() == $(this).attr("title")) {
                $(this).val("");
                $(this).attr("style", beginStyle);
            }
        });
        $(this).bind("blur", function(e) {
            if ($(this).val() == "") {
                $(this).attr("style", "color: #bbb;" + beginStyle).val($(this).attr("title"));
            }
        });
    });
});