/*** Contact form validation  ***/
	/* On focus change input and textarea color */
    $("#contact-form input, #contact-form textarea").focus(function () {
		/* Style */
        $(this).css("background","#FDFFCA");
        $(this).css("border-color","#DBDF6F");
    });

	/* On blur */
    $("#contact-form input, #contact-form textarea").blur(function () {
		var inputVal = jQuery.trim($(this).val()); /* Grabs actual input value and removes white space before and after it! */
		$(this).val(inputVal); /* Re-add the input without spaces */
		
		/* Style */
		$(this).css("background","white");
        $(this).css("border-color","#b7ddf2");
		
		var checkReq = $(this).attr("title"); /* Grabs input title="" */
		if (checkReq == "required" && inputVal == "") { /* If the title correspond to "required" AND the input is blank */
			$(this).css("background","#ffc9c9");
        	$(this).css("border-color","#ff4f4f");
    	} else {
    		$(this).css('background','#C9FFD0'); 
			$(this).css("border-color","#4FFF56");
		}
	});

