
/***
Equal Height Columns by Rob Glazebrook
http://www.cssnewbie.com/equal-height-columns-with-jquery/
***/
function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}



	/***
	jQuery Helpers
	***/

$(document).ready(function(){

	$(window).load(
		function() {
			equalHeight($(".equal_height"));
		}
	);	
	/***
	External links
	***/
	$("a[rel='external']").attr({target:"_blank"});
	

	/***
	Fire Fancybox for Images
	***/
	$("a.fancybox").fancybox({
		'zoomSpeedIn': 0,
		'zoomSpeedOut': 0,
		'zoomOpacity': false,
		'zoomSpeedChange': 0,
		'overlayShow': true,
		'overlayColor': '#fff',
		'overlayOpacity': 0.6,
		'hideOnContentClick': true,
		'centerOnScroll': false,
		'imageScale': false
	});
	
	$(".fancymodal").fancybox({
		'zoomSpeedIn': 0,
		'zoomSpeedOut': 0,
		'zoomOpacity': false,
		'zoomSpeedChange': 0,
		'overlayShow': true,
		'overlayColor': '#fff',
		'overlayOpacity': 0.6,
		'hideOnContentClick': false,
		'centerOnScroll': false,
		'autoScale': false,
		'imageScale': false
	});
	
	
	$("#page table tr:odd").addClass("odd");
	$("#page table tr:even").addClass("even");
	$("#page table tr td:odd").addClass("odd");
	$("#page table tr td:even").addClass("even");
	$("#page table tr th:odd").addClass("odd");
	$("#page table tr th:even").addClass("even");
	$("#page table tr:first-child").addClass("first");
	$("#page table tr:last-child").addClass("last");
	$("#page table td:first-child").addClass("first");
	$("#page table td:last-child").addClass("last");
	$("#page table th:first-child").addClass("first");
	$("#page table th:last-child").addClass("last");
	
	
	$("#page .home-block:even").addClass("home-block-even");
	$("#page .home-block:odd").addClass("home-block-odd");
	
	
	
	$(".input-mid").focusin(function(){
		
			$(this).parent().parent().parent("span").addClass("active-field");
			
			val = $(this).attr("value");
			alt = $(this).attr("alt");
			
			if (val == alt) {
				$(this).attr("value" , "");
			}
		}
	).focusout(function(){
		
			$(this).parent().parent().parent("span").removeClass("active-field");
			
			valNew = $(this).attr("value");
			
			if (valNew == "") {
				$(this).attr("value" , alt);
			} else {
				$(this).attr("value" , valNew);
			}
		}
	);
	
		

		
		
		
		
});
