// JavaScript Document

 
// When the DOM is ready...
$(function(){
	
	// Hide stuff with the JavaScript. If JS is disabled, the form will still be useable.
	//$("# a div id here").hide();
		
	// Reset form elements back to default values

	
	// Fade out steps 2 and 3 until ready
	$("#select_broadband").css({ opacity: 0.3 });
	$("#select_extras").css({ opacity: 0.3 });
	
	// Hide step 4 (form) until ready
	$("#submit_quote").css({ opacity: 0.1 });

	
	$.phoneComplete = "not complete";
	$.broadbandComplete = "not complete"; 
	$.extrasComplete = "not complete";
		
	
	function stepOneTest()
  {
		if ($.phoneComplete == "complete")
    {
			$("#select_broadband").css({
				opacity: 1.0
			});
			$("#select_extras").css({
				opacity: 0.7
			});
			$("#submit_quote").css({
				opacity: 0.7
			});
		}
	};
	
	
	$("#select_phone input[name=voice]").click(function(){
		$.phoneComplete = "complete";
		stepOneTest();
	});
	
	
	
	
	function stepTwoTest()
  {
		if (($.phoneComplete == "complete") && ($.broadbandComplete == "complete"))
    {
			$("#select_extras").css({
				opacity: 1.0
			});
			$("#submit_quote").css({
				opacity: 1.0
			});
		}
	};
	
	$("#select_broadband input[name=data]").click(function(){
		$.broadbandComplete = "complete";
		stepTwoTest();
	});
	
});