var ContentVideoModule = new Object();

ContentVideoModule.viewerLoaded = function( cof_index, the_index )
{
	var the_framework = ContentObjectFactory.getFrameworkFromIndex(cof_index);
	var the_module = document.getElementById( 'cof_block_' + cof_index + '_' + the_index );
	var the_videos = document.getElementsByClassName( 'cof-video', the_module );
	
	for( var i = 0; i < the_videos.length; i++ )
	{
		var the_id = the_videos[i].id;
		var resourceID = the_id.slice( the_id.lastIndexOf('_') + 1);
		var video_url = the_framework.getUrl() + '/video/' + resourceID;

		var moviestring = diva.baseURL + '/apps/flvplayer.swf?autostart=false&file=' + video_url;
		var FO = { movie: moviestring, quality:"high", bgcolor:"white", wmode:"transparent", width:"320", height:"240", majorversion:"8", build:"0" };
		UFO.create(FO, the_id);
	}
}

ContentVideoModule.getInputList = function ( cof_index, the_index )
{
	return new Array( 
		'cof_files_' + cof_index + '_' + the_index + '_0',
		'cof_videodescr_' + cof_index + '_' + the_index
	);
}

ContentVideoModule.getRules = function()
{
	var self = this;

	var my_rules = {
		'.cof-video-remove' : function(el)
		{
			el.onclick = function()
			{
				BasicControlDisable.removeControlsClick( el, self );	
			},
			
			el.onkeypress = function(e)
			{
				return ContentObjectFactory.doKeyPress( el, e );
			};	
		}
	};

	return my_rules;
}