$(document).ready(function(){

   $("#default").click(function(event){
     	event.preventDefault();
	$("body").css("font-size","10px");
	$.cookie("fontSize","10px");
   });

   $("#larger").click(function(event){
     	event.preventDefault();
	$("body").css("font-size","12px");
	$.cookie("fontSize","12px");
   });

   $("#largest").click(function(event){
     	event.preventDefault();
	$("body").css("font-size","14px");
	$.cookie("fontSize","14px");
   });

// Cookie
//var fontSize = $.cookie("fontSize");

// Calling Cookie
//if(fontSize == "10px") {
//	$("body").css("font-size","10px");
//};

//if(fontSize == "12px") {
//	$("body").css("font-size","12px");
//};

//if(fontSize == "14px") {
//	$("body").css("font-size","14px");
//};

$('#sesClear').hide();
$('#troubleCodes').hide();
$('a#sesClear-toggle').click(function() {
   $('#sesClear').toggle('slow');
         return false;
        });

		$('a#code-toggle').click(function() {
       	 $('#troubleCodes').toggle('slow');
         return false;
        });


	$('form.frmContact').submit(function() {
		$('form.frmContact span.error').remove();

		$('form.frmContact td.btnSubmit input').attr('disabled','disabled');
		var hasError = false;
        //alert('Should have removed errors');
		jQuery.each($('form.frmContact table td.required'),function() {
			var labelText = $(this).children('label').text();
			labelText = labelText.replace(' *','');

				if(jQuery.trim($(this).siblings('td').children('input').val()) == '') {
					$(this).next('td').append('<span class="error">What? No e-mail? Hmmm, try again...</span>');
					
					hasError = true;
				}
			
		});
		if(hasError) {
			$('form.frmContact td.btnSubmit input').removeAttr('disabled');
			return false;
		} else {
			//alert('The form would submit now');
			 //$('form.frmContact td.btnSubmit input').removeAttr('disabled');//Remove this line if using for real
			return true; //Change this to true when using it for real
		}
	});

 });
