
// When the DOM is ready...
$(function(){
	

	
	// Fade out steps 2 and 3 until ready
	$("#step_2 p").css({ opacity: 0.3 });
	
	
	//KaiMotion Calc
	$("#KM").click(function(){
		$("#step_1 li").removeClass("activecalc");
		$(this).parent().addClass("activecalc");
		$("#calcresults").html("<p>Enter your facility's information above to calculate your savings.</p>");
		
	$.ajax({
   type: "POST",
   url: "kmform.php",
   data: "",
   success: function(html){
     $("#step2data").html(html);
     $("#step_2 p").css({ opacity: 1.0 });
		$("#calcbutton").click(function(){
			var sqfoot = $("#sqfoot").val();
		var timescleaned = $("#timescleaned").val();
		var pay = $("#pay").val();
		$.ajax({
   type: "POST",
   url: "kmformprocess.php",
   data: "sqfoot=" + sqfoot + "&timescleaned=" + timescleaned + "&pay=" + pay,
   success: function(html){
     $("#calcresults").html(html);
        }
 });	
	return false;		
		});
   }
 });
     
     
     return false;
	
	});
	
	
	//Individual Building Calc
	$("#IB").click(function(){
		$("#step_1 li").removeClass("activecalc");
		$(this).parent().addClass("activecalc");
	 $("#calcresults").html("<p>Enter your facility's information above to calculate your savings.</p>");
		
	$.ajax({
   type: "POST",
   url: "ibform.php",
   data: "",
   success: function(html){
     $("#step2data").html(html);
     $("#step_2 p").css({ opacity: 1.0 });
		$("#calcbutton").click(function(){
			var restrooms = $("#restrooms").val();
			var fixtures = $("#fixtures").val();
		var timescleaned = $("#timescleaned").val();
		var pay = $("#pay").val();
		$.ajax({
   type: "POST",
   url: "ibformprocess.php",
   data: "restrooms=" + restrooms + "&fixtures=" + fixtures + "&timescleaned=" + timescleaned + "&pay=" + pay,
   success: function(html){
     $("#calcresults").html(html);
        }
 });	
	return false;		
		});
   }
 });
     
     
     return false;
	
	});
	
	//School District Calc
	$("#SD").click(function(){
		$("#step_1 li").removeClass("activecalc");
		$(this).parent().addClass("activecalc");
		$("#calcresults").html("<p>Enter your facility's information above to calculate your savings.</p>");
		
	$.ajax({
   type: "POST",
   url: "sdform.php",
   data: "",
   success: function(html){
     $("#step2data").html(html);
     $("#step_2 p").css({ opacity: 1.0 });
		$("#calcbutton").click(function(){
			var students = $("#students").val();
			var machines = $("#machines").val();
			var schools = $("#schools").val();
		var timescleaned = $("#timescleaned").val();
		var pay = $("#pay").val();
		$.ajax({
   type: "POST",
   url: "sdformprocess.php",
   data: "students=" + students + "&schools=" + schools + "&machines=" + machines + "&timescleaned=" + timescleaned + "&pay=" + pay,
   success: function(html){
     $("#calcresults").html(html);
        }
 });	
	return false;		
		});
   }
 });
     
     
     return false;
	
	});
	
	
	
	
	
});