 $(document).ready(function () {
        $("#step3").hide();
        $("#step4").hide();
        $("#step4").hide();
        
        $("form").submit(function() {
        	var name = $("#name").val();
        	var company = $("#company").val();
        	var email = $("#email").val();
        	var phone = $("#phone").val();
        	var message = $("#message").val();
        	if(name == "" || company == "" || email == "" || phone == "" || message == ""){
        		$("#client-info-error-msg").text("All fields are required!");
        		return false;
        	}else{
        		
        		return true;
        	}
          });
        /*
        $(function () { // 
        	$('.checkallgoals').click(function () {
        		//$(this).parents('ul:eq(0)').find(':checkbox').attr('checked', this.checked);
        		
        		$("div > ul:eq(0)").find(':checkbox').attr('checked', this.checked);
        		//$(this).parents('div:eq(0)').find(':checkbox').attr('checked', this.checked);
        		alert('hey');
        		
        	});
        });
        */
        
        $(".checkallgoals").click(function(){
        	 $("#allgoals").find("input[type=checkbox]").each(function(){
        		 if(this.checked){
        			 this.checked = false; 
        		 }else{
        			 this.checked = true;
        		 }
                 
             });
        });
        
        $(".checkallskills").click(function(){
       	 $(".allskills").find("input[type=checkbox]").each(function(){
       		 	if(this.checked){
       		 		this.checked = false;
       		 	}else{
       		 		this.checked = true;
       		 	}
            });
       });
        
        
        
      
        
        $(function () { // 
        	$('.checkallskills').click(function () {
        		$(this).parents('div:eq(0)').find(':checkbox').attr('checked', this.checked);
        	});
        });
        

        
                           
});
 



function gotoStep3(){
		
		if($("#project_details").val() == ""){
			$("#project-error-msg").text("* Please fill-out all fields");
			
		}else{
			$("#step2").hide();
			$("#step3").fadeIn("slow");
		}
        
}

function gotoStep4(){
		var budget = $("input:radio[name=budget]:checked").length;
		var goals = $("input:radio[name=goals]:checked").length;
		if(budget == 0 || goals == 0){
			
			$("#budget-error-msg").text("* Please fill-out all fields");
			$("#goals-error-msg").text("* Please fill-out all fields");
			if(budget>0){
				$("#budget-error-msg").text("");
			}
			if(goals>0){
				$("#goals-error-msg").text("");
			}
		}else{
			$("#budget-error-msg").text("");
			$("#goals-error-msg").text("");
			$("#step3").hide();
			$("#step4").fadeIn("slow");
		}
}

function staffLeasingStep3(){
	var checkbox = $("input:checkbox:checked").length;	
	var goals = $("input:checkbox[name=goals[]]:checked").length;
	
	if(checkbox == 0 || goals == 0){
			$("#skills-error").text("* Please fill-out all fields");
			$("#goals-error").text("* Please fill-out all fields");
			if(checkbox >0){
				$("#skills-error").text("");
			}
			if(goals>0){
				$("#goals-error").text("");
			}
		
	}else{
		$("#step2").hide();
		$("#step3").fadeIn("slow");
	}
    
}

function staffLeasingStep4(){
	var employees = $("input:radio[name=employee_reqt]:checked").length;
	var implement = $("input:radio[name=implement]:checked").length;
	if(employees == 0 || implement == 0){
		
		$("#employees-error").text("* Please fill-out all fields");
		$("#implement-error").text("* Please fill-out all fields");
		if(employees>0){
			$("#employees-error").text("");
		}
		if(implement>0){
			$("#implement-error").text("");
		}
	}else{
		
		$("#step3").hide();
		$("#step4").fadeIn("slow");
	}
}

function customDevtStep3(){
	if($("#development_detail").val() == ""){
		$("#development-error").text("* Please fill-out all fields");
		
	}else{
		$("#step2").hide();
		$("#step3").fadeIn("slow");
	}
    
}

function customDevtStep4(){
	var budget = $("input:radio[name=budget]:checked").length;
	var timeline = $("#development_timeline").val();
	
	if(budget == 0 || timeline == ""){
		
		$("#budget-error").text("* Please fill-out all fields");
		$("#timeline-error").text("* Please fill-out all fields");
		if(budget>0){
			$("#budget-error").text("");
		}
		if(timeline!=""){
			$("#timeline-error").text("");
		}
	}else{
		
		$("#step3").hide();
		$("#step4").fadeIn("slow");
	}
}




