$(document).ready(function() 
	{
		$("#nameError").hide();
		$("#nameGood").hide();
		
		$("#emailError").hide();
		$("#emailGood").hide();
		
		$("#emailconfError").hide();
		$("#emailconfGood").hide();
		
		$("#questionError").hide();
		$("#questionGood").hide();
		
		$("#submitMe").hide();
		
		$("#chat_name").focus();
		
		if (($("#chat_name").val() != "") && ($("#chat_email").val() != "") && ($("#emailconf").val() != "") && ($("#chat_email").val() == $("#emailconf").val()) && ($("#question").val() != ""))
			{
				$("#nameGood").show();
				$("#emailGood").show();
				$("#emailconfGood").show();
				$("#questionGood").show();
				$("#submitMe").slideDown(400);
			}
////////////////////////////////////////////////////////////////////////////////
//Begin Name check	
	$("#chat_name").blur(function(){
		if ($("#chat_name").val() == "")
		{
			$("#nameError").slideDown(200);
			$("#nameGood").slideUp(200);
			return (false);
		}
		else
		{
			$("#nameError").hide();
			$("#nameGood").slideDown(200);
			
			
			//Ultimate Check
			if (($("#chat_name").val() != "") && ($("#chat_email").val() != "") && ($("#emailconf").val() != "") && ($("#chat_email").val() == $("#emailconf").val()) && ($("#question").val() != ""))
			{
				$("#submitMe").slideDown(400);
				$("#nameError").hide();
				$("#nameGood").show();
				
				$("#emailError").hide();
				$("#emailGood").show();
				
				$("#emailconfError").hide();
				$("#emailconfGood").show();
				
				$("#questionError").hide();
				$("#questionGood").show();
			}
		}
	
	});
	
//End Name check
////////////////////////////////////////////////////////////////////////////////
//Begin Email check

	$("#chat_email").blur(function(){
		if (($("#chat_email").val() != $("#emailconf").val()) && ($("#emailconf").val() != ""))
		{
			$("#emailconfError").slideDown(200);
			$("#emailconfGood").hide();
			$("#submitMe").hide();
			return (false);
		}
	});
	
	$("#chat_email").blur(function(){
		if ($("#chat_email").val() == "")
		{		
			$("#emailGood").hide();
			$("#emailError").slideDown(400);
			return(false);
		}
	
	
	});

	
	$("#chat_email").keyup(function()
	{
			//Ultimate Check
			if (($("#chat_name").val() != "") && ($("#chat_email").val() != "") && ($("#emailconf").val() != "") && ($("#chat_email").val() == $("#emailconf").val()) && ($("#question").val() != ""))
			{
				$("#submitMe").slideDown(400);
				$("#nameError").hide();
				$("#nameGood").show();
				
				$("#emailError").hide();
				$("#emailGood").show();
				
				$("#emailconfError").hide();
				$("#emailconfGood").show();
				
				$("#questionError").hide();
				$("#questionGood").show();
			}
	});



//End Email check
////////////////////////////////////////////////////////////////////////////////
//Begin EmailConf check
	
	$("#emailconf").focus(function(){
		if($("#chat_email").val() != ""){
			$("#emailError").hide();
			$("#emailGood").slideDown(200);
		
		}
	});
	
	$("#emailconf").blur(function(){
		if (($("#chat_email").val() != $("#emailconf").val()) || ($("#emailconf").val() == ""))
		{
			$("#emailconfError").slideDown(200);
			$("#emailconfGood").slideUp(200);
			$("#submitMe").hide();
			return (false);
		}
		else{
			$("#emailconfError").hide();
			$("#emailconfGood").slideDown(200);
			$("#emailError").hide();
			$("#emailGood").slideDown(200);
			
			//Ultimate Check
			if (($("#chat_name").val() != "") && ($("#chat_email").val() != "") && ($("#emailconf").val() != "") && ($("#chat_email").val() == $("#emailconf").val()) && ($("#question").val() != ""))
			{
				$("#submitMe").slideDown(400);
				$("#nameError").hide();
				$("#nameGood").show();
				
				$("#emailError").hide();
				$("#emailGood").show();
				
				$("#emailconfError").hide();
				$("#emailconfGood").show();
				
				$("#questionError").hide();
				$("#questionGood").show();
			}
		}
	});
	$("$emailconf").blur(function(){
		if ($("#emailconf").val() == "")
		{
			$("#emailconfGood").slideUp(200);
			$("#emailconfError").slideDown(200);
			return (false);
		}
	});
	
//End EmailConf check
////////////////////////////////////////////////////////////////////////////////
//Begin Question check

$("$question").blur(function(){
		if ($("#question").val() == "")
		{
			$("#questionError").slideDown(200);
			$("#questionGood").slideUp(200);
			return (false);
		}
	});
	$("#question").blur(function(){
		if ($("#question").val() == "")
		{
			$("#questionError").slideDown(200);
			$("#questionGood").slideUp(200);
			$("#submitMe").hide();
			return (false);
		}
		else{
			$("#questionError").hide();
			$("#questionGood").slideDown(200);
			
			
			//Ultimate Check
			if (($("#chat_name").val() != "") && ($("#chat_email").val() != "") && ($("#emailconf").val() != "") && ($("#chat_email").val() == $("#emailconf").val()) && ($("#question").val() != ""))
			{
				$("#submitMe").slideDown(400);
				$("#nameError").hide();
				$("#nameGood").show();
				
				$("#emailError").hide();
				$("#emailGood").show();
				
				$("#emailconfError").hide();
				$("#emailconfGood").show();
				
				$("#questionError").hide();
				$("#questionGood").show();
			}
		}
	});
	

//End Question check
////////////////////////////////////////////////////////////////////////////////
/*
two things.
if you get the captcha wrong, the fields come back, full, but there is no submit button. AT THE END so Onload...if != "" and Emails are ==  CHECK CHECK CHECK CHECK; Show SUBMIT else hide Submit

second typing an email should do nothing to the emailcheck div, so do, Nothing for email, BUT just leave the ultimate check
the email CONF should put up the X on both email and conf if they are not equal, else if they are equal...but a green check on both

*/

});