	Gallery.count = 0;
	function Gallery( xmlConfigFile, width, height ) {
		Gallery.count++;
		this.xmlConfigFile = xmlConfigFile;
		
		this.location = 'extern/' ;
		this.swfLocation = this.location + 'gallery.swf';
		this.resourceString = '';
		this.name = "ae_gallery_" + Gallery.count;
		this.id = this.name; 
		
		this.height = height;
		this.width = width;
		this.colour = "324E63";
		this.params = {
			'allowScriptAccess': 	'always',
			'movie':				this.swfLocation,
			'FlashVars':			this.resourceString,
			'quality':				'high',
			'bgcolor':				'0x' + this.colour,
			'wmode':				'transparent'
		};
		this.resource = {
			'xmlConfigFile': this.xmlConfigFile
		};
		this.code = '';
		
		this.prepare = function() {
			for( var key in this.resource ) {
				this.resourceString += key + '=' + this.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.code += "<div id=\"" + this.id + "_description\" class=\"description\">\n</div>";
			
		}
		
		this.place = function() {
			this.prepare();
			document.write( this.code );
			ae_gallery_pageInit();
		}
	}
	
	
	
	
	
	 var ae_gallery_jsReady = false;
	function ae_gallery_isReady() {
         return ae_gallery_jsReady;
     }
	 
     function ae_gallery_pageInit() {
         ae_gallery_jsReady = true;
      }
	 
	 function ae_gallery_writeDescription(movieID, value) {
		document.getElementById( movieID + "_description" ).innerHTML = value ;
     }