$(document).ready(function () 
{
	hoverFormRow();
	hoverFormRowERR();
	highlightInput();
	ToggleChefType();
});

function hoverFormRowERR()
{
	$(".divFormErrDisplay").prepend('<span class="pointer"></span>');
	var divDisplay = $(".divClearForm .divFormErrDisplay").parent();
	divDisplay.removeClass("divClearForm");
	divDisplay.addClass("divClearFormERR");
	
	var a = $(".divClearFormERR .divFormErrDisplay").parent();
	a.hover(
		function () {
			$(".divFormErrDisplay").css("display","none");

			$(this).css("background-color","#FFDD00");
			$(this).find("span:first").css("display","block");
			$(this).css("border-right","none")
			$(this).css("border-left","none")
		}, 
		function () {
			$(this).find("span:first").css("display","none");
		}
	);
}
function hoverFormRow()
{
	$(".divClearForm").hover(
		function () {
			$(".divClearForm").css("background-color","")
			$(".divClearForm").css("border-right","none")
			$(".divClearForm").css("border-left","none")
			
			$(this).css("background-color","#F5F5F5")
			$(this).css("border-right","2px #FFAA00 solid")
			$(this).css("border-left","2px #FFAA00 solid")
		}, 
		function () {
			$(this).css("background-color","")
			$(this).css("border-right","none")
			$(this).css("border-left","none")
		}
	);
}
function highlightInput()
{
	$("input").focus(
		function () {
			$(this).css("border","1px #FF7000 solid")
			$(this).css("background-color","#F5F5F5")
		}
	);
	$("input").blur(
		function () {
			$(this).css("border","1px #AAAAAA solid")
			$(this).css("background-color","#FFFFFF")
		}
	);
	$("textarea").focus(
		function () {
			$(this).css("border","1px #FF7000 solid")
			$(this).css("background-color","#F5F5F5")
		}
	);
	$("textarea").blur(
		function () {
			$(this).css("border","1px #AAAAAA solid")
			$(this).css("background-color","#FFFFFF")
		}
	);
}
function ToggleChefType()
{
	$(".iama").change(
		function () {
			if($(this).attr("value") == "1")
			{
				$("#venue").parent().css("display","block");
				if($(".venue").attr("value") == "")
				{
					$("#details").parent().css("display","block");
				}
				else
				{
					$("#details").parent().css("display","none");
				}
			}
			else
			{
				$("#venue").parent().css("display","none");
				$("#details").parent().css("display","none");
			}
		}
	);
	$(".venue").change(
		function () {
			if($(this).attr("value") == "")
			{
				$("#details").parent().css("display","block");
			}
			else
			{
				$("#details").parent().css("display","none");
			}
		}
	);
}