_.Module.define({path:"common/component/image_water/water_flash",requires:[],sub:{initial:function(a){this.options=a;this.imageUrl=a.imageUrl;this.uploadUrl=a.uploadUrl;this.text=a.text||{};this.font=a.font||{};this.EVENTS=["onProgressListen","onComplete","onError"];this.token=+(new Date)},start:function(){this.initFlashvars();this.generateCallBack();this.initUI()},initFlashvars:function(){var c=this.text;var a=this.font;var b=this.imageUrl;this.flashVars=["imageUrl="+encodeURIComponent(this.imageUrl),"uploadURL="+encodeURIComponent(this.uploadUrl),"content="+encodeURIComponent(c.content),"x="+encodeURIComponent(c.x),"y="+encodeURIComponent(c.y),"width="+encodeURIComponent(c.width),"lineHeight="+encodeURIComponent(a.lineHeight||""),"color="+encodeURIComponent(a.color||""),"family="+encodeURIComponent(a.family||""),"size="+encodeURIComponent(a.size||"")].join("&")},initUI:function(){var c=this.flashChecker();var b;var f="flashImageWater"+this.token;var a=$("<div>").appendTo(document.body).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:1,bottom:1});if(!c.hasFlash){this.flashError()}var d='<object id="'+f+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+1+'" height="'+1+'"><param name="allowScriptAccess" value="always" /><param value="transparent" name="wmode"><param name="flashvars" value="'+this.flashVars+'" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+this.options.flashUrl+'" /></object>';var e='<object id="'+f+'" type="application/x-shockwave-flash" data="'+this.options.flashUrl+'" width="'+1+'" height="'+1+'"><param name="allowScriptAccess" value="always" /><param value="transparent" name="wmode"><param name="flashvars" value="'+this.flashVars+'" /></object>';if(navigator.appName.indexOf("Microsoft")!=-1){a.html(d)}else{a.html(e)}this.imageWater=document[f]||window[f]},generateCallBack:function(){var d=this.token;var b=this;for(var c=0;c<this.EVENTS.length;c++){var a=this.EVENTS[c],e=a+d;window[e]=(function(f){return function(g){b.trigger(f,g)}})(a);this.flashVars+="&"+this.decodeCamel(a)+"="+e}},decodeCamel:function(a){return a.replace(/([A-Z])/g,function(c,b){return"_"+b.toLowerCase()})},flashChecker:function(){var hasFlash=false;var flashVersion;var isIE=
/*@cc_on!@*/
0;if(isIE){var swf=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(swf){hasFlash=true;flashVersion=swf.GetVariable("$version")}}else{if(navigator.plugins&&navigator.plugins.length>0){var swf=navigator.plugins["Shockwave Flash"];if(swf){hasFlash=true;flashVersion=swf.description}}}var versionArr=flashVersion.split(",");return{hasFlash:hasFlash,version:flashVersion.match(/\d+/g)}},flashError:function(){$.dialog.alert('\u68c0\u6d4b\u5230\u60a8\u7684\u6d4f\u89c8\u5668\u6ca1\u6709\u5b89\u88c5\u6700\u65b0Adobe Flash Player\u63d2\u4ef6\uff0c\u8fd9\u4f1a\u5f71\u54cd\u60a8\u8bbf\u95ee\u672c\u9875\u9762\u7684\u90e8\u5206\u529f\u80fd\u3002<br /><center>\u8bf7<a href="http://get.adobe.com/cn/flashplayer/" target="_blank">\u70b9\u6b64</a>\u5b89\u88c5</center>')},merge:function(){this.start()}}});