//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 声明命名空间
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
AE.namespace("AE.run.alipay.home");
AE.namespace("AE.app");

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// flash-banner 初始化
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
AE.run.alipay.home.hugeBanner = function(config){
	this.config = {
		flashplayerVersion : 7,	// 支持flashplayer版本
		flashBanner	:	get("flash-banner"),	// flash banner 容器
		imageBanner : get("image-banner") // image banner 容器
	};
	
	this.temp = {};

	// 返回对象
	return this;
};


AE.run.alipay.home.hugeBanner.prototype = {
	// 判断是否支持flash
	isFlashSupport : function(options){	// options : 版本号
			var contentVersion = options.ver; 
			var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? 
			navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0; 
			if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" "); 
				for (var i = 0; i < words.length; ++i){ 
					if (isNaN(parseInt(words[i]))) 
					continue; 
					var pluginVersion = words[i]; 
				} 
				var flashCanPlay = pluginVersion >= contentVersion; 
			}
			else if( window.ActiveXObject ) { 
				  for (var i=contentVersion;i>=2;i--) {
				   try {
				    var fl=eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+i+"');");
				    if (fl) { f=i + '.0'; break; }
				   }catch(e) {}
				  }
					if(fl){flashCanPlay=true;}
			}
			return flashCanPlay;
	},
	
	// 初始化
	init : function(customConfig){
			// 合并配置
			this.config = YL.merge(this.config,customConfig||{});
			// 定义_self
			var _self = this;var config = this.config;
			
			// 根据元素是否存在决定是否退出
			if(!config.flashBanner){
				if(!config.imageBanner)return;
				config.imageBanner.style.display = "";
				return;
			}
			
			// 显示图片或flash
			if(_self.isFlashSupport({ver:config.flashplayerVersion})){
				config.flashBanner.style.display = "";
			}else{
				config.imageBanner.style.display = "";
			}
	}

};

// 提取为APP
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// current 定位脚本
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
AE.app.urlCurrent = function(config){
	this.config = {
		rules : {
				"menu-1" : {regx:"fdsfs1",className:"step-2"},
				"menu-2" : {regx:"dsfsd2",className:"step-2"}
		}
	};
	

	//delete this.config.rules["menu-1"];

	for(i in this.config.rules){
		alert(i + " = " + this.config.rules[i]);
	}

	
	this.temp = {};

	// 返回对象
	return this;
}


//var s = (new AE.app.urlCurrent());