function jfFlashPlayer () {
	this.videoLimit  = 1;
	this.mode        = "singlePlayer";
	this.swfID       = "SinglePlayer";
	this.swfLocation = null;
	this.swfWidth    = null;
	this.swfHeight   = null;
	this.videoData   = [];
	
	//set-up function
	this.setUp      = function (settings) {
		if (typeof settings.videoLimit == "number") this.videoLimit = settings.videoLimit;
		if (settings.mode) this.mode = settings.mode;
		if (settings.swfID) this.swfID = settings.swfID;
		if (settings.swfLocation) this.swfLocation = settings.swfLocation;
		if (settings.swfWidth) this.swfWidth = settings.swfWidth;
		if (settings.swfHeight) this.swfHeight = settings.swfHeight;
	};
	
	//write flash player to page
	//this uses SWFObject
	this.write = function (containerID) {
		if (SWFObject) {
			var player = new SWFObject(this.swfLocation, this.swfID, this.swfWidth, this.swfHeight, "9", "#000000");
			player.addParam('allowfullscreen','true');
			player.addParam('allowscriptaccess','always');
			player.write(containerID);
			
			return true;
		}
		else {
			return false;
		}
	};
	
	//stores data
	this.addVideoData = function () {
		for (var i=0; i<arguments.length; i++) {
			if ((this.videoLimit != 0 && this.videoData.length != this.videoLimit) || this.videoLimit == 0) {
				this.videoData.push(arguments[i]);
			}
		}
	};
	
	//retrieves data
	this.getVideoData = function (index) {
		return this.videoData[index];
	};
	
	//sends data to flash
	this.sendDataToFlashMovie = function (index) {
		if (typeof index != "number") {
			this.flashMovie.SetVariable('/:PlayVideoSelected',this.data.PlayVideoSelected);
			this.flashMovie.SetVariable('/:ForcePlayAmount',this.data.ForcePlayAmount);
			for (var i=0; i<this.videoData.length; i++) {
				//get data
				this.data       = this.getVideoData(i);
			
				//get flash movie object
				this.flashMovie = window.document[this.swfID] ? window.document[this.swfID] : getFlashMovieObject(this.swfID);
			
				//send variables
				this.flashMovie.SetVariable('/:Video'+(i+1)+'VideoURL',this.data.VideoURL);
				if (this.data.ForcePlayAmount) this.flashMovie.SetVariable('/:Video'+(i+1)+'ForcePlayAmount',this.data.ForcePlayAmount);
				if (this.data.ForcePlay1URL) this.flashMovie.SetVariable('/:Video'+(i+1)+'ForcePlay1URL',this.data.ForcePlay1URL);
				if (this.data.ForcePlay2URL) this.flashMovie.SetVariable('/:Video'+(i+1)+'ForcePlay2URL',this.data.ForcePlay2URL);
				if (this.data.ScrubBarOffDuringForcePlay1) this.flashMovie.SetVariable('/:Video'+(i+1)+'ScrubBarOffDuringForcePlay1',this.data.ScrubBarOffDuringForcePlay1);
				if (this.data.ScrubBarOffDuringForcePlay2) this.flashMovie.SetVariable('/:Video'+(i+1)+'ScrubBarOffDuringForcePlay2',this.data.ScrubBarOffDuringForcePlay2);
			}
		}
		else {
			//get data
			this.data       = this.getVideoData(index);
			
			//get flash movie object
			this.flashMovie = window.document[this.swfID] ? window.document[this.swfID] : getFlashMovieObject(this.swfID);
			
			//send variables
			this.flashMovie.SetVariable('/:PlayVideoSelected',this.data.PlayVideoSelected);
			this.flashMovie.SetVariable('/:ForcePlayAmount',this.data.ForcePlayAmount);
			this.flashMovie.SetVariable('/:VideoURL',this.data.VideoURL);
			if (this.data.ForcePlay1URL) this.flashMovie.SetVariable('/:ForcePlay1URL',this.data.ForcePlay1URL);
			if (this.data.ForcePlay2URL) this.flashMovie.SetVariable('/:ForcePlay2URL',this.data.ForcePlay2URL);
			if (this.data.ScrubBarOffDuringForcePlay1) this.flashMovie.SetVariable('/:ScrubBarOffDuringForcePlay1',this.data.ScrubBarOffDuringForcePlay1);
			if (this.data.ScrubBarOffDuringForcePlay2) this.flashMovie.SetVariable('/:ScrubBarOffDuringForcePlay2',this.data.ScrubBarOffDuringForcePlay2);
		}
	};
}
