function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
function myFocus(element) {
 if (element.value == element.defaultValue) {
   element.value = '';
 }
}
function myBlur(element) {
 if (element.value == '') {
   element.value = element.defaultValue;
 }
}
function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

$(document).ready(function() {
	//$('#slide').innerfade({
	//	speed: 'slow',
	//	timeout: 7000,
	//	type: 'sequence',
	//	containerheight: '271px'
	//});
	$('#sidebar ul li:last-child').addClass('end');
	$('#sidebar li.on').parent().parent().addClass('on');
	//equalHeight($("#boxes .box"));
	// Colorbox for attorneys page
	$(".related").colorbox({width:"669px", height:"590px", inline:true, href:"#relatedvideos"});
	$("a[rel='gallery']").colorbox({transition:"fade"});
	$(".address a").colorbox({width:"80%", height:"80%", iframe:true});
	$("#photo .video").colorbox({width:"60%", height:"60%", iframe:true});
	$(".colorbox").colorbox({width:"750px", height:"500px", iframe:true});
	
	$('#relatedvideos ul li:odd').addClass('odd');
	
	
	/// Videos
	
	$('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'all') {
			$('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('ul#portfolio li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});

