(function(b){b.vPhoneCount=0;var a={vPhone:function(o){b.vPhoneCount++;var f={ready:null,noServer:null,status:null,reg:null,incoming:null,disconnect:null,connect:null,micStatus:null,swfPath:"flash",quality:"high",cssPrefix:"jqvp",width:215,height:138,position:"static",bgcolor:"#ffffff"};b.extend(f,o);var k={id:b(this).attr("id"),swf:f.swfPath+((f.swfPath!="")?"/":"")+"vphone.swf",fid:f.cssPrefix+"_flash_"+b.vPhoneCount,hid:f.cssPrefix+"_force_"+b.vPhoneCount};b.extend(f,k);b(this).data("vPhone.config",f);var n={login:function(x,q,v,y,w,s,t,u){var r=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(r);p.fl_login(q,v,y,w,s,t,u)},logout:function(q){var r=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(r);p.fl_logout()},call:function(r,q){var s=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(s);p.fl_call(q)},dtmf:function(r,q){var s=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(s);p.fl_dtmf(q)},accept:function(q){var r=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(r);p.fl_accept()},hangup:function(q){var r=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(r);p.fl_hangup()},settings:function(q){var r=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(r);p.fl_settings()},setVolume:function(r,q){var s=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(s);p.fl_set_volume(q)},setMicVolume:function(r,q){var s=b(this).data("vPhone.config").fid;var p=b(this).data("vPhone.getMovie")(s);p.fl_set_mic_volume(q)}};for(var c in n){var i="vPhone."+c;b(this).unbind(i);b(this).bind(i,n[c])}var m=function(e){if(b.browser.msie){return window[e]}else{return document[e]}};b(this).data("vPhone.getMovie",m);var j="";if(typeof(navigator)=="object"&&"userAgent" in navigator&&navigator.userAgent.indexOf("NT 6.1")!=-1){j="no"}var g={id:f.id,fid:f.fid,aec:j,};var h={allowscriptaccess:"always",quality:"high",bgcolor:f.bgcolor,wmode:"transparent"};var l={id:f.fid,name:f.fid};b("<div/>").attr("id",f.fid).appendTo(this);swfobject.embedSWF(f.swf,f.fid,f.width,f.height,"10.0.0",null,g,h,l);var d='<div id="'+f.hid+'"></div>';b(this).append(d);b(this).css("position",f.position);if(f.top!=""){b(this).css("top",f.top)}if(f.bottom!=""){b(this).css("bottom",f.bottom)}if(f.left!=""){b(this).css("left",f.left)}if(f.right!=""){b(this).css("right",f.right)}b("#"+f.hid).css({"text-indent":"-9999px"});return b(this)},login:function(d,i,e,c,h,f,g){b(this).trigger("vPhone.login",[d,i,e,c,h,f,g]);b(window).bind("beforeunload",function(j){b(this).trigger("vPhone.logout")})},logout:function(){b(this).trigger("vPhone.logout")},call:function(c){b(this).trigger("vPhone.call",c)},dtmf:function(c){b(this).trigger("vPhone.dtmf",c)},accept:function(){b(this).trigger("vPhone.accept")},hangup:function(){b(this).trigger("vPhone.hangup")},settings:function(){b(this).trigger("vPhone.settings")},setVolume:function(c){b(this).trigger("vPhone.setVolume",c)},setMicVolume:function(c){b(this).trigger("vPhone.setMicVolume",c)},_vphone_ready:function(){var c=b(this).data("vPhone.config");var d=c.ready;if(d!=null){d()}},_vphone_no_server:function(e){var d=b(this).data("vPhone.config");var c=d.noServer;if(c!=null){c(e)}},_vphone_status:function(e){var c=b(this).data("vPhone.config");var d=c.status;if(d!=null){d(e)}},_vphone_registered:function(){var c=b(this).data("vPhone.config");var d=c.reg;if(d!=null){d()}},_vphone_ringing:function(){var c=b(this).data("vPhone.config");var d=c.ringing;if(d!=null){d()}},_vphone_connected:function(){var d=b(this).data("vPhone.config");var c=d.connect;if(c!=null){c()}},_vphone_accepted:function(){var d=b(this).data("vPhone.config");var c=d.connect;if(c!=null){c()}},_vphone_disconnected:function(){var c=b(this).data("vPhone.config");var d=c.disconnect;if(d!=null){d()}},_vphone_incoming:function(f,d){var c=b(this).data("vPhone.config");var e=c.incoming;if(e!=null){e(f,d)}},_vphone_mic_status:function(e){var d=b(this).data("vPhone.config");var c=d.micStatus;if(c!=null){c(e)}},_vphone_alive:function(c){var e=b(this).data("vPhone.config");var d=e.alive;if(d!=null){d(c)}},_vphone_error:function(d,e){var c=b(this).data("vPhone.config");var f=c.error;if(f!=null){f(d,e)}}};b.each(a,function(c){b.fn[c]=this})})(jQuery);
