var CONTROL_KEY=1,SHIFT_KEY=2,CONTROL_SHIFT_KEY=3;
function roundcube_browser(){this.ver=parseFloat(navigator.appVersion);this.appver=navigator.appVersion;this.agent=navigator.userAgent;this.name=navigator.appName;this.vendor=navigator.vendor?navigator.vendor:"";this.vendver=navigator.vendorSub?parseFloat(navigator.vendorSub):0;this.product=navigator.product?navigator.product:"";this.platform=String(navigator.platform).toLowerCase();this.lang=navigator.language?navigator.language.substring(0,2):navigator.browserLanguage?navigator.browserLanguage.substring(0,
2):navigator.systemLanguage?navigator.systemLanguage.substring(0,2):"en";this.win=this.platform.indexOf("win")>=0?true:false;this.mac=this.platform.indexOf("mac")>=0?true:false;this.linux=this.platform.indexOf("linux")>=0?true:false;this.unix=this.platform.indexOf("unix")>=0?true:false;this.dom=document.getElementById?true:false;this.dom2=document.addEventListener&&document.removeEventListener;this.ie4=(this.ie=document.all?true:false)&&!this.dom;this.ie5=this.dom&&this.appver.indexOf("MSIE 5")>0;
this.ie8=this.dom&&this.appver.indexOf("MSIE 8")>0;this.ie7=this.dom&&this.appver.indexOf("MSIE 7")>0;this.ie6=this.dom&&!this.ie8&&!this.ie7&&this.appver.indexOf("MSIE 6")>0;this.mz=this.dom&&this.ver>=5;this.ns6=(this.ns=this.ver<5&&this.name=="Netscape"||this.ver>=5&&this.vendor.indexOf("Netscape")>=0)&&parseInt(this.vendver)==6;this.ns7=this.ns&&parseInt(this.vendver)==7;this.safari=this.agent.toLowerCase().indexOf("safari")>0||this.agent.toLowerCase().indexOf("applewebkit")>0;this.konq=this.agent.toLowerCase().indexOf("konqueror")>
0;if((this.opera=window.opera?true:false)&&window.RegExp)this.vendver=/opera(\s|\/)([0-9\.]+)/i.test(navigator.userAgent)?parseFloat(RegExp.$2):-1;else if(!this.vendver&&this.safari)this.vendver=/(safari|applewebkit)\/([0-9]+)/i.test(this.agent)?parseInt(RegExp.$2):0;else if(!this.vendver&&this.mz||this.agent.indexOf("Camino")>0)this.vendver=/rv:([0-9\.]+)/.test(this.agent)?parseFloat(RegExp.$1):0;else if(this.ie&&window.RegExp)this.vendver=/msie\s+([0-9\.]+)/i.test(this.agent)?parseFloat(RegExp.$1):
0;else if(this.konq&&window.RegExp)this.vendver=/khtml\/([0-9\.]+)/i.test(this.agent)?parseFloat(RegExp.$1):0;if(this.safari&&/;\s+([a-z]{2})-[a-z]{2}\)/i.test(this.agent))this.lang=RegExp.$1;this.dhtml=this.ie4&&this.win||this.ie5||this.ie6||this.ns4||this.mz;this.vml=this.win&&this.ie&&this.dom&&!this.opera;this.pngalpha=this.mz||this.opera&&this.vendver>=6||this.ie&&this.mac&&this.vendver>=5||this.ie&&this.win&&this.vendver>=5.5||this.safari;this.opacity=this.mz||this.ie&&this.vendver>=5.5&&!this.opera||
this.safari&&this.vendver>=100;this.cookies=navigator.cookieEnabled;this.xmlhttp_test=function(){var a=new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");return this.xmlhttp=window.XMLHttpRequest||window.ActiveXObject&&a()?true:false}}
var rcube_event={get_target:function(a){return(a=a||window.event)&&a.target?a.target:a.srcElement},get_keycode:function(a){return(a=a||window.event)&&a.keyCode?a.keyCode:a&&a.which?a.which:0},get_button:function(a){return(a=a||window.event)&&typeof a.button!="undefined"?a.button:a&&a.which?a.which:0},get_modifier:function(a){var c=0;a=a||window.event;if(bw.mac&&a){c+=(a.metaKey&&CONTROL_KEY)+(a.shiftKey&&SHIFT_KEY);return c}if(a){c+=(a.ctrlKey&&CONTROL_KEY)+(a.shiftKey&&SHIFT_KEY);return c}},get_mouse_pos:function(a){if(!a)a=
window.event;var c=a.pageX?a.pageX:a.clientX,b=a.pageY?a.pageY:a.clientY;if(document.body&&document.all){c+=document.body.scrollLeft;b+=document.body.scrollTop}if(a._offset){c+=a._offset.left;b+=a._offset.top}return{x:c,y:b}},add_listener:function(a){if(a.object&&a.method){if(!a.element)a.element=document;if(!a.object._rc_events)a.object._rc_events=[];var c=a.event+"*"+a.method;a.object._rc_events[c]||(a.object._rc_events[c]=function(b){return a.object[a.method](b)});if(a.element.addEventListener)a.element.addEventListener(a.event,
a.object._rc_events[c],false);else if(a.element.attachEvent){a.element.detachEvent("on"+a.event,a.object._rc_events[c]);a.element.attachEvent("on"+a.event,a.object._rc_events[c])}else a.element["on"+a.event]=a.object._rc_events[c]}},remove_listener:function(a){if(!a.element)a.element=document;var c=a.event+"*"+a.method;if(a.object&&a.object._rc_events&&a.object._rc_events[c])if(a.element.removeEventListener)a.element.removeEventListener(a.event,a.object._rc_events[c],false);else if(a.element.detachEvent)a.element.detachEvent("on"+
a.event,a.object._rc_events[c]);else a.element["on"+a.event]=null},cancel:function(a){a=a?a:window.event;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();a.cancelBubble=true;return a.returnValue=false}};function rcube_event_engine(){this._events={}}
rcube_event_engine.prototype={addEventListener:function(a,c,b){if(!this._events)this._events={};this._events[a]||(this._events[a]=[]);this._events[a][this._events[a].length]={func:c,obj:b?b:window}},removeEventListener:function(a,c,b){if(typeof b=="undefined")b=window;for(var d,e=0;this._events&&this._events[a]&&e<this._events[a].length;e++)if((d=this._events[a][e])&&d.func==c&&d.obj==b)this._events[a][e]=null},triggerEvent:function(a,c){var b,d;if(typeof c=="undefined")c=this;else if(typeof c=="object")c.event=
a;if(this._events&&this._events[a]&&!this._event_exec){this._event_exec=true;for(var e=0;e<this._events[a].length;e++)if(d=this._events[a][e]){if(typeof d.func=="function")b=d.func.call?d.func.call(d.obj,c):d.func(c);else if(typeof d.obj[d.func]=="function")b=d.obj[d.func](c);if(typeof b!="undefined"&&!b)break}}this._event_exec=false;return b}};
function rcube_layer(a,c){this.name=a;this.create=function(b){var d=b.x?b.x:0,e=b.y?b.y:0,f=b.width,h=b.height,i=b.zindex,j=b.vis;b=b.parent;var g;g=document.createElement("DIV");with(g){a=this.name;with(style){position="absolute";visibility=j?j==2?"inherit":"visible":"hidden";left=d+"px";top=e+"px";if(f)width=f.toString().match(/\%$/)?f:f+"px";if(h)height=h.toString().match(/\%$/)?h:h+"px";if(i)zIndex=i}}b?b.appendChild(g):document.body.appendChild(g);this.elm=g};if(c!=null){this.create(c);this.name=
this.elm.id}else this.elm=document.getElementById(a);if(!this.elm)return false;this.css=this.elm.style;this.event=this.elm;this.width=this.elm.offsetWidth;this.height=this.elm.offsetHeight;this.x=parseInt(this.elm.offsetLeft);this.y=parseInt(this.elm.offsetTop);this.visible=this.css.visibility=="visible"||this.css.visibility=="show"||this.css.visibility=="inherit"?true:false;this.move=function(b,d){this.x=b;this.y=d;this.css.left=Math.round(this.x)+"px";this.css.top=Math.round(this.y)+"px"};this.resize=
function(b,d){this.css.width=b+"px";this.css.height=d+"px";this.width=b;this.height=d};this.show=function(b){if(b==1){this.css.visibility="visible";this.visible=true}else if(b==2){this.css.visibility="inherit";this.visible=true}else{this.css.visibility="hidden";this.visible=false}};this.write=function(b){this.elm.innerHTML=b}}
function rcube_check_email(a,c){if(a&&window.RegExp)return(c?new RegExp("(^|<|[,;s\n])([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*($|>|[,;s\n])","i"):
new RegExp("^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*$",
"i")).test(a)?true:false;return false}function rcube_clone_object(a){var c={};for(var b in a)c[b]=a[b]&&typeof a[b]=="object"?clone_object(a[b]):a[b];return c}function urlencode(a){return window.encodeURIComponent?encodeURIComponent(a):escape(a)}
function rcube_find_object(a,c){var b,d;c||(c=document);if(c.getElementsByName&&(b=c.getElementsByName(a)))d=b[0];if(!d&&c.getElementById)d=c.getElementById(a);if(!d&&c.all)d=c.all[a];if(!d&&c.images.length)d=c.images[a];if(!d&&c.forms.length)for(b=0;b<c.forms.length;b++)if(c.forms[b].name==a)d=c.forms[b];else if(c.forms[b].elements[a])d=c.forms[b].elements[a];if(!d&&c.layers){if(c.layers[a])d=c.layers[a];for(b=0;!d&&b<c.layers.length;b++)d=rcube_find_object(a,c.layers[b].document)}return d}
function rcube_mouse_is_over(a,c){a=rcube_event.get_mouse_pos(a);var b=$(c).offset();return a.x>=b.left&&a.x<b.left+c.offsetWidth&&a.y>=b.top&&a.y<b.top+c.offsetHeight}function setCookie(a,c,b,d,e,f){a=a+"="+escape(c)+(b?"; expires="+b.toGMTString():"")+(d?"; path="+d:"")+(e?"; domain="+e:"")+(f?"; secure":"");document.cookie=a}
function getCookie(a){var c=document.cookie;a=a+"=";var b=c.indexOf("; "+a);if(b==-1){b=c.indexOf(a);if(b!=0)return null}else b+=2;var d=document.cookie.indexOf(";",b);if(d==-1)d=c.length;return unescape(c.substring(b+a.length,d))}roundcube_browser.prototype.set_cookie=setCookie;roundcube_browser.prototype.get_cookie=getCookie;
function rcube_console(){this.log=function(a){var c=rcube_find_object("dbgconsole");if(c){a+=a.charAt(a.length-1)=="\n"?"--------------------------------------\n":"\n--------------------------------------\n";if(bw.konq){c.innerText+=a;c.value=c.innerText}else c.value+=a}};this.reset=function(){var a=rcube_find_object("dbgconsole");if(a)a.innerText=a.value=""}}var bw=new roundcube_browser;window.console||(console=new rcube_console);
RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};if(bw.ie){document._getElementById=document.getElementById;document.getElementById=function(a){var c=0,b=document._getElementById(a);if(!b||b.id!=a)for(;(b=document.all[c])&&b.id!=a;)c++;return b}};
