﻿/// <reference path="lib/jquery-1.3.2-vsdoc.js" />

$(function() {
    $("#form_contact").validate({
        rules: {
            Name: { required: true },
            EmailAddress: { required: true, email: true },
            Body: { required: true }
        },
        messages: {
            Name: { required: "" },
            EmailAddress: { required: "", email: "" },
            Body: { required: "" }
        }
    });
});

$(function() {
    $("input[type=text], textarea, input[type=password], select").addClass("inputfield");

    $("input[type=text], textarea, input[type=password], select").focus(function() {
        $(this).removeClass("inputfield");
        $(this).addClass("inputfield_focus");
    });

    $("input[type=text], textarea, input[type=password], select").blur(function() {
        $(this).removeClass("inputfield_focus");
        $(this).addClass("inputfield");
    });
});

$(function() {
    var recommendations = $("#recommendations").children(".recommendation");

    if (recommendations.length) {
        var index = Math.floor(Math.random() * recommendations.length);

        recommendations.not(recommendations[index]).hide();
    }
});