var EmbeddedSoftPhone=new Class({phoneObject:null,lastUrl:"",init:function(){},deinit:function(){},getLastUrl:function(){return this.lastUrl},register:function(c,b){try{this.phoneObject.Register(c,b)}catch(a){}},unregister:function(){try{this.phoneObject.Unregister()}catch(a){}},call:function(a){this.phoneObject.Call(a)},answer:function(a){this.phoneObject.Answer(a)},cancel:function(a){this.phoneObject.Terminate(a)},refer:function(a,b){this.phoneObject.Refer(a,b)},dial:function(a,b){this.phoneObject.Dial(a,urlTo)},requestRegState:function(){this.phoneObject.GetRegState()},requestCallState:function(a){this.phoneObject.GetCallState(a)},enumCalls:function(){var a=this.phoneObject.EnumCalls();if(a==""){return new Array()}var b=a.split("|");return b},enumPlaybackDevices:function(){var a=this.phoneObject.GetPlaybackDevices();return a},enumCaptureDevices:function(){var a=this.phoneObject.GetCaptureDevices();return a},getVersion:function(){var a=this.phoneObject.GetVersion();return a},getCompInfo:function(){try{var a=this.phoneObject.GetCompInfo();return a}catch(b){return null}},prefetchLog:function(){},getLog:function(){try{var a=this.phoneObject.GetLog();return a}catch(b){return null}}});var ActiveXSoftPhone=new Class({Extends:EmbeddedSoftPhone,init:function(){this.phoneObject=document.getElementById("softPhoneObject");if(!this.phoneObject.object){throw"not_installed"}var a="";try{a=this.phoneObject.GetError()}catch(b){}if(a!=""){throw a}},latestVersion:function(){return latestCABVersion},isOutOfDate:function(){var b=this.phoneObject.GetVersion().split(".");var c=this.latestVersion().split(".");for(var a=0;a<4;a++){if(parseInt(c[a])>parseInt(b[a])){return true}}return false},updateLink:function(){return"/update_activex"},installFunction:function(){return null}});var NPAPISoftPhone=new Class({Extends:EmbeddedSoftPhone,callbacks:{OnRegStateChanged:null,OnCallStateChanged:null},init:function(f,a){this.callbacks.OnRegStateChanged=f;this.callbacks.OnCallStateChanged=a;if(!navigator.plugins["TalkPad Browser Plugin"]){throw"not_installed"}var b="";this.phoneObject=document.embeds[0];try{this.phoneObject.SetCallback(this.callbacks);if(!this.phoneObject.Init()){throw false}}catch(c){try{b=this.phoneObject.GetError()}catch(d){}}if(b){throw b}},latestVersion:function(){return latestOperaVersion},isOutOfDate:function(){return this.getVersion()<this.latestVersion()},updateLink:function(){return"/softphone-"+this.latestVersion()+".exe"},installFunction:function(){return null}});

