ONEHAT.widget.Gallery = function() {
	var obj = {
		init: function() {
			
			var oThis = this;
			
			
			// Get elements to work with
			this.videos = [
				'PB1',
				'PB2'
			];
			
			// Assign event handlers
			for (var n = 0; n < this.videos.length; n++) {
				this[this.videos[n]] = Ext.get(this.videos[n]);
				this[this.videos[n]].on('click', function(e) {
					oThis.embed(e);
				});
			}
			
		},
		
		embed: function(e) {
			var video = e.getTarget().id;
			
		//	if (Ext.isIE6) {
		//		alert('You are using an unsupported browser. Gallery videos may not work as expected.');
		//	} else {
				swfobject.embedSWF(
					'video/purityBall/' + video + '.swf', 
					video,
					265, // width
					245, // height
					'9.0.0',
					'scripts/purityBall/swfobject/expressInstall.swf', 
					{}, // flashvars
					{ // params
					//	src: 'video/purityBall/' + video + '.swf',
						quality: 'high',
						play: 'true',
						autoplay: 'true',
						loop: 'false',
						scale: 'showall',
						wmode: 'window',
						allowFullScreen: 'true',
						allowScriptAccess: 'sameDomain',
						movie: 'video/purityBall/' + video
					}, { // attributes
						src: 'video/purityBall/' + video,
						quality: 'high',
						play: 'true',
						autoplay: 'true',
						loop: 'false',
						scale: 'showall',
						wmode: 'window',
						allowFullScreen: 'true',
						allowScriptAccess: 'sameDomain',
						movie: 'video/purityBall/' + video
					}
				);
		//	}
		}
	};
	obj.init();
	return obj;
}();

