var panoramicFlash = new Class({
	getOptions: function(){
		return {
            width: 570,
            height: 300,
            destination: '',
            base: null,
            name: '',
            PWViewer: '360flash/PWViewer.swf',
            lwImg: 'resources/',
            lwBgColor: '204,255,255,255',
            iniFile: '',
            progressType: '1',
            swfFile: '',
            allowNetworking: 'all',
            allowScriptAccess: 'always',
            allowFullScreen: 'true',
            scale: 'noscale'
		};
	},

	initialize: function(options){
        this.setOptions(this.getOptions(), options);
        this.options.iniFile = 'config_'+this.options.name+'.bin';

        so = new SWFObject(this.options.PWViewer,this.options.name,this.options.width,this.options.height,"9.0.28","#FFFFFF");
        so.addVariable("base", this.options.base);
        so.addVariable("lwImg", this.options.lwImg);
        so.addVariable("lwBgColor",this.options.lwBgColor);
        so.addVariable("iniFile", this.options.iniFile);
        so.addVariable("progressType", this.options.progressType);
        so.addVariable("swfFile", this.options.swfFile);
        so.addParam("allowNetworking", this.options.allowNetworking);
        so.addParam("allowScriptAccess", this.options.allowScriptAccess);
        so.addParam("allowFullScreen", this.options.allowFullScreen);
        so.addParam("scale", this.options.scale);
        so.write(this.options.destination);
    },

    change: function (options) {
        this.setOptions(this.getOptions(), options);
        this.options.iniFile = 'config_'+this.options.name+'.bin';

        so = new SWFObject(this.options.PWViewer,this.options.name,this.options.width,this.options.height,"9.0.28","#FFFFFF");
        so.addVariable("base", this.options.base);
        so.addVariable("lwImg", this.options.lwImg);
        so.addVariable("lwBgColor",this.options.lwBgColor);
        so.addVariable("iniFile", this.options.iniFile);
        so.addVariable("progressType", this.options.progressType);
        so.addVariable("swfFile", this.options.swfFile);
        so.addParam("allowNetworking", this.options.allowNetworking);
        so.addParam("allowScriptAccess", this.options.allowScriptAccess);
        so.addParam("allowFullScreen", this.options.allowFullScreen);
        so.addParam("scale", this.options.scale);
        so.write(this.options.destination);
    }
})

panoramicFlash.implement(new Options);
