// Placeholder

var phDefaultText = "Search the site...";
var phEmailText = "Enter your e-mail here";

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

function initEmail() {
    var phe = jQuery("input#email-ph");
    phe.focus(function() {
        var o = jQuery(this);
        if(o.val() == phEmailText) {
            o.val("");
            if(o.hasClass("placeholder")) {
                o.removeClass("placeholder");
            }
        }
    });
    phe.blur(function() {
        var o = jQuery(this);
        if(o.val().length == 0) {
            o.attr("value", phEmailText);
            o.addClass("placeholder");
        }
    });
}

jQuery(document).ready(initSearch);
jQuery(document).ready(initEmail);