/*
container for flash player obj used for onload function
*/
function flv_player(path){
	var width = 629;//630;
	var height = 356;//270;
	var no_flash = document.getElementById('no_flash');
	var player = new SWFObject(path+"media/swf/flvplayer/vidPlayer.swf", "videoPlayer", width, height, "8", "#FFFFFF", true);
	player.addParam("wmode", "transparent"); 
	player.addParam("menu", "false"); 
//	so.addParam("wmode", "transparent");
	player.addParam("allowScriptAccess", "always");
	player.write("flv_player");
	no_flash.style.display = 'block';
}

/*
Play flash video on flash player
*/
function play_flash_video(id, video, trackLabel){
	// Use a variable to reference the embedded SWF file.
    var flashVideoPlayer;

    /* Check whether the browser is IE. If so, flashVideoPlayer is
	window.videoPlayer. Otherwise, it's document.videoPlayer. The
	videoPlayer is the ID assigned to the <object> and <embed> tags. */
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    flashVideoPlayer = (isIE) ? window[id] : document[id];

    /* When the user clicks the play button in the form, and call the playVideo() function within the SWF file, passing it the URL of the FLV file. */
    flashVideoPlayer.playVideo(video, trackLabel);
	//alert(video+',trackLabel:'+trackLabel);
}

function play_mp4_video(swfid, videoURL, mediaName, bannerURL ){
    var flashVideoPlayer;

    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    flashVideoPlayer = (isIE) ? window[swfid] : document[swfid];

    flashVideoPlayer.playVideo(videoURL, mediaName, bannerURL);
	//alert(videoURL+',mediaName:'+bannerURL);
}


/*
Play video in flash player
*/
function play_video(path,folder,vidname,wait){

  var ep_dir = 'http://flash.sonypictures.com/video/movies/thehotticket/';
	var vid_id = 'videoPlayer';
  folder = String(folder);
	vidname = String(vidname);
	var season = vidname.substr(0,1);
	var vid_file = vidname+'.flv';

	if(!wait)
		wait = 0;
	window.setTimeout('play_flash_video(\''+vid_id+'\',\''+ep_dir+folder+'/'+vid_file+'\',\''+vidname+'\')',wait);//wait for flash player to load
}



function playmp4(vidname,mediaName,banner,wait){

  var ep_dir = 'http://flash.sonypictures.com/video/movies/';
	var vid_id = 'videoPlayer';
  //folder = String(folder);
	vidname = String(vidname);
	var season = vidname.substr(0,1);
	var vid_file = vidname+'.mp4';

	if(!wait)
		wait = 0;
	window.setTimeout('play_mp4_video(\''+vid_id+'\',\''+ep_dir+'/'+vid_file+'\',\''+mediaName+'\',\''+banner+'\')',wait);//wait for flash player to load
}