$.fn.equalHeights = function(px) {
	$(this).each(function(){
		var currentTallest = 0;
		$(this).children().each(function(i){
			if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
		});
		// for ie6, set height since min-height isn't supported
		if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
		$(this).children().css({'min-height': currentTallest});
		// $(this).children().children("img").css({'margin-bottom': currentTallest-65}); 
		// above line would set the bottom margin of the images to the height of the box minus the height of the image, so no text
		// could float underneath
	});
	return this;
};


$(function() {
	$(".readmoreacc").accordion({ 
		header: 'h6', 
		active: false, 
		collapsible: true
	});
	
	$("#career-benefits").accordion({ 
		header: 'h6',
		collapsible: true,
		autoHeight: false
	 });
	
	$(".splash-box li:even").addClass("oddbox");
	$(".splash-box").equalHeights();
	
	var oicaption = $("#operational-image img").width();
	$("#operational-image").css("width", oicaption+2);
	
	var sidebarh = $("#content-subpage").height();
	$("#sidebar-left").css("height", sidebarh+10);
	$("body.page-contact #sidebar-left").css("height", sidebarh-120);
	
	$(".contact-table input[type=radio]").css("width", "auto"); 
	$(".contact-table input[type=checkbox]").css("width", "auto");
	
	$("#header-tabs").tabs();
	
	if ($.browser.msie && parseInt($.browser.version) == 6 ) { 
		$("#right-side #top-nav").css("margin-right","11px");
		$("#secondary-top-nav").css("margin-right","11px");
		$("#header-points li").css("margin-bottom","-8px");
		$("form#needs").css("margin-right","11px");
		$(".bottom-box-links").css("margin-right","-10px");
		$(".bottom-container img").css("margin-right","-11px");
		$("#major-clients").css("margin-bottom","30px");
		$("#addt-clients").css("margin-bottom","30px");
		$(".contact-callouts").css("padding-right","16px");
		$("#content-left-wide").css("margin-left", "14px");
		$(".ineed-callouts").css("padding-right","0");
	};
	
	/*if ($.browser.msie) { 
		$("#major-clients li").prepend("<b>&bull;</b> ");
		$("#addt-clients li").prepend("<b>&bull;</b> ");
		$(".clients-full li").prepend("<b>&bull;</b> ");
	}; */
	
	///////////// Small Contact Form ///////////////
	
	$("#openContactForm").click(function(){$("div.shadow-expert").find("div.dropDownContactForm:hidden").slideDown("slow");});
	//$("input.buttonBslideup").click(function(){ $("div.shadow-expert").find("div.fourthparagraph:visible").slideUp("slow"); });
	
	$('#contactSubmitSmall').click(function() {
		submitFormFunction();
	});
	///////////////////////////////////////////////
});

Cufon.replace('.box-title', { fontFamily: 'Myriad Pro' });
Cufon.replace('.callout-title', { fontFamily: 'Myriad Pro' });
Cufon.replace('#top-nav', { fontFamily: 'Myriad Pro' });
Cufon.replace('#secondary-top-nav', { fontFamily: 'Myriad Pro' });
Cufon.replace('#needs label', { fontFamily: 'Myriad Pro' });
Cufon.replace('p#administration', { fontFamily: 'Myriad Pro' });
Cufon.replace('#admin-nav ul li', { fontFamily: 'Myriad Pro' });
Cufon.replace('.secondary-title', { fontFamily: 'Myriad Condensed' });
Cufon.replace('.breadcrumb', { fontFamily: 'Myriad Condensed' });
Cufon.replace('.featured-item', { fontFamily: 'Myriad Condensed' });
Cufon.replace('.hp-title-1', { fontFamily: 'Myriad Condensed' });
Cufon.replace('.hp-title-2', { fontFamily: 'Myriad Condensed' });