(function(){Type.registerNamespace("Telerik.Web.UI"); Type.registerNamespace("Telerik.Web.UI.Captcha"); Telerik.Web.UI.RadCaptcha=function(e){Telerik.Web.UI.RadCaptcha.initializeBase(this,[e]); this._audioElement=null; this._objectElement=null; this._audioUrl=null; this._enableAudio=false; this._persistCode=false; this._enableMissingPluginNotification=false; this._enableDownloadAudio=false; this._focusCssClass="rcFocusTxt"; }; $telerik.toCaptcha=function(e){return e; }; $telerik.findCaptcha=$find; Telerik.Web.UI.RadCaptcha.prototype={initialize:function(){Telerik.Web.UI.RadCaptcha.callBaseMethod(this,"initialize"); var e=this.get_textBox(); if(e){e.setAttribute("autoComplete","off"); this._focusTxtDelegate=Function.createDelegate(this,this._focusTxtHandler); $addHandler(e,"focus",this._focusTxtDelegate); this._blurTxtDelegate=Function.createDelegate(this,this._blurTxtHandler); $addHandler(e,"blur",this._blurTxtDelegate); }if(this.get_enableAudio()){this._initCaptchaAudio(); this._managePluginNotificationVisibility(!this._captchaAudio.canPlay&&this._enableMissingPluginNotification); this._manageDownloadLinkVisibility(this._enableDownloadAudio); this._manageAudioLinkVisibility(!(!this._captchaAudio.canPlay&&this._enableDownloadAudio)); this._setupAudioLink(); this._setAudioUrlDelegate=Function.createDelegate(this,this._setAudioUrl); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._setAudioUrlDelegate); }this.raiseEvent("load",Sys.EventArgs.Empty); },dispose:function(){if(this.get_audioLink()){$clearHandlers(this.get_audioLink()); }if(this._setAudioUrlDelegate){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._setAudioUrlDelegate); }if(this._captchaAudio){this._captchaAudio.dispose(); delete this._captchaAudio; }var e=this.get_textBox(); if(e){$removeHandler(e,"focus",this._focusTxtDelegate); $removeHandler(e,"blur",this._blurTxtDelegate); delete this._focusTxtDelegate; delete this._blurTxtDelegate; }Telerik.Web.UI.RadCaptcha.callBaseMethod(this,"dispose"); },get_textBox:function(){if(!this._txt){this._txt=this._getChildElement("CaptchaTextBox"); }return this._txt; },get_textBoxLabel:function(){if(!this._label){this._label=this._getChildElement("CaptchaTextBoxLabel"); }return this._label; },_focusTxtHandler:function(f){Sys.UI.DomElement.addCssClass(this._txt,this._focusCssClass); },_blurTxtHandler:function(f){Sys.UI.DomElement.removeCssClass(this._txt,this._focusCssClass); },setFocusTxtCssClass:function(e){this._focusCssClass=e; },get_audioUrl:function(){return this._audioUrl; },set_audioUrl:function(e){this._audioUrl=e; },get_enableAudio:function(){return this._enableAudio; },set_enableAudio:function(e){this._enableAudio=e; },get_audioLink:function(){var e=this._getChildElement("CaptchaAudioCode"); if(!e){e=this._getChildElement("CaptchaAudioCodeUP"); }return e; },onAudioPlay:function(f){this._captchaAudio.play(); return $telerik.cancelRawEvent(f); },_initCaptchaAudio:function(){if(this._captchaAudio&&this._captchaAudio.dispose){this._captchaAudio.dispose(); delete this._captchaAudio; }var e=$telerik.isChrome||this._persistCode; this._captchaAudio=new Telerik.Web.UI.Captcha.CaptchaAudio(this.get_element(),this.get_audioUrl(),e); },_setupAudioLink:function(){var e=this.get_audioLink(); if(e){e.setAttribute("href","#"); this._audioPlayDelegate=Function.createDelegate(this,this.onAudioPlay); $telerik.addHandler(e,"click",this._audioPlayDelegate,false); }},_managePluginNotificationVisibility:function(e){this._manageItemVisiblity("PluginNotificationPanel",e); },_manageDownloadLinkVisibility:function(e){this._manageItemVisiblity("CaptchaDownloadAudioCode",e); this._manageItemVisiblity("CaptchaDownloadAudioCodeUP",e); },_manageAudioLinkVisibility:function(e){this._manageItemVisiblity("CaptchaAudioCode",e); this._manageItemVisiblity("CaptchaAudioCodeUP",e); },_manageItemVisiblity:function(g,e){var f=this._getChildElement(g); if(f){f.style.display=e?"block":"none"; }},_setAudioUrl:function(h,e){var f=this.get_audioLink(); if(f){var g=f.getAttribute("href",2); if(g&&g!="#"){this.set_audioUrl(g); this._setupAudioLink(); this._initCaptchaAudio(); }}},add_load:function(e){this.get_events().addHandler("load",e); },remove_load:function(e){this.get_events().removeHandler("load",e); }}; Telerik.Web.UI.RadCaptcha.registerClass("Telerik.Web.UI.RadCaptcha",Telerik.Web.UI.RadWebControl); Telerik.Web.UI.Captcha.CaptchaAudio=function(f,e,g){this.domElement=null; this.canPlay=false; this._url=e; this._parentElement=f; this._reload=g; this.preload("auto"); this.initialize(); }; Telerik.Web.UI.Captcha.CaptchaAudio.prototype={initialize:function(){var e=this; if(e._canPlayHtmlAudio()||e._canPlayWithPlugin()){e.canPlay=true; e._createDomElement(); if(e._parentElement){e._parentElement.appendChild(e.domElement); }}},dispose:function(){if(this.domElement&&this._parentElement){this.domElement.parentNode.removeChild(this.domElement); delete this.domElement; }},play:function(){try{if(this._reload&&this.domElement.load){this.domElement.load(); }this.domElement.play(); }catch(f){return false; }return true; },pause:function(){},stop:function(){},preload:function(e){this._preloadValue=e||"auto"; },_createDomElement:function(){if(this._canPlayHtmlAudio()){this.domElement=this._createAudioElement(this._url); }else{this.domElement=this._createEmbedElement(this._url); }},_createAudioElement:function(f){var e=this._createElement("audio"); e.setAttribute("src",f); e.setAttribute("preload",this._preloadValue); e.style.position="absolute"; e.style.top=0; e.style.left=0; return e; },_createEmbedElement:function(f){var e=this._createElement("embed"); e.setAttribute("src",f); e.setAttribute("autostart","false"); e.setAttribute("pluginspage",Telerik.Web.BrowserPlugins.QuickTimePlayer?"http://www.apple.com/quicktime/download/":"http://www.microsoft.com/Windows/MediaPlayer"); e.setAttribute("enablejavascript","true"); e.setAttribute("type","audio/wav"); e.setAttribute("tabIndex","-1"); e.style.width="0px"; e.style.hegiht="0px"; e.style.position="absolute"; e.style.top=0; e.style.left=0; return e; },_createElement:function(e){return document.createElement(e); },_canPlayHtmlAudio:function(){return Telerik.Web.BrowserFeatures.nativeAudio.wave; },_canPlayWithPlugin:function(){return Telerik.Web.BrowserPlugins.QuickTimePlayer||Telerik.Web.BrowserPlugins.WindowsMediaPlayer; }}; Telerik.Web.UI.Captcha.CaptchaAudio.registerClass("Telerik.Web.UI.Captcha.CaptchaAudio",null); var a=document.createElement("audio"); function c(h){var g=false; try{g=!!(a.canPlayType&&a.canPlayType(h).replace(/no/gi,"")); }catch(f){}return g; }Telerik.Web.BrowserFeatures.addSuite("nativeAudio",{wave:c("audio/wav"),mp3:c("audio/mpeg"),ogg:c("audio/ogg")}); function d(f){var h=navigator.plugins; for(var e=0; e