/*-------------------------------------------------------------------------------------------------------
 FUNCTIONS FOR STEP 1 OF ESTIMATE FORM
-------------------------------------------------------------------------------------------------------*/

// Hide residence size option if business or single item move.	
$(function() 
   {
   $(".hideresidencesize").change(function() 
	   {
		$("#residencesize").hide("slow");
		});
	});

	
// Show residence size option only if residential move desired.
$(function() 
   {
   $(".showresidencesize").change(function() 
	   {
  	   $("#residencesize").show("slow");
		});
	});

	
// Toggle to hide packing requests if unload only.
$(function()
   {
   $("#servicetype").change(function() 
	   {
      var selectedServiceType = $('#servicetype').val();

      if (selectedServiceType == '3')
         {
  		   $("#packingrequesteddiv").hide("slow");
			}
		else
         {
  		   $("#packingrequesteddiv").show("slow");
			}
		   
		});
	});


// Show how found explaination if user choses other
$(function()
   {
   $("#howfound").change(function() 
	   {
		
      var selectedHowFound = $('#howfound').val();

      if (selectedHowFound == 'Other')
         {
  		   $("#howfoundotherdiv").show("slow");
			}
		else
         {
  		   $("#howfoundotherdiv").hide("slow");
			}
		   
		});
	});

	
// Datepicker function
$(function() 
   {
   $("#datepicker").datepicker(
	   {
	   numberOfMonths: 2,
		minDate:1
		});
	});

	



/*-------------------------------------------------------------------------------------------------------
 FUNCTIONS FOR STEP 2 OF ESTIMATE FORM
-------------------------------------------------------------------------------------------------------*/
	
// Toggle to show options for start location.
$(function()
   {
   $("#starttype").change(function() 
	   {
      var selectedStartType = $('#starttype').val();

      // Highrise
      if (selectedStartType == '3')
         {
  		   $("#startdistancediv").show("slow");
  		   $("#startstoragenamediv").hide("slow");
  		   $("#startstoragefloordiv").hide("slow");
  		   $("#startfloordiv").hide("slow");
  		   $("#startnumfloorsdiv").hide("slow");
  		   $("#startalleydiv").hide("slow");
  		   $("#startelevatordiv").hide("slow");
  		   $("#startelevatortypediv").show("slow");
  		   $("#startelevatorreservediv").show("slow");
			}

		// Single family house
      else if (selectedStartType == '1')
         {
  		   $("#startdistancediv").show("slow");
  		   $("#startstoragenamediv").hide("slow");
  		   $("#startstoragefloordiv").hide("slow");
  		   $("#startfloordiv").hide("slow");
  		   $("#startnumfloorsdiv").show("slow");
  		   $("#startalleydiv").show("slow");
  		   $("#startelevatordiv").hide("slow");
  		   $("#startelevatortypediv").hide("slow");
  		   $("#startelevatorreservediv").hide("slow");
			}

      // Storage unit
      else if (selectedStartType == '4')
         {
  		   $("#startdistancediv").hide("slow");
  		   $("#startstoragenamediv").show("slow");
  		   $("#startstoragefloordiv").show("slow");
  		   $("#startfloordiv").hide("slow");
  		   $("#startnumfloorsdiv").hide("slow");
  		   $("#startalleydiv").hide("slow");
  		   $("#startelevatordiv").hide("slow");
  		   $("#startelevatortypediv").hide("slow");
  		   $("#startelevatorreservediv").hide("slow");
			}
			
		// Apartment / condo
      else
		   {
  		   $("#startdistancediv").show("slow");
  		   $("#startstoragenamediv").hide("slow");
  		   $("#startstoragefloordiv").hide("slow");
  		   $("#startfloordiv").show("slow");
  		   $("#startnumfloorsdiv").hide("slow");
  		   $("#startalleydiv").show("slow");
  		   $("#startelevatordiv").show("slow");
         if ($('#startelevator').is(':checked'))
            {
   		   $("#startelevatortypediv").show("slow");
   	   	$("#startelevatorreservediv").show("slow");
	   		}
         else
		      {
   	   	$("#startelevatortypediv").hide("slow");
      		$("#startelevatorreservediv").hide("slow");
   			}
			}
		});
	});

	
// Toggle to show options for end location
$(function()
   {
   $("#endtype").change(function() 
	   {
      var selectedEndType = $('#endtype').val();

      // Highrise
      if (selectedEndType == '3')
         {
  		   $("#enddistancediv").show("slow");
  		   $("#endstoragenamediv").hide("slow");
  		   $("#endfloordiv").hide("slow");
  		   $("#endstoragefloordiv").hide("slow");
  		   $("#endnumfloorsdiv").hide("slow");
  		   $("#endalleydiv").hide("slow");
  		   $("#endelevatordiv").hide("slow");
  		   $("#endelevatortypediv").show("slow");
  		   $("#endelevatorreservediv").show("slow");
			}
			
		// Single family house
      else if (selectedEndType == '1')
         {
  		   $("#enddistancediv").show("slow");
  		   $("#endstoragenamediv").hide("slow");
  		   $("#endfloordiv").hide("slow");
  		   $("#endstoragefloordiv").hide("slow");
  		   $("#endnumfloorsdiv").show("slow");
  		   $("#endalleydiv").show("slow");
  		   $("#endelevatordiv").hide("slow");
  		   $("#endelevatortypediv").hide("slow");
  		   $("#endelevatorreservediv").hide("slow");
			}
		
		// Storage unit	
      else if (selectedEndType == '4')
         {
  		   $("#enddistancediv").hide("slow");
  		   $("#endstoragenamediv").show("slow");
  		   $("#endstoragefloordiv").show("slow");
  		   $("#endfloordiv").hide("slow");
  		   $("#endnumfloorsdiv").hide("slow");
  		   $("#endalleydiv").hide("slow");
  		   $("#endelevatordiv").hide("slow");
  		   $("#endelevatortypediv").hide("slow");
  		   $("#endelevatorreservediv").hide("slow");
			}
			
		// Apartment / condo
      else
		   {
  		   $("#enddistancediv").show("slow");
  		   $("#endstoragenamediv").hide("slow");
  		   $("#endstoragefloordiv").hide("slow");
  		   $("#endfloordiv").show("slow");
  		   $("#endnumfloorsdiv").hide("slow");
  		   $("#endalleydiv").show("slow");
  		   $("#endelevatordiv").show("slow");
         if ($('#endelevator').is(':checked'))
            {
   		   $("#endelevatortypediv").show("slow");
   	   	$("#endelevatorreservediv").show("slow");
	   		}
         else
		      {
   	   	$("#endelevatortypediv").hide("slow");
      		$("#endelevatorreservediv").hide("slow");
   			}
			}
		});
	});



	
	
// NEW ESTIMATE FORM JAVA
$(function()
   {
	for (var i=0; i<=2; i++)
	   {
  
  
      $("#start" + i + "type").change(function() 
   	   {
         if ($(this).val() == '3')
            {
			   alert("highrise");

            }








  
  		   });
      }      
	});








	
// Furniture disassembly toggle.
$(function()
   {
   $("#disassemble").change(function() 
	   {
      if ($('#disassemble').is(':checked'))
         {
   		$("#disassemblebox").show("slow");
			}
      else
		   {
  		   $("#disassemblebox").hide("slow");
			}
		});
	});

	
// Show more elevator options
$(function()
   {
   $("#startelevator").change(function() 
	   {
      if ($('#startelevator').is(':checked'))
         {
   		$("#startelevatortypediv").show("slow");
   		$("#startelevatorreservediv").show("slow");
			}
      else
		   {
   		$("#startelevatortypediv").hide("slow");
   		$("#startelevatorreservediv").hide("slow");
			}
		});
	});

$(function()
   {
   $("#endelevator").change(function() 
	   {
      if ($('#endelevator').is(':checked'))
         {
   		$("#endelevatortypediv").show("slow");
   		$("#endelevatorreservediv").show("slow");
			}
      else
		   {
   		$("#endelevatortypediv").hide("slow");
   		$("#endelevatorreservediv").hide("slow");
			}
		});
	});



	

/*-------------------------------------------------------------------------------------------------------
 FUNCTIONS FOR FAQ
-------------------------------------------------------------------------------------------------------*/
	
// FAQ toggle to show answers to questions.	
$(function() 
   {
   $(".faq").find('dt').click(function()
	   {
   	var answer = $(this).next();
					 if (answer.is(':visible')) {
							 answer.slideUp('slow');
					 } else {
							 answer.slideDown('slow');
					 }
		});
	});


