//v1.0
// 	Name: JStoFlashInterface.js
// 	Desc: Exteranl JavaScript Interface for communitcating to Flash Player
// 			primarily for loading videos and images into FRI header
//	Author: Jeff Boothe
// 	Date: Jan 10, 2009

/*
*	getFlashObject()
*	@movieName: reference to the 'id' of the Flash Movie
*	returns: object reference to the Flash Movie
*/
function getFlashObject(movieName) {
	return document[movieName];
	//var isIE = navigator.appName.indexOf("Microsoft") != -1;
	//return (isIE) ? window[movieName] : document[movieName];
}

/* 	playStandaloneMedia()
*	@mediaTitle:String title text displayed above the movie- use "" for no title
*	@mediaUrl:String url is file path from root of site
*	@mediaParams:String pipe delimited string of params
*		ex: w:483|h:273|x:250|y:86|autoPlay:false|firstImgUrl:media/imageMedia/media_img_name.jpg|lastImgUrl:media/imageMedia/media_img_name2.jpg
*		-@w:int width of media 
* 		-@h:int height of media 
*		-@x:int x pos of movie 
*		-@y:int y pos of movie 
* 		-@autoPlay:boolean
*		-@firstImgUrl:String img path (from site root) to display in first frame of movie while waiting for user input
*		-@lastImgUrl:String  img path (from site root) to display in last frame after the movied finishes
*	@captionFile:String the file name of the caption xml file excluding the '_es' the underscore and language suffix; def dir is xmlData/captions/
*	@captionParams:String pipe delimited string of params
*		ex: w:480|h:40|x:2|y:300|textSize:13|textColor:0x999999|textBold:true|textAlign:left
*		-@w:int width of caption text area 
* 		-@h:int height of caption text area
*		-@x:int x pos of caption text area
*		-@y:int y pos of caption text area
*		-@textSize:int point size of caption text
* 		-@textColor:int hexidecimal color value for caption text
*		-@textBold:boolean true false to format caption text bold
*		-@textAlign:String caption text alignment left, right, center, justify
*/
function playMedia(mediaTitle, mediaUrl, mediaParams, captionFile, captionParams) {  	 	
	//alert('mediaTitle:'+ mediaTitle +', mediaUrl:'+ mediaUrl +', mediaParams:'+ mediaParams+', captionFile:'+ captionFile+', captionParams:'+ captionParams );
	getFlashObject("videoPlayer").callStandalonePlayer(mediaTitle, mediaUrl, mediaParams, captionFile, captionParams);
}
