$().ready(function(){
	//Inputs that have integrated labels
	$("input.label,textarea.label").focus(function(){
		if($.trim($(this).val()) == $(this).attr("title")){
			$(this).val("");
		}
	});
	$("input.label,textarea.label").blur(function(){
		if($.trim($(this).val()) == ""){
			$(this).val($(this).attr('title'));
		}
	});
	
	$(".our-people .option").click(function(e){
		e.preventDefault();
		var index = $(this).index();
		$(".our-people .option.on").removeClass("on").addClass("hidden");
		$(".our-people .middle-box.on").removeClass("on").addClass("hidden");
		$(this).removeClass("hidden").addClass("on");
		$(".our-people .middle-box").eq(index-1).addClass("on").removeClass("hidden");
	});
	$('#fader').innerfade({
		speed: 1500,
		timeout: 6000,
		type: 'sequence',
		containerheight: '272px'
	}); 
	 $("ul.quickoffice li").mouseover(function(){  
        $('div',this).stop().show().animate({height:'81px'},{queue:false, duration:250 })  
     });    
     $("ul.quickoffice li").mouseout(function(){  
         $('div',this).stop().animate({height:'0px'},{queue:false, duration:375, complete: function(){ $(this).hide(); }  })  
     });
	 
	//Print Link
	$(".print").click(function(e){
		e.preventDefault();
		window.print();
	});
	//Custom Select
	$(".custom-select").mxnphpCustomSelect();
	
	//Color Box Map
	$('.map').colorbox();
	
	//Prevent Submission of form without checking first two boxes
	$("#thecontactform").submit(function(e) {
		if( !$('input[name=acknowledgment]:checked').length || !$('input[name=formal-understanding]:checked').length ) {
			//stop the form from submitting
			e.preventDefault();
			alert("Please read and agree to the first two checkboxes before submitting.");
		}
		return true;
	});

	
});
