$(document).ready(function() {
		
		var action = ("&file=On_Management_Consulting_Delivery.flv&image=jw/On_Management_Consulting_Delivery.jpg&fs=1&stretching=fill");
		var so = new SWFObject('jw/player.swf','mpl','450','274','8');
		so.addParam('allowscriptaccess','always');
		so.addParam('allowfullscreen','false');
		so.addParam('wmode','transparent');
		so.addParam('flashvars',action);
		so.write('player');
		
		$('.videoContainer').click(function() {
               
			//Specify active thumbnail image
			var img = $(this).attr("id");
			
			//Hide All Information Content
			$('.info').each(function() {
				   $(this).hide();
			});
			
			//Remove all active buttons
			$('.sacrificialLamb').each(function() {
				   $(this).attr("class", $(this).attr("class").replace("sacrificialLamb", ""));
			});
			
			//Remove all active buttons
			$('.videoContainer_active').each(function() {
				   $(this).attr("class", $(this).attr("class").replace("_active", ""));
			});
			
			//Set the active button
			$(this).attr("class", $(this).attr("class").replace("videoContainer", "videoContainer_active"));
			
			//IF statment to tell if the item is an image or video. Must manually enter in new IDs
			if (img == "flash_fpo2" || img == "flash_fpo3") {
				// IS IMAGE
				//$("#player").html() == ("<img src='images/content/"+img+".jpg' />");
				var previewimage = ("<img src='templates/theme/default/images/content/"+img+".jpg' />");
				$("#player").html(previewimage);
			} else {
				//IS VIDEO
				var action = ("&file="+img+".flv&image=jw/"+img+".jpg&fs=1&autostart=true&stretching=fill");
				var so = new SWFObject('jw/player.swf','mpl','450','274','8');
				so.addParam('allowscriptaccess','always');
				so.addParam('allowfullscreen','false');
				so.addParam('wmode','transparent');
				so.addParam('flashvars',action);
				so.write('player');
			};
        });
});

