(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}
})(jQuery);

$(document).ready(function() {
	
	// adds target blank to hrefs not to our domain.    
	
	jQuery("a[href^='http:'], a[href^='https:']").not("[href*='withoutthestress.com']").attr('target','_blank'); 
			
	// fancybox
	
	$(".content_image a").fancybox({
		'overlayShow'	: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titleShow'		: false
	});
	
	// contact-form validation
	
	$("#contact_form").validate();
	
	$("#related_articles div.inset").equalHeights();
	
	$("#passport_expiration_date").date_input();
	
			
});


	



