// JavaScript Document
$(function() {
	//alert($("#menuCol3").height());
	var menuHeight = Math.max($("#menuCol1").height(),$("#menuCol3").height()) - 30;
	var clinicsHeight = $("#menuClinicsContent").height();
	
	//alert(menuHeight);
	
	
	$("#menuClinicsContent").height(menuHeight);
	
	$("#menuCol2").hover(
		function() {
			// over
			$("#menuClinicsContent").animate({height: clinicsHeight}, "normal", "swing");
			$("#menuClinicsFade").animate({bottom: -40}, "normal", "swing");
			//$("#menuClinicsFadeContainer").fadeOut();
		},
		function() {
			// out
			$("#menuClinicsContent").animate({height: menuHeight}, "normal", "swing");
			$("#menuClinicsFade").animate({bottom: 0}, "normal", "swing");
			//$("#menuClinicsFadeContainer").fadeIn();
		}
	);

});

function switchMedia(show) {
	//alert(show);
	
	/*
	var m = $("#"+show);
	var position = m.position();
	var newTop = (position) ? -position.top : 0;
	$("#mediaContent").animate({top: newTop}, "normal", "swing");
	*/
	
	//$(".mediaBlock").fadeOut("fast", function() { $("#"+show).fadeIn(); })
	$(".mediaBlock").hide();
	$("#"+show).show();
	
	$(".mediaArrow").html('&ndash;');
	$("#"+show+"Arrow").html("&lt;");
}

function swapImage(image) {
	/* this is a simple mouse over script for vidoe screenshots */
	document.getElementById("screenshot-" + image).src = "images/video-screengrabs/" + image + "-over.gif";
}

function swapImageReset() {
	document.getElementById("screenshot-2010-Wrapup-Video-Animation").src = "images/video-screengrabs/2010-Wrapup-Video-Animation_0.jpg";
	document.getElementById("screenshot-coldsmoke-teaser-2010").src = "images/video-screengrabs/coldsmoke-teaser-2010.gif";
	document.getElementById("screenshot-coldsmoke-slideshow-2010").src = "images/video-screengrabs/coldsmoke-slideshow-2010.jpg";
	document.getElementById("screenshot-coldsmoke-slideshow-2009").src = "images/video-screengrabs/coldsmoke-slideshow-2009.gif";
	/*document.getElementById("screenshot-coldsmoke-slideshow-2008").src = "images/video-screengrabs/coldsmoke-slideshow-2008.gif";*/
}

playVideo = function() {
	
	var jwplayer = document.getElementById('video2009playerobj');
	jwplayer.sendEvent("PLAY","true");
	alert('play');
}