$(document).ready(function() {
    $("#formContainer, form, p, input[type='text']").focus(
    function() {
        $(this).closest('p').css({
            "background": "#ccdaee"
        });
    });

    $("#formContainer, form, p, input[type='text']").blur(
    function() {
        $(this).closest('p').animate({
          backgroundColor: "#ffffff"
        }, 300 );
    });

    $("#formContainer, form, p, select").focus(
    function() {
        $(this).closest('p').css({
            "background": "#ccdaee"
        });
    });

    $("#formContainer, form, p, select").blur(
    function() {
        $(this).closest('p').animate({
          backgroundColor: "#ffffff"
        }, 300 );
    });

    $("#submit").hover(
    function() {
        $(this).css({
            "cursor": "pointer",
						"background" : "#9BC4E2"
        });
    },
    function() {
        $(this).css({
            "cursor": "default",
						"background" : "#ccdaee"
        });
    }
    );

    // $('#hospital_committees_other').keyup(function(){  
    //     var length = $(this).val().length;
    //   			var boxes = new Array();
    // 				boxes[0] = $("#hospital_committees_performance_improvement");
    // 				boxes[1] = $("#hospital_committees_product_evaluation");
    // 				if (length > 0)
    // 				{
    // 					for (i=0;i<boxes.length;i++)
    // 					{
    //     		boxes[i].removeClass('validate[required]');
    // 					}
    // 				}
    // 				else 
    // 				{
    // 					for (i=0;i<boxes.length;i++)
    // 					{
    //     		boxes[i].addClass('validate[required]');
    // 					}
    // 				}
    // }); 

    $('#education_other').keyup(function(){  
        var length = $(this).val().length;
				if (length > 0)
				{
       		$('#education').removeClass('validate[required]');
				}
				else 
				{
       		$('#education').addClass('validate[required]');
				}
    }); 

    $('#job_title_other').keyup(function(){  
        var length = $(this).val().length;
				if (length > 0)
				{
       		$('#job_title').removeClass('validate[required]');
				}
				else 
				{
       		$('#job_title').addClass('validate[required]');
				}
    });

    $("#report tr").hover(
    function() {
        $(this).css({
						"background" : "#9BC4E2"
        });
    },
    function() {
        $(this).css({
						"background" : "#f0f0f0"
        });
    }
    );
});
