function _ovp(){}; 
function OmniVideoPlayer(){}; 
		 OmniVideoPlayer.prototype = new _ovp();

	_ovp.prototype.init = function(){
		//Events that are broadcast FROM the video player
		this.VIDEO_START 		= "onVideoStart";
		this.VIDEO_CHANGE		= "onVideoChange";
		this.VIDEO_COMPLETE 	= "onVideoComplete";
		this.ADVERT_START		= "onAdvertStart";
		this.ADVERT_END 		= "onAdvertEnd";
		this.COMPANION_AD		= "onCompanionAdvert";
		this.VIDEO_PAUSED		= "onVideoPaused";
		this.VIDEO_UNPAUSED		= "onVideoUnpaused";
		this.CONNECTION_FAILURE = "onConnectionFailure";
		this.STREAM_NOT_FOUND	= "onStreamNotFound";
		this.DEBUG				= "onDebug";
		
		this.SWFID 				= 'OmniVideoPlayerScreen';
		var allEvents = [this.DEBUG, this.VIDEO_START, this.VIDEO_CHANGE, this.VIDEO_COMPLETE, this.ADVERT_START, this.ADVERT_END, this.COMPANION_AD, this.VIDEO_PAUSED, this.VIDEO_UNPAUSED, this.CONNECTION_FAILURE, this.STREAM_NOT_FOUND];
		this.buildEventQueues(allEvents);
		
		//Events that are broadcast TO the video player via the trigger() function
		this.PAUSE 				= "pausePlayback";
		this.PLAY				= "resumePlayback";
		this.TOGGLE_PLAY_PAUSE	= "onPlaybackToggled";
		this.LOAD_VIDEO			= "loadVideo";
	};
	_ovp.prototype.buildEventQueues = function( arr ){
		var t = arr.length;
		this.events = {};
		for(var i=0; i<t; i++){
			this.events[arr[i]] = [];
		}
	};
	_ovp.prototype.registerListener = function( eventName, obj ){ // :String, :Function
		var alreadySubscribed = false;
		var evt = this.events[eventName];
		if( typeof(obj) == 'function' ){
			if(evt != undefined){
				var t = evt.length;
				for(var i=0; i<t; i++){
					if(evt[i] == obj){
						alreadySubscribed = true;
					}
				}
				if(!alreadySubscribed){
					evt.push( obj );
				}
			}else{
				//alert('Attempting to register invalid event name.');
			}
		}else{
			//alert('Attempting to register an object other than a function');
		}
	};
	_ovp.prototype.unregisterListener = function( eventName, obj ){ // :String, :Function
		try{
			var evt = this.events[eventName];
			if(evt != undefined){
				var t = evt.length;
				//otherwise prototype an array.filter() method
				for(var i=0; i<t; i++){
					if(evt[i] == obj){
						evt = evt.splice(i, 1);
						break;
					}
				}
			}
		}catch(e){};
	};
	_ovp.prototype.proxyOutgoingFlashEvent = function( evt, args ){
		try{
			var event = this.events[evt];
			if(event){
				var t = event.length;
				for(var i=0; i<t; i++){
					event[i]( args );
				}
			}
		}catch(e){};
	};
	_ovp.prototype.getCurrentPlaying = function(){
		return document.getElementById(this.SWFID).getCurrentPlaying();
	};
	_ovp.prototype.trigger = function( evt, args ){
		document.getElementById(this.SWFID).trigger( evt, args );
	};
	
	_ovp.prototype.testEventBroadcast = function( eventName, args ){
		this.proxyOutgoingFlashEvent(eventName, args)
	};


