	Slideshow.count = 0;
	function Slideshow( resource, settings ) {
		Slideshow.count++;
		this.resource = resource;
		this.settings = settings;
		
		this.location = ( this.resource.swfPath != undefined ) ? this.resource.swfPath : '' ;
		this.swfLocation = this.location + 'slideshow.swf';
		this.resourceString = '';
		this.name = "slideshow";
		this.id = this.name + Slideshow.count;
		
		this.height = 550;
		if ( resource.height != undefined ) 
			this.height = resource.height;
		else resource.height = this.height;
		
		this.width = 400;
		if ( resource.width != undefined ) 
			this.width = resource.width;
		else resource.width = this.width;
		this.colour = ( settings == null || this.settings.colour == undefined) ? "000000" : this.settings.colour;
		
		this.params = {
			'allowScriptAccess': 	'always',
			'movie':				this.swfLocation,
			'FlashVars':			this.resourceString,
			'quality':				'high',
			'bgcolor':				'0x' + this.colour,
			'wmode':				'transparent'
			};
		this.code = '';
		
		this.prepare = function() {
			for( var key in this.resource ) {
				this.resourceString += key + '=' + resource[key] + "&";
			}
			this.params.FlashVars = this.resourceString;
			
			this.code = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" "
				+ "codebase=\"http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0\" "
				+ "width=\"" + this.width + "\" height=\"" + this.height + "\" id=\"" + this.id + "\" align=\"middle\">\n";

			for( var key in this.params )
				this.code += "\t<param name=\"" + key + "\" value=\"" + this.params[key] + "\" />\n";
			
			this.code += "<embed src=\"" + this.swfLocation + "\" FlashVars=\"" + this.resourceString + "\" quality=\"" + this.params.quality + "\" "
					+	"bgcolor=\"#" + this.colour + "\" width=\"" + this.width + "\" height=\"" + this.height + "\" name=\""+ this.name +"\" "
					+	"align=\"middle\" allowScriptAccess=\"" + this.params.allowScriptAccess + "\"  wmode=\""+ this.params.wmode +"\""
					+	"type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" />\n";
			this.code += "</object>\n";
		}
		
		this.place = function() {
			this.prepare();
			document.write( this.code );
		}
	}
