var VideoPlayer = {
	
	videos:		[],
	
	
	init:		function(data)	{
		if (!data)	var data = this.data;

		// prepare player for this videos
		for(var i=0; i < data.length; i++)	{
			var id = data[i].videoID;
			this.videos[id] = data[i].cryptID;
			$('profileVideo_' + id).addEvent('click', this.showVideo.bind(this, id));
			$('profileVideo_' + id).addClass('cursorHand');
		}
	},
	
	getPlayerCode:		function(id)	{
		var file = this.videos[id];
		var playerCode = this.videoPlayerCode1 + file + this.videoPlayerCode2;
		return playerCode;
	},
	
	showVideo:		function(id)	{
		//if (this.lastWindow) this.lastWindow.close();
		var player = window.open('/user/videoPlayer/id/' + id + '/cryptID/' + this.videos[id]  + '/?' + SID, 'VideoPlayer','width=320,height=280,status=no,location=no');
		if (window.focus)	player.focus();
	}
	
		
}


