/******************************************************************

 playbackHTML.htm

 - This file contains the shared html that hosts the flash 
   conversations. It makes use of javascript variables that 
   are set in the other js files included in the conversation 
   html file.
   
 - variables are:
 	1. clientDirName: name of directory where conversation 
 	hosting pages (i.e. betablockers.htm ) and configuration
 	data for a specific client are stored. The product is
 	shipped with one directory named 'default'.
 	2. sharedImagesDir: directory where images that are
 	shared across multiple conversations are stored.
 	3. conversationsDir: the path/name of the directory where 
 	all conversations are stored.
 	4. conversationName: The name of the directory where 
 	a single conversation along with its mpeg and 
 	swf files are stored.
 	5. rootClientDir: The paht/name of the directory that
 	is the root of all client directories. This variable is 
 	set in 'commondata/lib/js/paths.js'.

 - copyright 2009 Healthwise, Inc.

 - created January 12, 2009

******************************************************************/

page = '<title>' + pageTitle +'</title> ';
page += ' <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
page += ' <script type="text/javascript"> ';
page += '	var flashvars =';
page += '		{clientImagesDataDir: "' + rootClientDir  + clientDirName + '/clientdata/clientimages/", ';
page += '		sharedImagesDataDir: "' + sharedImagesDir + '", ';
page += '		commonDataFile: "' + rootClientDir  + clientDirName + '/clientdata/common.xml", ';
page += '		summaryPageDataDir: "../summarypage/"';
if ( surveyURL != null )
page += '		, surveyURL: "' + surveyURL + '"';
if ( condition != null )
page += '		, condition: "' + condition + '"';
if ( allAboutID != null )
page += '		, allAboutID: "' + allAboutID + '"';
if ( userID != null )
page += '		, userID: "' + userID + '"';

page += '	}; ';
page += '	var params = ';
page += '		{ allowScriptAccess: "sameDomain", ';
page += '		base: "' + conversationsDir + conversationName + '/module" }; ';
page += '	var attributes = ';
page += '		{ name: "HWConversation", ';
page += '		id: "HWConversation", ';
page += '		align: "middle", ';
page += '		bgcolor: "#000000" }; ';
page += '	swfobject.embedSWF( "' + conversationsDir + conversationName + '/module/Playback.swf", "altContent", "' + movieWidth + '", "' + movieHeight + '", "8.0", "../../../commondata/lib/expressInstall.swf", flashvars, params, attributes); ';
page += '</script> ';
var winHeight = movieHeight + 220;
var winWidth = movieWidth + 80;
page += '<script language="javascript" type="text/javascript"> ';
page += '	window.resizeTo( ' + winWidth +' , ' + winHeight + '); ';
page += '</script> ';
page += '<form name="FlashMovie"> ';
page += '<table id="FlashTable"  border="1" bordercolor="white"> ';
page += '	<tr> ';
page += '		<td > ';
page += '			<table border="1" height="100%"> ';
page += '				<tr><td> ';
page += '					<div id="altContent"> ';
page += '						<p>You need to install the latest Flash Plugin and make sure that Javascript is enabled in order to view this conversation.</p> ';
page += '						<ol> ';
page += '							<li>Install the Adobe Flash plugin located <a href="http://get.adobe.com/flashplayer/">here</a>.</li> ';
page += '							<li>If the conversation still does not play, open your browser settings and make sure that javascript is enabled.</li> ';
page += '						</ol> ';
page += '					</div> ';
page += '				</td></tr> ';
page += '			</table> ';
page += '		</td> ';
page += '	</tr> ';
page += '</table> ';
page += '</form> ';

document.write( page );
