$(document).ready(function(){
    var text = '';
    var defaults = ["Your Name.", "Email."];
    
    // Setup defaults
    $.each($("div#form input"), function(i, item){
        if($(item).attr('name') == 'name')
        {
            $(item).val('Your Name.');
        }
        else if($(item).attr('name') == 'email')
        {
            $(item).val('Email.');
        }
    });
    
    $("div#form textarea").val('Comments.');
    
    // Focus
    $("div#form input").focus(function(){
        var modified = true;
        var value = $(this).val();
        $.each(defaults, function(i, item){
            //alert('a' + value + 'a');
            if(value == item)
            {
                modified = false;
            }
        });
        
        if(!modified)
        {
            text = $(this).val();
            $(this).val('');
        }
    });
    
    $("div#form textarea").focus(function(){
        if($(this).val() == 'Comments.')
        {
            text = $(this).val();
            $(this).val('');
        }
    });
    
    // Blur
    $("div#form input").blur(function(){
        if($(this).val() == '')
        {
            if($(this).attr('name') == 'name')
            {
                $(this).val('Your Name.');
            }
            else if($(this).attr('name') == 'email')
            {
                $(this).val('Email.');
            }
        }
    });
    
    $("div#form textarea").blur(function(){
        if($(this).val() == '')
        {
            $(this).val('Comments.');
        }
    });
});