var OnlineUpdater = new Class( {
	initialize: function ( el, path ) {
		this.EL = $( el );
		this.PATH = path;
		var _this = this;
		new Request.JSON( {
			url: this.PATH + "air_version.js",
			onComplete: function ( json ) {
				if( json ) {
					if( json.path && json.version )
						_this.build( json );
				}
			}
		} ).send();
	},
	build: function ( json ) {
		new Swiff( this.PATH + "AIRInstallBadge.swf", {
			width: 215,
			height: 180,
			container: this.EL,
			vars: {
				'airversion': "1.1",
				'appname': json.name,
				'appurl': json.path,
				'appid': json.id,
				'pubid': json.pubid,
				'appversion': json.version,
				'imageurl': this.PATH + encodeURIComponent( json.name ) + ".png",
				'appinstallarg': 'webinstall with OnlineUpdater Mootools Class',
				'applauncharg': 'weblaunch with OnlineUpdater Mootools Class',
				'helpurl': json.help || "./",
				'hidehelp': false,
				'skiptransition': false,
				'titlecolor': '#e4e4e4',
				'buttonlabelcolor': '#eeeecc',
				'appnamecolor': '#e4e4e4',
				'str_err_airswf': '<u>Running locally?</u>'
			}
		} );
	}
} );

