	var flashvars;
		function embedVideoPlayer(idToReplace, vvideo, vwidth, vheight, vautoPlay, splashUrl) {
			//this player is FlowPlayer - http://flowplayer.org/

			var cSplashUrl = "";
			var cVAutoPlay = vautoPlay;
			var cSplashUrlConfigTxt = "";
			if(splashUrl != null && splashUrl != "")
			{
				cSplashUrl = splashUrl;
				cVAutoPlay = false;
				cSplashUrlConfigTxt = "splashImageFile: '" + cSplashUrl + "',"; 
			}
			flashvars = {
				 config: "{ " + cSplashUrlConfigTxt + " showVolumeSlider: false, loop: false, controlsOverVideo: 'ease', controlBarBackgroundColor: -1, controlBarGloss: 'low', showFullScreenButton: false, showMenu: false, showVolumeSlider: true, autoPlay: " + cVAutoPlay + ", initialScale: 'fit', videoFile: '" + vvideo + "' }" 
			};
			var params = {"wmode":"transparent"};
			var attributes = {};

			swfobject.embedSWF("/Zondervan/include/flowplayer2/FlowPlayerDark.swf", idToReplace, vwidth, vheight, "9.0.0", "/Zondervan/Include/swfobject2.1/expressInstall.swf", flashvars, params, attributes)
		}
		
		function switchVideo(vidUrl, title) {
			$("h2 span").text(title);
			
			$("#videoReplace").replaceWith("<a id=\"videoReplace\"></a>");
			embedVideoPlayer("videoReplace", vidUrl, 740, 416, true);
		}
		
		function embedVideoNumber(videoNumberToLoad, splashUrl, autoPlay)
		{
			var videoNum = parseInt(videoNumberToLoad) - 1;
			var vidPath = $(".vid").eq(videoNum).metadata().videoFile;
			$("h2 span").text($(".vid").eq(videoNum).children("h3").text());
			embedVideoPlayer("videoReplace", vidPath, 740, 416, autoPlay, splashUrl);
			
		}
		$(document).ready(function(){
			$(".vid img").reflect();
			
			$(".nav").corner("10px bottom cc:#000");
			
			$(".vid").corner("round 5px cc:#202020").parent().corner("round 5px cc:#000");
			
			$(".button").corner("round 3px").parent().corner("round 3px")
			
			$(".vid").click(function(){
				var data = $(this).metadata();
				switchVideo(data.videoFile, $(this).children("h3").text());
			});
			
			$(".vid").hover(
				function () {
					$(this).parent().css('background', '#525252');
				}, 
				function () {
					$(this).parent().css('background', '#202020');
				}
			);
			$(".button").hover(
				function () {
					$(this).parent().css('background', '#545454').parent().parent().css('background', '#202020');
				}, 
				function () {
					$(this).parent().css('background', '#2a2a2a').parent().parent().css('background', '#525252');
				}
			);
			var videoToPlay = $.query.get('vid');
			if(videoToPlay == "")
			{
				// setup default
				if ( $("div#start").length > 0 )
				{
					var videoToLoad = $("#start").attr("class");
					var splashUrl = $("#start").text();
					embedVideoNumber(videoToLoad, splashUrl, false);
				}
				else  //assume to load first vid
				{
					embedVideoNumber(1, "", false);
				}
			}
			else
			{
				embedVideoNumber(videoToPlay, "", true);
			}
		});