jQuery(document).ready(function($) {
	$(".iframeColorbox").colorbox({iframe:true, innerWidth:800, innerHeight:600});
	
	$("table tr:odd").css({'background-color':'#4d4730'});
	
	$("#video .videoOverlay").hover(function() {
		$(this).animate({opacity: 1});
	},
	function() {
		$(this).animate({opacity: 0.5});
	});
	
	$("#translation_bar #flag_en").find("img").remove();
	$("#translation_bar #flag_en").html("ENGLISH");
	$("#translation_bar #flag_en").after("<span>|</span>");
	$("#translation_bar #flag_es").find("img").remove();
	$("#translation_bar #flag_es").html("ESPANOL");
	
	var FullscreenrOptions = {  width: 1920, height: 1200, bgID: '#bgimg' };
	$.fn.fullscreenr(FullscreenrOptions);
	
	var homeLeftHeight = $("#homeBottomContainer #leftContainer").height();
	var homeRightHeight = $("#homeBottomContainer #rightContainer").height();
	if(homeLeftHeight > homeRightHeight) { $("#homeBottomContainer #rightContainer").height(homeLeftHeight); }
	else { $("#homeBottomContainer #leftContainer").height(homeRightHeight); }
	
	
	$('#menu-header-nav li a')
	.css( {backgroundPosition: "0 0"} )
	.mouseover(function(){
		$(this).stop().animate({backgroundPosition:"(0 -180px)", opacity: 1}, {duration:300});
		$(this).children(".sub").stop().animate({color: "#f0c40e"});
	})
	.mouseout(function(){
		$(this).stop().animate({backgroundPosition:"(0 0)", opacity: 0.5 }, {duration:500});
		$(this).children(".sub").stop().animate({color: "white"});
	})
	
	 $('#loopedSlider #navigation div').hover(
		function() {
			$(this).stop().animate({opacity: 0.8});
		},
		function() {
			$(this).stop().animate({opacity: 0.5});
	});
	$("#ssm li a, #sidebar a").hover(
		function() {
			$(this).stop().animate({color: "#F0C40E"},'fast');
		},
		function() {
			$(this).stop().animate({color: "#EAE2BB"},'fast');
		}
	);
	$("#sidebar .catIcon").hover(
		function() {
			$(this).find(".catName").stop().animate({color: "#F0C40E"},'fast');
		},
		function() {
			$(this).find(".catName").stop().animate({color: "#EAE2BB"},'fast');
		}
	);
	$(".corporate_wellness #sidebarNav li a").hover(
		function() {
			$(this).stop().animate({color: "#00aeef"},'fast');
		},
		function() {
			$(this).stop().animate({color: "#EAE2BB"},'fast');
		}
	);
	$(".executive_services #subMenu a, .executive_services #footer ul li a").hover(
		function() {
			$(this).stop().animate({color: "#f0c40e"},'fast');
		},
		function() {
			$(this).stop().animate({color: "#FFFFCC"},'fast');
		}
	);
	$(".corporate_wellness #subMenu a, .corporate_wellness #footer ul li a").hover(
		function() {
			$(this).stop().animate({color: "#f0c40e"},'fast');
		},
		function() {
			$(this).stop().animate({color: "#eae2bb"},'fast');
		}
	);
	$(".peak_performance #subMenu a, .peak_performance #footer ul li a").hover(
		function() {
			$(this).stop().animate({color: "#f0c40e"},'fast');
		},
		function() {
			$(this).stop().animate({color: "#ff3d00"},'fast');
		}
	);	
	$(".default #subMenu a").hover(
		function() {
			$(this).stop().animate({color: "#f0c40e"},'fast');
		},
		function() {
			$(this).stop().animate({color: "white"},'fast');
		}
	);
	
	$(".default #footer ul li a").hover(
		function() {
			$(this).stop().animate({color: "#f0c40e"},'fast');
		},
		function() {
			$(this).stop().animate({color: "#959595"},'fast');
		} 
	);
	/*var subHomeBlogHeight = $("#subHomeBlogWrap").height();
	var subHomeSidebarHeight = $("#subHomeSidebar").height();
	if(subHomeBlogHeight >= subHomeSidebarHeight) { $("#subHomeSidebar .sidebarContent").height(subHomeBlogHeight-29);} */
	
	var subHomeWidgetMax = 0;
	$("#subHomeBottomWidgets .subHomeWidget").each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > subHomeWidgetMax) { subHomeWidgetMax = thisHeight; }
	});
	$("#subHomeBottomWidgets .subHomeWidget").height(subHomeWidgetMax);
		
	var sidebar = setInterval(function(){
		$("#sidebarNav").slideDown();
		clearInterval(sidebar);
	},1000);
	
	$("#accordion").accordion({header: '.accordionHead', autoHeight: false, 
		create: function(event, ui) {
			var accordionHeight = $("#contentWrap").height();
			$("#sidebar").css("height",accordionHeight+135);
		}	
	});
	
	$('.ui-accordion').bind('accordionchange', function(event, ui) {
		var accordionHeight = $("#contentWrap").height();
		$("#sidebar").animate({height: accordionHeight+135},{queue: false});
	});

	$(".staffTabs ul li").hover(
		function() {
			$(this).find(".staffOverlay").animate({"opacity":0},300);
		},
		function() {
			$(this).find(".staffOverlay").stop().animate({"opacity":0.7},500);
		}
	); 
	
	$(".staffTabs ul li a").click(function() {
		$(this).parent().addClass("ui-state-active");
	});

	$("#tabs").tabs({ 
		fx: { opacity: 'toggle', height: 'toggle'},
		show: function(event, ui) {
			$("#sidebar").animate({"height": $("#contentContainer").height() });
		}
	 });
	var pageContentHeight = $("#pageContainer #contentContainer").height();
	var pageSidebarHeight = $("#pageContainer #sidebar").height();
	if(pageContentHeight > pageSidebarHeight) { $("#pageContainer #sidebar").height(pageContentHeight); }
});

jQuery.noConflict(); if (typeof(window.$) === 'undefined') { window.$ = jQuery; } 


