﻿var showDean=function(){
	$('.dean .flashBackground').flash({
	swf: '/media/personalStories/lipitorVideoShell.swf',
		params:{
			play:true,
			wmode:'transparent'
		},
		flashvars: {
		    swfPath: '/media/personalStories/swfs/videoPlayerDean.swf',
			xmlPath:'/media/personalStories/xml/Dean.xml',
			account:'pfizerlipitor'
		},
		height:302,
		width:563
	});
	$('.steve .videoWindow, .john .videoWindow').slideUp();
	$('.dean .videoWindow').slideToggle();

	$('.dean img, .dean .description').slideUp();
	$('.steve img, .steve .description').slideDown();
	$('.john img, .john .description').slideDown();
	setTimeout(function(){
		$('.dean .flashBackground').prepend('<p class="btnClose">Close</p>');
	},2000);
};

var showSteve=function(){
	$('.steve .flashBackground').flash({
	swf: '/media/personalStories/lipitorVideoShell.swf',
		params:{
			play:true,
			wmode:'transparent'
		},
		flashvars:{
		    swfPath:'/media/personalStories/swfs/videoPlayerSteve.swf',
		    xmlPath:'/media/personalStories/xml/Steve.xml',
		    account:'pfizerlipitor'
		},
		height:302,
		width:563
	});
	$('.dean .videoWindow, .john .videoWindow').slideUp();
	$('.steve .videoWindow').slideToggle();

	$('.steve img, .steve .description').slideUp();
	$('.dean img, .dean .description').slideDown();
	$('.john img, .john .description').slideDown();
	setTimeout(function(){
		$('.steve .flashBackground').prepend('<p class="btnClose">Close</p>');
	},2000);
};

var showJohn=function(){
	$('.john .flashBackground').flash({
	    swf: '/media/personalStories/lipitorVideoShell.swf',
		params:{
			play:true,
			wmode:'transparent'
		},
		flashvars:{
		    swfPath:'/media/personalStories/swfs/videoPlayerJohnShell.swf',
		    xmlPath:'/media/personalStories/xml/JohnShell.xml',
		    account:'pfizerlipitor'
		},
		height:302,
		width:563
	});
	$('.steve .videoWindow, .dean .videoWindow').slideUp();
	$('.john .videoWindow').slideToggle();

	$('.john img, .john .description').slideUp();
	$('.dean img, .dean .description').slideDown();
	$('.steve img, .steve .description').slideDown();
	setTimeout(function(){
		$('.john .flashBackground').prepend('<p class="btnClose">Close</p>');
	},2000);
};

$(document).ready(function(){
	$('.videoWindow').hide();
	$('.story img').click(function(){
		$('.flashBackground').html('');
		if ($(this).parent().hasClass('dean')) {
			showDean();
		} else if ($(this).parent().hasClass('steve')) {
			showSteve();
		} else if ($(this).parent().hasClass('john')) {
			showJohn();
		}
	});
	$('p.btnClose').live('click', function(){
		$('.flashBackground').html('');
		$('.videoWindow').slideUp();
		$('.story img, .story .description').slideDown();
	});
});