/**
 * Flash class container
 * @access public
 * @static
 */

var Flash = {};


/**
 * Flash detector class
 * @access public
 * @static
 */

Flash.Detector = {

	
	/**
	 * Detected flash version
	 * @access public
	 * @static
	 * @var Int If -1 not detected
	 */
	
	version 	: -1,
	
	
	/**
	 * Initialize. Do detection and assign detected version
	 * to Flash.Detector.version
	 * @access public
	 * @static
	 * @return Void
	 */
	
	init : function() {
	
		// Having ActiveXObject, try to detect with it
		if( window.ActiveXObject ) {
		
			for( var idx = 10; idx > 0; idx-- ) {
					
				try{
					new window.ActiveXObject( 'ShockwaveFlash.ShockwaveFlash.' + idx );
					this.version = idx;
					break;
				} catch( oError ) {
					// Exception
				}
			
			}
		
		// If having plugin
		} else if( navigator.plugins && navigator.plugins['Shockwave Flash'] && navigator.plugins['Shockwave Flash'].description ) {
		
			var matches = navigator.plugins['Shockwave Flash'].description.match( /([0-9]+)\.[0-9]+/ );
			
			if( matches[1] && ! isNaN( parseInt( matches[1] ) ) ) {
				this.version = parseInt( matches[1] );
			}
		
		}
	
	}
	

}

// Automatic detection
Flash.Detector.init();

var do_flash_detect = true;
if( top.frames.length > 0 ){
	do_flash_detect = false;
}
