﻿
	//Global Player variable
	var player;

	function playerReady(obj) 
	{
		//Determine if the Player is ready so we can load a subsequent video
		//and set the pointer to the player
		
		//alert('the videoplayer '+obj['id']+' has been instantiated');
		player = document.getElementById(obj['id']);
	};
	
	function loadVideo(vfile,vimage)
	{
		//Replace the current Video with the one they clicked on
		player.sendEvent('load', {file:vfile, image:vimage});
		player.sendEvent('autostart', 'true');
		player.sendEvent('play');
		toTop();
	};

	function loadVideoPlaylistItem(item)
	{
		//Replace the current Video with the one they clicked on
		//Playlist items are 0 based (first one is 0, 2nd one is 1, etc.)
		player.sendEvent('item', item);
		toTop();
	};


	function toTop() {
	        self.scrollTo(0, 0)
	}



