// JavaScript Document
$(function(){
		   
		   $('#mainRotation').innerfade({ 
						  speed: 2000, 
						  timeout: 5000, 
						  type: 'sequence', 
						  containerheight: '424px'
					}); 
		   
		    $('#rotateSide').innerfade({ 
						  speed: 2000, 
						  timeout: 5000, 
						  type: 'random', 
						  containerheight: '263px'
					}); 
	$("#accordion h6.question:first").addClass("active");
	$("#accordion div.answer:not(:first)").hide();

	$("#accordion h6.question").click(function(){	
				
	
	  $(this).next("div.answer").slideToggle(500)
	  .siblings("div.answer:visible").slideUp(300);
	  $(this).toggleClass("active");
	  $(this).siblings("h6.question").removeClass("active");
	 
	
											 });
	
	$("#accordion h6.question").hover(function(){
											   $(this).css({color: "#002a46"});
											   $(this).mouseout(function(){
														$(this).css({color: "#a14623"});
																		 });										   
											   });
	   
		   
$("#dropmenu ul").css({display: "none"}); // Opera Fix 
$("#dropmenu li").hover(function(){ 
        $(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); 
        },function(){ 
        	$(this).find('ul:first').css({visibility: "hidden"}); 
        });  

});


function checkValues(form)
{
		var error = false;
		var errorMsg = "<p><strong>You must correct the following errors before you submit this form</strong></p>";
		
		if(form.first_name.value== "")
		{
			error = true;
			errorMsg += "<p>You must enter a valid first name</p>";
			//$("#first_name").css({"background" : "url(wp-content/themes/boyer/_images/bg_formBox_error.png) no-repeat"});
		}
	if(form.last_name.value== "")
		{
			error = true;
			errorMsg += "<p>You must enter a valid last name</p>";
			//$("#last_name").css({"background" : "url(wp-content/themes/boyer/_images/bg_formBox_error.png) no-repeat"});
		}
	if(form.email.value== "")
		{
			error = true;
			errorMsg += "<p>You must enter a valid email address</p>";
			//$("#last_name").css({"background" : "url(wp-content/themes/boyer/_images/bg_formBox_error.png) no-repeat"});
		}

		
	if(error)
		{
			$("#formError").html(errorMsg);
			//$("#formError").css({"display" : "block"});
			$("#formError").slideDown('fast');
				return false;
		}
		
		return true;
}
