// Placeholder

var phDefaultText = "City";
var phDefaultText1 = "Postal Code";

function initSearch() {
    var ph = $("input#city-ph");
    var ph1 = $("input#postal-ph");
    ph.focus(function() {
        var o = $(this);
        if(o.val() == phDefaultText) {
            o.val("");
            if(o.hasClass("placeholder")) {
                o.removeClass("placeholder");
            }
        }
    });
    ph.blur(function() {
        var o = $(this);
        if(o.val().length == 0) {
            o.attr("value", phDefaultText);
            o.addClass("placeholder");
        }
    });
    ph1.focus(function() {
        var o = $(this);
        if(o.val() == phDefaultText1) {
            o.val("");
            if(o.hasClass("placeholder")) {
                o.removeClass("placeholder");
            }
        }
    });
    ph1.blur(function() {
        var o = $(this);
        if(o.val().length == 0) {
            o.attr("value", phDefaultText1);
            o.addClass("placeholder");
        }
    });
}

$(document).ready(initSearch);
$(document).ready(function() {
    var link = $("a#cvv-find-link");
    link.click(function() {
        $("div#cvv-container").toggle("normal");
    });
});
