
function initMenu() {
  $('#menu ul').hide();
  $('#maininfodiv').hide();
  //$('#estimate2').hide();
  $('#menu li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#menu ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  
    $('#moreinfo').click(
    function() {
		if ($('#estimate2').is(':hidden'))
		{
			$('#estimate1').hide();
			$('#estimate2').slideDown('normal');
			$('#maininfo').show();
			$('#maininfodiv').show();
			return false;
		}
		}
    );
	
	    $('#maininfo').click(
    function() {
		if ($('#estimate1').is(':hidden'))
		{
			  $('#maininfodiv').hide();
			$('#estimate2').hide();
			$('#estimate1').slideDown('normal');
			return false;
		}
		} 
    );
  }

$(document).ready(function() {

initMenu();

	$('#estimatesubmit').click(function(){
		if($("#name").val()==""){
		    alert("Please complete the entire form.");
			return false;
		}
		if($("#email").val()==""){
		    alert("Please complete the entire form.");
			return false;
		}
		if($("#phone").val()==""){
		    alert("Please complete the entire form.");
			return false;
		}
	});

});
