// FLASH PLAYER STATES
var FP_STATE_NOTLOADED = 1;
var FP_STATE_LOADED = 2;
var FP_STATE_PLAYING = 4;
var FP_STATE_END = 8;
var FP_STATE_STOP = 16;
var FP_STATE_PAUSE = 32;
var FP_STATE_RESUME = 64;

// CALLS TO FLASH PLAYER
function flashPlayer(id, swf, width, height) {	
		this.flashswf = swf;
		this.flashId = id;
		this.flash_width = width || "482";
		this.flash_height = height || "398";
		this.init();

};

flashPlayer.prototype.call = function (name, param) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	var obj = (isIE) ? window[this.flashId] : document[this.flashId];
	obj.call(name, param);
};

flashPlayer.prototype.init = function () {
	if($('flashcontent') != null)
	{
		window[this.flashId] = new Object();
		var so = new SWFObject(noCacheIE(this.flashswf), this.flashId, this.flash_width, this.flash_height, "7.0.19", "#000000");		
		so.addParam("quality", "high");
		so.addParam("allowScriptAccess", "always");
		so.addParam("allowFullScreen", "true");
		so.write("flashcontent");
	}
};	

// CALLS FROM FLASH PLAYERS
function FP_onNext(skip) {
	$I.playNextVideo(true);
};

function FP_onPrevious() {
	$I.playPreviousVideo(true);
};

function FP_onPlayComplete() {
	$I.setPlayerState(FP_STATE_END);
	$I.playNextVideo(false);
};

function FP_onPlayerReady(state) {	
	$I.setPlayerState(FP_STATE_LOADED);
	if (state == true) {
	// PLAYING VIDEO, DO NOTHING
	
	} else {
	// NOT PLAYING VIDEO, PLAY FIRST IN QUEUE
		
	};
};

function FP_updatePlayerStatus(state) {
	$I.setPlayerState(state);
};

function FP_onPause(value) {
	$I.playerOnPause(value);
};