$Bootstrap={_loaded:{},_loaded_groups:{},_pending_lazy:{},_styles:[],_style_limit:25,_next_style_index:0,applyCss:function(_1){
if(!_1){
return;
}
var _2=document.getElementsByTagName("head")[0];
var _3=/MSIE/.test(navigator.userAgent);
var _4=true;
if(_3&&this._styles.length==this._style_limit){
if(this._next_style_index==this._style_limit){
this._next_style_index=0;
}
var _5=this._styles[this._next_style_index];
_1=_5.innerHTML+_1;
this._next_style_index++;
_4=false;
}else{
var _5=document.createElement("style");
_5.setAttribute("type","text/css");
if(_3){
this._styles.push(_5);
}
}
if(_4&&!_3){
_2.appendChild(_5);
}
if(_5.styleSheet){
_5.styleSheet.cssText=_1;
}else{
var _6=document.createTextNode(_1);
_5.appendChild(_6);
}
if(_4&&_3){
_2.appendChild(_5);
}
return _5;
},getAppWindow:function(){
var _7=window;
while(_7){
if(_7._wm__app_win){
return _7;
}
if(_7._wm__app_win_ptr){
return _7._wm__app_win_ptr;
}
_7=_7.opener;
}
return null;
},getBuildVersion:function(_8,_9){
if(Webmail.isDev()){
return (new Date).getTime();
}else{
_9=_9.replace(/-.*/,"");
var _a=this.getAppWindow()._wm__build_versions[_8]||{};
return _a[_9]||(new Date).getTime();
}
},getUrl:function(_b,_c,_d){
if(_b=="css"||_b=="combo"||_b=="widgets"){
var _e=this.getAppWindow()._wm__globals["css_agent"];
_c+="-"+_e;
}
var _f="_build/"+_b+"/"+_c+"."+this.getBuildVersion(_b,_c)+"."+Webmail.getGlobal("js_extension");
if(_d.static_domain){
var _10=(Webmail.isHttps()?"https://":"http://");
var uri=Webmail.getVersionUri().replace(/^(https?:\/\/).*?\//,"$1"+CFG_STATIC_DOMAIN+"/");
_f=uri+_f;
}
return _f;
},isAppWindow:function(){
return (window==this.getAppWindow());
},notLoaded:function(key){
if(this._loaded[key]){
return false;
}
this._loaded[key]=true;
return true;
},reportLoaded:function(_13,_14){
var _15=_13+_14;
this._loaded_groups[_15]=true;
try{
if(this._pending_lazy[_15]){
if(this._pending_lazy[_15].callback){
this._pending_lazy[_15].callback();
}
}
delete this._pending_lazy[_15];
}
catch(e){
}
},request:function(_16,_17,_18){
var _19=_16+_17;
if(this._loaded_groups[_19]){
return;
}
_18=wack.extend({async:false,callback:null,lazy:false,static_domain:false},_18||{});
var url=this.getUrl(_16,_17,_18);
if(_18.lazy){
this._pending_lazy[_19]=_18;
var _1b=Element.create("script");
_1b.type="text/javascript";
_1b.src=url;
document.getElementsByTagName("head")[0].appendChild(_1b);
}else{
var _1c=new Ajax.Request(url,{method:"get",asynchronous:_18.async,onSuccess:function(r){
try{
if(window.execScript){
window.execScript(r.responseText);
}else{
if(false){
}else{
window.eval(r.responseText);
}
}
}
catch(e){
alert("An unexpected error has occurred.\n\n"+"("+_19+", "+e.message+")");
}
$Bootstrap._loaded_groups[_19]=true;
}});
}
}};
function REQUIRE(s,o){
var p=s.split("/");
$Bootstrap.request(p[0],p[1],o);
}
$Bootstrap.reportLoaded("js","bootstrap");
if($Bootstrap.notLoaded("48e22344dadd6e39b041d416d7e97ea4")){
var Prototype={Version:"1.5.0",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_22,_23){
for(var _24 in _23){
_22[_24]=_23[_24];
}
return _22;
};
Object.extend(Object,{inspect:function(_25){
try{
if(_25===undefined){
return "undefined";
}
if(_25===null){
return "null";
}
return _25.inspect?_25.inspect():_25.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_26){
var _27=[];
for(var _28 in _26){
_27.push(_28);
}
return _27;
},values:function(_29){
var _2a=[];
for(var _2b in _29){
_2a.push(_29[_2b]);
}
return _2a;
},clone:function(_2c){
return Object.extend({},_2c);
}});
Function.prototype.bind=function(){
var _2d=this,args=$A(arguments),object=args.shift();
return function(){
if(typeof $A==="function"){
return _2d.apply(object,args.concat($A(arguments)));
}
};
};
Function.prototype.bindAsEventListener=function(_2e){
var _2f=this,args=$A(arguments),_2e=args.shift();
return function(_30){
if(typeof $A==="function"){
return _2f.apply(_2e,[(_30||window.event)].concat(args).concat($A(arguments)));
}
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _31=this.toString(16);
if(this<16){
return "0"+_31;
}
return _31;
},succ:function(){
return this+1;
},times:function(_32){
$R(0,this,true).each(_32);
return this;
}});
var Try={these:function(){
var _33;
for(var i=0,length=arguments.length;i<length;i++){
var _35=arguments[i];
try{
_33=_35();
break;
}
catch(e){
}
}
return _33;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_36,_37){
this.callback=_36;
this.frequency=_37;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},stop:function(){
if(!this.timer){
return;
}
clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback(this);
}
finally{
this.currentlyExecuting=false;
}
}
}};
String.interpret=function(_38){
return _38==null?"":String(_38);
};
Object.extend(String.prototype,{gsub:function(_39,_3a){
var _3b="",source=this,match;
_3a=arguments.callee.prepareReplacement(_3a);
while(source.length>0){
if(match=source.match(_39)){
_3b+=source.slice(0,match.index);
_3b+=String.interpret(_3a(match));
source=source.slice(match.index+match[0].length);
}else{
_3b+=source,source="";
}
}
return _3b;
},sub:function(_3c,_3d,_3e){
_3d=this.gsub.prepareReplacement(_3d);
_3e=_3e===undefined?1:_3e;
return this.gsub(_3c,function(_3f){
if(--_3e<0){
return _3f[0];
}
return _3d(_3f);
});
},scan:function(_40,_41){
this.gsub(_40,_41);
return this;
},truncate:function(_42,_43){
_42=_42||30;
_43=_43===undefined?"...":_43;
return this.length>_42?this.slice(0,_42-_43.length)+_43:this;
},strip:function(){
return this.replace(/^\s+/,"").replace(/\s+$/,"");
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _44=new RegExp(Prototype.ScriptFragment,"img");
var _45=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_44)||[]).map(function(_46){
return (_46.match(_45)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_47){
return eval(_47);
});
},escapeHTML:function(){
var div=document.createElement("div");
var _49=document.createTextNode(this);
div.appendChild(_49);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_4b,_4c){
return _4b+_4c.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_4d){
var _4e=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_4e){
return {};
}
return _4e[1].split(_4d||"&").inject({},function(_4f,_50){
if((_50=_50.split("="))[0]){
var _51=decodeURIComponent(_50[0]);
var _52=_50[1]?decodeURIComponent(_50[1]):undefined;
if(_4f[_51]!==undefined){
if(_4f[_51].constructor!=Array){
_4f[_51]=[_4f[_51]];
}
if(_52){
_4f[_51].push(_52);
}
}else{
_4f[_51]=_52;
}
}
return _4f;
});
},toArray:function(){
return this.split("");
},succ:function(){
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},camelize:function(){
var _53=this.split("-"),len=_53.length;
if(len==1){
return _53[0];
}
var _54=this.charAt(0)=="-"?_53[0].charAt(0).toUpperCase()+_53[0].substring(1):_53[0];
for(var i=1;i<len;i++){
_54+=_53[i].charAt(0).toUpperCase()+_53[i].substring(1);
}
return _54;
},capitalize:function(){
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){
return this.gsub(/_/,"-");
},inspect:function(_56){
var _57=this.replace(/\\/g,"\\\\");
if(_56){
return "\""+_57.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_57.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_58){
if(typeof _58=="function"){
return _58;
}
var _59=new Template(_58);
return function(_5a){
return _59.evaluate(_5a);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_5b,_5c){
this.template=_5b.toString();
this.pattern=_5c||Template.Pattern;
},evaluate:function(_5d){
return this.template.gsub(this.pattern,function(_5e){
var _5f=_5e[1];
if(_5f=="\\"){
return _5e[2];
}
return _5f+String.interpret(_5d[_5e[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_60){
var _61=0;
try{
this._each(function(_62){
try{
_60(_62,_61++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_63,_64){
var _65=-_63,slices=[],array=this.toArray();
while((_65+=_63)<array.length){
slices.push(array.slice(_65,_65+_63));
}
return slices.map(_64);
},all:function(_66){
var _67=true;
this.each(function(_68,_69){
_67=_67&&!!(_66||Prototype.K)(_68,_69);
if(!_67){
throw $break;
}
});
return _67;
},any:function(_6a){
var _6b=false;
this.each(function(_6c,_6d){
if(_6b=!!(_6a||Prototype.K)(_6c,_6d)){
throw $break;
}
});
return _6b;
},collect:function(_6e){
var _6f=[];
this.each(function(_70,_71){
_6f.push((_6e||Prototype.K)(_70,_71));
});
return _6f;
},detect:function(_72){
var _73;
this.each(function(_74,_75){
if(_72(_74,_75)){
_73=_74;
throw $break;
}
});
return _73;
},findAll:function(_76){
var _77=[];
this.each(function(_78,_79){
if(_76(_78,_79)){
_77.push(_78);
}
});
return _77;
},grep:function(_7a,_7b){
var _7c=[];
this.each(function(_7d,_7e){
var _7f=_7d.toString();
if(_7f.match(_7a)){
_7c.push((_7b||Prototype.K)(_7d,_7e));
}
});
return _7c;
},include:function(_80){
var _81=false;
this.each(function(_82){
if(_82==_80){
_81=true;
throw $break;
}
});
return _81;
},inGroupsOf:function(_83,_84){
_84=_84===undefined?null:_84;
return this.eachSlice(_83,function(_85){
while(_85.length<_83){
_85.push(_84);
}
return _85;
});
},inject:function(_86,_87){
this.each(function(_88,_89){
_86=_87(_86,_88,_89);
});
return _86;
},invoke:function(_8a){
var _8b=$A(arguments).slice(1);
return this.map(function(_8c){
return _8c[_8a].apply(_8c,_8b);
});
},max:function(_8d){
var _8e;
this.each(function(_8f,_90){
_8f=(_8d||Prototype.K)(_8f,_90);
if(_8e==undefined||_8f>=_8e){
_8e=_8f;
}
});
return _8e;
},min:function(_91){
var _92;
this.each(function(_93,_94){
_93=(_91||Prototype.K)(_93,_94);
if(_92==undefined||_93<_92){
_92=_93;
}
});
return _92;
},partition:function(_95){
var _96=[],falses=[];
this.each(function(_97,_98){
((_95||Prototype.K)(_97,_98)?_96:falses).push(_97);
});
return [_96,falses];
},pluck:function(_99){
var _9a=[];
this.each(function(_9b,_9c){
_9a.push(_9b[_99]);
});
return _9a;
},reject:function(_9d){
var _9e=[];
this.each(function(_9f,_a0){
if(!_9d(_9f,_a0)){
_9e.push(_9f);
}
});
return _9e;
},sortBy:function(_a1){
return this.map(function(_a2,_a3){
return {value:_a2,criteria:_a1(_a2,_a3)};
}).sort(function(_a4,_a5){
var a=_a4.criteria,b=_a5.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.map();
},zip:function(){
var _a7=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_a7=args.pop();
}
var _a8=[this].concat(args).map($A);
return this.map(function(_a9,_aa){
return _a7(_a8.pluck(_aa));
});
},size:function(){
return this.toArray().length;
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_ab){
if(!_ab){
return [];
}
if(_ab.toArray){
return _ab.toArray();
}else{
var _ac=[];
for(var i=0,length=_ab.length;i<length;i++){
_ac.push(_ab[i]);
}
return _ac;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_ae){
for(var i=0,length=this.length;i<length;i++){
_ae(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_b0){
return _b0!=null;
});
},flatten:function(){
return this.inject([],function(_b1,_b2){
return _b1.concat(_b2&&_b2.constructor==Array?_b2.flatten():[_b2]);
});
},without:function(){
var _b3=$A(arguments);
return this.select(function(_b4){
return !_b3.include(_b4);
});
},indexOf:function(_b5){
for(var i=0,length=this.length;i<length;i++){
if(this[i]==_b5){
return i;
}
}
return -1;
},reverse:function(_b7){
return (_b7!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_b8,_b9){
return _b8.include(_b9)?_b8:_b8.concat([_b9]);
});
},clone:function(){
return [].concat(this);
},size:function(){
return this.length;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
function $w(_ba){
_ba=_ba.strip();
return _ba?_ba.split(/\s+/):[];
}
if(window.opera){
Array.prototype.concat=function(){
var _bb=[];
for(var i=0,length=this.length;i<length;i++){
_bb.push(this[i]);
}
for(var i=0,length=arguments.length;i<length;i++){
if(arguments[i].constructor==Array){
for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++){
_bb.push(arguments[i][j]);
}
}else{
_bb.push(arguments[i]);
}
}
return _bb;
};
}
var Hash=function(obj){
Object.extend(this,obj||{});
};
Object.extend(Hash,{toQueryString:function(obj){
var _c0=[];
this.prototype._each.call(obj,function(_c1){
if(!_c1.key){
return;
}
if(_c1.value&&_c1.value.constructor==Array){
var _c2=_c1.value.compact();
if(_c2.length<2){
_c1.value=_c2.reduce();
}else{
key=encodeURIComponent(_c1.key);
_c2.each(function(_c3){
_c3=_c3!=undefined?encodeURIComponent(_c3):"";
_c0.push(key+"="+encodeURIComponent(_c3));
});
return;
}
}
if(_c1.value==undefined){
_c1[1]="";
}
_c0.push(_c1.map(encodeURIComponent).join("="));
});
return _c0.join("&");
}});
Object.extend(Hash.prototype,Enumerable);
Object.extend(Hash.prototype,{_each:function(_c4){
for(var key in this){
var _c6=this[key];
if(_c6&&_c6==Hash.prototype[key]){
continue;
}
var _c7=[key,_c6];
_c7.key=key;
_c7.value=_c6;
_c4(_c7);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_c8){
return $H(_c8).inject(this,function(_c9,_ca){
_c9[_ca.key]=_ca.value;
return _c9;
});
},remove:function(){
var _cb;
for(var i=0,length=arguments.length;i<length;i++){
var _cd=this[arguments[i]];
if(_cd!==undefined){
if(_cb===undefined){
_cb=_cd;
}else{
if(_cb.constructor!=Array){
_cb=[_cb];
}
_cb.push(_cd);
}
}
delete this[arguments[i]];
}
return _cb;
},toQueryString:function(){
return Hash.toQueryString(this);
},inspect:function(){
return "#<Hash:{"+this.map(function(_ce){
return _ce.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}});
function $H(_cf){
if(_cf&&_cf.constructor==Hash){
return _cf;
}
return new Hash(_cf);
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_d0,end,_d2){
this.start=_d0;
this.end=end;
this.exclusive=_d2;
},_each:function(_d3){
var _d4=this.start;
while(this.include(_d4)){
_d3(_d4);
_d4=_d4.succ();
}
},include:function(_d5){
if(_d5<this.start){
return false;
}
if(this.exclusive){
return _d5<this.end;
}
return _d5<=this.end;
}});
var $R=function(_d6,end,_d8){
return new ObjectRange(_d6,end,_d8);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_d9){
this.responders._each(_d9);
},register:function(_da){
if(!this.include(_da)){
this.responders.push(_da);
}
},unregister:function(_db){
this.responders=this.responders.without(_db);
},dispatch:function(_dc,_dd,_de,_df){
this.each(function(_e0){
if(typeof _e0[_dc]=="function"){
try{
_e0[_dc].apply(_e0,[_dd,_de,_df]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_e1){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_e1||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){
this.options.parameters=this.options.parameters.toQueryParams();
}
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,_e3){
this.transport=Ajax.getTransport();
this.setOptions(_e3);
this.request(url);
},request:function(url){
this.url=url;
this.method=this.options.method;
var _e5=this.options.parameters;
if(!["get","post"].include(this.method)){
_e5["_method"]=this.method;
this.method="post";
}
_e5=Hash.toQueryString(_e5);
if(_e5&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_e5+="&_=";
}
if(this.method=="get"&&_e5){
this.url+=(this.url.indexOf("?")>-1?"&":"?")+_e5;
}
try{
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){
setTimeout(function(){
this.respondToReadyState(1);
}.bind(this),10);
}
this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
var _e6=this.method=="post"?(this.options.postBody||_e5):null;
this.transport.send(_e6);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _e7=this.transport.readyState;
if(_e7>1&&!((_e7==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _e8={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){
_e8["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
_e8["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _e9=this.options.requestHeaders;
if(typeof _e9.push=="function"){
for(var i=0,length=_e9.length;i<length;i+=2){
_e8[_e9[i]]=_e9[i+1];
}
}else{
$H(_e9).each(function(_eb){
_e8[_eb.key]=_eb.value;
});
}
}
for(var _ec in _e8){
this.transport.setRequestHeader(_ec,_e8[_ec]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_ed){
var _ee=Ajax.Request.Events[_ed];
var _ef=this.transport,json=this.evalJSON();
if(_ee=="Complete"){
try{
this._complete=true;
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_ef,json);
}
catch(e){
this.dispatchException(e);
}
}
try{
(this.options["on"+_ee]||Prototype.emptyFunction)(_ef,json);
Ajax.Responders.dispatch("on"+_ee,this,_ef,json);
}
catch(e){
this.dispatchException(e);
}
if(_ee=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(_f0){
try{
return this.transport.getResponseHeader(_f0);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var _f1=this.getHeader("X-JSON");
return _f1?eval("("+_f1+")"):null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_f2){
(this.options.onException||Prototype.emptyFunction)(this,_f2);
Ajax.Responders.dispatch("onException",this,_f2);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_f3,url,_f5){
this.container={success:(_f3.success||_f3),failure:(_f3.failure||(_f3.success?null:_f3))};
this.transport=Ajax.getTransport();
this.setOptions(_f5);
var _f6=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_f7,_f8){
this.updateContent();
_f6(_f7,_f8);
}).bind(this);
this.request(url);
},updateContent:function(){
var _f9=this.container[this.success()?"success":"failure"];
var _fa=this.transport.responseText;
if(!this.options.evalScripts){
_fa=_fa.stripScripts();
}
if(_f9=$(_f9)){
if(this.options.insertion){
new this.options.insertion(_f9,_fa);
}else{
_f9.update(_fa);
}
}
if(this.success()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_fb,url,_fd){
this.setOptions(_fd);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_fb;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.options.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_fe){
if(this.options.decay){
this.decay=(_fe.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_fe.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
function $(_ff){
if(arguments.length>1){
for(var i=0,elements=[],length=arguments.length;i<length;i++){
elements.push($(arguments[i]));
}
return elements;
}
if(typeof _ff=="string"){
_ff=document.getElementById(_ff);
}
return Element.extend(_ff);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_101,_102){
var _103=[];
var _104=document.evaluate(_101,$(_102)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,length=_104.snapshotLength;i<length;i++){
_103.push(_104.snapshotItem(i));
}
return _103;
};
}
document.getElementsByClassName=function(_106,_107){
if(Prototype.BrowserFeatures.XPath){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_106+" ')]";
return document._getElementsByXPath(q,_107);
}else{
var _109=($(_107)||document.body).getElementsByTagName("*");
var _10a=[],child;
for(var i=0,length=_109.length;i<length;i++){
child=_109[i];
if(Element.hasClassName(child,_106)){
_10a.push(Element.extend(child));
}
}
return _10a;
}
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_10c){
if(!_10c||_nativeExtensions||_10c.nodeType==3){
return _10c;
}
if(!_10c._extended&&_10c.tagName&&_10c!=window){
var _10d=Object.clone(Element.Methods),cache=Element.extend.cache;
if(_10c.tagName=="FORM"){
Object.extend(_10d,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_10c.tagName)){
Object.extend(_10d,Form.Element.Methods);
}
Object.extend(_10d,Element.Methods.Simulated);
for(var _10e in _10d){
var _10f=_10d[_10e];
if(typeof _10f=="function"&&!(_10e in _10c)){
_10c[_10e]=cache.findOrStore(_10f);
}
}
}
_10c._extended=true;
return _10c;
};
Element.extend.cache={findOrStore:function(_110){
return this[_110]=this[_110]||function(){
return _110.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_111){
return $(_111).style.display!="none";
},toggle:function(_112){
_112=$(_112);
Element[Element.visible(_112)?"hide":"show"](_112);
return _112;
},hide:function(_113){
$(_113).style.display="none";
return _113;
},show:function(_114){
$(_114).style.display="";
return _114;
},remove:function(_115){
_115=$(_115);
_115.parentNode.removeChild(_115);
return _115;
},update:function(_116,html){
html=typeof html=="undefined"?"":html.toString();
$(_116).innerHTML=html.stripScripts();
setTimeout(function(){
html.evalScripts();
},10);
return _116;
},replace:function(_118,html){
_118=$(_118);
html=typeof html=="undefined"?"":html.toString();
if(_118.outerHTML){
_118.outerHTML=html.stripScripts();
}else{
var _11a=_118.ownerDocument.createRange();
_11a.selectNodeContents(_118);
_118.parentNode.replaceChild(_11a.createContextualFragment(html.stripScripts()),_118);
}
setTimeout(function(){
html.evalScripts();
},10);
return _118;
},inspect:function(_11b){
_11b=$(_11b);
var _11c="<"+_11b.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _11e=pair.first(),attribute=pair.last();
var _11f=(_11b[_11e]||"").toString();
if(_11f){
_11c+=" "+attribute+"="+_11f.inspect(true);
}
});
return _11c+">";
},recursivelyCollect:function(_120,_121){
_120=$(_120);
var _122=[];
while(_120=_120[_121]){
if(_120.nodeType==1){
_122.push(Element.extend(_120));
}
}
return _122;
},ancestors:function(_123){
return $(_123).recursivelyCollect("parentNode");
},descendants:function(_124){
return $A($(_124).getElementsByTagName("*"));
},immediateDescendants:function(_125){
if(!(_125=$(_125).firstChild)){
return [];
}
while(_125&&_125.nodeType!=1){
_125=_125.nextSibling;
}
if(_125){
return [_125].concat($(_125).nextSiblings());
}
return [];
},previousSiblings:function(_126){
return $(_126).recursivelyCollect("previousSibling");
},nextSiblings:function(_127){
return $(_127).recursivelyCollect("nextSibling");
},siblings:function(_128){
_128=$(_128);
return _128.previousSiblings().reverse().concat(_128.nextSiblings());
},match:function(_129,_12a){
if(typeof _12a=="string"){
_12a=new Selector(_12a);
}
return _12a.match($(_129));
},up:function(_12b,_12c,_12d){
return Selector.findElement($(_12b).ancestors(),_12c,_12d);
},down:function(_12e,_12f,_130){
return Selector.findElement($(_12e).descendants(),_12f,_130);
},previous:function(_131,_132,_133){
return Selector.findElement($(_131).previousSiblings(),_132,_133);
},next:function(_134,_135,_136){
return Selector.findElement($(_134).nextSiblings(),_135,_136);
},getElementsBySelector:function(){
var args=$A(arguments),element=$(args.shift());
return Selector.findChildElements(element,args);
},getElementsByClassName:function(_138,_139){
return document.getElementsByClassName(_139,_138);
},readAttribute:function(_13a,name){
_13a=$(_13a);
if(document.all&&!window.opera){
var t=Element._attributeTranslations;
if(t.values[name]){
return t.values[name](_13a,name);
}
if(t.names[name]){
name=t.names[name];
}
var _13d=_13a.attributes[name];
if(_13d){
return _13d.nodeValue;
}
}
return _13a.getAttribute(name);
},getHeight:function(_13e){
return $(_13e).getDimensions().height;
},getWidth:function(_13f){
return $(_13f).getDimensions().width;
},classNames:function(_140){
return new Element.ClassNames(_140);
},hasClassName:function(_141,_142){
if(!(_141=$(_141))){
return;
}
var _143=_141.className;
if(_143.length==0){
return false;
}
if(_143==_142||_143.match(new RegExp("(^|\\s)"+_142+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_144,_145){
if(!(_144=$(_144))){
return;
}
Element.classNames(_144).add(_145);
return _144;
},removeClassName:function(_146,_147){
if(!(_146=$(_146))){
return;
}
Element.classNames(_146).remove(_147);
return _146;
},toggleClassName:function(_148,_149){
if(!(_148=$(_148))){
return;
}
Element.classNames(_148)[_148.hasClassName(_149)?"remove":"add"](_149);
return _148;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_14a){
_14a=$(_14a);
var node=_14a.firstChild;
while(node){
var _14c=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_14a.removeChild(node);
}
node=_14c;
}
return _14a;
},empty:function(_14d){
return $(_14d).innerHTML.match(/^\s*$/);
},descendantOf:function(_14e,_14f){
_14e=$(_14e),_14f=$(_14f);
while(_14e=_14e.parentNode){
if(_14e==_14f){
return true;
}
}
return false;
},scrollTo:function(_150){
_150=$(_150);
var pos=Position.cumulativeOffset(_150);
window.scrollTo(pos[0],pos[1]);
return _150;
},getStyle:function(_152,_153){
_152=$(_152);
if(["float","cssFloat"].include(_153)){
_153=(typeof _152.style.styleFloat!="undefined"?"styleFloat":"cssFloat");
}
_153=_153.camelize();
var _154=_152.style[_153];
if(!_154){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_152,null);
_154=css?css[_153]:null;
}else{
if(_152.currentStyle){
_154=_152.currentStyle[_153];
}
}
}
if((_154=="auto")&&["width","height"].include(_153)&&(_152.getStyle("display")!="none")){
_154=_152["offset"+_153.capitalize()]+"px";
}
if(window.opera&&["left","top","right","bottom"].include(_153)){
if(Element.getStyle(_152,"position")=="static"){
_154="auto";
}
}
if(_153=="opacity"){
if(_154){
return parseFloat(_154);
}
if(_154=(_152.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_154[1]){
return parseFloat(_154[1])/100;
}
}
return 1;
}
return _154=="auto"?null:_154;
},setStyle:function(_156,_157){
_156=$(_156);
for(var name in _157){
var _159=_157[name];
if(name=="opacity"){
if(_159==1){
_159=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1;
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_156.style.filter=_156.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_159==""){
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_156.style.filter=_156.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_159<0.00001){
_159=0;
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_156.style.filter=_156.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_159*100+")";
}
}
}
}else{
if(["float","cssFloat"].include(name)){
name=(typeof _156.style.styleFloat!="undefined")?"styleFloat":"cssFloat";
}
}
_156.style[name.camelize()]=_159;
}
return _156;
},getDimensions:function(_15a){
_15a=$(_15a);
var _15b=$(_15a).getStyle("display");
if(_15b!="none"&&_15b!=null){
return {width:_15a.offsetWidth,height:_15a.offsetHeight};
}
var els=_15a.style;
var _15d=els.visibility;
var _15e=els.position;
var _15f=els.display;
els.visibility="hidden";
els.position="absolute";
els.display="block";
var _160=_15a.clientWidth;
var _161=_15a.clientHeight;
els.display=_15f;
els.position=_15e;
els.visibility=_15d;
return {width:_160,height:_161};
},makePositioned:function(_162){
_162=$(_162);
var pos=Element.getStyle(_162,"position");
if(pos=="static"||!pos){
_162._madePositioned=true;
_162.style.position="relative";
if(window.opera){
_162.style.top=0;
_162.style.left=0;
}
}
return _162;
},undoPositioned:function(_164){
_164=$(_164);
if(_164._madePositioned){
_164._madePositioned=undefined;
_164.style.position=_164.style.top=_164.style.left=_164.style.bottom=_164.style.right="";
}
return _164;
},makeClipping:function(_165){
_165=$(_165);
if(_165._overflow){
return _165;
}
_165._overflow=_165.style.overflow||"auto";
if((Element.getStyle(_165,"overflow")||"visible")!="hidden"){
_165.style.overflow="hidden";
}
return _165;
},undoClipping:function(_166){
_166=$(_166);
if(!_166._overflow){
return _166;
}
_166.style.overflow=_166._overflow=="auto"?"":_166._overflow;
_166._overflow=null;
return _166;
}};
Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});
Element._attributeTranslations={};
Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};
Element._attributeTranslations.values={_getAttr:function(_167,_168){
return _167.getAttribute(_168,2);
},_flag:function(_169,_16a){
return $(_169).hasAttribute(_16a)?_16a:null;
},style:function(_16b){
return _16b.style.cssText.toLowerCase();
},title:function(_16c){
var node=_16c.getAttributeNode("title");
return node.specified?node.nodeValue:null;
}};
Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});
Element.Methods.Simulated={hasAttribute:function(_16e,_16f){
var t=Element._attributeTranslations;
_16f=t.names[_16f]||_16f;
return $(_16e).getAttributeNode(_16f).specified;
}};
if(document.all&&!window.opera){
Element.Methods.update=function(_171,html){
_171=$(_171);
html=typeof html=="undefined"?"":html.toString();
var _173=_171.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].include(_173)){
var div=document.createElement("div");
switch(_173){
case "THEAD":
case "TBODY":
div.innerHTML="<table><tbody>"+html.stripScripts()+"</tbody></table>";
depth=2;
break;
case "TR":
div.innerHTML="<table><tbody><tr>"+html.stripScripts()+"</tr></tbody></table>";
depth=3;
break;
case "TD":
div.innerHTML="<table><tbody><tr><td>"+html.stripScripts()+"</td></tr></tbody></table>";
depth=4;
}
$A(_171.childNodes).each(function(node){
_171.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_171.appendChild(node);
});
}else{
_171.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _171;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _178="HTML"+tag+"Element";
if(window[_178]){
return;
}
var _179=window[_178]={};
_179.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_17a){
Object.extend(Element.Methods,_17a||{});
function copy(_17b,_17c,_17d){
_17d=_17d||false;
var _17e=Element.extend.cache;
for(var _17f in _17b){
var _180=_17b[_17f];
if(!_17d||!(_17f in _17c)){
_17c[_17f]=_17e.findOrStore(_180);
}
}
}
if(typeof HTMLElement!="undefined"){
copy(Element.Methods,HTMLElement.prototype);
copy(Element.Methods.Simulated,HTMLElement.prototype,true);
copy(Form.Methods,HTMLFormElement.prototype);
[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_181){
copy(Form.Element.Methods,_181.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_182){
this.adjacency=_182;
};
Abstract.Insertion.prototype={initialize:function(_183,_184){
this.element=$(_183);
this.content=_184.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _185=this.element.tagName.toUpperCase();
if(["TBODY","TR"].include(_185)){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
setTimeout(function(){
_184.evalScripts();
},10);
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(_187){
_187.each((function(_188){
this.element.parentNode.insertBefore(_188,this.element);
}).bind(this));
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(_189){
_189.reverse(false).each((function(_18a){
this.element.insertBefore(_18a,this.element.firstChild);
}).bind(this));
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(_18b){
_18b.each((function(_18c){
this.element.appendChild(_18c);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_18d){
_18d.each((function(_18e){
this.element.parentNode.insertBefore(_18e,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_18f){
this.element=$(_18f);
},_each:function(_190){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_190);
},set:function(_192){
this.element.className=_192;
},add:function(_193){
if(this.include(_193)){
return;
}
this.set($A(this).concat(_193).join(" "));
},remove:function(_194){
if(!this.include(_194)){
return;
}
this.set($A(this).without(_194).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_195){
this.params={classNames:[]};
this.expression=_195.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_196){
throw "Parse error in selector: "+_196;
}
if(this.expression==""){
abort("empty expression");
}
var _197=this.params,expr=this.expression,match,modifier,clause,rest;
while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_197.attributes=_197.attributes||[];
_197.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||""});
expr=match[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
modifier=match[1],clause=match[2],rest=match[3];
switch(modifier){
case "#":
_197.id=clause;
break;
case ".":
_197.classNames.push(clause);
break;
case "":
case undefined:
_197.tagName=clause.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _198=this.params,conditions=[],clause;
if(_198.wildcard){
conditions.push("true");
}
if(clause=_198.id){
conditions.push("element.readAttribute(\"id\") == "+clause.inspect());
}
if(clause=_198.tagName){
conditions.push("element.tagName.toUpperCase() == "+clause.inspect());
}
if((clause=_198.classNames).length>0){
for(var i=0,length=clause.length;i<length;i++){
conditions.push("element.hasClassName("+clause[i].inspect()+")");
}
}
if(clause=_198.attributes){
clause.each(function(_19a){
var _19b="element.readAttribute("+_19a.name.inspect()+")";
var _19c=function(_19d){
return _19b+" && "+_19b+".split("+_19d.inspect()+")";
};
switch(_19a.operator){
case "=":
conditions.push(_19b+" == "+_19a.value.inspect());
break;
case "~=":
conditions.push(_19c(" ")+".include("+_19a.value.inspect()+")");
break;
case "|=":
conditions.push(_19c("-")+".first().toUpperCase() == "+_19a.value.toUpperCase().inspect());
break;
case "!=":
conditions.push(_19b+" != "+_19a.value.inspect());
break;
case "":
case undefined:
conditions.push("element.hasAttribute("+_19a.name.inspect()+")");
break;
default:
throw "Unknown operator "+_19a.operator+" in selector";
}
});
}
return conditions.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       element = $(element);       return "+this.buildMatchExpression());
},findElements:function(_19e){
var _19f;
if(_19f=$(this.params.id)){
if(this.match(_19f)){
if(!_19e||Element.childOf(_19f,_19e)){
return [_19f];
}
}
}
_19e=(_19e||document).getElementsByTagName(this.params.tagName||"*");
var _1a0=[];
for(var i=0,length=_19e.length;i<length;i++){
if(this.match(_19f=_19e[i])){
_1a0.push(Element.extend(_19f));
}
}
return _1a0;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_1a2,_1a3){
var _1a4=new Selector(_1a3);
return _1a2.select(_1a4.match.bind(_1a4)).map(Element.extend);
},findElement:function(_1a5,_1a6,_1a7){
if(typeof _1a6=="number"){
_1a7=_1a6,_1a6=false;
}
return Selector.matchElements(_1a5,_1a6||"*")[_1a7||0];
},findChildElements:function(_1a8,_1a9){
return _1a9.map(function(_1aa){
return _1aa.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(_1ab,expr){
var _1ad=new Selector(expr);
return _1ab.inject([],function(_1ae,_1af){
return _1ae.concat(_1ad.findElements(_1af||_1a8));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_1b1,_1b2){
var data=_1b1.inject({},function(_1b4,_1b5){
if(!_1b5.disabled&&_1b5.name){
var key=_1b5.name,value=$(_1b5).getValue();
if(value!=undefined){
if(_1b4[key]){
if(_1b4[key].constructor!=Array){
_1b4[key]=[_1b4[key]];
}
_1b4[key].push(value);
}else{
_1b4[key]=value;
}
}
}
return _1b4;
});
return _1b2?data:Hash.toQueryString(data);
}};
Form.Methods={serialize:function(form,_1b8){
return Form.serializeElements(Form.getElements(form),_1b8);
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_1ba,_1bb){
if(Form.Element.Serializers[_1bb.tagName.toLowerCase()]){
_1ba.push(Element.extend(_1bb));
}
return _1ba;
});
},getInputs:function(form,_1bd,name){
form=$(form);
var _1bf=form.getElementsByTagName("input");
if(!_1bd&&!name){
return $A(_1bf).map(Element.extend);
}
for(var i=0,matchingInputs=[],length=_1bf.length;i<length;i++){
var _1c1=_1bf[i];
if((_1bd&&_1c1.type!=_1bd)||(name&&_1c1.name!=name)){
continue;
}
matchingInputs.push(Element.extend(_1c1));
}
return matchingInputs;
},disable:function(form){
form=$(form);
form.getElements().each(function(_1c3){
_1c3.blur();
_1c3.disabled="true";
});
return form;
},enable:function(form){
form=$(form);
form.getElements().each(function(_1c5){
_1c5.disabled="";
});
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_1c7){
return _1c7.type!="hidden"&&!_1c7.disabled&&["input","select","textarea"].include(_1c7.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_1c9){
$(_1c9).focus();
return _1c9;
},select:function(_1ca){
$(_1ca).select();
return _1ca;
}};
Form.Element.Methods={serialize:function(_1cb){
_1cb=$(_1cb);
if(!_1cb.disabled&&_1cb.name){
var _1cc=_1cb.getValue();
if(_1cc!=undefined){
var pair={};
pair[_1cb.name]=_1cc;
return Hash.toQueryString(pair);
}
}
return "";
},getValue:function(_1ce){
_1ce=$(_1ce);
var _1cf=_1ce.tagName.toLowerCase();
return Form.Element.Serializers[_1cf](_1ce);
},clear:function(_1d0){
$(_1d0).value="";
return _1d0;
},present:function(_1d1){
return $(_1d1).value!="";
},activate:function(_1d2){
_1d2=$(_1d2);
_1d2.focus();
if(_1d2.select&&(_1d2.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_1d2.type))){
_1d2.select();
}
return _1d2;
},disable:function(_1d3){
_1d3=$(_1d3);
_1d3.disabled=true;
return _1d3;
},enable:function(_1d4){
_1d4=$(_1d4);
_1d4.blur();
_1d4.disabled=false;
return _1d4;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
var $F=Form.Element.getValue;
Form.Element.Serializers={input:function(_1d5){
switch(_1d5.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_1d5);
default:
return Form.Element.Serializers.textarea(_1d5);
}
},inputSelector:function(_1d6){
return _1d6.checked?_1d6.value:null;
},textarea:function(_1d7){
return _1d7.value;
},select:function(_1d8){
return this[_1d8.type=="select-one"?"selectOne":"selectMany"](_1d8);
},selectOne:function(_1d9){
var _1da=_1d9.selectedIndex;
return _1da>=0?this.optionValue(_1d9.options[_1da]):null;
},selectMany:function(_1db){
var _1dc,length=_1db.length;
if(!length){
return null;
}
for(var i=0,_1dc=[];i<length;i++){
var opt=_1db.options[i];
if(opt.selected){
_1dc.push(this.optionValue(opt));
}
}
return _1dc;
},optionValue:function(opt){
return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;
}};
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_1e0,_1e1,_1e2){
this.frequency=_1e1;
this.element=$(_1e0);
this.callback=_1e2;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _1e3=this.getValue();
var _1e4=("string"==typeof this.lastValue&&"string"==typeof _1e3?this.lastValue!=_1e3:String(this.lastValue)!=String(_1e3));
if(_1e4){
this.callback(this.element,_1e3);
this.lastValue=_1e3;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_1e5,_1e6){
this.element=$(_1e5);
this.callback=_1e6;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _1e7=this.getValue();
if(this.lastValue!=_1e7){
this.callback(this.element,_1e7);
this.lastValue=_1e7;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_1e8){
if(_1e8.type){
switch(_1e8.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_1e8,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_1e8,"change",this.onElementEvent.bind(this));
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(_1e9){
return _1e9.target||_1e9.srcElement;
},isLeftClick:function(_1ea){
return (((_1ea.which)&&(_1ea.which==1))||((_1ea.button)&&(_1ea.button==1)));
},pointerX:function(_1eb){
return _1eb.pageX||(_1eb.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_1ec){
return _1ec.pageY||(_1ec.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_1ed){
if(_1ed.preventDefault){
_1ed.preventDefault();
_1ed.stopPropagation();
}else{
_1ed.returnValue=false;
_1ed.cancelBubble=true;
}
},findElement:function(_1ee,_1ef){
var _1f0=Event.element(_1ee);
while(_1f0.parentNode&&(!_1f0.tagName||(_1f0.tagName.toUpperCase()!=_1ef.toUpperCase()))){
_1f0=_1f0.parentNode;
}
return _1f0;
},observers:false,_observeAndCache:function(_1f1,name,_1f3,_1f4){
if(!this.observers){
this.observers=[];
}
if(_1f1.addEventListener){
this.observers.push([_1f1,name,_1f3,_1f4]);
_1f1.addEventListener(name,_1f3,_1f4);
}else{
if(_1f1.attachEvent){
this.observers.push([_1f1,name,_1f3,_1f4]);
_1f1.attachEvent("on"+name,_1f3);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,length=Event.observers.length;i<length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_1f6,name,_1f8,_1f9){
_1f6=$(_1f6);
_1f9=_1f9||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1f6.attachEvent)){
name="keydown";
}
Event._observeAndCache(_1f6,name,_1f8,_1f9);
},stopObserving:function(_1fa,name,_1fc,_1fd){
_1fa=$(_1fa);
_1fd=_1fd||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1fa.detachEvent)){
name="keydown";
}
if(_1fa.removeEventListener){
_1fa.removeEventListener(name,_1fc,_1fd);
}else{
if(_1fa.detachEvent){
try{
_1fa.detachEvent("on"+name,_1fc);
}
catch(e){
}
}
}
}});
if(navigator.appVersion.match(/\bMSIE\b/)){
Event.observe(window,"unload",Event.unloadCache,false);
}
var Position={includeScrollOffsets:false,prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_1fe){
var _1ff=0,valueL=0;
do{
_1ff+=_1fe.scrollTop||0;
valueL+=_1fe.scrollLeft||0;
_1fe=_1fe.parentNode;
}while(_1fe);
return [valueL,_1ff];
},cumulativeOffset:function(_200){
var _201=0,valueL=0;
do{
_201+=_200.offsetTop||0;
valueL+=_200.offsetLeft||0;
_200=_200.offsetParent;
}while(_200);
return [valueL,_201];
},positionedOffset:function(_202){
var _203=0,valueL=0;
do{
_203+=_202.offsetTop||0;
valueL+=_202.offsetLeft||0;
_202=_202.offsetParent;
if(_202){
if(_202.tagName=="BODY"){
break;
}
var p=Element.getStyle(_202,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_202);
return [valueL,_203];
},offsetParent:function(_205){
if(_205.offsetParent&&!(_205.style.display=="none"&&_205.offsetParent==document.body)){
return _205.offsetParent;
}
if(_205==document.body){
return _205;
}
while((_205=_205.parentNode)&&_205!=document.body){
if(Element.getStyle(_205,"position")!="static"){
return _205;
}
}
return document.body;
},within:function(_206,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_206,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_206);
return (y>=this.offset[1]&&y<this.offset[1]+_206.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_206.offsetWidth);
},withinIncludingScrolloffsets:function(_209,x,y){
var _20c=this.realOffset(_209);
this.xcomp=x+_20c[0]-this.deltaX;
this.ycomp=y+_20c[1]-this.deltaY;
this.offset=this.cumulativeOffset(_209);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_209.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_209.offsetWidth);
},overlap:function(mode,_20e){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_20e.offsetHeight)-this.ycomp)/_20e.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_20e.offsetWidth)-this.xcomp)/_20e.offsetWidth;
}
},page:function(_20f){
var _210=0,valueL=0;
var _211=_20f;
do{
_210+=_211.offsetTop||0;
valueL+=_211.offsetLeft||0;
if(_211.offsetParent==document.body){
if(Element.getStyle(_211,"position")=="absolute"){
break;
}
}
}while(_211=_211.offsetParent);
_211=_20f;
do{
if(!window.opera||_211.tagName=="BODY"){
_210-=_211.scrollTop||0;
valueL-=_211.scrollLeft||0;
}
}while(_211=_211.parentNode);
return [valueL,_210];
},clone:function(_212,_213){
var _214=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_212=$(_212);
var p=Position.page(_212);
_213=$(_213);
var _216=[0,0];
var _217=null;
if(Element.getStyle(_213,"position")=="absolute"){
_217=Position.offsetParent(_213);
_216=Position.page(_217);
}
if(_217==document.body){
_216[0]-=document.body.offsetLeft;
_216[1]-=document.body.offsetTop;
}
if(_214.setLeft){
_213.style.left=(p[0]-_216[0]+_214.offsetLeft)+"px";
}
if(_214.setTop){
_213.style.top=(p[1]-_216[1]+_214.offsetTop)+"px";
}
if(_214.setWidth){
_213.style.width=_212.offsetWidth+"px";
}
if(_214.setHeight){
_213.style.height=_212.offsetHeight+"px";
}
},absolutize:function(_218){
_218=$(_218);
if(_218.style.position=="absolute"){
return;
}
Position.prepare();
var _219=Position.positionedOffset(_218);
var top=_219[1];
var left=_219[0];
var _21c=_218.clientWidth;
var _21d=_218.clientHeight;
_218._originalLeft=left-parseFloat(_218.style.left||0);
_218._originalTop=top-parseFloat(_218.style.top||0);
_218._originalWidth=_218.style.width;
_218._originalHeight=_218.style.height;
_218.style.position="absolute";
_218.style.top=top+"px";
_218.style.left=left+"px";
_218.style.width=_21c+"px";
_218.style.height=_21d+"px";
},relativize:function(_21e){
_21e=$(_21e);
if(_21e.style.position=="relative"){
return;
}
Position.prepare();
_21e.style.position="relative";
var top=parseFloat(_21e.style.top||0)-(_21e._originalTop||0);
var left=parseFloat(_21e.style.left||0)-(_21e._originalLeft||0);
_21e.style.top=top+"px";
_21e.style.left=left+"px";
_21e.style.height=_21e._originalHeight;
_21e.style.width=_21e._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_221){
var _222=0,valueL=0;
do{
_222+=_221.offsetTop||0;
valueL+=_221.offsetLeft||0;
if(_221.offsetParent==document.body){
if(Element.getStyle(_221,"position")=="absolute"){
break;
}
}
_221=_221.offsetParent;
}while(_221);
return [valueL,_222];
};
}
Element.addMethods();
}
if($Bootstrap.notLoaded("4f62fc6eb892bd96b1e31f4e3878786b")){
var Debug={alert:function(v){
alert(Debug.dump(v));
},dump:function(v,l,r){
function indent(n){
var r="";
for(var i=0;i<n;i++){
r+=" ";
}
return r;
}
if(r===undefined){
r=true;
}
var t=typeof v;
var l=l||0;
if(t=="object"){
var _22b=[];
for(var i in v){
if(typeof v[i]=="function"){
continue;
}
var p=indent(l+4)+i+" => ";
if(r){
p+=this.dump(v[i],l+4,true);
}else{
p+=v[i];
}
_22b.push(p);
}
return "{\n"+_22b.join(",\n")+"\n"+indent(l)+"}";
}else{
return v;
}
},popup:function(obj){
if(typeof obj=="string"){
var _22f=obj;
}else{
var _22f=this.dump(obj);
}
var w=window.open("","","width=800,height=600,scrollbars=yes");
w.document.open();
w.document.write("<pre>"+obj+"</pre>");
w.document.close();
},_fixed_window:null,fixedPopup:function(str){
if(!this._fixed_window||this._fixed_window.closed){
this._fixed_window=window.open("","","width=800,height=600,scrollbars=yes");
}
this._fixed_window.document.body.innerHTML+="<pre>"+str+"</pre>";
}};
}
if($Bootstrap.notLoaded("ff1ce524f8b7ee297c8a82c79ee26820")){
var JSON=function(){
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={"boolean":function(x){
return String(x);
},number:function(x){
return isFinite(x)?String(x):"null";
},string:function(x){
if(/["\\\x00-\x1f]/.test(x)){
x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){
var c=m[b];
if(c){
return c;
}
c=b.charCodeAt();
return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
});
}
return "\""+x+"\"";
},object:function(x){
if(x){
var a=[],b,f,i,l,v;
if(x instanceof Array){
a[0]="[";
l=x.length;
for(i=0;i<l;i+=1){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
}
a[a.length]=v;
b=true;
}
}
}
a[a.length]="]";
}else{
if(x instanceof Object){
a[0]="{";
for(i in x){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
}
a.push(s.string(i),":",v);
b=true;
}
}
}
a[a.length]="}";
}else{
return;
}
}
return a.join("");
}
return "null";
}};
return {stringify:function(v){
var f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
return v;
}
}
return null;
},parse:function(text){
try{
return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+text+")");
}
catch(e){
return false;
}
}};
}();
}
if($Bootstrap.notLoaded("e415771d02b6f98c90436f8a34d6993b")){
Framework={create:function(name,obj){
var _240=name.split(".");
var root=window;
var i=0;
for(ii=_240.length-1;i<ii;i++){
if(!root[_240[i]]){
root[_240[i]]={exists:false};
}
root=root[_240[i]];
}
if(root[_240[i]]){
var leaf=root[_240[i]];
if(typeof leaf["exists"]!="undefined"&&leaf.exists==false){
delete leaf["exists"];
}
}else{
root[_240[i]]={};
}
if(typeof obj=="function"&&obj.bind){
root[_240[i]]=obj;
}else{
for(var p in obj){
if(typeof root[_240[i]][p]=="undefined"){
root[_240[i]][p]=obj[p];
}
}
}
return root[_240[i]];
},register:function(name){
var _246=name.split(".");
var root=window;
var i=0;
for(ii=_246.length;i<ii;i++){
if(!root[_246[i]]){
root[_246[i]]={exists:false};
}
root=root[_246[i]];
}
}};
function defined(v){
if(typeof (v)=="undefined"){
return false;
}else{
return true;
}
}
}
if($Bootstrap.notLoaded("5e911cddd131af06bcc095f5461fbdad")){
Browser={is_safari_1_3:/Safari\/312/.test(navigator.userAgent),is_safari:/Konqueror|Safari|KHTML/.test(navigator.userAgent),is_ie:/MSIE/.test(navigator.userAgent),is_ie6:/MSIE\ 6/.test(navigator.userAgent),is_ie7:/MSIE\ 7/.test(navigator.userAgent),is_firefox:/Firefox/.test(navigator.userAgent),is_win:/Win/.test(navigator.platform),is_win2k:/Windows\ NT\ 5\.0/.test(navigator.userAgent),is_mac:/Mac/.test(navigator.platform),is_linux:/Linux/.test(navigator.platform),getDimensions:function(){
if(this.is_ie){
var _24a=document.body.clientHeight;
var _24b=document.body.clientWidth;
}else{
var _24a=window.innerHeight;
var _24b=window.innerWidth;
}
return [_24a,_24b];
},getIframeDocument:function(_24c){
if(!_24c){
return null;
}
var root=_24c.contentWindow||_24c.contentDocument;
if(root.document){
root=root.document;
}
return root;
},popup:function(u,h,w,t,l,_253,_254){
var left=l||(screen.width-w)/2;
var top=t||(screen.height-h-60)/2;
_253=(_253?"yes":"no");
_254=(_254?"yes":"no");
var _257="status,width="+w+",height="+h+",scrollbars="+_254+",resizable="+_253+",top="+top+",left="+left;
return window.open(u,"",_257);
}};
}
if($Bootstrap.notLoaded("3f2f1ddb89e6f36af2e73b1c338ee436")){
function __ginit(){
if($_w){
return;
}
$_w=window;
$_d=document;
$_b=document.body;
}
function _ac(par){
for(a=1,aa=arguments.length;a<aa;a++){
_ge(par).appendChild(_ge(arguments[a]));
}
}
function _ac_index(par,_25a){
var _25b=_ge(par).childNodes.length-1;
if(_25b<0){
_25b=0;
}
for(var a=2,aa=arguments.length;a<aa;a++){
if(_25a<=_25b){
var _25d=_ge(par).childNodes[_25a];
_ge(par).insertBefore(_ge(arguments[a]),_25d);
}else{
_ge(par).appendChild(_ge(arguments[a]));
}
}
}
function _ce(type,_25f){
__ginit();
var e=$_d.createElement(type);
if(!e){
return false;
}
for(p in _25f){
e[p]=_25f[p];
}
return e;
}
function _ce_html(html){
__ginit();
var c=_ce("div");
_html(c,html);
return c.firstChild;
}
function _check(o){
_ge(o).checked=true;
}
function _cookie(n,v,e){
if(v){
var d=(new Date).getTime();
document.cookie=n+"="+v+";"+(e?"expires="+(new Date(d+e).toGMTString()):"");
}else{
var c=" "+$_d.cookie;
var p=c.indexOf(" "+n+"=");
if(p!=-1){
var e=c.indexOf(";",p);
return c.substring(p+n.length+2,(e==-1?c.length:e));
}else{
return "";
}
}
}
function _cssProp(elem,prop,_26c){
var s,p="undefined";
var dv=document.defaultView;
if(dv&&dv.getComputedStyle){
s=dv.getComputedStyle(elem,"");
if(s){
p=s.getPropertyValue(prop);
}
}else{
if(elem.currentStyle){
var a=prop.split("-");
prop=a[0];
for(var i=1;i<a.length;++i){
c=a[i].charAt(0);
prop+=a[i].replace(c,c.toUpperCase());
}
p=elem.currentStyle[prop];
}else{
return null;
}
}
return _26c?(parseInt(p)||0):p;
}
function _find_parent(e,f){
while(e!=$_b&&!f(e)){
e=e.parentNode;
}
if(e==$_b){
return null;
}
return e;
}
function _ge(obj,win){
__ginit();
if(typeof obj!="string"){
return obj;
}
if(win){
d=win.document;
}else{
d=$_d;
}
return d.getElementById(obj);
}
function _height(obj,h){
obj=_ge(obj);
if(h){
obj.style.height=parseInt(h)+"px";
}else{
return obj.offsetHeight;
}
}
function _hide(o){
var d=_ge(o);
if(d){
d.style.display="none";
}
}
function _html(obj,h){
obj=_ge(obj);
if(typeof h!="undefined"){
obj.innerHTML=h;
}else{
return obj.innerHTML;
}
}
function _left(obj,l){
obj=_ge(obj);
if(l){
obj.style.left=parseInt(l)+"px";
}else{
var cl=0;
if(obj.offsetParent){
while(obj.offsetParent){
cl+=obj.offsetLeft;
obj=obj.offsetParent;
}
}else{
cl+=obj.offsetLeft;
}
return cl;
}
}
function _msx(e){
if(window.event){
return event.clientX;
}else{
return e.clientX;
}
}
function _msy(e){
if(window.event){
return event.clientY;
}else{
return e.clientY;
}
}
function _node_name(o){
return o.nodeName.toLowerCase();
}
function _pd(e){
if(e&&e.preventDefault){
e.preventDefault();
}else{
if(window.event){
window.event.returnValue=false;
}
}
}
function _rc(par,chi){
par.removeChild(chi);
}
function _remove(elem){
elem=_ge(elem);
elem.parentNode.removeChild(elem);
}
function _select(o,v){
o=_ge(o);
var op=o.options;
var idx=0;
for(i=0,ii=op.length;i<ii;i++){
if(op[i].value==v){
idx=i;
break;
}
}
o.selectedIndex=idx;
}
function _serialize(v){
var r="";
if(typeof v=="string"||typeof v=="number"){
if(v.replace){
v=v.replace(/\"/g,"\\\"");
}
r="\""+v+"\"";
}else{
var c=[];
for(var i in v){
c.push(i+":"+_serialize(v[i]));
}
r="{"+c.join(",")+"}";
}
return r;
}
function _show(o){
_ge(o).style.display="";
}
function _sp(e){
if(e&&e.stopPropagation){
e.stopPropagation();
}else{
if(window.event){
window.event.cancelBubble=true;
}
}
}
function _src_elem(e,n){
var o=null;
if(window.event){
o=window.event.srcElement;
}else{
if(e){
o=e.target;
}else{
return null;
}
}
if(n){
o=_find_parent(o,function(x){
return (_node_name(x)==n?true:false);
});
}
return o;
}
function _style(o,st){
o=_ge(o);
for(s in st){
o.style[s]=st[s];
}
}
function _top(obj,t){
obj=_ge(obj);
if(t){
obj.style.top=parseInt(t)+"px";
}else{
var ct=0;
if(obj.offsetParent){
while(obj.offsetParent){
ct+=obj.offsetTop;
obj=obj.offsetParent;
}
}else{
ct+=obj.offsetTop;
}
return ct;
}
}
function _uncheck(o){
_ge(o).checked=false;
}
function _v(obj,v){
obj=_ge(obj);
if(typeof v!="undefined"){
obj.value=v;
}else{
if(obj&&obj.value){
return obj.value;
}
}
return "";
}
function _width(obj,w){
obj=_ge(obj);
if(w){
obj.style.width=parseInt(w)+"px";
}else{
return obj.offsetWidth;
}
}
$_w=null;
$_d=null;
$_b=null;
}
if($Bootstrap.notLoaded("a1d0b8672681f3e5ad73076dad1a1c0c")){
if(Object&&Object.extend){
Object.extend(Array.prototype,{insert:function(_29d,_29e){
for(var i=this.length-1;i>=_29d;i--){
this[i+1]=this[i];
}
this[_29d]=_29e;
},isMember:function(str,_2a1){
return this.indexOf(str,_2a1)>-1;
},quicksort:function(_2a2,low,high){
var _2a5,pivot,swap1,swap2,temp;
_2a2=_2a2||Array._compareNormal;
if(typeof low=="undefined"){
low=0;
}
if(typeof high=="undefined"){
high=this.length-1;
}
if((high-low)==1){
if(_2a2(this[low],this[high])==1){
temp=this[low];
this[low]=this[high];
this[high]=temp;
}
return;
}
_2a5=parseInt((low+high)/2);
pivot=this[_2a5];
this[_2a5]=this[low];
this[low]=pivot;
swap1=low+1;
swap2=high;
do{
while(swap1<=swap2&&_2a2(this[swap1],pivot)!=1){
swap1++;
}
while(_2a2(this[swap2],pivot)==1){
swap2--;
}
if(swap1<swap2){
temp=this[swap1];
this[swap1]=this[swap2];
this[swap2]=temp;
}
}while(swap1<swap2);
this[low]=this[swap2];
this[swap2]=pivot;
if(low<(swap2-1)){
this.quicksort(_2a2,low,swap2-1);
}
if((swap2+1)<high){
this.quicksort(_2a2,swap2+1,high);
}
},remove:function(_2a6){
for(var i=_2a6,ii=this.length-1;i<ii;i++){
this[i]=this[i+1];
}
if(this.length>0){
this.length--;
}
},unique:function(_2a8){
if(this.length==0){
return this;
}
if(arguments.length==0){
_2a8=false;
}
var _2a9=new Array(this[0]);
var _2aa,tmp1,tmp2;
for(var i=0;i<this.length;i++){
if(!_2a9.isMember(this[i],_2a8)){
_2a9.push(this[i]);
}
}
return _2a9;
},in_array:function(obj){
var len=this.length;
for(var x=0;x<=len;x++){
if(this[x]==obj){
return true;
}
}
return false;
}});
}
if(Object&&Object.extend){
Object.extend(Array,{diff:function(_2af,_2b0){
var diff=[];
for(var i=0,ii=_2af.length;i<ii;i++){
if(!_2b0.isMember(_2af[i])){
diff.push(_2af[i]);
}
}
return diff;
},merge:function(){
var _2b3=[];
for(var a=0,aa=arguments.length;a<aa;a++){
for(var i=0,ii=arguments[a].length;i<ii;i++){
_2b3.push(arguments[a][i]);
}
}
return _2b3;
},_compareNormal:function(a,b){
if(a<b){
return -1;
}else{
if(a>b){
return 1;
}else{
return 0;
}
}
}});
}
}
if($Bootstrap.notLoaded("842814c5c5b8254f3a34982948200b29")){
if(Object&&Object.extend&&Element){
var ElementExt={append:function(){
var _2b8=$(arguments[0]);
for(var i=1,ii=arguments.length;i<ii;i++){
_2b8.appendChild($(arguments[i]));
}
return _2b8;
},appendOverlay:function(_2ba,_2bb){
var _2bc=_2ba.lastChild||_2ba;
var _2bd=Position.cumulativeOffset(_2bc);
var _2be=_2ba==_2bc?{width:0,height:0}:Element.getDimensions(_2bc);
Element.setStyle(_2bb,{position:"absolute",left:_2bd[0]+"px",top:(_2bd[1]+_2be.height)+"px"});
},appendStrict:function(){
var args=$A(arguments);
var _2c0=args.shift();
_2c0=$(_2c0);
for(var i=0,ii=args.length;i<ii;i++){
var _2c2=Element.create("div");
_2c2.appendChild($(args[i]));
_2c0.innerHTML=_2c0.innerHTML+_2c2.innerHTML;
}
return _2c0;
},create:function(type,_2c4){
var elem=document.createElement(type);
for(p in _2c4){
elem[p]=_2c4[p];
}
return $(elem);
},__create_html_div:null,createHtml:function(html){
if(!Element.__create_html_div){
Element.__create_html_div=Element.create("div");
}
Element.__create_html_div.innerHTML=html;
var _2c7=Element.__create_html_div.firstChild;
Element.remove(_2c7);
return $(_2c7);
},getByTag:function(_2c8,tag){
return _2c8.getElementsByTagName(tag);
},_getDimensions:Element.getDimensions,getDimensions:function(_2ca){
var _2cb=$(_2ca)._getDimensions();
if(Browser.is_safari&&_2ca.tagName.toLowerCase()=="tr"){
var _2cc=0;
var _2cd=_2ca.childNodes;
for(var i=0;i<_2cd.length;i++){
var _2cf=$(_2cd[i])._getDimensions().height;
if(_2cf>_2cc){
_2cc=_2cf;
}
}
return {width:_2cb.width,height:_2cc};
}else{
return _2cb;
}
},getText:function(_2d0){
if(_2d0.childNodes.length>1){
return _2d0.childNodes[1].nodeValue;
}else{
return _2d0.firstChild.nodeValue;
}
},insert:function(_2d1,_2d2){
_2d1=$(_2d1);
if(!_2d1){
return;
}
var _2d3=_2d1.childNodes;
var _2d4=_2d3.length-1;
if(_2d4<0){
_2d4=0;
}
for(var a=2,aa=arguments.length;a<aa;a++){
if(_2d3.length>0&&_2d2<=_2d4){
var _2d6=_2d3[_2d2];
_2d1.insertBefore($(arguments[a]),_2d6);
}else{
_2d1.appendChild($(arguments[a]));
}
}
},isMember:function(_2d7,_2d8){
if($(_2d8).parentNode==$(_2d7)){
return true;
}else{
return false;
}
},isOrphan:function(_2d9){
_2d9=$(_2d9);
if(!_2d9.parentNode||Element.nodeName(_2d9.parentNode)=="#document-fragment"){
return true;
}else{
return false;
}
},reallyVisible:function(_2da){
_2da=$(_2da);
if((_2da.offsetHeight||0)==0){
return false;
}else{
return true;
}
},update:function(_2db,text){
$(_2db).innerHTML=text;
},updateText:function(_2dd,text,_2df){
_2df=Object.extend({escape_spaces:false,allow_breaks:true},_2df||{});
text=text.escapeHTML();
if(!_2df.allow_breaks){
text=text.replace(/ /g,"&nbsp;");
}else{
if(_2df.escape_spaces){
text=text.replace(/  /g," &nbsp;");
}
}
$(_2dd).innerHTML=text;
},contains:function(_2e0,_2e1){
if(!$(_2e1)){
return false;
}else{
if($(_2e1)==$(_2e0)){
return true;
}else{
return Element.contains($(_2e0),$(_2e1).parentNode);
}
}
}};
Object.extend(Element,ElementExt);
Element.addMethods(ElementExt);
Object.extend(Element,{nodeName:function(_2e2){
return (new String($(_2e2).nodeName)).toLowerCase();
}});
}
document._getElementById=document.getElementById;
document.getElementById=function(id){
var a=[];
var o=document._getElementById(id);
if(!o){
return o;
}
while(o.id!=id){
a.push({i:o.id,e:o});
o.id="";
o=document._getElementById(id);
if(!o){
return o;
}
}
for(j=0,jj=a.length;j<jj;j++){
a[j].e.id=a[j].i;
}
a=null;
return o;
};
}
if($Bootstrap.notLoaded("76874a4e44f462537d24fd3137829cfe")){
if(Object&&Object.extend&&Event){
Object.extend(Event,{type:function(e){
return e.type;
},key:function(e){
return e.keyCode;
}});
Event._observe=Event.observe;
Event.observe=function(_2e8,_2e9,func,_2eb){
if(_2eb){
func=func.bindAsEventListener(_2eb);
}
Event._observe(_2e8,_2e9,func);
};
Event.__observeAndCache=Event._observeAndCache;
Event._observeAndCache=function(_2ec,name,_2ee,_2ef){
if(name=="dblclick"&&navigator.appVersion.match(/Konqueror|Safari|KHTML/)){
if(!_2ec.ondblclick){
_2ec.ondblclick=function(e){
var _2f1=Event.element(e);
while(!_2f1.ondblclick){
_2f1=_2f1.parentNode;
if(_2f1==document.body){
return false;
}
}
$A(_2f1.dbl_funcs).each(function(func){
func(e);
});
};
}
if(!_2ec.dbl_funcs){
_2ec.dbl_funcs=new Array();
}
_2ec.dbl_funcs.push(_2ee);
}else{
if((name=="click"||name=="dblclick")&&Element.nodeName(_2ec)=="a"){
_2ec.onclick=function(){
return false;
};
}
Event.__observeAndCache(_2ec,name,_2ee,_2ef);
}
};
Event._stopObserving=Event.stopObserving;
Event.stopObserving=function(_2f3,name,_2f5,_2f6){
if(name=="dblclick"&&navigator.appVersion.match(/Konqueror|Safari|KHTML/)){
if(_2f3.dbl_funcs){
_2f3.dbl_funcs=_2f3.dbl_funcs.reject(function(func){
return (func==_2f5);
});
}
}else{
Event._stopObserving(_2f3,name,_2f5,_2f6);
}
};
Event.stopPropagation=function(_2f8){
if(_2f8.preventDefault){
_2f8.stopPropagation();
}else{
_2f8.cancelBubble=true;
}
};
}
}
if($Bootstrap.notLoaded("e71ce29c967e3eeccdb8b5cf3d592c78")){
if(Object&&Object.extend&&Form){
Form.prepare=function(form){
var _2fa=Form.getElements(form);
for(var i=0,ii=_2fa.length;i<ii;i++){
var elm=_2fa[i];
if(elm.name&&!form[elm.name]){
form[elm.name]=elm;
}
}
};
}
}
if($Bootstrap.notLoaded("755a567decd59875365159c0d29db763")){
if(typeof Form=="undefined"){
Form={};
}
Form.Select={append:function(_2fd,opt){
var _2ff=document.createElement("option");
Element.update(_2ff,opt.text.replace(/\ /g,"&nbsp;"));
_2ff.value=opt.value;
_2ff.className=opt.className;
_2fd.appendChild(_2ff);
return _2ff;
},binarySearch:function(_300,opt){
var _302=Object.extend({returnBestFitPosition:false,low:0,high:_300.options.length},arguments[2]||{});
var low=_302.low;
var high=_302.high;
while(low!=high){
var mid=parseInt((low+high)/2);
if(opt.text>_300.options[mid].text){
low=mid+1;
}else{
if(opt.text<_300.options[mid].text){
high=mid;
}else{
return mid;
}
}
}
if(_302.returnBestFitPosition){
return low;
}
return -1;
},clear:function(_306){
_306=$(_306);
while(_306&&_306.options&&_306.options.length>0){
try{
_306.options[0]=null;
}
catch(e){
}
}
},contains:function(_307,opt){
var _309=Object.extend({sorted:false},arguments[2]||{});
if(_309.sorted){
return (Form.Select.binarySearch(_307,opt)>-1);
}else{
return (Form.Select.iterativeSearch(_307,opt,_309)>-1);
}
},insert:function(_30a,opt){
var _30c=Object.extend({sorted:false,unique:false,position:_30a.options.length},arguments[2]||{});
if(_30c.sorted){
_30c.position=Form.Select.binarySearch(_30a,opt,{returnBestFitPosition:true});
}
if(_30c.unique&&_30a.options.length>0&&((_30c.sorted&&_30c.position<_30a.options.length&&_30a.options[_30c.position].value==opt.value)||Form.Select.contains(_30a,opt,_30c))){
return false;
}
if(_30c.position>_30a.options.length){
return false;
}else{
if(_30c.position==_30a.options.length){
return Form.Select.append(_30a,opt);
}else{
var _30d=document.createElement("option");
Element.update(_30d,opt.text.replace(/\ /g,"&nbsp;"));
_30d.value=opt.value;
_30d.className=opt.className;
_30a.insertBefore(_30d,_30a.options[_30c.position]);
return _30d;
}
}
},iterativeSearch:function(_30e,opt){
for(var i=0;i<_30e.options.length;i++){
if(_30e.options[i].text==opt.text){
return i;
}
}
return -1;
},remove:function(_311,opt){
var _313=Object.extend({sorted:false},arguments[2]||{});
var _314=-1;
do{
if(_313.sorted){
_314=Form.Select.binarySearch(_311,opt);
}else{
_314=Form.Select.iterativeSearch(_311,opt);
}
if(_314!=-1){
var _315=_311.options[_314].value;
_311.options[_314]=null;
return _315;
}
}while(_314!=-1);
},setSelected:function(_316,_317){
_316=$(_316);
for(var i=0,ii=_316.options.length;i<ii;i++){
if(_316.options[i].value==_317){
_316.selectedIndex=i;
return true;
}
}
return false;
},setInnerHTML:function(_319,html){
if(wack.Browser.is_ie){
html="<option>truncated</option>"+html;
}
_319.innerHTML=html;
if(wack.Browser.is_ie){
_319.outerHTML=_319.outerHTML;
}
},swap:function(_31b,_31c,_31d){
var opt1=_31b.options[_31c];
var opt2=_31b.options[_31d];
var _320=opt1.text;
var _321=opt1.value;
opt1.text=opt2.text;
opt1.value=opt2.value;
opt2.text=_320;
opt2.value=_321;
},transfer:function(_322,_323){
var _324=[];
var _325=arguments[2]||{};
while(_322.selectedIndex!=-1){
var opt=_322.options[_322.selectedIndex];
_322.options[_322.selectedIndex]=null;
_324.push(opt.value);
opt.text=opt.text.escapeHTML({escape_newlines:false});
Form.Select.insert(_323,opt,_325);
}
return _324;
},copy:function(_327,_328){
var _329=arguments[2]||{};
$A(_327.options).each(function(opt){
Form.Select.insert(_328,opt,_329);
});
}};
if(Object.extend){
Object.extend(Form.Select,{include:Form.Select.contains});
}
}
if($Bootstrap.notLoaded("3becd7b6dca5d8b33ac9960a2adde6b5")){
if(Object&&Object.extend&&Function){
Object.extend(Function,{release:function(func,win){
win=win||window;
win.setTimeout(func,1);
}});
}
}
if($Bootstrap.notLoaded("da038ea0aedc4da16143fe95b1a949d9")){
if(Object&&Object.extend){
Object.extend(Number.prototype,{format:function(){
return Number.format(this);
}});
Object.extend(Number,{format:function(n){
var s=String(n);
var l=s.length;
var o=l-3;
var r="";
while(o>0){
r=","+s.substr(o,3)+r;
o-=3;
}
r=s.substr(0,o+3)+r;
return r;
}});
}
}
if($Bootstrap.notLoaded("130d923153e0271ab263bc00af57792a")){
Object.equals=function(_332,_333){
if(!window.JSON){
return false;
}
return (JSON.stringify(_332)==JSON.stringify(_333));
};
if(Object.extend){
Object.extend(Object,{bindCallbacks:function(obj){
for(var t in obj){
if(t.substr(0,3)=="_cb"&&!obj[t.substr(1)]){
obj[t.substr(1)]=obj[t].bind(obj);
}
}
},bindObservers:function(obj){
for(var t in obj){
if(t.substr(0,3)=="_ev"&&!obj[t.substr(1)]){
obj[t.substr(1)]=obj[t].bindAsEventListener(obj);
}
}
},copy:function(obj){
switch(typeof obj){
case "object":
if(obj===null){
return obj;
}else{
if(obj instanceof Array){
var _339=obj.clone();
for(var i=0,ii=_339.length;i<ii;i++){
_339[i]=Object.copy(_339[i]);
}
return _339;
}else{
if(obj.clone){
return obj.clone();
}else{
if(obj instanceof Object){
var _339=Object.clone(obj);
for(var i in _339){
_339[i]=Object.copy(_339[i]);
}
return _339;
}
}
}
}
return obj;
case "function":
case "boolean":
case "number":
case "string":
default:
return obj;
}
}});
}
}
if($Bootstrap.notLoaded("85b02162b717b2dd47c07b50f5eeeb7f")){
String.prototype.urlEncode=function(){
var _33b="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";
var HEX="0123456789ABCDEF";
var _33d=this;
var _33e="";
for(var i=0;i<_33d.length;i++){
var ch=_33d.charAt(i);
if(ch==" "){
_33e+="+";
}else{
if(_33b.indexOf(ch)!=-1){
_33e+=ch;
}else{
var _341=ch.charCodeAt(0);
if(_341>255){
alert("Unicode Character '"+ch+"' cannot be encoded using standard URL encoding.\n"+"(URL encoding only supports 8-bit characters.)\n"+"A space (+) will be substituted.");
_33e+="+";
}else{
_33e+="%";
_33e+=HEX.charAt((_341>>4)&15);
_33e+=HEX.charAt(_341&15);
}
}
}
}
return _33e;
};
String.prototype.urlDecode=function(){
var _342="0123456789ABCDEFabcdef";
var _343=this.toString();
_343=_343.replace(/%00/g,"");
var _344="";
var i=0;
while(i<_343.length){
var ch=_343.charAt(i);
if(ch=="+"){
_344+=" ";
i++;
}else{
if(ch=="%"){
if(i<(_343.length-2)&&_342.indexOf(_343.charAt(i+1))!=-1&&_342.indexOf(_343.charAt(i+2))!=-1){
_344+=unescape(_343.substr(i,3));
i+=3;
}else{
_344+="";
i++;
}
}else{
_344+=ch;
i++;
}
}
}
return _344;
};
String.prototype.trim=function(){
var str=this;
str=str.replace(/^\s*/,"").replace(/\s*$/,"");
return str;
};
String.prototype.escapeHTML=function(_348){
_348=Object.extend({allow_wrap:true,escape_newlines:true,escape_spaces:false},_348||{});
if(_348.escape_newlines){
var _349=this.split("\n");
}else{
var _349=[this];
}
var div=document.createElement("div");
var ret="";
for(var i=0,ii=_349.length;i<ii;i++){
var _34d=document.createTextNode(_349[i]);
div.appendChild(_34d);
if(_348.escape_newlines&&i+1!=ii){
var br=document.createElement("br");
div.appendChild(br);
}
}
ret=div.innerHTML;
div.innerHTML="";
if(_348.escape_spaces){
ret=(_348.allow_wrap?ret.replace(/  /g," &nbsp;"):ret.replace(/ /g,"&nbsp;"));
}
return ret;
};
String.prototype.unescapeHTML=function(_34f){
_34f=Object.extend({unescape_spaces:false},_34f||{});
var div=document.createElement("div");
var text=this.stripTags();
if(_34f.unescape_spaces){
text=text.replace("&nbsp;"," ");
}
text_array=text.split("\n");
var _352="";
for(var i=0,ii=text_array.length;i<ii;i++){
div.innerHTML=text_array[i];
_352+=div.childNodes[0]?div.childNodes[0].nodeValue:"";
if(i+1!=ii){
_352+="\n";
}
}
return _352;
};
if(Object&&Object.extend){
Object.extend(String.prototype,{addSlashes:function(){
return String.addSlashes(this);
},htmlEncode:function(){
var _354=this.toString();
_354=_354.replace(/&/g,"&amp;");
_354=_354.replace(/</g,"&lt;");
_354=_354.replace(/>/g,"&gt;");
return _354;
},splitByLastChar:function(find){
return String.splitByLastChar(this,find);
},toFilesize:function(_356){
_356=_356||0;
var size=parseFloat(this)/1024;
size=size.toFixed(_356);
var unit="KB";
if(size<1){
size="< 1";
}else{
if(size>=1048576){
size=size/1048576;
size=size.toFixed(_356);
unit="GB";
}else{
if(size>=1024){
size=size/1024;
size=size.toFixed(_356);
unit="MB";
}
}
}
return size+" "+unit;
}});
Object.extend(String,{addSlashes:function(s){
s=new String(s);
s=s.replace(/\\/g,"\\\\");
s=s.replace(/\'/g,"\\'");
s=s.replace(/\"/g,"\\\"");
return s;
},compare:function(a,b,_35c){
if(!_35c){
a=a.toLowerCase();
b=b.toLowerCase();
}
if(a==b){
return true;
}else{
return false;
}
},repeat:function(_35d,_35e){
var _35f="";
for(var i=0;i<_35e;i++){
_35f+=_35d;
}
return _35f;
},splitByLastChar:function(_361,find){
var p=_361.lastIndexOf(find);
if(p==-1){
return [_361,_361];
}else{
return [_361.substring(0,p),_361.substring(p+1)];
}
}});
}
String.prototype.urlencode=String.prototype.urlEncode;
String.prototype.urldecode=String.prototype.urlDecode;
function urldecode(_364){
return _364.urlDecode();
}
}
if($Bootstrap.notLoaded("732d8729061df620cbb7ffa6fe890c11")){
wack={addMethods:function(obj,_366,_367){
wack.extend(obj,_366);
if(_367){
for(var func in _366){
obj.prototype[func]=function(){
var args=[];
for(var i=0,ii=arguments.length;i<ii;i++){
args.push(arguments[i]);
}
return _366[func].apply(null,[this].concat(args));
};
}
}
},depends:function(path){
var _36c=path.split(".");
var root=window;
for(var i=0,ii=_36c.length;i<ii;i++){
if(!root[_36c[i]]){
root[_36c[i]]={__wack_exists:false};
}
root=root[_36c[i]];
}
},extend:function(obj,_370){
for(var prop in _370){
obj[prop]=_370[prop];
}
return obj;
},log:function(_372){
wack.Log.log(_372);
}};
}
if($Bootstrap.notLoaded("4cd7039ea1a50104df9be23f50fc4f17")){
wack.Class={create:function(){
return function(){
if(this.initialize){
this.initialize.apply(this,arguments);
}
};
}};
}
if($Bootstrap.notLoaded("485d117e7c9c446113152c1ce3fe3acb")){
wack.depends("wack.Array");
wack.Array.prototype={all:function(_373){
var _374=(_373||Prototype.K);
for(var i=0,ii=this.length;i<ii;i++){
if(!_374(this[i],i)){
return false;
}
}
return true;
},collect:function(_376){
var _377=[];
var _378=(_376||Prototype.K);
for(var i=0,ii=this.length;i<ii;i++){
_377.push(_378(this[i],i));
}
return _377;
},detect:function(_37a){
for(var i=0,ii=this.length;i<ii;i++){
if(_37a(this[i],i)){
return this[i];
}
}
return null;
},findAll:function(_37c){
var _37d=[];
for(var i=0,ii=this.length;i<ii;i++){
if(_37c(this[i],i)){
_37d.push(this[i]);
}
}
return _37d;
},include:function(_37f){
for(var i=0,ii=this.length;i<ii;i++){
if(this[i]==_37f){
return true;
}
}
return false;
},inject:function(memo,_382){
for(var i=0,ii=this.length;i<ii;i++){
memo=_382(memo,this[i],i);
}
return memo;
},max:function(_384){
if(this.length==0){
return;
}
var _385=_384||Prototype.K;
var _386=_385(this[0],0);
for(var i=1,ii=this.length;i<ii;i++){
var _388=_385(this[i],i);
if(_388>_386){
_386=_388;
}
}
return _386;
},min:function(_389){
if(this.length==0){
return;
}
var _38a=_389||Prototype.K;
var _38b=_38a(this[0],0);
for(var i=1,ii=this.length;i<ii;i++){
var _38d=_38a(this[i],i);
if(_38d<_38b){
_38b=_38d;
}
}
return _38b;
},pluck:function(_38e){
var _38f=[];
for(var i=0,ii=this.length;i<ii;i++){
_38f.push(this[i][_38e]);
}
return _38f;
},reject:function(_391){
var _392=[];
for(var i=0,ii=this.length;i<ii;i++){
if(!_391(this[i],i)){
_392.push(this[i]);
}
}
return _392;
}};
wack.extend(wack.Array.prototype,{map:wack.Array.prototype.collect,find:wack.Array.prototype.detect,select:wack.Array.prototype.findAll,member:wack.Array.prototype.include});
wack.extend(Array.prototype,wack.Array.prototype);
}
if($Bootstrap.notLoaded("19b5fd9e1cb549064e788d139e162926")){
wack.BigInterval=function(_394,_395){
var _396=1000;
var _397=60*_396;
var _398=_397;
var sum=0;
function step(){
if(sum>=_395){
_394();
sum=0;
step();
}else{
sum+=1;
setTimeout(step,_398);
}
}
step();
};
}
if($Bootstrap.notLoaded("992a2284d034a68730c925d01fc6701a")){
wack.Browser={is_safari_1_3:/Safari\/312/.test(navigator.userAgent),is_safari:/Konqueror|Safari|KHTML/.test(navigator.userAgent),is_safari4:/Version\/4.*Safari\//.test(navigator.userAgent),is_ie:/MSIE/.test(navigator.userAgent),is_ie6:/MSIE\ 6/.test(navigator.userAgent),is_ie7:/MSIE\ 7/.test(navigator.userAgent),is_ie8:/MSIE\ 8/.test(navigator.userAgent),is_firefox:/Firefox/.test(navigator.userAgent),is_ff2:/Firefox\/2/.test(navigator.userAgent),is_ff3:/Firefox\/3/.test(navigator.userAgent),is_opera:/Opera/.test(navigator.userAgent),is_chrome:/Chrome/.test(navigator.userAgent),is_win:/Win/.test(navigator.platform),is_win2k:/Windows\ NT\ 5\.0/.test(navigator.userAgent),is_mac:/Mac/.test(navigator.platform),is_linux:/Linux/.test(navigator.platform),is_https:document.location.protocol=="https:",controlVersion:function(){
var _39a;
var axo;
var e;
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
_39a=axo.GetVariable("$version");
}
catch(e){
}
if(!_39a){
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_39a="WIN 6,0,21,0";
axo.AllowScriptAccess="always";
_39a=axo.GetVariable("$version");
}
catch(e){
}
}
if(!_39a){
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
_39a=axo.GetVariable("$version");
}
catch(e){
}
}
if(!_39a){
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
_39a="WIN 3,0,18,0";
}
catch(e){
}
}
if(!_39a){
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
_39a="WIN 2,0,0,11";
}
catch(e){
_39a=-1;
}
}
return _39a;
},deleteCookie:function(name){
this.setCookie(name,"",-1);
},detectFlashVersion:function(_39e,_39f,_3a0){
versionStr=this.getSwfVersion();
if(versionStr==-1){
return false;
}else{
if(versionStr!=0){
if(this.is_ie&&this.is_win&&!this.is_opera){
tempArray=versionStr.split(" ");
tempString=tempArray[1];
versionArray=tempString.split(",");
}else{
versionArray=versionStr.split(".");
}
var _3a1=versionArray[0];
var _3a2=versionArray[1];
var _3a3=versionArray[2];
if(_3a1>parseFloat(_39e)){
return true;
}else{
if(_3a1==parseFloat(_39e)){
if(_3a2>parseFloat(_39f)){
return true;
}else{
if(_3a2==parseFloat(_39f)){
if(_3a3>=parseFloat(_3a0)){
return true;
}
}
}
}
}
return false;
}
}
},getCookie:function(name){
var _3a5=" "+String(document.cookie);
var pos=_3a5.indexOf(" "+name+"=");
if(pos!=-1){
var end=_3a5.indexOf(";",pos);
if(end==-1){
end=_3a5.length;
}
var val=_3a5.substring(pos+name.length+2,end);
return val;
}
return null;
},getCssProperty:function(elem,prop,_3ab){
var s,p="undefined";
var a=prop.split("-");
prop=a[0];
for(var i=1;i<a.length;++i){
c=a[i].charAt(0);
prop+=a[i].replace(c,c.toUpperCase());
}
var dv=document.defaultView;
if(dv&&dv.getComputedStyle){
s=dv.getComputedStyle(elem,"");
if(s){
p=s[prop];
}
}else{
if(elem.currentStyle){
p=elem.currentStyle[prop];
}else{
return null;
}
}
return _3ab?(parseInt(p)||0):p;
},getDimensions:function(){
if(this.is_ie){
var _3b0=document.body.clientHeight;
var _3b1=document.body.clientWidth;
}else{
var _3b0=window.innerHeight;
var _3b1=window.innerWidth;
}
return [_3b0,_3b1];
},getIframeDocument:function(_3b2){
if(!_3b2){
return null;
}
var root=_3b2.contentWindow||_3b2.contentDocument;
if(root.document){
root=root.document;
}
return root;
},getSwfVersion:function(){
var _3b4=-1;
if(navigator.plugins!=null&&navigator.plugins.length>0){
if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){
var _3b5=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";
var _3b6=navigator.plugins["Shockwave Flash"+_3b5].description;
var _3b7=_3b6.split(" ");
var _3b8=_3b7[2].split(".");
var _3b9=_3b8[0];
var _3ba=_3b8[1];
var _3bb=_3b7[3];
if(_3bb==""){
_3bb=_3b7[4];
}
if(_3bb[0]=="d"){
_3bb=_3bb.substring(1);
}else{
if(_3bb[0]=="r"){
_3bb=_3bb.substring(1);
if(_3bb.indexOf("d")>0){
_3bb=_3bb.substring(0,_3bb.indexOf("d"));
}
}
}
var _3b4=_3b9+"."+_3ba+"."+_3bb;
}
}else{
if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){
_3b4=4;
}else{
if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){
_3b4=3;
}else{
if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){
_3b4=2;
}else{
if(this.is_ie&&this.is_win&&!this.is_opera){
_3b4=this.controlVersion();
}
}
}
}
}
return _3b4;
},popup:function(u,h,w,t,l,_3c1,_3c2){
var left=l||(screen.width-w)/2;
var top=t||(screen.height-h-60)/2;
_3c1=(_3c1?"yes":"no");
_3c2=(_3c2?"yes":"no");
var _3c5="status,width="+w+",height="+h+",scrollbars="+_3c2+",resizable="+_3c1+",top="+top+",left="+left;
return window.open(u,"",_3c5);
},setCookie:function(name,_3c7,_3c8){
if(_3c8){
var date=new Date();
date.setTime(date.getTime()+(_3c8*24*60*60*1000));
var _3ca="; expires="+date.toGMTString();
}else{
var _3ca="";
}
document.cookie=name+"="+_3c7+_3ca+"; path=/";
}};
}
if($Bootstrap.notLoaded("a71c82e4de1eff0122f404c08a73f6c3")){
wack.DateTime=wack.Class.create();
wack.extend(wack.DateTime,{DATE_AMERICAN:1,DATE_INTL:2,HOUR_12:1,HOUR_24:2,_bad_date:new Date("xxx!"),parseDateString:function(date,_3cc){
if(date==""){
return new Date;
}
_3cc=_3cc||wack.DateTime.DATE_AMERICAN;
var _3cd=date.split("-");
if(_3cd.length==3){
return new Date(parseInt(_3cd[0],10),parseInt(_3cd[1],10)-1,parseInt(_3cd[2],10));
}
var _3cd=date.split("/");
if(_3cd.length==3){
var _3ce,day;
var year=_3cd[2];
if(_3cc==wack.DateTime.DATE_AMERICAN){
_3ce=_3cd[0];
day=_3cd[1];
}else{
_3ce=_3cd[1];
day=_3cd[0];
}
return new Date(year,_3ce,day);
}
return new Date(date);
},parseDateTimeString:function(_3d0,_3d1){
_3d1=_3d1||this._date_order;
var _3d2=_3d0.split(" ");
var _3d3=_3d2.shift();
var _3d4=_3d2.join(" ");
var _3d5=this.parseDateString(_3d3,_3d1);
var _3d6=this.parseTimeString(_3d4);
if(!this._checkDateObject(_3d5)||!this._checkDateObject(_3d6)){
return this._bad_date;
}
var _3d7=new Date(_3d5.getFullYear(),_3d5.getMonth(),_3d5.getDate(),_3d6.getHours(),_3d6.getMinutes(),_3d6.getSeconds());
return _3d7;
},parseTimeString:function(time){
var _3d9=new Date("January 1, 1970 "+time);
var _3da=parseInt(time,10);
if(!this._checkDateObject(_3d9)){
if(!_3da){
return this._bad_date;
}
if(time.indexOf(":")>0){
var _3db=time.split(":");
if(_3db[1]){
var _3dc=time.substr(-2).toLowerCase();
if(_3dc!="am"&&_3dc!="pm"){
_3dc="am";
}
if(_3db[1].replace(_3dc,"").length!=2){
return this._bad_date;
}
var _3dd=parseInt(_3db[1],10);
if(_3dd==""||isNaN(_3dd)){
_3dd=0;
}
if(_3dd<10){
_3dd="0"+_3dd;
}
time=_3db[0]+":"+_3dd+" "+_3dc;
}else{
time=_3da+":00 am";
}
return this.parseTimeString(time);
}else{
var mins="00";
if(_3da>=100){
var _3df=Math.floor(_3da/100);
mins=_3da%100;
if(mins<10){
mins="0"+""+mins;
}
_3da=_3df;
}
if(_3da<24){
var _3dc=time.substr(-2).toLowerCase();
time=_3da+":"+mins;
if(_3dc=="pm"||(_3dc!="am"&&_3da==12)){
time+=" pm";
}else{
if(_3da<=12){
time=time+=" am";
}
}
return this.parseTimeString(time);
}
var _3e0=time.match(/([\d]{1,2})([\d]{2})/);
var hour=_3e0[1];
var _3e2=_3e0[2];
if(typeof (_3e2)=="undefined"||_3e2==""){
_3e2="00";
}
if(hour>23||_3e2>59){
return this._bad_date;
}
time=hour+":"+_3e2;
return this.parseTimeString(time);
}
_3d9=this._bad_date;
}
return _3d9;
},_checkDateObject:function(date){
if(date=="Invalid Date"||isNaN(date)){
return false;
}else{
return true;
}
},day_names:["Date.L.Sunday","Date.L.Monday","Date.L.Tuesday","Date.L.Wednesday","Date.L.Thursday","Date.L.Friday","Date.L.Saturday","Date.L.Sunday","Date.L.Sat/Sun"],day_abbrev:["Date.L.Sunday.Ab","Date.L.Monday.Ab","Date.L.Tuesday.Ab","Date.L.Wednesday.Ab","Date.L.Thursday.Ab","Date.L.Friday.Ab","Date.L.Saturday.Ab","Date.L.Sunday.Ab"],month_names:["","Date.L.January","Date.L.February","Date.L.March","Date.L.April","Date.L.May","Date.L.June","Date.L.July","Date.L.August","Date.L.September","Date.L.October","Date.L.November","Date.L.December"],month_abbrev:["","Date.L.January.Ab","Date.L.February.Ab","Date.L.March.Ab","Date.L.April.Ab","Date.L.May.Ab","Date.L.June.Ab","Date.L.July.Ab","Date.L.August.Ab","Date.L.September.Ab","Date.L.October.Ab","Date.L.November.Ab","Date.L.December.Ab"],millisecondsPerDay:86400000,convertUnit:function(val,_3e5,_3e6){
if(!_3e5||!_3e6){
return false;
}
var _3e7={"week":60*24*7,"day":60*24,"hour":60,"minute":1};
return val*_3e7[_3e5]/_3e7[_3e6];
},convertToBiggestUnit:function(val,unit){
if(val>0){
var _3ea=["week","day","hour","minute"];
for(var i=0;i<_3ea.length;i++){
var _3ec=_3ea[i];
res=parseInt(this.convertUnit(val,unit,_3ec));
if(res>0){
return {val:res,unit:_3ec};
}
}
}
return {val:val,unit:unit};
},getEndOfMonth:function(val){
if(!wack.DateTime.isDate(val)){
return null;
}
if(typeof (val)=="string"){
val=new Date(val);
}
val=val.add(0,1);
val=new Date(val.getMonth()+1+"/1/"+val.getFullYear()).add(-1);
return val;
},getStartEndDates:function(_3ee,date){
var type=_3ee||"month";
if(!date){
var date=new Date();
}
if(typeof (date)=="string"){
date=new Date(date);
}
var _3f1="";
var _3f2="";
switch(type){
case "month":
_3f1=new Date(date.getFullYear(),date.getMonth(),1);
_3f2=_3f1.add(0,1).add(-1);
break;
case "week":
var _3f3=date.getDay();
_3f1=date.add(1-(_3f3==0?7:_3f3));
_3f2=_3f1.add(6);
break;
case "weekend":
var _3f3=date.getDay();
_3f1=date.add(5-_3f3);
_3f2=_3f1.add(2);
break;
case "workweek":
var _3f3=date.getDay();
_3f1=date.add(1-_3f3);
_3f2=_3f1.add(4);
break;
default:
_3f1=date;
_3f2=date;
}
var _3f4={"start":_3f1,"end":_3f2};
return _3f4;
},intlToAmerican:function(_3f5){
var _3f6=String(_3f5).match(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/);
if(!_3f6){
return false;
}
var date=new Date(_3f6[3],_3f6[2]-1,_3f6[1]);
var _3f8=date.format("%m/%d/%Y");
return _3f8;
},isDate:function(_3f9){
if(typeof (_3f9)!="string"){
var _3fa=Date.parse(_3f9);
if(isNaN(_3fa)){
return null;
}
_3f9=_3f9.getMonth()+1+"/"+_3f9.getDate()+"/"+_3f9.getFullYear();
}
var re=/^\d{1,2}\/\d{1,2}\/\d{4}$/;
if(re.test(_3f9)){
var dArr=_3f9.split("/");
var d=new Date(_3f9);
return d.getMonth()+1==dArr[0]&&d.getDate()==dArr[1]&&d.getFullYear()==dArr[2];
}else{
return false;
}
},isEndOfMonth:function(val){
if(!wack.DateTime.isDate(val)){
return false;
}
if(typeof (val)=="string"){
val=new Date(val);
}
var _3ff=new Array(4,6,9,11);
var _400=val.getMonth()+1;
var day=val.getDate();
var year=val.getFullYear();
var _403=false;
if(day==31){
_403=true;
}else{
if(day==30&&_3ff.indexOf(_400)>=0){
_403=true;
}else{
if(day==29&&wack.DateTime.isLeapYear(year)){
_403=true;
}else{
if(day==28&&_400==2&&!wack.DateTime.isLeapYear(year)){
_403=true;
}
}
}
}
return _403;
},isLeapYear:function(yr){
return new Date(yr,2-1,29).getDate()==29;
},minutesToString:function(_405){
if(!_405||_405==""||_405==0){
return "0 "+L("Date.L.Minute.P");
}
var _406=new Array("week","day","hour","minute");
var _407={"week":7*24*60,"day":24*60,"hour":60,"minute":1};
for(var i=0,ii=_406.length;i<ii;i++){
var _409=_406[i];
var r=wack.DateTime.convertUnit(_405,"minute",_409);
if(r>=1){
if(r-parseInt(r)>0){
var _40b=parseInt(r);
var _40c=_405-(_40b*_407[_409]);
var _40d=".S";
if(_40b>1){
_40d=".P";
}
var _40e=_409.substring(0,1).toUpperCase()+_409.substring(1,_409.length);
var _40f=_40b+" "+L("Date.L."+_40e+_40d);
if(_40c>0){
_40f+=" "+wack.DateTime.minutesToString(_40c);
}
}else{
var _40d=".S";
if(r>1){
_40d=".P";
}
var _40e=_409.substring(0,1).toUpperCase()+_409.substring(1,_409.length);
var _40f=r+" "+L("Date.L."+_40e+_40d);
}
break;
}
}
return _40f;
},monthNumFromName:function(n){
n=n.toLowerCase();
switch(n){
case "jan":
case "january":
n=1;
break;
case "feb":
case "february":
n=2;
break;
case "mar":
case "march":
n=3;
break;
case "apr":
case "april":
n=4;
break;
case "may":
n=5;
break;
case "jun":
case "june":
n=6;
break;
case "jul":
case "july":
n=7;
break;
case "aug":
case "august":
n=8;
break;
case "sep":
case "sept":
case "september":
n=9;
break;
case "oct":
case "october":
n=10;
break;
case "nov":
case "november":
n=11;
break;
case "dec":
case "december":
n=12;
break;
}
return n;
},dayNameFromNum:function(n){
var nm=["Date.L.Sunday","Date.L.Monday","Date.L.Tuesday","Date.L.Wednesday","Date.L.Thursday","Date.L.Friday","Date.L.Saturday","Date.L.Sunday","Date.L.SatSun"];
return L(nm[n]);
},Methods:{add:function(d,m,y,H,i,s){
d=d||0;
m=m||0;
y=y||0;
H=H||0;
i=i||0;
s=s||0;
var nd=this.getDate()+d;
var nm=this.getMonth()+m;
var ny=this.getFullYear()+y;
var cH=this.getHours()+H;
var ci=this.getMinutes()+i;
var cs=this.getSeconds()+s;
if(wack.Browser.is_safari){
if(ci>127){
cH=Math.floor(ci/60)+cH;
ci=ci%60;
}else{
if(ci<-128){
while(ci<-128){
cH--;
ci=ci-60;
}
}
}
if(cH>127){
nd=Math.floor(cH/24)+nd;
cH=cH%24;
}else{
if(cH<-128){
while(cH<-128){
nd--;
cH=cH+24;
}
}
}
if(nm>11){
ny=Math.floor(nm/11)+ny;
nm=nm%11-1;
}else{
if(nm<0){
while(nm<0){
ny--;
nm=12+nm;
}
}
}
}
return new Date(ny,nm,nd,cH,ci,cs);
},diff:function(_41f,_420){
var _421=this.getDate();
var iOut=0;
var _423=Date.parse(_421);
var _424=Date.parse(_41f);
if(isNaN(_423)||isNaN(_424)){
return null;
}
if(_420.charAt(0)=="undefined"){
return null;
}
var _425=_424-_423;
switch(_420.charAt(0)){
case "d":
case "D":
iOut=Math.round(_425/86400000);
break;
case "h":
case "H":
iOut=Math.round(_425/3600000);
break;
case "n":
case "N":
iOut=Math.round(_425/60000);
break;
case "s":
case "S":
iOut=Math.round(_425/1000);
break;
default:
return null;
}
return iOut;
},format:function(_426){
var _427=_426.split("%");
var _428=_427[0];
for(var i=1,ii=_427.length;i<ii;i++){
var _42a=_427[i];
var type=_42a.charAt(0);
var _42c=wack.DateTime.FormatMethods[type];
if(_42c){
_428+=_42c(this)+_42a.substr(1);
}else{
_428+="%"+_42a;
}
}
return _428;
},getDateString:function(_42d){
var _42e;
switch(_42d){
case wack.DateTime.DATE_INTL:
_42e="%d/%m/%Y";
break;
case wack.DateTime.DATE_AMERICAN:
default:
_42e="%m/%d/%Y";
}
return this.format(_42e);
},simpleIntl:function(_42f){
switch(_42f){
case "american":
return this.format("%m/%d/%Y");
case "european":
return this.format("%d/%m/%Y");
default:
throw "Unknown date format";
}
}},FormatMethods:{n:function(date){
return date.getMonth()+1;
},m:function(date){
var _432=date.getMonth()+1;
return (_432<10?"0"+_432:_432);
},F:function(date){
var _434=date.getMonth()+1;
return L(wack.DateTime.month_names[_434]);
},M:function(date){
var _436=date.getMonth()+1;
return L(wack.DateTime.month_abbrev[_436]);
},j:function(date){
return date.getDate();
},d:function(date){
var _439=date.getDate();
return (_439<10?"0"+_439:_439);
},l:function(date){
return L(wack.DateTime.day_names[date.getDay()]);
},D:function(date){
return L(wack.DateTime.day_abbrev[date.getDay()]);
},w:function(date){
return date.getDay();
},Y:function(date){
return date.getFullYear();
},H:function(date){
var hour=date.getHours();
return (hour<10?"0"+hour:hour);
},G:function(date){
return date.getHours();
},g:function(date){
var hour=date.getHours();
return (hour==0?12:(hour>12?hour-12:hour));
},i:function(date){
var _444=date.getMinutes();
return (_444<10?"0"+_444:_444);
},A:function(date){
var hour=date.getHours();
return (hour==0||hour<12?"AM":"PM");
},a:function(date){
var hour=date.getHours();
return (hour==0||hour<12?"am":"pm");
}}});
wack.DateTime.prototype={_date_obj:null,_date_order:wack.DateTime.DATE_AMERICAN,_hour_format:wack.DateTime.HOUR_12,__construct:function(){
},isValid:function(){
if(this._date_obj&&wack.DateTime._checkDateObject(this._date_obj)){
return true;
}else{
return false;
}
},setDateOrder:function(_449){
this._date_order=_449;
},setDateString:function(date){
this._date_obj=wack.DateTime.parseDateString(date,this._date_order);
},setDateTimeString:function(_44b){
this._date_obj=wack.DateTime.parseDateTimeString(_44b,this._date_order);
},setHourFormat:function(_44c){
this._hour_format=_44c;
},setTimeString:function(time){
this._date_obj=wack.DateTime.parseTimeString(time);
},format:function(_44e){
if(this._date_obj){
return this._date_obj.format(_44e);
}else{
return "";
}
},basicDateLong:function(){
if(this._date_order==wack.DateTime.DATE_INTL){
return this.format("%D %d/%n/%Y");
}else{
return this.format("%D %n/%d/%Y");
}
},basicDateShort:function(){
if(this._date_order==wack.DateTime.DATE_INTL){
return this.format("%D %j/%n");
}else{
return this.format("%D %n/%j");
}
},basicTime:function(){
if(this._hour_format==wack.DateTime.HOUR_24){
return this.format("%H:%i");
}else{
return this.format("%g:%i %a");
}
},getSimpleDisplay:function(){
var now=new Date;
var _450=now.getYear();
var _451=now.getMonth();
var _452=now.getDate();
var _453=_450+"-"+_451+"-"+_452;
var _454=this._date_obj;
var year=_454.getYear();
var _456=_454.getMonth();
var day=_454.getDate();
var date=year+"-"+_456+"-"+day;
var _459="";
if(date==_453){
_459=L("L.Today")+" "+this.basicTime();
}else{
if(year!=_450||_456>_451||(_456==_451&&_454.getDate()>now.getDate())){
_459=this.basicDateLong();
}else{
_459=this.basicDateShort()+" "+this.basicTime();
}
}
return _459;
},getDayString:function(day){
},getTimeStamp:function(date){
return this._date_obj.getTime();
}};
function newDate(s){
if(s==""){
return new Date;
}
var p=(new String(s)).split("-");
if(p.length!=3){
var d=new Date(s);
}else{
var d=new Date(parseInt(p[0],10),parseInt(p[1],10)-1,parseInt(p[2],10));
}
if(d=="Invalid Date"||isNaN(d)){
d=new Date(0);
}
return d;
}
function newTime(s){
var d=new Date("January 1, 1970 "+s);
if(d=="Invalid Date"||isNaN(d)){
d=new Date(0);
}
return d;
}
function newDateTime(dt){
var _462=dt.indexOf(" ");
var _463=dt.substr(0,_462);
var _464=dt.substr(_462+1);
var date=newDate(_463);
var time=newTime(_464);
return new Date(date.getFullYear(),date.getMonth(),date.getDate(),time.getHours(),time.getMinutes(),time.getSeconds());
}
if(!window.L){
L=function(s){
switch(s){
case "Date.L.Sunday":
return "Sunday";
case "Date.L.Monday":
return "Monday";
case "Date.L.Tuesday":
return "Tuesday";
case "Date.L.Wednesday":
return "Wednesday";
case "Date.L.Thursday":
return "Thursday";
case "Date.L.Friday":
return "Friday";
case "Date.L.Saturday":
return "Saturday";
case "Date.L.Sunday":
return "Sunday";
case "Date.L.Sat/Sun":
return "Sat/Sun";
case "Date.L.Sunday.Ab":
return "Sun";
case "Date.L.Monday.Ab":
return "Mon";
case "Date.L.Tuesday.Ab":
return "Tue";
case "Date.L.Wednesday.Ab":
return "Wed";
case "Date.L.Thursday.Ab":
return "Thu";
case "Date.L.Friday.Ab":
return "Fri";
case "Date.L.Saturday.Ab":
return "Sat";
case "Date.L.Sunday.Ab":
return "Sun";
case "Date.L.January":
return "January";
case "Date.L.February":
return "February";
case "Date.L.March":
return "March";
case "Date.L.April":
return "April";
case "Date.L.May":
return "May";
case "Date.L.June":
return "June";
case "Date.L.July":
return "July";
case "Date.L.August":
return "August";
case "Date.L.September":
return "September";
case "Date.L.October":
return "October";
case "Date.L.November":
return "November";
case "Date.L.December":
return "December";
case "Date.L.January.Ab":
return "Jan";
case "Date.L.February.Ab":
return "Feb";
case "Date.L.March.Ab":
return "Mar";
case "Date.L.April.Ab":
return "Apr";
case "Date.L.May.Ab":
return "May";
case "Date.L.June.Ab":
return "Jun";
case "Date.L.July.Ab":
return "Jul";
case "Date.L.August.Ab":
return "Aug";
case "Date.L.September.Ab":
return "Sep";
case "Date.L.October.Ab":
return "Oct";
case "Date.L.November.Ab":
return "Nov";
case "Date.L.December.Ab":
return "Dec";
default:
return s;
}
};
}
wack.extend(Date.prototype,wack.DateTime.Methods);
}
if($Bootstrap.notLoaded("86243117c20eb322f85fb216a6360ffe")){
wack.Element={nodeName:function(_468){
return (new String(_468.nodeName)).toLowerCase();
}};
wack.Element.Methods={addClassName:function(_469,_46a){
var _46b=$(_469).className.split(/\s+/);
for(var i=0,ii=_46b.length;i<ii;i++){
if(_46b[i]==_46a){
return _469;
}
}
_469.className+=" "+_46a;
return _469;
},create:function(type,_46e){
var elem=document.createElement(type);
for(p in _46e){
elem[p]=_46e[p];
}
return $(elem);
},fitHeightToParent:function(_470,_471){
_471=_471||_470.parentNode;
var _472=this.getTotalOffsets(_470)["top"];
var _473=this.getTotalOffsets(_471)["top"];
var _474=_472-_473;
_470.style.height=_471.offsetHeight-_474+"px";
},getScrollbarWidth:function(_475){
if(_475.offsetWidth>_475.clientWidth){
return _475.offsetWidth-_475.clientWidth;
}else{
return 0;
}
},getTotalOffsets:function(_476){
var top=0;
var left=0;
while(_476){
top+=_476.offsetTop||0;
left+=_476.offsetLeft||0;
_476=_476.offsetParent;
}
return {top:top,left:left};
},isAncestor:function(_479,el){
while(el){
if(el==_479){
return true;
}
el=el.parentNode;
}
return false;
},isOrphan:function(elem){
if(!elem.parentNode||elem.parentNode.nodeName.toLowerCase()=="#document-fragment"){
return true;
}else{
return false;
}
},remove:function(_47c){
if(_47c&&_47c.parentNode){
_47c.parentNode.removeChild(_47c);
}
},removeClassName:function(_47d,_47e){
_47d=$(_47d);
if(!_47d){
return;
}
var _47f=_47d.className.split(/\s+/);
var _480=null;
for(var i=0,ii=_47f.length;i<ii;i++){
if(_47f[i]==_47e){
_480=i;
break;
}
}
if(_480!==null){
_47d.className=_47f.slice(0,_480).concat(_47f.slice(_480+1)).join(" ");
}
return _47d;
},setDimensions:function(_482,dims){
if(typeof dims.width!=="undefined"){
if(dims.width>0){
_482.style.width=dims.width+"px";
}
}
if(typeof dims.height!=="undefined"){
if(dims.height>0){
_482.style.height=dims.height+"px";
}
}
}};
wack.extend(wack.Element,wack.Element.Methods);
wack.extend(Element,wack.Element.Methods);
if(window.Element&&window.Element.addMethods){
Element.addMethods(wack.Element.Methods);
}
}
if($Bootstrap.notLoaded("0060907a9f5bc879883cee43ec7959f1")){
wack.depends("wack.Email");
wack.Email.Recipient=wack.Class.create();
wack.Email.Recipient.prototype={_name:null,_email:null,initialize:function(_484){
if(!_484){
return;
}
var _485=this._parseString(_484);
this._name=_485.name;
this._email=_485.email;
},getEmail:function(){
return this._email;
},getName:function(){
return this._name;
},getString:function(){
var _486=this._email;
if(this._name){
_486="\""+this._name+"\" <"+_486+">";
}
return _486;
},setEmail:function(_487){
this._email=_487;
},setName:function(name){
this._name=name;
},_parseString:function(_489){
var _48a={name:null,email:null};
var _48b=_489.lastIndexOf("<");
if(_48b==-1){
_48a.email=_489;
}else{
var name=_489.substr(0,_48b).trim();
name=name.replace(/"/g,"");
var _48d=_489.substr(_48b).trim();
_48d=_48d.replace(/[<>]/g,"");
_48a.name=name;
_48a.email=_48d;
}
return _48a;
}};
}
if($Bootstrap.notLoaded("e4691acd1fcac9a3e5d623e6966779fc")){
wack.Event={element:function(_48e){
return _48e.target||_48e.srcElement;
}};
}
if($Bootstrap.notLoaded("984a33660f0a7f1ac69ac88e18634a36")){
wack.Keyboard=wack.Class.create();
wack.Keyboard.KEY_ARROW_DOWN="_down";
wack.Keyboard.KEY_ARROW_UP="_up";
wack.Keyboard.KEY_DELETE="_delete";
wack.Keyboard.KEY_ENTER="_enter";
wack.Keyboard.KEY_ESCAPE="_escape";
wack.Keyboard.KEY_META="_meta";
wack.Keyboard.KEY_SPACE="_space";
wack.Keyboard.prototype={callbacks:{},callbacks_ctrl:{},last_key:null,initialize:function(){
this.callbacks={};
this.callbacks_ctrl={};
},addCallback:function(keys,_490){
this.callbacks[keys]=_490;
},addCallbackWithCtrl:function(ch,_492){
this.callbacks_ctrl[ch]=_492;
},handleEvent:function(e){
var key=this.getKeyPressed(e);
if(key===null){
return;
}
var _495=e.ctrlKey;
var src=wack.Event.element(e);
var _497={input:true,textarea:true,select:true};
var _498=false;
if(_497[wack.Element.nodeName(src)]){
if(wack.Element.nodeName(src)=="input"){
if(src.type=="text"){
_498=true;
}
}else{
_498=true;
}
}
if(_498&&key!=wack.Keyboard.KEY_ESCAPE){
return;
}
if(this.last_key&&this.last_key==wack.Keyboard.KEY_META){
return;
}
if(_495){
if(this.callbacks_ctrl[key]){
this.callbacks_ctrl[key](e);
Event.stop(e);
}
this.last_key=null;
return;
}
if(this.last_key&&this.callbacks[this.last_key+key]){
this.callbacks[this.last_key+key](e,this);
this.last_key=null;
Event.stop(e);
return;
}
if(this.callbacks[key]){
this.callbacks[key](e,this);
Event.stop(e);
return;
}
this.last_key=key;
var _499=(key==wack.Keyboard.KEY_META?2000:1000);
setTimeout(function(){
this.last_key=null;
}.bind(this),_499);
},getKeyPressed:function(_49a){
var _49b=_49a.keyCode;
var _49c=_49a.charCode;
if(_49b==16||_49b==17){
return null;
}
if(_49a.metaKey){
return wack.Keyboard.KEY_META;
}
var _49d={13:wack.Keyboard.KEY_ENTER,27:wack.Keyboard.KEY_ESCAPE,32:wack.Keyboard.KEY_SPACE,38:wack.Keyboard.KEY_ARROW_UP,40:wack.Keyboard.KEY_ARROW_DOWN,46:wack.Keyboard.KEY_DELETE,91:wack.Keyboard.KEY_META,191:{lower:"/",upper:"?"}};
var k=_49b||_49c;
if(_49d[k]){
if(_49a.shiftKey&&typeof (_49d[k].upper)!=="undefined"){
return _49d[k].upper;
}else{
if(typeof (_49d[k].lower)!=="undefined"){
return _49d[k].lower;
}else{
return _49d[k];
}
}
}
if(_49c){
return String.fromCharCode(_49c);
}
var _49f={1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")"};
var key=String.fromCharCode(_49b);
if(_49a.shiftKey){
if(_49f[key]){
return _49f[key];
}
return key.toUpperCase();
}else{
return key.toLowerCase();
}
}};
}
if($Bootstrap.notLoaded("5c13321ab307053694c17a09dd63911f")){
wack.List=wack.Class.create();
wack.List.prototype={_list:null,initialize:function(){
this._list=[];
},add:function(item){
this.addItemToList(item,this._list);
},clear:function(){
this._list=[];
},contains:function(item){
for(var x=0;x<this._list.length;x++){
if(this.matches(item,this._list[x])){
return true;
}
}
return false;
},isEmpty:function(){
if(this._list.length==0){
return true;
}else{
return false;
}
},remove:function(item){
if(this.contains(item)){
this.removeItemFromList(item,this._list);
return true;
}
return false;
},shiftTopItem:function(){
return this._list.shift();
},addItemToList:function(item,list){
list.push(item);
},removeItemFromList:function(item,list){
var _4a9=new wack.List();
for(var x=0;x<list.length;x++){
if(!list.matches(item,list[x])){
_4a9.add(list[x]);
}
}
list=_4a9;
},matches:function(item,_4ac){
if(item==_4ac){
return true;
}
return false;
}};
}
if($Bootstrap.notLoaded("54514feebf3c36a9dfdd0b5ef067b557")){
wack.Log={_log:[],_max:40,dump:function(_4ad){
var _4ad=_4ad||"\n";
var _4ae="";
for(var i=0,ii=this._log.length;i<ii;i++){
}
return _4ae;
},log:function(_4b0){
var now=new Date();
var time=[now.getFullYear(),"-",now.getMonth()+1,"-",now.getDate()," ",(now.getHours()<10?"0"+now.getHours():now.getHours()),":",(now.getMinutes()<10?"0"+now.getMinutes():now.getMinutes()),":",(now.getSeconds()<10?"0"+now.getSeconds():now.getSeconds()),":",].join("");
this._log.push({time:time,message:_4b0});
while(this._log.length>this._max){
this._log.shift();
}
},setLimit:function(max){
if(typeof max=="integer"){
this._max=max;
}
}};
}
if($Bootstrap.notLoaded("61abe11291a42161b3ec410554ea5458")){
wack.depends("wack.Number");
wack.Number.prototype={toColor:function(){
var _4b4=this.toString(16);
while(_4b4.length<6){
_4b4="0"+_4b4;
}
return _4b4;
}};
wack.extend(Number.prototype,wack.Number.prototype);
}
if($Bootstrap.notLoaded("71e2d73af2d6d87448c882fcb7014cab")){
wack.depends("wack.SortedArray");
wack.SortedArray.factory=function(_4b5,_4b6){
var ar=_4b5||[];
for(var name in this.Methods){
ar[name]=this.Methods[name];
}
if(_4b6){
ar._compare=_4b6;
}
return ar;
};
wack.SortedArray.Methods={add:function(val){
var _4ba=this._binarySearch(val);
this.splice(_4ba[1],0,val);
},include:function(val){
return this._binarySearch(val)[0];
},merge:function(ar){
var _4bd=wack.SortedArray.factory([],this._compare);
for(var i=0,j=0,ii=this.length,jj=ar.length;i<ii&&j<jj;){
switch(this._compare(this[i],ar[j])){
case 1:
_4bd.push(ar[j]);
j++;
break;
case -1:
_4bd.push(this[i]);
i++;
break;
case 0:
_4bd.push(this[i]);
_4bd.push(ar[j]);
i++;
j++;
break;
}
}
for(;i<ii;i++){
_4bd.push(this[i]);
}
for(;j<jj;j++){
_4bd.push(ar[j]);
}
return _4bd;
},remove:function(val){
var _4c0=this._binarySearch(val);
if(_4c0[0]){
this.splice(_4c0[1],1);
}
},_binarySearch:function(_4c1){
var low=0;
var high=this.length;
while(low!=high){
var mid=parseInt((low+high)/2);
switch(this._compare(_4c1,this[mid])){
case 1:
low=mid+1;
break;
case -1:
high=mid;
break;
case 0:
return [true,mid];
default:
throw "error";
}
}
return [false,low];
},_compare:function(val1,val2){
if(val1<val2){
return -1;
}else{
if(val1>val2){
return 1;
}else{
return 0;
}
}
}};
}
if($Bootstrap.notLoaded("69f5b1ebc3748451c56516a6dda86d1b")){
String.prototype.parseColor=function(){
var _4c7="#";
if(this.slice(0,4)=="rgb("){
var cols=this.slice(4,this.length-1).split(",");
var i=0;
do{
_4c7+=parseInt(cols[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_4c7+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_4c7=this.toLowerCase();
}
}
}
return (_4c7.length==7?_4c7:(arguments[0]||this));
};
Element.collectTextNodes=function(_4ca){
return $A($(_4ca).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_4cc,_4cd){
return $A($(_4cc).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,_4cd))?Element.collectTextNodesIgnoreClass(node,_4cd):""));
}).flatten().join("");
};
Element.setContentZoom=function(_4cf,_4d0){
_4cf=$(_4cf);
_4cf.setStyle({fontSize:(_4d0/100)+"em"});
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
return _4cf;
};
Element.getOpacity=function(_4d1){
_4d1=$(_4d1);
var _4d2;
if(_4d2=_4d1.getStyle("opacity")){
return parseFloat(_4d2);
}
if(_4d2=(_4d1.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_4d2[1]){
return parseFloat(_4d2[1])/100;
}
}
return 1;
};
Element.setOpacity=function(_4d3,_4d4){
_4d3=$(_4d3);
if(_4d4==1){
_4d3.setStyle({opacity:(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1});
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_4d3.setStyle({filter:Element.getStyle(_4d3,"filter").replace(/alpha\([^\)]*\)/gi,"")});
}
}else{
if(_4d4<0.00001){
_4d4=0;
}
_4d3.setStyle({opacity:_4d4});
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_4d3.setStyle({filter:_4d3.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_4d4*100+")"});
}
}
return _4d3;
};
Element.getInlineOpacity=function(_4d5){
return $(_4d5).style.opacity||"";
};
Element.forceRerendering=function(_4d6){
try{
_4d6=$(_4d6);
var n=document.createTextNode(" ");
_4d6.appendChild(n);
_4d6.removeChild(n);
}
catch(e){
}
};
Array.prototype.call=function(){
var args=arguments;
this.each(function(f){
f.apply(this,args);
});
};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(_4da){
if(typeof Builder=="undefined"){
throw ("Effect.tagifyText requires including script.aculo.us' builder.js library");
}
var _4db="position:relative";
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_4db+=";zoom:1";
}
_4da=$(_4da);
$A(_4da.childNodes).each(function(_4dc){
if(_4dc.nodeType==3){
_4dc.nodeValue.toArray().each(function(_4dd){
_4da.insertBefore(Builder.node("span",{style:_4db},_4dd==" "?String.fromCharCode(160):_4dd),_4dc);
});
Element.remove(_4dc);
}
});
},multiple:function(_4de,_4df){
var _4e0;
if(((typeof _4de=="object")||(typeof _4de=="function"))&&(_4de.length)){
_4e0=_4de;
}else{
_4e0=$(_4de).childNodes;
}
var _4e1=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _4e2=_4e1.delay;
$A(_4e0).each(function(_4e3,_4e4){
new _4df(_4e3,Object.extend(_4e1,{delay:_4e4*_4e1.speed+_4e2}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_4e5,_4e6){
_4e5=$(_4e5);
_4e6=(_4e6||"appear").toLowerCase();
var _4e7=Object.extend({queue:{position:"end",scope:(_4e5.id||"global"),limit:1}},arguments[2]||{});
Effect[_4e5.visible()?Effect.PAIRS[_4e6][1]:Effect.PAIRS[_4e6][0]](_4e5,_4e7);
}};
var Effect2=Effect;
Effect.Transitions={linear:Prototype.K,sinoidal:function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
},reverse:function(pos){
return 1-pos;
},flicker:function(pos){
return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
},wobble:function(pos){
return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
},pulse:function(pos,_4ed){
_4ed=_4ed||5;
return (Math.round((pos%(1/_4ed))*_4ed)==0?((pos*_4ed*2)-Math.floor(pos*_4ed*2)):1-((pos*_4ed*2)-Math.floor(pos*_4ed*2)));
},none:function(pos){
return 0;
},full:function(pos){
return 1;
}};
Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_4f0){
this.effects._each(_4f0);
},add:function(_4f1){
var _4f2=new Date().getTime();
var _4f3=(typeof _4f1.options.queue=="string")?_4f1.options.queue:_4f1.options.queue.position;
switch(_4f3){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_4f1.finishOn;
e.finishOn+=_4f1.finishOn;
});
break;
case "with-last":
_4f2=this.effects.pluck("startOn").max()||_4f2;
break;
case "end":
_4f2=this.effects.pluck("finishOn").max()||_4f2;
break;
}
_4f1.startOn+=_4f2;
_4f1.finishOn+=_4f2;
if(!_4f1.options.queue.limit||(this.effects.length<_4f1.options.queue.limit)){
this.effects.push(_4f1);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),40);
}
},remove:function(_4f6){
this.effects=this.effects.reject(function(e){
return e==_4f6;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _4f8=new Date().getTime();
this.effects.invoke("loop",_4f8);
}});
Effect.Queues={instances:$H(),get:function(_4f9){
if(typeof _4f9!="string"){
return _4f9;
}
if(!this.instances[_4f9]){
this.instances[_4f9]=new Effect.ScopedQueue();
}
return this.instances[_4f9];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_4fa){
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_4fa||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.event("beforeStart");
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_4fb){
if(_4fb>=this.startOn){
if(_4fb>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_4fb-this.startOn)/(this.finishOn-this.startOn);
var _4fd=Math.round(pos*this.options.fps*this.options.duration);
if(_4fd>this.currentFrame){
this.render(pos);
this.currentFrame=_4fd;
}
}
},render:function(pos){
if(this.state=="idle"){
this.state="running";
this.event("beforeSetup");
if(this.setup){
this.setup();
}
this.event("afterSetup");
}
if(this.state=="running"){
if(this.options.transition){
pos=this.options.transition(pos);
}
pos*=(this.options.to-this.options.from);
pos+=this.options.from;
this.position=pos;
this.event("beforeUpdate");
if(this.update){
this.update(pos);
}
this.event("afterUpdate");
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_4ff){
if(this.options[_4ff+"Internal"]){
this.options[_4ff+"Internal"](this);
}
if(this.options[_4ff]){
this.options[_4ff](this);
}
},inspect:function(){
return "#<Effect:"+$H(this).inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(_500){
this.effects=_500||[];
this.start(arguments[1]);
},update:function(_501){
this.effects.invoke("render",_501);
},finish:function(_502){
this.effects.each(function(_503){
_503.render(1);
_503.cancel();
_503.event("beforeFinish");
if(_503.finish){
_503.finish(_502);
}
_503.event("afterFinish");
});
}});
Effect.Event=Class.create();
Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){
var _504=Object.extend({duration:0},arguments[0]||{});
this.start(_504);
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_505){
this.element=$(_505);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
var _506=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(_506);
},update:function(_507){
this.element.setOpacity(_507);
}});
Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(_508){
this.element=$(_508);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _509=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_509);
},setup:function(){
this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){
this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop;
}
},update:function(_50a){
this.element.setStyle({left:Math.round(this.options.x*_50a+this.originalLeft)+"px",top:Math.round(this.options.y*_50a+this.originalTop)+"px"});
}});
Effect.MoveBy=function(_50b,_50c,_50d){
return new Effect.Move(_50b,Object.extend({x:_50d,y:_50c},arguments[3]||{}));
};
Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(_50e,_50f){
this.element=$(_50e);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _510=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_50f},arguments[2]||{});
this.start(_510);
},setup:function(){
this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(k){
this.originalStyle[k]=this.element.style[k];
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var _512=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(_513){
if(_512.indexOf(_513)>0){
this.fontSize=parseFloat(_512);
this.fontSizeType=_513;
}
}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;
if(this.options.scaleMode=="box"){
this.dims=[this.element.offsetHeight,this.element.offsetWidth];
}
if(/^content/.test(this.options.scaleMode)){
this.dims=[this.element.scrollHeight,this.element.scrollWidth];
}
if(!this.dims){
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
}
},update:function(_514){
var _515=(this.options.scaleFrom/100)+(this.factor*_514);
if(this.options.scaleContent&&this.fontSize){
this.element.setStyle({fontSize:this.fontSize*_515+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_515,this.dims[1]*_515);
},finish:function(_516){
if(this.restoreAfterFinish){
this.element.setStyle(this.originalStyle);
}
},setDimensions:function(_517,_518){
var d={};
if(this.options.scaleX){
d.width=Math.round(_518)+"px";
}
if(this.options.scaleY){
d.height=Math.round(_517)+"px";
}
if(this.options.scaleFromCenter){
var topd=(_517-this.dims[0])/2;
var _51b=(_518-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-topd+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_51b+"px";
}
}else{
if(this.options.scaleY){
d.top=-topd+"px";
}
if(this.options.scaleX){
d.left=-_51b+"px";
}
}
}
this.element.setStyle(d);
}});
Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(_51c){
this.element=$(_51c);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _51d=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_51d);
},setup:function(){
if(this.element.getStyle("display")=="none"){
this.cancel();
return;
}
this.oldStyle={backgroundImage:this.element.getStyle("background-image")};
this.element.setStyle({backgroundImage:"none"});
if(!this.options.endcolor){
this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff");
}
if(!this.options.restorecolor){
this.options.restorecolor=this.element.getStyle("background-color");
}
this._base=$R(0,2).map(function(i){
return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
}.bind(this));
this._delta=$R(0,2).map(function(i){
return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
}.bind(this));
},update:function(_520){
this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(this._base[i]+(this._delta[i]*_520)).toColorPart());
}.bind(this))});
},finish:function(){
this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(_524){
this.element=$(_524);
this.start(arguments[1]||{});
},setup:function(){
Position.prepare();
var _525=Position.cumulativeOffset(this.element);
if(this.options.offset){
_525[1]+=this.options.offset;
}
var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
this.scrollStart=Position.deltaY;
this.delta=(_525[1]>max?max:_525[1])-this.scrollStart;
},update:function(_527){
Position.prepare();
window.scrollTo(Position.deltaX,this.scrollStart+(_527*this.delta));
}});
Effect.Fade=function(_528){
_528=$(_528);
var _529=_528.getInlineOpacity();
var _52a=Object.extend({from:_528.getOpacity()||1,to:0,afterFinishInternal:function(_52b){
if(_52b.options.to!=0){
return;
}
_52b.element.hide().setStyle({opacity:_529});
}},arguments[1]||{});
return new Effect.Opacity(_528,_52a);
};
Effect.Appear=function(_52c){
_52c=$(_52c);
var _52d=Object.extend({from:(_52c.getStyle("display")=="none"?0:_52c.getOpacity()||0),to:1,afterFinishInternal:function(_52e){
_52e.element.forceRerendering();
},beforeSetup:function(_52f){
_52f.element.setOpacity(_52f.options.from).show();
}},arguments[1]||{});
return new Effect.Opacity(_52c,_52d);
};
Effect.Puff=function(_530){
_530=$(_530);
var _531={opacity:_530.getInlineOpacity(),position:_530.getStyle("position"),top:_530.style.top,left:_530.style.left,width:_530.style.width,height:_530.style.height};
return new Effect.Parallel([new Effect.Scale(_530,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_530,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_532){
Position.absolutize(_532.effects[0].element);
},afterFinishInternal:function(_533){
_533.effects[0].element.hide().setStyle(_531);
}},arguments[1]||{}));
};
Effect.BlindUp=function(_534){
_534=$(_534);
_534.makeClipping();
return new Effect.Scale(_534,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_535){
_535.element.hide().undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(_536){
_536=$(_536);
var _537=_536.getDimensions();
return new Effect.Scale(_536,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_537.height,originalWidth:_537.width},restoreAfterFinish:true,afterSetup:function(_538){
_538.element.makeClipping().setStyle({height:"0px"}).show();
},afterFinishInternal:function(_539){
_539.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_53a){
_53a=$(_53a);
var _53b=_53a.getInlineOpacity();
return new Effect.Appear(_53a,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_53c){
new Effect.Scale(_53c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_53d){
_53d.element.makePositioned().makeClipping();
},afterFinishInternal:function(_53e){
_53e.element.hide().undoClipping().undoPositioned().setStyle({opacity:_53b});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(_53f){
_53f=$(_53f);
var _540={top:_53f.getStyle("top"),left:_53f.getStyle("left"),opacity:_53f.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(_53f,{x:0,y:100,sync:true}),new Effect.Opacity(_53f,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_541){
_541.effects[0].element.makePositioned();
},afterFinishInternal:function(_542){
_542.effects[0].element.hide().undoPositioned().setStyle(_540);
}},arguments[1]||{}));
};
Effect.Shake=function(_543){
_543=$(_543);
var _544={top:_543.getStyle("top"),left:_543.getStyle("left")};
return new Effect.Move(_543,{x:20,y:0,duration:0.05,afterFinishInternal:function(_545){
new Effect.Move(_545.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_546){
new Effect.Move(_546.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_547){
new Effect.Move(_547.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_548){
new Effect.Move(_548.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_549){
new Effect.Move(_549.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_54a){
_54a.element.undoPositioned().setStyle(_544);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_54b){
_54b=$(_54b).cleanWhitespace();
var _54c=_54b.down().getStyle("bottom");
var _54d=_54b.getDimensions();
return new Effect.Scale(_54b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_54d.height,originalWidth:_54d.width},restoreAfterFinish:true,afterSetup:function(_54e){
_54e.element.makePositioned();
_54e.element.down().makePositioned();
if(window.opera){
_54e.element.setStyle({top:""});
}
_54e.element.makeClipping().setStyle({height:"0px"}).show();
},afterUpdateInternal:function(_54f){
_54f.element.down().setStyle({bottom:(_54f.dims[0]-_54f.element.clientHeight)+"px"});
},afterFinishInternal:function(_550){
_550.element.undoClipping().undoPositioned();
_550.element.down().undoPositioned().setStyle({bottom:_54c});
}},arguments[1]||{}));
};
Effect.SlideUp=function(_551){
_551=$(_551).cleanWhitespace();
var _552=_551.down().getStyle("bottom");
return new Effect.Scale(_551,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_553){
_553.element.makePositioned();
_553.element.down().makePositioned();
if(window.opera){
_553.element.setStyle({top:""});
}
_553.element.makeClipping().show();
},afterUpdateInternal:function(_554){
_554.element.down().setStyle({bottom:(_554.dims[0]-_554.element.clientHeight)+"px"});
},afterFinishInternal:function(_555){
_555.element.hide().undoClipping().undoPositioned().setStyle({bottom:_552});
_555.element.down().undoPositioned();
}},arguments[1]||{}));
};
Effect.Squish=function(_556){
return new Effect.Scale(_556,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_557){
_557.element.makeClipping();
},afterFinishInternal:function(_558){
_558.element.hide().undoClipping();
}});
};
Effect.Grow=function(_559){
_559=$(_559);
var _55a=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _55b={top:_559.style.top,left:_559.style.left,height:_559.style.height,width:_559.style.width,opacity:_559.getInlineOpacity()};
var dims=_559.getDimensions();
var _55d,initialMoveY;
var _55e,moveY;
switch(_55a.direction){
case "top-left":
_55d=initialMoveY=_55e=moveY=0;
break;
case "top-right":
_55d=dims.width;
initialMoveY=moveY=0;
_55e=-dims.width;
break;
case "bottom-left":
_55d=_55e=0;
initialMoveY=dims.height;
moveY=-dims.height;
break;
case "bottom-right":
_55d=dims.width;
initialMoveY=dims.height;
_55e=-dims.width;
moveY=-dims.height;
break;
case "center":
_55d=dims.width/2;
initialMoveY=dims.height/2;
_55e=-dims.width/2;
moveY=-dims.height/2;
break;
}
return new Effect.Move(_559,{x:_55d,y:initialMoveY,duration:0.01,beforeSetup:function(_55f){
_55f.element.hide().makeClipping().makePositioned();
},afterFinishInternal:function(_560){
new Effect.Parallel([new Effect.Opacity(_560.element,{sync:true,to:1,from:0,transition:_55a.opacityTransition}),new Effect.Move(_560.element,{x:_55e,y:moveY,sync:true,transition:_55a.moveTransition}),new Effect.Scale(_560.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:_55a.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_561){
_561.effects[0].element.setStyle({height:"0px"}).show();
},afterFinishInternal:function(_562){
_562.effects[0].element.undoClipping().undoPositioned().setStyle(_55b);
}},_55a));
}});
};
Effect.Shrink=function(_563){
_563=$(_563);
var _564=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _565={top:_563.style.top,left:_563.style.left,height:_563.style.height,width:_563.style.width,opacity:_563.getInlineOpacity()};
var dims=_563.getDimensions();
var _567,moveY;
switch(_564.direction){
case "top-left":
_567=moveY=0;
break;
case "top-right":
_567=dims.width;
moveY=0;
break;
case "bottom-left":
_567=0;
moveY=dims.height;
break;
case "bottom-right":
_567=dims.width;
moveY=dims.height;
break;
case "center":
_567=dims.width/2;
moveY=dims.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_563,{sync:true,to:0,from:1,transition:_564.opacityTransition}),new Effect.Scale(_563,window.opera?1:0,{sync:true,transition:_564.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_563,{x:_567,y:moveY,sync:true,transition:_564.moveTransition})],Object.extend({beforeStartInternal:function(_568){
_568.effects[0].element.makePositioned().makeClipping();
},afterFinishInternal:function(_569){
_569.effects[0].element.hide().undoClipping().undoPositioned().setStyle(_565);
}},_564));
};
Effect.Pulsate=function(_56a){
_56a=$(_56a);
var _56b=arguments[1]||{};
var _56c=_56a.getInlineOpacity();
var _56d=_56b.transition||Effect.Transitions.sinoidal;
var _56e=function(pos){
return _56d(1-Effect.Transitions.pulse(pos,_56b.pulses));
};
_56e.bind(_56d);
return new Effect.Opacity(_56a,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(_570){
_570.element.setStyle({opacity:_56c});
}},_56b),{transition:_56e}));
};
Effect.Fold=function(_571){
_571=$(_571);
var _572={top:_571.style.top,left:_571.style.left,width:_571.style.width,height:_571.style.height};
_571.makeClipping();
return new Effect.Scale(_571,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_573){
new Effect.Scale(_571,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_574){
_574.element.hide().undoClipping().setStyle(_572);
}});
}},arguments[1]||{}));
};
["setOpacity","getOpacity","getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass"].each(function(f){
Element.Methods[f]=Element[f];
});
Element.Methods.visualEffect=function(_576,_577,_578){
s=_577.gsub(/_/,"-").camelize();
effect_class=s.charAt(0).toUpperCase()+s.substring(1);
new Effect[effect_class](_576,_578);
return $(_576);
};
Element.addMethods();
}
if($Bootstrap.notLoaded("29b7dc3c8edf15ad120fc1fe2284c30c")){
if(typeof Effect=="undefined"){
throw ("dragdrop.js requires including script.aculo.us' effects.js library");
}
var Droppables={drops:[],remove:function(_579){
this.drops=this.drops.reject(function(d){
return d.element==$(_579);
});
},add:function(_57b){
_57b=$(_57b);
var _57c=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});
if(_57c.containment){
_57c._containers=[];
var _57d=_57c.containment;
if((typeof _57d=="object")&&(_57d.constructor==Array)){
_57d.each(function(c){
_57c._containers.push($(c));
});
}else{
_57c._containers.push($(_57d));
}
}
if(_57c.accept){
_57c.accept=[_57c.accept].flatten();
}
Element.makePositioned(_57b);
_57c.element=_57b;
this.drops.push(_57c);
},findDeepestChild:function(_57f){
deepest=_57f[0];
for(i=1;i<_57f.length;++i){
if(Element.isParent(_57f[i].element,deepest.element)){
deepest=_57f[i];
}
}
return deepest;
},isContained:function(_580,drop){
var _582;
if(drop.tree){
_582=_580.treeNode;
}else{
_582=_580.parentNode;
}
return drop._containers.detect(function(c){
return _582==c;
});
},isAffected:function(_584,_585,drop){
return ((drop.element!=_585)&&((!drop._containers)||this.isContained(_585,drop))&&((!drop.accept)||(Element.classNames(_585).detect(function(v){
return drop.accept.include(v);
})))&&Position.within(drop.element,_584[0],_584[1]));
},deactivate:function(drop){
if(drop.hoverclass){
Element.removeClassName(drop.element,drop.hoverclass);
}
this.last_active=null;
},activate:function(drop){
if(drop.hoverclass){
Element.addClassName(drop.element,drop.hoverclass);
}
this.last_active=drop;
},show:function(_58a,_58b){
if(!this.drops.length){
return;
}
var _58c=[];
if(this.last_active){
this.deactivate(this.last_active);
}
this.drops.each(function(drop){
if(Droppables.isAffected(_58a,_58b,drop)){
_58c.push(drop);
}
});
if(_58c.length>0){
drop=Droppables.findDeepestChild(_58c);
Position.within(drop.element,_58a[0],_58a[1]);
if(drop.onHover){
drop.onHover(_58b,drop.element,Position.overlap(drop.overlap,drop.element));
}
Droppables.activate(drop);
}
},fire:function(_58e,_58f){
if(!this.last_active){
return;
}
Position.prepare();
if(this.isAffected([Event.pointerX(_58e),Event.pointerY(_58e)],_58f,this.last_active)){
if(this.last_active.onDrop){
this.last_active.onDrop(_58f,this.last_active.element,_58e);
}
}
},reset:function(){
if(this.last_active){
this.deactivate(this.last_active);
}
}};
var Draggables={drags:[],observers:[],register:function(_590){
if(this.drags.length==0){
this.eventMouseUp=this.endDrag.bindAsEventListener(this);
this.eventMouseMove=this.updateDrag.bindAsEventListener(this);
this.eventKeypress=this.keyPress.bindAsEventListener(this);
Event.observe(document,"mouseup",this.eventMouseUp);
Event.observe(document,"mousemove",this.eventMouseMove);
Event.observe(document,"keypress",this.eventKeypress);
}
this.drags.push(_590);
},unregister:function(_591){
this.drags=this.drags.reject(function(d){
return d==_591;
});
if(this.drags.length==0){
Event.stopObserving(document,"mouseup",this.eventMouseUp);
Event.stopObserving(document,"mousemove",this.eventMouseMove);
Event.stopObserving(document,"keypress",this.eventKeypress);
}
},activate:function(_593){
if(_593.options.delay){
this._timeout=setTimeout(function(){
Draggables._timeout=null;
window.focus();
Draggables.activeDraggable=_593;
}.bind(this),_593.options.delay);
}else{
window.focus();
this.activeDraggable=_593;
}
},deactivate:function(){
this.activeDraggable=null;
},updateDrag:function(_594){
if(!this.activeDraggable){
return;
}
var _595=[Event.pointerX(_594),Event.pointerY(_594)];
if(this._lastPointer&&(this._lastPointer.inspect()==_595.inspect())){
return;
}
this._lastPointer=_595;
this.activeDraggable.updateDrag(_594,_595);
},endDrag:function(_596){
if(this._timeout){
clearTimeout(this._timeout);
this._timeout=null;
}
if(!this.activeDraggable){
return;
}
this._lastPointer=null;
this.activeDraggable.endDrag(_596);
this.activeDraggable=null;
},keyPress:function(_597){
if(this.activeDraggable){
this.activeDraggable.keyPress(_597);
}
},addObserver:function(_598){
this.observers.push(_598);
this._cacheObserverCallbacks();
},removeObserver:function(_599){
this.observers=this.observers.reject(function(o){
return o.element==_599;
});
this._cacheObserverCallbacks();
},notify:function(_59b,_59c,_59d){
if(this[_59b+"Count"]>0){
this.observers.each(function(o){
if(o[_59b]){
o[_59b](_59b,_59c,_59d);
}
});
}
if(_59c.options[_59b]){
_59c.options[_59b](_59c,_59d);
}
},_cacheObserverCallbacks:function(){
["onStart","onEnd","onDrag"].each(function(_59f){
Draggables[_59f+"Count"]=Draggables.observers.select(function(o){
return o[_59f];
}).length;
});
}};
var Draggable=Class.create();
Draggable._dragging={};
Draggable.prototype={initialize:function(_5a1){
var _5a2={handle:false,reverteffect:function(_5a3,_5a4,_5a5){
var dur=Math.sqrt(Math.abs(_5a4^2)+Math.abs(_5a5^2))*0.02;
new Effect.Move(_5a3,{x:-_5a5,y:-_5a4,duration:dur,queue:{scope:"_draggable",position:"end"}});
},endeffect:function(_5a7){
var _5a8=typeof _5a7._opacity=="number"?_5a7._opacity:1;
new Effect.Opacity(_5a7,{duration:0.2,from:0.7,to:_5a8,queue:{scope:"_draggable",position:"end"},afterFinish:function(){
Draggable._dragging[_5a7]=false;
}});
},zindex:1000,revert:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};
if(!arguments[1]||typeof arguments[1].endeffect=="undefined"){
Object.extend(_5a2,{starteffect:function(_5a9){
_5a9._opacity=Element.getOpacity(_5a9);
Draggable._dragging[_5a9]=true;
new Effect.Opacity(_5a9,{duration:0.2,from:_5a9._opacity,to:0.7});
}});
}
var _5aa=Object.extend(_5a2,arguments[1]||{});
this.element=$(_5a1);
if(_5aa.handle&&(typeof _5aa.handle=="string")){
this.handle=this.element.down("."+_5aa.handle,0);
}
if(!this.handle){
this.handle=$(_5aa.handle);
}
if(!this.handle){
this.handle=this.element;
}
if(_5aa.scroll&&!_5aa.scroll.scrollTo&&!_5aa.scroll.outerHTML){
_5aa.scroll=$(_5aa.scroll);
this._isScrollChild=Element.childOf(this.element,_5aa.scroll);
}
Element.makePositioned(this.element);
this.delta=this.currentDelta();
this.options=_5aa;
this.dragging=false;
this.eventMouseDown=this.initDrag.bindAsEventListener(this);
Event.observe(this.handle,"mousedown",this.eventMouseDown);
Draggables.register(this);
},destroy:function(){
Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);
Draggables.unregister(this);
},currentDelta:function(){
return ([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]);
},initDrag:function(_5ab){
if(typeof Draggable._dragging[this.element]!="undefined"&&Draggable._dragging[this.element]){
return;
}
if(Event.isLeftClick(_5ab)){
var src=Event.element(_5ab);
if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="OPTION"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){
return;
}
var _5ad=[Event.pointerX(_5ab),Event.pointerY(_5ab)];
var pos=Position.cumulativeOffset(this.element);
this.offset=[0,1].map(function(i){
return (_5ad[i]-pos[i]);
});
Draggables.activate(this);
Event.stop(_5ab);
}
},startDrag:function(_5b0){
this.dragging=true;
if(this.options.zindex){
this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);
this.element.style.zIndex=this.options.zindex;
}
if(this.options.ghosting){
this._clone=this.element.cloneNode(true);
Position.absolutize(this.element);
this.element.parentNode.insertBefore(this._clone,this.element);
}
if(this.options.scroll){
if(this.options.scroll==window){
var _5b1=this._getWindowScroll(this.options.scroll);
this.originalScrollLeft=_5b1.left;
this.originalScrollTop=_5b1.top;
}else{
this.originalScrollLeft=this.options.scroll.scrollLeft;
this.originalScrollTop=this.options.scroll.scrollTop;
}
}
Draggables.notify("onStart",this,_5b0);
if(this.options.starteffect){
this.options.starteffect(this.element);
}
},updateDrag:function(_5b2,_5b3){
if(!this.dragging){
this.startDrag(_5b2);
}
Position.prepare();
Droppables.show(_5b3,this.element);
Draggables.notify("onDrag",this,_5b2);
this.draw(_5b3);
if(this.options.change){
this.options.change(this);
}
if(this.options.scroll){
this.stopScrolling();
var p;
if(this.options.scroll==window){
with(this._getWindowScroll(this.options.scroll)){
p=[left,top,left+width,top+height];
}
}else{
p=Position.page(this.options.scroll);
p[0]+=this.options.scroll.scrollLeft+Position.deltaX;
p[1]+=this.options.scroll.scrollTop+Position.deltaY;
p.push(p[0]+this.options.scroll.offsetWidth);
p.push(p[1]+this.options.scroll.offsetHeight);
}
var _5b5=[0,0];
if(_5b3[0]<(p[0]+this.options.scrollSensitivity)){
_5b5[0]=_5b3[0]-(p[0]+this.options.scrollSensitivity);
}
if(_5b3[1]<(p[1]+this.options.scrollSensitivity)){
_5b5[1]=_5b3[1]-(p[1]+this.options.scrollSensitivity);
}
if(_5b3[0]>(p[2]-this.options.scrollSensitivity)){
_5b5[0]=_5b3[0]-(p[2]-this.options.scrollSensitivity);
}
if(_5b3[1]>(p[3]-this.options.scrollSensitivity)){
_5b5[1]=_5b3[1]-(p[3]-this.options.scrollSensitivity);
}
this.startScrolling(_5b5);
}
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
Event.stop(_5b2);
},finishDrag:function(_5b6,_5b7){
this.dragging=false;
if(this.options.ghosting){
Position.relativize(this.element);
Element.remove(this._clone);
this._clone=null;
}
if(_5b7){
Droppables.fire(_5b6,this.element);
}
Draggables.notify("onEnd",this,_5b6);
var _5b8=this.options.revert;
if(_5b8&&typeof _5b8=="function"){
_5b8=_5b8(this.element);
}
var d=this.currentDelta();
if(_5b8&&this.options.reverteffect){
this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0]);
}else{
this.delta=d;
}
if(this.options.zindex){
this.element.style.zIndex=this.originalZ;
}
if(this.options.endeffect){
this.options.endeffect(this.element);
}
Draggables.deactivate(this);
Droppables.reset();
},keyPress:function(_5ba){
if(_5ba.keyCode!=Event.KEY_ESC){
return;
}
this.finishDrag(_5ba,false);
Event.stop(_5ba);
},endDrag:function(_5bb){
if(!this.dragging){
return;
}
this.stopScrolling();
this.finishDrag(_5bb,true);
Event.stop(_5bb);
},draw:function(_5bc){
var pos=Position.cumulativeOffset(this.element);
if(this.options.ghosting){
var r=Position.realOffset(this.element);
pos[0]+=r[0]-Position.deltaX;
pos[1]+=r[1]-Position.deltaY;
}
var d=this.currentDelta();
pos[0]-=d[0];
pos[1]-=d[1];
if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){
pos[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;
pos[1]-=this.options.scroll.scrollTop-this.originalScrollTop;
}
var p=[0,1].map(function(i){
return (_5bc[i]-pos[i]-this.offset[i]);
}.bind(this));
if(this.options.snap){
if(typeof this.options.snap=="function"){
p=this.options.snap(p[0],p[1],this);
}else{
if(this.options.snap instanceof Array){
p=p.map(function(v,i){
return Math.round(v/this.options.snap[i])*this.options.snap[i];
}.bind(this));
}else{
p=p.map(function(v){
return Math.round(v/this.options.snap)*this.options.snap;
}.bind(this));
}
}
}
var _5c5=this.element.style;
if((!this.options.constraint)||(this.options.constraint=="horizontal")){
_5c5.left=p[0]+"px";
}
if((!this.options.constraint)||(this.options.constraint=="vertical")){
_5c5.top=p[1]+"px";
}
if(_5c5.visibility=="hidden"){
_5c5.visibility="";
}
},stopScrolling:function(){
if(this.scrollInterval){
clearInterval(this.scrollInterval);
this.scrollInterval=null;
Draggables._lastScrollPointer=null;
}
},startScrolling:function(_5c6){
if(!(_5c6[0]||_5c6[1])){
return;
}
this.scrollSpeed=[_5c6[0]*this.options.scrollSpeed,_5c6[1]*this.options.scrollSpeed];
this.lastScrolled=new Date();
this.scrollInterval=setInterval(this.scroll.bind(this),10);
},scroll:function(){
var _5c7=new Date();
var _5c8=_5c7-this.lastScrolled;
this.lastScrolled=_5c7;
if(this.options.scroll==window){
with(this._getWindowScroll(this.options.scroll)){
if(this.scrollSpeed[0]||this.scrollSpeed[1]){
var d=_5c8/1000;
this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1]);
}
}
}else{
this.options.scroll.scrollLeft+=this.scrollSpeed[0]*_5c8/1000;
this.options.scroll.scrollTop+=this.scrollSpeed[1]*_5c8/1000;
}
Position.prepare();
Droppables.show(Draggables._lastPointer,this.element);
Draggables.notify("onDrag",this);
if(this._isScrollChild){
Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);
Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*_5c8/1000;
Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*_5c8/1000;
if(Draggables._lastScrollPointer[0]<0){
Draggables._lastScrollPointer[0]=0;
}
if(Draggables._lastScrollPointer[1]<0){
Draggables._lastScrollPointer[1]=0;
}
this.draw(Draggables._lastScrollPointer);
}
if(this.options.change){
this.options.change(this);
}
},_getWindowScroll:function(w){
var T,L,W,H;
with(w.document){
if(w.document.documentElement&&documentElement.scrollTop){
T=documentElement.scrollTop;
L=documentElement.scrollLeft;
}else{
if(w.document.body){
T=body.scrollTop;
L=body.scrollLeft;
}
}
if(w.innerWidth){
W=w.innerWidth;
H=w.innerHeight;
}else{
if(w.document.documentElement&&documentElement.clientWidth){
W=documentElement.clientWidth;
H=documentElement.clientHeight;
}else{
W=body.offsetWidth;
H=body.offsetHeight;
}
}
}
return {top:T,left:L,width:W,height:H};
}};
var SortableObserver=Class.create();
SortableObserver.prototype={initialize:function(_5cc,_5cd){
this.element=$(_5cc);
this.observer=_5cd;
this.lastValue=Sortable.serialize(this.element);
},onStart:function(){
this.lastValue=Sortable.serialize(this.element);
},onEnd:function(){
Sortable.unmark();
if(this.lastValue!=Sortable.serialize(this.element)){
this.observer(this.element);
}
}};
var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(_5ce){
while(_5ce.tagName!="BODY"){
if(_5ce.id&&Sortable.sortables[_5ce.id]){
return _5ce;
}
_5ce=_5ce.parentNode;
}
},options:function(_5cf){
_5cf=Sortable._findRootElement($(_5cf));
if(!_5cf){
return;
}
return Sortable.sortables[_5cf.id];
},destroy:function(_5d0){
var s=Sortable.options(_5d0);
if(s){
Draggables.removeObserver(s.element);
s.droppables.each(function(d){
Droppables.remove(d);
});
s.draggables.invoke("destroy");
delete Sortable.sortables[s.element.id];
}
},create:function(_5d3){
_5d3=$(_5d3);
var _5d4=Object.extend({element:_5d3,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:_5d3,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});
this.destroy(_5d3);
var _5d5={revert:true,scroll:_5d4.scroll,scrollSpeed:_5d4.scrollSpeed,scrollSensitivity:_5d4.scrollSensitivity,delay:_5d4.delay,ghosting:_5d4.ghosting,constraint:_5d4.constraint,handle:_5d4.handle};
if(_5d4.starteffect){
_5d5.starteffect=_5d4.starteffect;
}
if(_5d4.reverteffect){
_5d5.reverteffect=_5d4.reverteffect;
}else{
if(_5d4.ghosting){
_5d5.reverteffect=function(_5d6){
_5d6.style.top=0;
_5d6.style.left=0;
};
}
}
if(_5d4.endeffect){
_5d5.endeffect=_5d4.endeffect;
}
if(_5d4.zindex){
_5d5.zindex=_5d4.zindex;
}
var _5d7={overlap:_5d4.overlap,containment:_5d4.containment,tree:_5d4.tree,hoverclass:_5d4.hoverclass,onHover:Sortable.onHover};
var _5d8={onHover:Sortable.onEmptyHover,overlap:_5d4.overlap,containment:_5d4.containment,hoverclass:_5d4.hoverclass};
Element.cleanWhitespace(_5d3);
_5d4.draggables=[];
_5d4.droppables=[];
if(_5d4.dropOnEmpty||_5d4.tree){
Droppables.add(_5d3,_5d8);
_5d4.droppables.push(_5d3);
}
(this.findElements(_5d3,_5d4)||[]).each(function(e){
var _5da=_5d4.handle?$(e).down("."+_5d4.handle,0):e;
_5d4.draggables.push(new Draggable(e,Object.extend(_5d5,{handle:_5da})));
Droppables.add(e,_5d7);
if(_5d4.tree){
e.treeNode=_5d3;
}
_5d4.droppables.push(e);
});
if(_5d4.tree){
(Sortable.findTreeElements(_5d3,_5d4)||[]).each(function(e){
Droppables.add(e,_5d8);
e.treeNode=_5d3;
_5d4.droppables.push(e);
});
}
this.sortables[_5d3.id]=_5d4;
Draggables.addObserver(new SortableObserver(_5d3,_5d4.onUpdate));
},findElements:function(_5dc,_5dd){
return Element.findChildren(_5dc,_5dd.only,_5dd.tree?true:false,_5dd.tag);
},findTreeElements:function(_5de,_5df){
return Element.findChildren(_5de,_5df.only,_5df.tree?true:false,_5df.treeTag);
},onHover:function(_5e0,_5e1,_5e2){
if(Element.isParent(_5e1,_5e0)){
return;
}
if(_5e2>0.33&&_5e2<0.66&&Sortable.options(_5e1).tree){
return;
}else{
if(_5e2>0.5){
Sortable.mark(_5e1,"before");
if(_5e1.previousSibling!=_5e0){
var _5e3=_5e0.parentNode;
_5e0.style.visibility="hidden";
_5e1.parentNode.insertBefore(_5e0,_5e1);
if(_5e1.parentNode!=_5e3){
Sortable.options(_5e3).onChange(_5e0);
}
Sortable.options(_5e1.parentNode).onChange(_5e0);
}
}else{
Sortable.mark(_5e1,"after");
var _5e4=_5e1.nextSibling||null;
if(_5e4!=_5e0){
var _5e3=_5e0.parentNode;
_5e0.style.visibility="hidden";
_5e1.parentNode.insertBefore(_5e0,_5e4);
if(_5e1.parentNode!=_5e3){
Sortable.options(_5e3).onChange(_5e0);
}
Sortable.options(_5e1.parentNode).onChange(_5e0);
}
}
}
},onEmptyHover:function(_5e5,_5e6,_5e7){
var _5e8=_5e5.parentNode;
var _5e9=Sortable.options(_5e6);
if(!Element.isParent(_5e6,_5e5)){
var _5ea;
var _5eb=Sortable.findElements(_5e6,{tag:_5e9.tag,only:_5e9.only});
var _5ec=null;
if(_5eb){
var _5ed=Element.offsetSize(_5e6,_5e9.overlap)*(1-_5e7);
for(_5ea=0;_5ea<_5eb.length;_5ea+=1){
if(_5ed-Element.offsetSize(_5eb[_5ea],_5e9.overlap)>=0){
_5ed-=Element.offsetSize(_5eb[_5ea],_5e9.overlap);
}else{
if(_5ed-(Element.offsetSize(_5eb[_5ea],_5e9.overlap)/2)>=0){
_5ec=_5ea+1<_5eb.length?_5eb[_5ea+1]:null;
break;
}else{
_5ec=_5eb[_5ea];
break;
}
}
}
}
_5e6.insertBefore(_5e5,_5ec);
Sortable.options(_5e8).onChange(_5e5);
_5e9.onChange(_5e5);
}
},unmark:function(){
if(Sortable._marker){
Sortable._marker.hide();
}
},mark:function(_5ee,_5ef){
var _5f0=Sortable.options(_5ee.parentNode);
if(_5f0&&!_5f0.ghosting){
return;
}
if(!Sortable._marker){
Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
}
var _5f1=Position.cumulativeOffset(_5ee);
Sortable._marker.setStyle({left:_5f1[0]+"px",top:_5f1[1]+"px"});
if(_5ef=="after"){
if(_5f0.overlap=="horizontal"){
Sortable._marker.setStyle({left:(_5f1[0]+_5ee.clientWidth)+"px"});
}else{
Sortable._marker.setStyle({top:(_5f1[1]+_5ee.clientHeight)+"px"});
}
}
Sortable._marker.show();
},_tree:function(_5f2,_5f3,_5f4){
var _5f5=Sortable.findElements(_5f2,_5f3)||[];
for(var i=0;i<_5f5.length;++i){
var _5f7=_5f5[i].id.match(_5f3.format);
if(!_5f7){
continue;
}
var _5f8={id:encodeURIComponent(_5f7?_5f7[1]:null),element:_5f2,parent:_5f4,children:[],position:_5f4.children.length,container:$(_5f5[i]).down(_5f3.treeTag)};
if(_5f8.container){
this._tree(_5f8.container,_5f3,_5f8);
}
_5f4.children.push(_5f8);
}
return _5f4;
},tree:function(_5f9){
_5f9=$(_5f9);
var _5fa=this.options(_5f9);
var _5fb=Object.extend({tag:_5fa.tag,treeTag:_5fa.treeTag,only:_5fa.only,name:_5f9.id,format:_5fa.format},arguments[1]||{});
var root={id:null,parent:null,children:[],container:_5f9,position:0};
return Sortable._tree(_5f9,_5fb,root);
},_constructIndex:function(node){
var _5fe="";
do{
if(node.id){
_5fe="["+node.position+"]"+_5fe;
}
}while((node=node.parent)!=null);
return _5fe;
},sequence:function(_5ff){
_5ff=$(_5ff);
var _600=Object.extend(this.options(_5ff),arguments[1]||{});
return $(this.findElements(_5ff,_600)||[]).map(function(item){
return item.id.match(_600.format)?item.id.match(_600.format)[1]:"";
});
},setSequence:function(_602,_603){
_602=$(_602);
var _604=Object.extend(this.options(_602),arguments[2]||{});
var _605={};
this.findElements(_602,_604).each(function(n){
if(n.id.match(_604.format)){
_605[n.id.match(_604.format)[1]]=[n,n.parentNode];
}
n.parentNode.removeChild(n);
});
_603.each(function(_607){
var n=_605[_607];
if(n){
n[1].appendChild(n[0]);
delete _605[_607];
}
});
},serialize:function(_609){
_609=$(_609);
var _60a=Object.extend(Sortable.options(_609),arguments[1]||{});
var name=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:_609.id);
if(_60a.tree){
return Sortable.tree(_609,arguments[1]).children.map(function(item){
return [name+Sortable._constructIndex(item)+"[id]="+encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
}).flatten().join("&");
}else{
return Sortable.sequence(_609,arguments[1]).map(function(item){
return name+"[]="+encodeURIComponent(item);
}).join("&");
}
}};
Element.isParent=function(_60e,_60f){
if(!_60e.parentNode||_60e==_60f){
return false;
}
if(_60e.parentNode==_60f){
return true;
}
return Element.isParent(_60e.parentNode,_60f);
};
Element.findChildren=function(_610,only,_612,_613){
if(!_610.hasChildNodes()){
return null;
}
_613=_613.toUpperCase();
if(only){
only=[only].flatten();
}
var _614=[];
$A(_610.childNodes).each(function(e){
if(e.tagName&&e.tagName.toUpperCase()==_613&&(!only||(Element.classNames(e).detect(function(v){
return only.include(v);
})))){
_614.push(e);
}
if(_612){
var _617=Element.findChildren(e,only,_612,_613);
if(_617){
_614.push(_617);
}
}
});
return (_614.length>0?_614.flatten():[]);
};
Element.offsetSize=function(_618,type){
return _618["offset"+((type=="vertical"||type=="height")?"Height":"Width")];
};
}
if($Bootstrap.notLoaded("977b5de2c0c0659c6735c3a9ab1812c5")){
if(typeof Effect=="undefined"){
throw ("controls.js requires including script.aculo.us' effects.js library");
}
var Autocompleter={};
Autocompleter.Base=function(){
};
Autocompleter.Base.prototype={baseInitialize:function(_61a,_61b,_61c){
this.element=$(_61a);
this.update=$(_61b);
this.hasFocus=false;
this.changed=false;
this.active=false;
this.index=0;
this.entryCount=0;
if(this.setOptions){
this.setOptions(_61c);
}else{
this.options=_61c||{};
}
this.options.paramName=this.options.paramName||this.element.name;
this.options.tokens=this.options.tokens||[];
this.options.frequency=this.options.frequency||0.4;
this.options.minChars=this.options.minChars||1;
this.options.onShow=this.options.onShow||function(_61d,_61e){
if(!_61e.style.position||_61e.style.position=="absolute"){
_61e.style.position="absolute";
Position.clone(_61d,_61e,{setHeight:false,offsetTop:_61d.offsetHeight});
}
Effect.Appear(_61e,{duration:0.15});
};
this.options.onHide=this.options.onHide||function(_61f,_620){
new Effect.Fade(_620,{duration:0.15});
};
if(typeof (this.options.tokens)=="string"){
this.options.tokens=new Array(this.options.tokens);
}
this.observer=null;
this.element.setAttribute("autocomplete","off");
Element.hide(this.update);
Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));
Event.observe(this.element,"keypress",this.onKeyPress.bindAsEventListener(this));
},show:function(){
if(Element.getStyle(this.update,"display")=="none"){
this.options.onShow(this.element,this.update);
}
if(!this.iefix&&(navigator.appVersion.indexOf("MSIE")>0)&&(navigator.userAgent.indexOf("Opera")<0)&&(Element.getStyle(this.update,"position")=="absolute")){
new Insertion.After(this.update,"<iframe id=\""+this.update.id+"_iefix\" "+"style=\"display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" "+"src=\"javascript:false;\" frameborder=\"0\" scrolling=\"no\"></iframe>");
this.iefix=$(this.update.id+"_iefix");
}
if(this.iefix){
setTimeout(this.fixIEOverlapping.bind(this),50);
}
},fixIEOverlapping:function(){
Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});
this.iefix.style.zIndex=1;
this.update.style.zIndex=2;
Element.show(this.iefix);
},hide:function(){
this.stopIndicator();
if(Element.getStyle(this.update,"display")!="none"){
this.options.onHide(this.element,this.update);
}
if(this.iefix){
Element.hide(this.iefix);
}
},startIndicator:function(){
if(this.options.indicator){
Element.show(this.options.indicator);
}
},stopIndicator:function(){
if(this.options.indicator){
Element.hide(this.options.indicator);
}
},onKeyPress:function(_621){
if(this.active){
switch(_621.keyCode){
case Event.KEY_TAB:
case Event.KEY_RETURN:
this.selectEntry();
Event.stop(_621);
case Event.KEY_ESC:
this.hide();
this.active=false;
Event.stop(_621);
return;
case Event.KEY_LEFT:
case Event.KEY_RIGHT:
return;
case Event.KEY_UP:
this.markPrevious();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_621);
}
return;
case Event.KEY_DOWN:
this.markNext();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_621);
}
return;
}
}else{
if(_621.keyCode==Event.KEY_TAB||_621.keyCode==Event.KEY_RETURN||(navigator.appVersion.indexOf("AppleWebKit")>0&&_621.keyCode==0)){
return;
}
}
this.changed=true;
this.hasFocus=true;
if(this.observer){
clearTimeout(this.observer);
}
this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);
},activate:function(){
this.changed=false;
this.hasFocus=true;
this.getUpdatedChoices();
},onHover:function(_622){
var _623=Event.findElement(_622,"LI");
if(this.index!=_623.autocompleteIndex){
this.index=_623.autocompleteIndex;
this.render();
}
Event.stop(_622);
},onClick:function(_624){
var _625=Event.findElement(_624,"LI");
this.index=_625.autocompleteIndex;
this.selectEntry();
this.hide();
},onBlur:function(_626){
setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false;
},render:function(){
if(this.entryCount>0){
for(var i=0;i<this.entryCount;i++){
this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");
}
if(this.hasFocus){
this.show();
this.active=true;
}
}else{
this.active=false;
this.hide();
}
},markPrevious:function(){
if(this.index>0){
this.index--;
}else{
this.index=this.entryCount-1;
}
this.getEntry(this.index).scrollIntoView(true);
},markNext:function(){
if(this.index<this.entryCount-1){
this.index++;
}else{
this.index=0;
}
this.getEntry(this.index).scrollIntoView(false);
},getEntry:function(_628){
return this.update.firstChild.childNodes[_628];
},getCurrentEntry:function(){
return this.getEntry(this.index);
},selectEntry:function(){
this.active=false;
this.updateElement(this.getCurrentEntry());
},updateElement:function(_629){
if(this.options.updateElement){
this.options.updateElement(_629);
return;
}
var _62a="";
if(this.options.select){
var _62b=document.getElementsByClassName(this.options.select,_629)||[];
if(_62b.length>0){
_62a=Element.collectTextNodes(_62b[0],this.options.select);
}
}else{
_62a=Element.collectTextNodesIgnoreClass(_629,"informal");
}
var _62c=this.findLastToken();
if(_62c!=-1){
var _62d=this.element.value.substr(0,_62c+1);
var _62e=this.element.value.substr(_62c+1).match(/^\s+/);
if(_62e){
_62d+=_62e[0];
}
this.element.value=_62d+_62a;
}else{
this.element.value=_62a;
}
this.element.focus();
if(this.options.afterUpdateElement){
this.options.afterUpdateElement(this.element,_629);
}
},updateChoices:function(_62f){
if(!this.changed&&this.hasFocus){
this.update.innerHTML=_62f;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.down());
if(this.update.firstChild&&this.update.down().childNodes){
this.entryCount=this.update.down().childNodes.length;
for(var i=0;i<this.entryCount;i++){
var _631=this.getEntry(i);
_631.autocompleteIndex=i;
this.addObservers(_631);
}
}else{
this.entryCount=0;
}
this.stopIndicator();
this.index=0;
if(this.entryCount==1&&this.options.autoSelect){
this.selectEntry();
this.hide();
}else{
this.render();
}
}
},addObservers:function(_632){
Event.observe(_632,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(_632,"click",this.onClick.bindAsEventListener(this));
},onObserverEvent:function(){
this.changed=false;
if(this.getToken().length>=this.options.minChars){
this.startIndicator();
this.getUpdatedChoices();
}else{
this.active=false;
this.hide();
}
},getToken:function(){
var _633=this.findLastToken();
if(_633!=-1){
var ret=this.element.value.substr(_633+1).replace(/^\s+/,"").replace(/\s+$/,"");
}else{
var ret=this.element.value;
}
return /\n/.test(ret)?"":ret;
},findLastToken:function(){
var _635=-1;
for(var i=0;i<this.options.tokens.length;i++){
var _637=this.element.value.lastIndexOf(this.options.tokens[i]);
if(_637>_635){
_635=_637;
}
}
return _635;
}};
Ajax.Autocompleter=Class.create();
Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(_638,_639,url,_63b){
this.baseInitialize(_638,_639,_63b);
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.defaultParams=this.options.parameters||null;
this.url=url;
},getUpdatedChoices:function(){
entry=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;
if(this.options.defaultParams){
this.options.parameters+="&"+this.options.defaultParams;
}
new Ajax.Request(this.url,this.options);
},onComplete:function(_63c){
this.updateChoices(_63c.responseText);
}});
Autocompleter.Local=Class.create();
Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_63d,_63e,_63f,_640){
this.baseInitialize(_63d,_63e,_640);
this.options.array=_63f;
},getUpdatedChoices:function(){
this.updateChoices(this.options.selector(this));
},setOptions:function(_641){
this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(_642){
var ret=[];
var _644=[];
var _645=_642.getToken();
var _646=0;
for(var i=0;i<_642.options.array.length&&ret.length<_642.options.choices;i++){
var elem=_642.options.array[i];
var _649=_642.options.ignoreCase?elem.toLowerCase().indexOf(_645.toLowerCase()):elem.indexOf(_645);
while(_649!=-1){
if(_649==0&&elem.length!=_645.length){
ret.push("<li><strong>"+elem.substr(0,_645.length)+"</strong>"+elem.substr(_645.length)+"</li>");
break;
}else{
if(_645.length>=_642.options.partialChars&&_642.options.partialSearch&&_649!=-1){
if(_642.options.fullSearch||/\s/.test(elem.substr(_649-1,1))){
_644.push("<li>"+elem.substr(0,_649)+"<strong>"+elem.substr(_649,_645.length)+"</strong>"+elem.substr(_649+_645.length)+"</li>");
break;
}
}
}
_649=_642.options.ignoreCase?elem.toLowerCase().indexOf(_645.toLowerCase(),_649+1):elem.indexOf(_645,_649+1);
}
}
if(_644.length){
ret=ret.concat(_644.slice(0,_642.options.choices-ret.length));
}
return "<ul>"+ret.join("")+"</ul>";
}},_641||{});
}});
Field.scrollFreeActivate=function(_64a){
setTimeout(function(){
Field.activate(_64a);
},1);
};
Ajax.InPlaceEditor=Class.create();
Ajax.InPlaceEditor.defaultHighlightColor="#FFFF99";
Ajax.InPlaceEditor.prototype={initialize:function(_64b,url,_64d){
this.url=url;
this.element=$(_64b);
this.options=Object.extend({okButton:true,okText:"ok",cancelLink:true,cancelText:"cancel",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(_64e,_64f){
new Effect.Highlight(_64f,{startcolor:this.options.highlightcolor});
},onFailure:function(_650){
alert("Error communicating with the server: "+_650.responseText.stripTags());
},callback:function(form){
return Form.serialize(form);
},handleLineBreaks:true,loadingText:"Loading...",savingClassName:"inplaceeditor-saving",loadingClassName:"inplaceeditor-loading",formClassName:"inplaceeditor-form",highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{},evalScripts:false},_64d||{});
if(!this.options.formId&&this.element.id){
this.options.formId=this.element.id+"-inplaceeditor";
if($(this.options.formId)){
this.options.formId=null;
}
}
if(this.options.externalControl){
this.options.externalControl=$(this.options.externalControl);
}
this.originalBackground=Element.getStyle(this.element,"background-color");
if(!this.originalBackground){
this.originalBackground="transparent";
}
this.element.title=this.options.clickToEditText;
this.onclickListener=this.enterEditMode.bindAsEventListener(this);
this.mouseoverListener=this.enterHover.bindAsEventListener(this);
this.mouseoutListener=this.leaveHover.bindAsEventListener(this);
Event.observe(this.element,"click",this.onclickListener);
Event.observe(this.element,"mouseover",this.mouseoverListener);
Event.observe(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.observe(this.options.externalControl,"click",this.onclickListener);
Event.observe(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.observe(this.options.externalControl,"mouseout",this.mouseoutListener);
}
},enterEditMode:function(evt){
if(this.saving){
return;
}
if(this.editing){
return;
}
this.editing=true;
this.onEnterEditMode();
if(this.options.externalControl){
Element.hide(this.options.externalControl);
}
Element.hide(this.element);
this.createForm();
this.element.parentNode.insertBefore(this.form,this.element);
if(!this.options.loadTextURL){
Field.scrollFreeActivate(this.editField);
}
if(evt){
Event.stop(evt);
}
return false;
},createForm:function(){
this.form=document.createElement("form");
this.form.id=this.options.formId;
Element.addClassName(this.form,this.options.formClassName);
this.form.onsubmit=this.onSubmit.bind(this);
this.createEditField();
if(this.options.textarea){
var br=document.createElement("br");
this.form.appendChild(br);
}
if(this.options.okButton){
okButton=document.createElement("input");
okButton.type="submit";
okButton.value=this.options.okText;
okButton.className="editor_ok_button";
this.form.appendChild(okButton);
}
if(this.options.cancelLink){
cancelLink=document.createElement("a");
cancelLink.href="#";
cancelLink.appendChild(document.createTextNode(this.options.cancelText));
cancelLink.onclick=this.onclickCancel.bind(this);
cancelLink.className="editor_cancel";
this.form.appendChild(cancelLink);
}
},hasHTMLLineBreaks:function(_654){
if(!this.options.handleLineBreaks){
return false;
}
return _654.match(/<br/i)||_654.match(/<p>/i);
},convertHTMLLineBreaks:function(_655){
return _655.replace(/<br>/gi,"\n").replace(/<br\/>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<p>/gi,"");
},createEditField:function(){
var text;
if(this.options.loadTextURL){
text=this.options.loadingText;
}else{
text=this.getText();
}
var obj=this;
if(this.options.rows==1&&!this.hasHTMLLineBreaks(text)){
this.options.textarea=false;
var _658=document.createElement("input");
_658.obj=this;
_658.type="text";
_658.name="value";
_658.value=text;
_658.style.backgroundColor=this.options.highlightcolor;
_658.className="editor_field";
var size=this.options.size||this.options.cols||0;
if(size!=0){
_658.size=size;
}
if(this.options.submitOnBlur){
_658.onblur=this.onSubmit.bind(this);
}
this.editField=_658;
}else{
this.options.textarea=true;
var _65a=document.createElement("textarea");
_65a.obj=this;
_65a.name="value";
_65a.value=this.convertHTMLLineBreaks(text);
_65a.rows=this.options.rows;
_65a.cols=this.options.cols||40;
_65a.className="editor_field";
if(this.options.submitOnBlur){
_65a.onblur=this.onSubmit.bind(this);
}
this.editField=_65a;
}
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
},getText:function(){
return this.element.innerHTML;
},loadExternalText:function(){
Element.addClassName(this.form,this.options.loadingClassName);
this.editField.disabled=true;
new Ajax.Request(this.options.loadTextURL,Object.extend({asynchronous:true,onComplete:this.onLoadedExternalText.bind(this)},this.options.ajaxOptions));
},onLoadedExternalText:function(_65b){
Element.removeClassName(this.form,this.options.loadingClassName);
this.editField.disabled=false;
this.editField.value=_65b.responseText.stripTags();
Field.scrollFreeActivate(this.editField);
},onclickCancel:function(){
this.onComplete();
this.leaveEditMode();
return false;
},onFailure:function(_65c){
this.options.onFailure(_65c);
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
this.oldInnerHTML=null;
}
return false;
},onSubmit:function(){
var form=this.form;
var _65e=this.editField.value;
this.onLoading();
if(this.options.evalScripts){
new Ajax.Request(this.url,Object.extend({parameters:this.options.callback(form,_65e),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this),asynchronous:true,evalScripts:true},this.options.ajaxOptions));
}else{
new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(form,_65e),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions));
}
if(arguments.length>1){
Event.stop(arguments[0]);
}
return false;
},onLoading:function(){
this.saving=true;
this.removeForm();
this.leaveHover();
this.showSaving();
},showSaving:function(){
this.oldInnerHTML=this.element.innerHTML;
this.element.innerHTML=this.options.savingText;
Element.addClassName(this.element,this.options.savingClassName);
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
},removeForm:function(){
if(this.form){
if(this.form.parentNode){
Element.remove(this.form);
}
this.form=null;
}
},enterHover:function(){
if(this.saving){
return;
}
this.element.style.backgroundColor=this.options.highlightcolor;
if(this.effect){
this.effect.cancel();
}
Element.addClassName(this.element,this.options.hoverClassName);
},leaveHover:function(){
if(this.options.backgroundColor){
this.element.style.backgroundColor=this.oldBackground;
}
Element.removeClassName(this.element,this.options.hoverClassName);
if(this.saving){
return;
}
this.effect=new Effect.Highlight(this.element,{startcolor:this.options.highlightcolor,endcolor:this.options.highlightendcolor,restorecolor:this.originalBackground});
},leaveEditMode:function(){
Element.removeClassName(this.element,this.options.savingClassName);
this.removeForm();
this.leaveHover();
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
if(this.options.externalControl){
Element.show(this.options.externalControl);
}
this.editing=false;
this.saving=false;
this.oldInnerHTML=null;
this.onLeaveEditMode();
},onComplete:function(_65f){
this.leaveEditMode();
this.options.onComplete.bind(this)(_65f,this.element);
},onEnterEditMode:function(){
},onLeaveEditMode:function(){
},dispose:function(){
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
}
this.leaveEditMode();
Event.stopObserving(this.element,"click",this.onclickListener);
Event.stopObserving(this.element,"mouseover",this.mouseoverListener);
Event.stopObserving(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.stopObserving(this.options.externalControl,"click",this.onclickListener);
Event.stopObserving(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.stopObserving(this.options.externalControl,"mouseout",this.mouseoutListener);
}
}};
Ajax.InPlaceCollectionEditor=Class.create();
Object.extend(Ajax.InPlaceCollectionEditor.prototype,Ajax.InPlaceEditor.prototype);
Object.extend(Ajax.InPlaceCollectionEditor.prototype,{createEditField:function(){
if(!this.cached_selectTag){
var _660=document.createElement("select");
var _661=this.options.collection||[];
var _662;
_661.each(function(e,i){
_662=document.createElement("option");
_662.value=(e instanceof Array)?e[0]:e;
if((typeof this.options.value=="undefined")&&((e instanceof Array)?this.element.innerHTML==e[1]:e==_662.value)){
_662.selected=true;
}
if(this.options.value==_662.value){
_662.selected=true;
}
_662.appendChild(document.createTextNode((e instanceof Array)?e[1]:e));
_660.appendChild(_662);
}.bind(this));
this.cached_selectTag=_660;
}
this.editField=this.cached_selectTag;
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
this.options.callback=function(form,_666){
return "value="+encodeURIComponent(_666);
};
}});
Form.Element.DelayedObserver=Class.create();
Form.Element.DelayedObserver.prototype={initialize:function(_667,_668,_669){
this.delay=_668||0.5;
this.element=$(_667);
this.callback=_669;
this.timer=null;
this.lastValue=$F(this.element);
Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this));
},delayedListener:function(_66a){
if(this.lastValue==$F(this.element)){
return;
}
if(this.timer){
clearTimeout(this.timer);
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);
this.lastValue=$F(this.element);
},onTimerEvent:function(){
this.timer=null;
this.callback(this.element,$F(this.element));
}};
}
if($Bootstrap.notLoaded("ec2ee87083765e93dfd1b36a74846b06")){
function Validator(){
this._rules=[];
this.badKey="";
}
Validator.$empty=function(v){
return (v!="");
};
Validator.$integer=function(v){
return (parseInt(v)==(v-0));
};
Validator.$positiveInteger=function(v){
return Validator.$integer(v)&&parseInt(v)>0;
};
Validator.$validDate=function(v){
var d=(typeof v=="string"?new Date(v):v);
if(d=="Invalid Date"||isNaN(d)){
return false;
}
if(typeof v=="string"&&v.indexOf("/")!=-1){
var _670=parseInt(v.substr(0,v.indexOf("/")),10);
if(_670!=(d.getMonth()+1)){
return false;
}
}
return true;
};
Validator.$validEmail=function(v){
var _672="[a-z0-9\\.\\'_\\-\\+\\=&]+";
var _673="([a-z0-9-]+\\.)";
var _674="([a-z0-9-]([a-z0-9-]*[a-z0-9-])?\\.)";
var _675=new RegExp("^"+_672+"@"+_674+"*?"+_673+"([a-z]{2,6})$","i");
if(_675.test(v)){
return true;
}else{
return false;
}
};
Validator.$validURL=function(v){
var _677=/^(http|https|ftp|ftps|telnet|smtp)\:\/\/(\w+(:\w+)?@)?\w+([\.\-]\w+)*\.\w{2,4}(\:\d+)*([\/\.\-\?\&\%\#\=\:\+\~]*\w+)*[\/\=]?$/i;
if(_677.test(v)){
return true;
}
var _678=v.indexOf("mailto:");
if(_678===0){
var _679=v.indexOf("?");
if(_679<=0){
_679=v.length;
}
var _67a=v.substring(7,_679);
if(_67a.length==0){
return false;
}
var _67b=_67a.split(",");
for(var i=0,ii=_67b.length;i<ii;i++){
if(Validator.$validEmail(_67b[i])==false){
return false;
}
}
return true;
}else{
return false;
}
};
Validator.$validTime=function(v){
if(String(v).trim()==""||isNaN(parseInt(v))){
return false;
}
var d=new Date("1/1/2001 "+v);
if(d=="Invalid Date"||isNaN(d)){
return false;
}
return true;
};
Validator.$validPhoneNumber=function(_67f){
_67f=_67f.replace(/\s/g,"");
return _67f.search(/^\(?[0-9]{3}\)?[-\.,]?[0-9]{3}[-\.,]?[0-9]{4}$/)!=-1;
};
Validator.prototype.addRule=function(k,v,f){
this._rules.push({"k":k,"v":v,"f":f});
};
Validator.prototype.validate=function(){
var _683=this._rules;
for(var i=0,ii=_683.length;i<ii;i++){
if(!_683[i].f(_683[i].v)){
this.badKey=_683[i].k;
return false;
}
}
return true;
};
}
if($Bootstrap.notLoaded("0caac164e9e3d3bbe52e35fe008a98ad")){
Keystroke=new function(){
this.alt=function(bool){
if(typeof bool=="undefined"){
return this._alt;
}else{
this._alt=bool;
}
};
this.ctrl=function(bool){
if(typeof bool=="undefined"){
return this._ctrl;
}else{
this._ctrl=bool;
}
};
this.enable=function(en){
if(typeof en=="undefined"){
return this._enabled;
}else{
if(en&&!this._set){
this._initialize();
}
this._enabled=en;
}
};
this.shift=function(bool){
if(typeof bool=="undefined"){
return this._shift;
}else{
this._shift=bool;
}
};
this.key=function(chr,bool){
if(!this._keys){
return false;
}
if(typeof bool=="undefined"){
return (typeof this._keys[chr]=="undefined"?false:this._keys[chr]);
}else{
this._keys[chr]=bool;
}
};
this._clearKeys=function(){
this.alt(false);
this.shift(false);
this.ctrl(false);
for(var _68b in this._keys){
this.key(_68b,false);
}
};
this._initialize=function(){
var ks=Keystroke;
Event.observe(window.document,"keydown",ks._keydownHandler.bindAsEventListener(ks));
Event.observe(window.document,"keyup",ks._keyupHandler.bindAsEventListener(ks));
Event.observe(window,"blur",ks._clearKeys.bindAsEventListener(ks));
ks._keys=[];
this._set=true;
};
this._keydownHandler=function(e){
switch(e.keyCode){
case 16:
this.shift(true);
break;
case 17:
this.ctrl(true);
break;
case 18:
this.alt(true);
break;
case 38:
break;
case 40:
break;
case 85:
this.key("u",true);
break;
case 90:
this.key("z",true);
break;
default:
return;
break;
}
};
this._keyupHandler=function(e){
switch(e.keyCode){
case 16:
this.shift(false);
break;
case 17:
this.ctrl(false);
break;
case 18:
this.alt(false);
break;
case 38:
break;
case 40:
break;
case 85:
this.key("u",false);
break;
case 90:
this.key("z",false);
break;
default:
return;
break;
}
};
};
Keystroke._enabled=false;
}
if($Bootstrap.notLoaded("4b4a53d5c78f4cb112f014efeb1939ef")){
Framework.register("Webmail");
$DateTime=Webmail.DateTime={create:function(date,time,_691){
var _692=new wack.DateTime;
if($Settings.getDateFormat()==wm_Settings_DATE_INTL){
_692.setDateOrder(wack.DateTime.DATE_INTL);
}else{
_692.setDateOrder(wack.DateTime.DATE_AMERICAN);
}
if($Settings.getHourFormat()==wm_Settings_HOUR_24){
_692.setHourFormat(wack.DateTime.HOUR_24);
}else{
_692.setHourFormat(wack.DateTime.HOUR_12);
}
if(date){
_692.setDateString(date);
}else{
if(time){
_692.setTimeString(time);
}else{
if(_691){
_692.setDateTimeString(_691);
}
}
}
return _692;
}};
}
if($Bootstrap.notLoaded("8e12de364df024699caab30dae16f16c")){
Framework.register("Webmail");
$Cache=Webmail.Cache={_cache:null,initialize:function(){
if($Preload&&$Preload["client_cache"]){
var me=$Bootstrap.getAppWindow().$Cache;
me._cache=$Preload["client_cache"];
}
},getValue:function(key){
var me=$Bootstrap.getAppWindow().$Cache;
if(me==this){
if(me._cache&&me._cache[key]){
return me._cache[key];
}
}else{
return me.getValue(key);
}
return null;
},resetValue:function(key){
var me=$Bootstrap.getAppWindow().$Cache;
if(me==this){
if(me._cache){
me._cache[key]=null;
}
}else{
me.resetValue(key);
}
},setValue:function(key,_699){
var me=$Bootstrap.getAppWindow().$Cache;
if(me==this){
if(me._cache){
me._cache[key]=_699;
}
}else{
me.setValue(key,_699);
}
}};
}
if($Bootstrap.notLoaded("94e4783eb11ffafae54f6ae63893c90a")){
function CheckDrag(){
this.call=false;
}
CheckDrag._dragging=false;
CheckDrag.prototype.load=function(_69b,_69c){
var cd=this;
if(!window._cd_arr){
window._cd_arr=[];
Event.observe(window.document,"mouseup",CheckDrag._mouseupHandler,false);
}
window._cd_arr.push(this);
if(_69c){
cd.call=_69c;
}else{
cd.call=false;
}
for(var i=0,ii=_69b.length;i<ii;i++){
_69b[i].CheckDrag=cd;
Event.observe(_69b[i],"mousedown",CheckDrag._mousedownCheckbox,false);
Event.observe(_69b[i],"mouseover",CheckDrag._mouseoverCheckbox,false);
Event.observe(_69b[i],"click",CheckDrag._preventCheck,false);
}
};
CheckDrag._mousedownCheckbox=function(e){
var elem=_src_elem(e,"input");
var cd=elem.CheckDrag;
window._curr_cd=cd;
cd._checkBox(elem,!elem.checked);
};
CheckDrag.prototype._checkBox=function(cbx,_6a3){
var cd=this;
cbx.checked=_6a3;
if(_6a3){
cd._dragging="check";
if(cd.call){
cd.call(cbx,true);
}
}else{
cd._dragging="uncheck";
if(cd.call){
cd.call(cbx,false);
}
}
};
CheckDrag._mouseoverCheckbox=function(e){
var elem=_src_elem(e,"input");
var cd=elem.CheckDrag;
if(cd._dragging!=false){
if(cd._dragging=="check"&&!elem.checked){
cd._checkBox(elem,true);
}else{
if(cd._dragging=="uncheck"&&elem.checked){
cd._checkBox(elem,false);
}
}
}
};
CheckDrag._preventCheck=function(e){
var cb=_src_elem(e,"input");
if(cb.checked){
cb.checked=false;
}else{
cb.checked=true;
}
};
CheckDrag._mouseupHandler=function(e){
if(window&&window._curr_cd){
window._curr_cd._dragging=false;
}
};
CheckDrag._flushListeners=function(){
};
}
if($Bootstrap.notLoaded("ace0a409c35b4c08fce03ee968e68d7b")){
var dp_event_managers=null;
DatePicker=function(){
};
DatePicker.iframes=[];
DatePicker.prototype={allow_back:true,allow_forward:true,back_callback:null,forward_callback:null,block_height:14,block_width:17,date:null,day_callback:null,empty_url:null,highlight_date:true,image_dir:"images/",show_leading_days:true,show_trailing_days:true,_debug:false,_height:0,_width:0,_make_header:function(){
var _6ab=Element.createHtml(["<div style=\"background:#999;padding:2px 0px;margin-bottom:2px\">","</div>"].join(""));
if(this.allow_back==true){
var _6ac=Element.createHtml(["<div style=\"float:left;padding:2px;margin-top:1px;cursor:pointer;\">","<img src=\""+this.image_dir+"DatePicker_back.gif\" />","</div>"].join(""));
Event.observe(_6ac,"click",DatePickerHelper._back);
if(this.back_callback){
Event.observe(_6ac,"click",this.back_callback);
}
Element.append(_6ab,_6ac);
}
if(this.allow_forward==true){
var _6ad="float:right;padding:2px;margin-top:1px;text-align:right;cursor:pointer;";
var _6ae=Element.createHtml(["<div style=\"",_6ad,"\">","<img src=\"",this.image_dir,"DatePicker_forward.gif\" />","</div>"].join(""));
Event.observe(_6ae,"click",DatePickerHelper._forward);
if(this.forward_callback){
Event.observe(_6ae,"click",this.forward_callback);
}
Element.append(_6ab,_6ae);
}
var text=_ce("div");
text.innerHTML=this.date.format("%F %Y");
text.style.color="#FFF";
text.style.textAlign="center";
_6ab.appendChild(text);
return _6ab;
},_make_minical:function(_6b0){
if(!_6b0){
var _6b1="style=\"border-bottom:1px solid #666\"";
var _6b0=Element.createHtml(["<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"100%\"><tbody>","<tr>","<td align=\"center\" ",_6b1,">"+L("Date.L.Sunday.Letter")+"</td>","<td align=\"center\" ",_6b1,">"+L("Date.L.Monday.Letter")+"</td>","<td align=\"center\" ",_6b1,">"+L("Date.L.Tuesday.Letter")+"</td>","<td align=\"center\" ",_6b1,">"+L("Date.L.Wednesday.Letter")+"</td>","<td align=\"center\" ",_6b1,">"+L("Date.L.Thursday.Letter")+"</td>","<td align=\"center\" ",_6b1,">"+L("Date.L.Friday.Letter")+"</td>","<td align=\"center\" ",_6b1,">"+L("Date.L.Saturday.Letter")+"</td>","</tr>","</tbody></table>"].join(""));
var _6b2=_6b0.firstChild;
for(row=1;row<7;row++){
var _6b3=Element.create("tr");
Element.append(_6b2,_6b3);
for(col=0;col<7;col++){
var cell=Element.create("td");
Element.setStyle(cell,{padding:"0 3px 1px 0",height:this.block_height+"px",textAlign:"right"});
Element.append(_6b3,cell);
}
}
}else{
var _6b2=_6b0.firstChild;
for(row=1;row<7;row++){
_6b3=_6b2.rows[row];
for(col=0;col<7;col++){
cell=_6b3.getElementsByTagName("td")[col];
Element.setStyle(cell,{border:"none",margin:"0",padding:"0 3px 1px 0",height:this.block_height+"px",textAlign:"right",backgroundColor:""});
Element.update(cell,"&nbsp;");
}
}
}
var _6b5=newDate(this.date.format("%Y-%m-01"));
var _6b6=newDate(_6b5.add(-1,1).format("%Y-%m-%d"));
if(this.show_leading_days==true){
var _6b7=_6b5.add(-_6b5.getDay()).format("%Y-%m-%d");
}else{
var _6b7=_6b5.format("%Y-%m-%d");
}
if(this.show_trailing_days==true&&_6b6.getDay()<6){
var _6b8=_6b6.add(6-_6b6.getDay()).format("%Y-%m-%d");
}else{
var _6b8=_6b6.format("%Y-%m-%d");
}
row=1;
col=newDate(_6b7).getDay();
var _6b3=_6b2.rows[row];
var _6b9=newDate(_6b7);
var _6ba=newDate(_6b8);
var _6bb=(new Date).format("%Y-%m-%d");
var _6bc=parseInt(this.date.format("%n"));
var _6bd="text-decoration:none;color:#000;";
var _6be="text-decoration:none;color:#ACA899;";
for(;_6b9<=_6ba;_6b9=_6b9.add(1)){
var _6bf=_6b9.format("%Y-%m-%d");
var cell=_6b3.getElementsByTagName("td")[col];
month=parseInt(_6bf.substring(5,7).replace(/^0/,""));
day=parseInt(_6bf.substring(8).replace(/^0/,""));
if(_6bf==_6bb){
Element.setStyle(cell,{border:"1px solid #5487BB",textAlign:"right",marginTop:"-1px",padding:"0 2px 0 0",height:this.block_height-1+"px"});
}
if(month!=_6bc){
Element.update(cell,["<a id=\"mcday",_6bf,"\" href=\"javascript:void(0);\" ","style=\"",_6be,"\">",day,"</a>"].join(""));
}else{
Element.update(cell,["<a id=\"mcday",_6bf,"\" href=\"javascript:void(0);\" ","style=\"",_6bd,"\">",day,"</a>"].join(""));
}
var link=cell.getElementsByTagName("a")[0];
link.date=_6bf;
if(this.day_callback){
Event.observe(link,"click",this.day_callback);
}
if(this.mousedown_callback){
Event.observe(link,"mousedown",this.mousedown_callback);
}
if(col==6){
col=0;
row++;
var _6b3=_6b0.rows[row];
}else{
col++;
}
}
return _6b0;
},create:function(){
if(this.date==null){
return;
}
this._height=132;
this._width=(this.block_width*7)+10;
var _6c1=Element.create("div");
_6c1.cdate=this.date.format("%Y-%m-%d");
_6c1.shwtrl=this.show_trailing_days;
_6c1.shwld=this.show_leading_days;
_6c1.block_height=this.block_height;
_6c1.block_width=this.block_width;
_6c1.day_callback=this.day_callback;
_6c1.style.height=this._height+"px";
_6c1.style.width=this._width+"px";
_6c1.style.background="#FFF";
_6c1.style.border="solid 1px #999999";
_6c1.style.padding="1px";
_6c1.style.fontSize="8pt";
_6c1.style.fontFamily="Arial, Helvetica, Sans-serif";
var _6c2=this._make_header();
var _6c3=this._make_minical();
_6c1.appendChild(_6c2);
_6c1.appendChild(_6c3);
if(Browser.is_ie6&&this.empty_url){
var _6c4=Element.create("div");
var _6c5=null;
for(var i=0,ii=DatePicker.iframes.length;i<ii;i++){
if(Element.isOrphan(DatePicker.iframes[i])){
_6c5=DatePicker.iframes[i];
break;
}
}
if(!_6c5){
_6c5=Element.createHtml("<iframe frameborder=\"0\" src=\""+this.empty_url+"\"></iframe>");
_6c5.style.height=this._height+4+"px";
_6c5.style.width=this._width+4+"px";
DatePicker.iframes.push(_6c5);
}
_6c1.style.position="relative";
_6c1.style.top=(-1*parseInt(_6c5.style.height,10))+"px";
Element.append(_6c4,_6c5,_6c1);
return _6c4;
}else{
return _6c1;
}
}};
var DatePickerHelper={_back:function(e){
Event.stop(e);
DatePickerHelper._nav(e,-1);
},_forward:function(e){
Event.stop(e);
DatePickerHelper._nav(e,1);
},_nav:function(e,d){
var elem=Event.findElement(e,"div");
var _6cc=elem.parentNode;
var _6cd=_6cc.parentNode;
DatePickerHelper.move_cal(_6cd,d);
},move_cal:function(cont,d){
var _6d0=cont;
var _6d1=_6d0.firstChild;
var _6d2=_6d0.lastChild;
var _6d3=newDate(_6d0.cdate);
if(typeof (d)=="number"||typeof (d)=="int"){
var _6d4=newDate(_6d0.cdate).add(0,d).format("%Y-%m-%d");
}else{
var _6d4=d;
}
_6d0.cdate=_6d4;
var _6d5=new DatePicker;
_6d5.date=newDate(_6d4);
_6d5.block_height=_6d0.block_height;
_6d5.block_width=_6d0.block_width;
_6d5.show_leading_days=_6d0.shwld;
_6d5.show_trailing_days=_6d0.shwtrl;
_6d5.day_callback=_6d0.day_callback;
_6d5._make_minical(_6d2);
_6d1.lastChild.innerHTML=newDate(_6d4).format("%F %Y");
}};
}
if($Bootstrap.notLoaded("296fc8c8a1d9158fd8761fa1c042f02e")){
var Minical2=Class.create();
Minical2.prototype={block_width:17,_start_date:null,_end_date:null,_first_date:null,_last_date:null,initialize:function(_6d6,_6d7){
Object.bindObservers(this);
this._options=Object.extend({date:new Date(),header_class_name:"",default_class_name:"",today_class_ame:"",highlight_class_name:"",day_callback:Prototype.emptyFunction,allow_back:true,allow_forward:true,forward_callback:Prototype.emptyFunction,back_callback:Prototype.emptyFunction,show_leading_days:true,show_trailing_days:true,back_image:"",forward_image:""},_6d7||{});
this._bold_days=[];
this._highlight_days={};
this._milliseconds_per_day=24*60*60*1000;
this.container=this._draw();
this.populate(this._options.date);
Element.append(_6d6,this.container);
},boldDays:function(days){
var _6d9=arguments[1]||"bold";
for(var i=0;i<days.length;i++){
var cell=this._findDayCell(days[i]);
if(cell){
cell.style.fontWeight=_6d9;
this._bold_days.push(days[i]);
}
}
},clear:function(){
this.unsetToday();
this.unboldAllDays();
this.unhighlightAllDays();
},gotoDate:function(date){
this.clear();
this.populate(date);
},highlightDays:function(days){
for(var i=0;i<days.length;i++){
var cell=this._findDayCell(days[i]);
if(cell){
Element.addClassName(cell,this._options.highlight_class_name);
this._highlight_days[days[i]]=cell;
}
}
},populate:function(date){
var _6e1=newDate((new Date()).format("%Y-%m-%d"));
if(this.date&&this.date.getMonth()==date.getMonth()&&this.date.getFullYear()==date.getFullYear()){
this.setToday(_6e1);
return;
}
this.date=date;
this._header.lastChild.innerHTML=date.format("%F %Y");
var _6e2=wack.DateTime.getStartEndDates("month",date);
var _6e3=_6e2.start;
var _6e4=_6e2.end;
if(this._options.show_leading_days==true){
this._start_date=_6e3.add(-_6e3.getDay());
}else{
this._start_date=_6e3;
}
this._first_date=_6e3.add(-_6e3.getDay());
if(this._options.show_trailing_days==true&&_6e4.getDay()<6){
this._end_date=_6e4.add(6-_6e4.getDay());
}else{
this._end_date=_6e4;
}
this._last_date=this._first_date.add(41);
var _6e5,col,end_date;
var _6e6=this._minical.firstChild.rows[1];
if(!this._options.show_leading_days){
_6e5=this._first_date;
col=0;
for(;_6e5<this._start_date;_6e5=_6e5.add(1)){
var cell=$(_6e6.getElementsByTagName("td")[col]);
this._resetCell(cell);
col++;
}
}
_6e5=this._start_date;
end_date=this._end_date;
col=this._start_date.getDay();
for(;_6e5<=end_date;_6e5=_6e5.add(1)){
var cell=$(_6e6.getElementsByTagName("td")[col]);
this._populateCell(cell,_6e5);
if(col==6){
col=0;
_6e6=_6e6.nextSibling;
}else{
col++;
}
}
var _6e5=this._end_date.add(1);
for(;_6e5<=this._last_date;_6e5=_6e5.add(1)){
var cell=$(_6e6.getElementsByTagName("td")[col]);
this._resetCell(cell);
if(col==6){
col=0;
_6e6=_6e6.nextSibling;
}else{
col++;
}
}
this.setToday(_6e1);
},reset:function(){
this.gotoDate(this._options.date);
},setToday:function(date){
if(date<this._start_date||date>this._end_date){
return;
}
this.unsetToday();
this._today=date;
this._today_cell=this._findDayCell(date);
Element.addClassName(this._today_cell,this._options.today_class_name);
},unsetToday:function(){
if(this._today_cell){
Element.removeClassName(this._today_cell,this._options.today_class_name);
this._today_cell=null;
}
},unboldAllDays:function(){
for(var i=0;i<this._bold_days.length;i++){
this._findDayCell(this._bold_days[i]).style.fontWeight="";
}
this._bold_days=[];
},unhighlightAllDays:function(){
for(var day in this._highlight_days){
Element.removeClassName(this._highlight_days[day],this._options.highlight_class_name);
}
this._highlight_days={};
},_draw:function(){
this._height=132;
this._width=parseInt(this.block_width*7)+10;
var _6eb=Element.create("div");
_6eb.style.height=this._height+"px";
_6eb.style.width=this._width+"px";
_6eb.style.background="#FFF";
_6eb.style.border="solid 1px #999999";
_6eb.style.padding="1px";
_6eb.style.fontSize="8pt";
_6eb.style.fontFamily="Arial, Helvetica, Sans-serif";
this._header=this._drawHeader();
this._minical=this._drawMinical();
_6eb.appendChild(this._header);
_6eb.appendChild(this._minical);
return _6eb;
},_drawHeader:function(){
var _6ec=Element.createHtml(["<div style=\"background:#999;padding:2px 0px;margin-bottom:2px\">","</div>"].join(""));
if(this._options.allow_back==true){
var _6ed=Element.createHtml(["<div style=\"float:left;padding:2px;margin-top:1px;cursor:pointer;\">","<img src=\"",this._options.back_image,"\" />","</div>"].join(""));
Event.observe(_6ed,"click",function(e){
this.gotoDate(this.date.add(0,-1));
this._options.back_callback(e);
}.bindAsEventListener(this));
Element.append(_6ec,_6ed);
}
if(this._options.allow_forward==true){
var _6ef="float:right;padding:2px;margin-top:1px;text-align:right;cursor:pointer;";
var _6f0=Element.createHtml(["<div style=\"",_6ef,"\">","<img src=\"",this._options.forward_image,"\" />","</div>"].join(""));
Event.observe(_6f0,"click",function(e){
this.gotoDate(this.date.add(0,1));
this._options.forward_callback(e);
}.bindAsEventListener(this));
Element.append(_6ec,_6f0);
}
var text=Element.create("div");
Element.update(text,this._options.date.format("%F %Y"));
Element.setStyle(text,{color:"#FFF",textAlign:"center"});
_6ec.appendChild(text);
return _6ec;
},_drawMinical:function(){
var _6f3;
if(window.L&&L("Date.L.Sunday.Letter")!=""){
_6f3={sunday:L("Date.L.Sunday.Letter"),monday:L("Date.L.Monday.Letter"),tuesday:L("Date.L.Tuesday.Letter"),wednesday:L("Date.L.Wednesday.Letter"),thursday:L("Date.L.Thursday.Letter"),friday:L("Date.L.Friday.Letter"),saturday:L("Date.L.Saturday.Letter")};
}else{
_6f3={sunday:"S",monday:"M",tuesday:"T",wednesday:"W",thursday:"T",friday:"F",saturday:"S"};
}
var _6f4="style=\"border-bottom:1px solid #666\"";
var _6f5=Element.createHtml(["<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"100%\">","<tbody>","<tr>","<td align=\"center\" ",_6f4,">"+_6f3.sunday+"</td>","<td align=\"center\" ",_6f4,">"+_6f3.monday+"</td>","<td align=\"center\" ",_6f4,">"+_6f3.tuesday+"</td>","<td align=\"center\" ",_6f4,">"+_6f3.wednesday+"</td>","<td align=\"center\" ",_6f4,">"+_6f3.thursday+"</td>","<td align=\"center\" ",_6f4,">"+_6f3.friday+"</td>","<td align=\"center\" ",_6f4,">"+_6f3.saturday+"</td>","</tr>","</tbody>","</table>"].join(""));
var _6f6=_6f5.firstChild;
for(row=1;row<7;row++){
var _6f7=Element.create("tr");
Element.append(_6f6,_6f7);
for(col=0;col<7;col++){
var cell=Element.create("td",{className:this._options.default_class_name});
Event.observe(cell,"click",this.evDayClick);
Element.append(_6f7,cell);
}
}
return _6f5;
},_findDayCell:function(date){
if(date<this._start_date||date>this._end_date){
return;
}
var _6fa=(date-this._start_date.add(-this._start_date.getDay()))/this._milliseconds_per_day;
_6fa=Math.ceil(_6fa);
var row=parseInt(_6fa/7);
var col=date.getDay();
return this._minical.firstChild.childNodes[1+row].childNodes[col];
},_populateCell:function(cell,date){
cell.innerHTML=date.format("%j");
cell.date=date.format("%Y-%m-%d");
if(this.date.getMonth()!=date.getMonth()){
Element.setStyle(cell,{color:"#ACA899",cursor:"pointer"});
}else{
Element.setStyle(cell,{color:"#000",cursor:"pointer"});
}
},_resetCell:function(cell){
cell.update("&nbsp;");
cell.setStyle({cursor:""});
cell.date=null;
},evDayClick:null,_evDayClick:function(e){
var _701=Event.findElement(e,"td");
if(_701.date){
var date=newDate(_701.date);
this._options.day_callback(date);
}
}};
}
if($Bootstrap.notLoaded("4e68eae375a5005ed5b2b5454d6e8a98")){
if(typeof MoUI=="undefined"){
MoUI={};
}
MoUI.Input=Class.create();
MoUI.Input.prototype={options:{},menu:[],mo_menu:null,input_elem:null,initialize:function(_703){
this.options=Object.extend({background_color:"#FFF",blank_image:null,border_color:"#333",menu_callback:Prototype.emptyFunction,hover_color:"#CCC",icon_width:25,input_id:"",type:"menu",width:120},_703||{});
},addMenuItem:function(val,txt,img,_707){
this.menu.push({value:val,text:txt,image:img,active_image:_707||img});
},create:function(){
this.options.type=this.options.type||menu;
var elem=null;
switch(this.options.type){
case "menu":
elem=this._createMenuInput();
break;
}
return elem;
},setActive:function(_709){
if(Browser.is_safari){
return;
}
for(var i=0,ii=this.menu.length;i<ii;i++){
if(this.menu[i].value==_709){
this.container.firstChild.style.backgroundImage="url("+this.menu[i].active_image+")";
break;
}
}
this.options.menu_callback(_709);
},_createMenuInput:function(){
this.container=Element.create("span");
Element.setStyle(this.container,{marginLeft:"-"+this.options.icon_width+"px"});
var _70b=this.input_elem=Element.create("input",{id:this.options.input_id});
Element.setStyle(_70b,{height:this.options.icon_height-4+"px",width:this.options.width-this.options.icon_width+"px",paddingTop:"3px",paddingLeft:this.options.icon_width+3+"px",marginBottom:(wack.Browser.is_ie?"3px":0)});
if(Browser.is_safari){
return _70b;
}
var icon=Element.create("img",{src:this.options.blank_image,align:"top"});
Element.setStyle(icon,{position:"relative",left:this.options.icon_width+4+"px",top:(wack.Browser.is_ie6||wack.Browser.is_ie7?"4px":"2px"),backgroundColor:"#FFF",backgroundImage:"url("+this.menu[0].active_image+")",backgroundRepeat:"no-repeat",backgroundPosition:"center center",height:this.options.icon_height+"px",width:this.options.icon_width+"px",paddingLeft:"3px",cursor:"pointer"});
Element.append(this.container,icon,_70b);
this.evMenuIconClick=this._evMenuIconClick.bindAsEventListener(this);
Event.observe(icon,"click",this.evMenuIconClick);
this.mo_menu=new MoUI.Menu({icon_width:this.options.icon_width,width:this.options.width,onclick:this.setActive.bind(this),onhide:function(){
this.container._menu_show=false;
}.bind(this)});
this.menu.each(function(item){
this.mo_menu.addItem(item.value,item.image,item.text);
}.bind(this));
return this.container;
},_evMenuIconClick:function(e){
Event.stop(e);
if(this.container._menu_show){
this.container._menu_show=false;
this.mo_menu.hide();
return;
}
if(this.menu.length>1){
this.container._menu_show=true;
var _70f=Position.cumulativeOffset(this.container.lastChild);
if(Browser.is_firefox){
_70f[0]+=1;
_70f[1]+=1;
}
this.mo_menu.show(_70f[0]+1,_70f[1]+this.container.lastChild.offsetHeight+1);
}
},evMenuIconClick:null,dummy:null};
}
if($Bootstrap.notLoaded("14273e1476a3c7b232eb41129fe98f7c")){
if(typeof MoUI=="undefined"){
MoUI={};
}
MoUI.Menu=Class.create();
MoUI.Menu.prototype={options:{},_items:[],_menu:null,_shown:false,initialize:function(_710){
this.options=Object.extend({autohide:true,border_color:"#333",hover_color:"#CCC",icon_width:25,onclick:Prototype.emptyFunction,onhide:Prototype.emptyFunction,width:"auto"},_710||{});
},addItem:function(_711,img,text){
this._items.push({value:_711,img:img,text:text});
},hide:function(){
if(this._shown&&this._menu&&!Element.isOrphan(this._menu)){
this._shown=false;
this.options.onhide();
Element.hide(this._menu);
}
},show:function(x,y){
this._menu=this._menu||this._create();
Element.show(this._menu);
Element.setStyle(this._menu,{position:"absolute",top:y+"px",left:x+"px"});
Element.append(document.body,this._menu);
if(this.options.autohide){
this.evDocumentClick=this._evDocumentClick.bindAsEventListener(this);
Event.observe(document,"click",this.evDocumentClick);
}
this._shown=true;
},_create:function(){
var ul=Element.create("ul");
var wd=this.options.width+(this.options.width=="auto"?"":"px");
Element.setStyle(ul,{margin:0,padding:0,listStyle:"none",background:"#FFF",width:wd,border:"1px solid "+this.options.border_color});
this._items.each(function(item){
if(item.text=="sep"){
var li=ul.lastChild;
Element.setStyle(li,{borderBottom:"1px solid "+this.options.hover_color,margin:"0 0 2px 0"});
}else{
var li=Element.create("li");
li._value=item.value;
Element.update(li,item.text);
Element.setStyle(li,{background:"no-repeat 0px center",backgroundPosition:"2px 5px",padding:"6px 6px 5px "+(this.options.icon_width+6)+"px",cursor:"pointer"});
if(item.img){
li.style.backgroundImage="url("+item.img+")";
}
Element.append(ul,li);
this.evItemMouseOver=this._evItemMouseOver.bindAsEventListener(this);
this.evItemMouseOut=this._evItemMouseOut.bindAsEventListener(this);
this.evItemClick=this._evItemClick.bindAsEventListener(this);
Event.observe(li,"mouseover",this.evItemMouseOver);
Event.observe(li,"mouseout",this.evItemMouseOut);
Event.observe(li,"click",this.evItemClick);
}
li=null;
}.bind(this));
return ul;
},_evDocumentClick:function(e){
this.hide();
},evDocumentClick:null,_evItemClick:function(e){
var elem=Event.findElement(e,"li");
this.options.onclick(elem._value);
},evItemClick:null,_evItemMouseOver:function(e){
var elem=Event.findElement(e,"li");
Element.setStyle(elem,{backgroundColor:this.options.hover_color});
},evItemMouseOver:null,_evItemMouseOut:function(e){
var elem=Event.findElement(e,"li");
Element.setStyle(elem,{backgroundColor:""});
},evItemMouseOut:null,dummy:null};
}
if($Bootstrap.notLoaded("e2cbc5a72a0e494365ef4cd09b5e4f0a")){
var Profiler=Class.create();
Profiler.prototype={initialize:function(obj,name){
this._object_name=name;
this._func_data=new Array();
this._max_duration={};
this._min_duration={};
this._total_calls={};
this._total_duration={};
this._win=window.open("","","width=800,height=600,scrollbars=yes");
this._timer=setInterval(this.draw.bind(this),10000);
function callMember(_723,func,name){
_723[name]=function(){
var _726=new Date();
var _727=func.apply(obj,$A(arguments));
var _728=new Date();
this._addFunctionCall({name:name,start:_726,end:_728,duration:_728-_726});
return _727;
}.bind(this);
}
for(var _729 in obj){
if(typeof obj[_729]=="function"){
callMember.bind(this)(obj,obj[_729],_729);
}
}
Event.observe(window,"unload",function(e){
this._win.close();
}.bind(this));
},draw:function(){
if(this._win.closed){
clearInterval(this._timer);
return;
}
var html="<h1>"+this._object_name+"</h1>";
html+=["<h3>Function Statistics</h3>","<table border='1' cellpading='2' cellspacing='0'>","<tr>","<td><strong>Function Name</strong></td>","<td><strong>Minimum Duration</strong></td>","<td><strong>Maximum Duration</strong></td>","<td><strong>Total Calls</strong></td>","<td><strong>Total Duration</strong></td>","<td><strong>Average Duration</strong></td>","</tr>"].join("");
$H(this._total_calls).each(function(pair){
var name=pair[0];
html+=["<tr>","<td>"+name+"</td><td>"+this._min_duration[name]+"</td>","<td>"+this._max_duration[name]+"</td>","<td>"+this._total_calls[name]+"</td>","<td>"+this._total_duration[name]+"</td>","<td>"+(this._total_duration[name]/this._total_calls[name])+"</td>","</tr>"].join("");
}.bind(this));
html+="</table>";
html+=["<h3>Function calls</h3>","<table border='1' cellpading='2' cellspacing='0'>","<tr>","<td><strong>Function Name</strong></td>","<td><strong>Duration</strong></td>","</tr>"].join("");
this._func_data.each(function(obj){
html+="<tr><td>"+obj.name+"</td><td>"+obj.duration+"</td></tr>";
});
html+="</table>";
this._win.document.body.innerHTML=html;
},_addFunctionCall:function(data){
if(!this._max_duration[data.name]||this._max_duration[data.name]<data.duration){
this._max_duration[data.name]=data.duration;
}
if(!this._min_duration[data.name]||this._min_duration[data.name]>data.duration){
this._min_duration[data.name]=data.duration;
}
if(!this._total_calls[data.name]){
this._total_calls[data.name]=0;
}
this._total_calls[data.name]++;
if(!this._total_duration[data.name]){
this._total_duration[data.name]=0;
}
this._total_duration[data.name]+=data.duration;
this._func_data.push(data);
}};
}
if($Bootstrap.notLoaded("65be2eeb06df3d9dbe00b963a617512f")){
function TimePicker(){
}
TimePicker.prototype={time:null,callback:null,use_24_hour:false,render:function(){
var _730=_ce_html("<select size=\"7\"></select>");
for(i=0;i<24;i++){
var hour,merid;
if(this.use_24_hour){
if(i<10){
hour="0"+i;
}else{
hour=i;
}
merid="";
}else{
if(i==0||i==12){
hour="12";
}else{
if(i<12){
hour=i;
}else{
hour=(i-12);
}
}
merid=" "+(i<12?"am":"pm");
}
var _732=hour+":00"+merid;
var _733=_ce("option",{"value":_732,"innerHTML":_732});
var _734=hour+":30"+merid;
var _735=_ce("option",{"value":_734,"innerHTML":_734});
_730.appendChild(_733);
_730.appendChild(_735);
}
if(this.time){
_select(_730,this.time);
if(_730[_730.selectedIndex].value!=this.time){
var _736=$DateTime.create(null,this.time);
var hour=parseInt(_736.format("%H"),10);
var _737=parseInt(_736.format("%i"),10);
var _738=(_737>=45);
var _737=((_737>=15)&&(_737<45))?30:0;
hour=_738?((hour+1)%24):hour;
_736.setTimeString(hour+":"+_737);
_select(_730,_736.basicTime());
}
}
if(this.callback){
Event.observe(_730,"click",this.callback);
}
if(this.mousedown_callback){
Event.observe(_730,"mousedown",this.mousedown_callback);
}
return _730;
}};
}
if($Bootstrap.notLoaded("3267af2f5695e1ba548fdf5dfdd29472")){
Webmail=new function(){
this._app_width=null;
this._app_height=null;
this._left_height=null;
this._left_width=null;
this._right_width=null;
this._right_height=null;
this._calendar_enable=true;
this._titlebar_timer=null;
this._logout_url=$Preload["Custom.logout_url"];
this._extra_covers=[];
this.appWidth=function(v){
if(typeof (v)=="undefined"){
return this._app_width;
}else{
this._app_width=v;
}
};
this.appHeight=function(v){
if(typeof (v)=="undefined"){
return this._app_height;
}else{
this._app_height=v;
}
};
this.calendarEnable=function(v){
return (window.$Calendar?true:false);
};
this.disable=function(_73c){
var _73d=1;
if(!_73c){
var _73e=$("webmail_cover");
var _73f=0;
}else{
var _73f=2000;
}
if(!_73e){
_73e=$UI.Alpha.newLayer("#FFF",_73d);
if(!_73c){
_73e.id="webmail_cover";
}else{
this._extra_covers.push(_73e);
}
_73e.style.cursor="wait";
Element.append(document.body,_73e);
}
Element.show(_73e);
Element.setStyle(_73e,{zIndex:_73f,position:"absolute",width:"100%",height:"100%",top:"0",left:"0"});
};
this.disableCloseWarning=function(){
window.onbeforeunload=null;
};
this.enable=function(){
if(this._extra_covers.length>0){
var _740=this._extra_covers.pop();
Element.remove(_740);
}else{
var _740=$("webmail_cover");
if(_740){
Element.hide(_740);
}
}
};
this.enableCloseWarning=function(msg){
if(!msg){
msg=L("Webmail.Close");
}
window.onbeforeunload=function(){
return msg;
};
};
this.extendSession=function(_742){
$Data.request("Webmail.extendSession",{background:true,handle_conn_err:false,err_callback:function(){
if(!_742){
setTimeout("Webmail.extendSession(true)",5000);
}
}});
};
this.getGlobal=function(key){
if(window._wm__globals){
return _wm__globals[key];
}else{
if(window.$Bootstrap){
var win=$Bootstrap.getAppWindow();
if(win){
return win._wm__globals[key];
}
}
}
return null;
};
this.getBaseUri=function(){
return this.getGlobal("base_uri");
};
this.getBlankUrl=function(){
if(wack.Browser.is_ie6||(wack.Browser.is_ie&&wack.Browser.is_https)){
return "misc/blank.html";
}
if(wack.Browser.is_mac&&wack.Browser.is_firefox){
return "misc/blank.html";
}
return "";
};
this.getSessionId=function(){
if(window.session_id){
return window.session_id;
}else{
return this.getGlobal("sid");
}
};
this.getSitePath=function(){
return this.getGlobal("site_path");
};
this.getUsername=function(){
return username.toLowerCase();
};
this.getVersionUri=function(){
return this.getGlobal("version_uri");
};
this.handleLoggedOff=function(tmp){
$UI.clearStatus();
if(window.WEBMAIL_APP){
var _746=function(){
window.onbeforeunload=null;
window.location=Webmail.getBaseUri()+"index.php";
};
}else{
var _746=null;
}
if(this.isBeta()){
var _747=tmp.replace(/\n/g,"<br />");
}else{
var _747=L("E.LoggedOff");
}
$UI.error(_747,_746);
};
this.isAppWindow=function(){
if($Bootstrap.getAppWindow()==window){
return true;
}else{
return false;
}
};
this.isBeta=function(){
if(this.getGlobal("is_beta")){
return true;
}else{
return false;
}
};
this.isDemo=function(){
return this.getGlobal("is_demo");
};
this.isDev=function(){
return this.getGlobal("is_dev");
};
this.isDomainQuarantine=function(){
return this.getGlobal("is_domain_quarantine");
};
this.isHttps=function(){
return this.getGlobal("is_https");
};
this.isManagedDomain=function(){
return this.getGlobal("is_managed_domain");
};
this.isQuarantine=function(){
return this.getGlobal("is_quarantine");
};
this.leftHeight=function(v){
if(typeof (v)=="undefined"){
return this._left_height;
}else{
this._left_height=v;
}
};
this.leftWidth=function(v){
if(typeof (v)=="undefined"){
return this._left_width;
}else{
this._left_width=v;
}
};
this.loadFolderManager=function(e){
var link=Event.findElement(e,"a");
$Controller.setWorkingElement(link);
setTimeout("$Controller.loadModule(\"FolderManager\")",1);
};
this.makeSidUrl=function(url){
if(url.indexOf("?")===-1){
url+="?";
}else{
url+="&";
}
url+=CFG_SESSION_NAME+"="+this.getSessionId();
return url;
};
this.print=function(){
window.print();
};
this.resetRightScroll=function(){
$("core_right").scrollTop="0";
$("core_right").scrollLeft="0";
};
this.rightWidth=function(v){
if(typeof (v)=="undefined"){
var rw=this._right_width;
if(!wack.Browser.is_ie){
rw-=4;
}
return rw;
}else{
this._right_width=v;
}
};
this.rightHeight=function(v){
if(typeof (v)=="undefined"){
return this._right_height;
}else{
this._right_height=v;
}
};
this.sendErrorReport=function(_750){
try{
$Data.request("Webmail.sendErrorReport",{callback:Prototype.emptyFunction},_750);
}
catch(e){
}
};
this.setRightScrollEnable=function(_751){
var prop=(_751?"auto":"hidden");
Element.setStyle("core_right",{overflow:prop});
};
this.showPrintLink=function(show){
if(show){
Element.show("Webmail_print_link");
Element.show("right_sep1");
}else{
Element.hide("Webmail_print_link");
Element.hide("right_sep1");
}
};
this.updateTitlebar=function(){
var _754="";
var _755=$FolderList.getNewMessages(CFG_FOLDER_INBOX);
if(_755>0){
_754="("+_755+") - ";
}
_754+=username+" - Webmail";
window.document.title=_754;
};
this.enableWindow=function(_756,_757){
if(_756){
Webmail.enable();
}else{
Webmail.disable();
}
};
};
window.onerror=function(desc,page,line,chr){
if(line!=0&&desc!="Error loading script"){
alert(desc+"\n\n"+page+" (line "+line+")");
}
return true;
};
function navigateExternal(url){
url=unescape(url);
if(window.onbeforeunload){
Webmail.disableCloseWarning();
window.location=url;
Webmail.enableCloseWarning();
}else{
window.location=url;
}
}
function L(k){
if(window.__L){
var arr=window.__L;
}else{
if(opener&&opener.__L){
var arr=opener.__L;
}else{
if(parent&&parent.__L){
var arr=parent.__L;
}else{
if(window.$Bootstrap&&$Bootstrap.getAppWindow()){
var arr=$Bootstrap.getAppWindow().__L;
}else{
var arr=[];
}
}
}
}
var l=arr[k]||"";
for(i=1,ii=arguments.length;i<ii;i++){
var _760=String(arguments[i]);
l=l.replace("%s",_760);
}
return l;
}
function report_bug(){
$Dispatcher.compose("","","","","webmail_feedback@mailtrust.com");
}
}
if($Bootstrap.notLoaded("da6eee4b9450f8feb17ca7f694df85f7")){
$JavascriptPreload=Webmail.JavascriptPreload={_groups:["widgets/Compose","combo/dialogs","combo/calendar","combo/notes","combo/contacts","combo/calendar_eventform","combo/tasks"],initialize:function(){
this._loadNext();
},loadNext:null,_loadNext:function(){
if(this._groups.length==0){
return;
}
var _761=this._groups.shift();
REQUIRE(_761,{lazy:true,callback:this.cbLoadNext.bind(this),static_domain:true});
},cbLoadNext:function(){
this._loadNext();
}};
}
if($Bootstrap.notLoaded("b7fa01504a9a5424f1668e90f5ab1d28")){
Framework.register("Webmail");
$Controller=Webmail.Controller=new function(){
this._active_module=null;
this._active_module_key=null;
this._last_resize=0;
this._modules={};
this._module_containers={};
this._module_loads={};
this._working_elem=null;
this._resize_timer=null;
this._resize_init=true;
this.assertCompatibility=function(){
if(!Ajax.getTransport()){
window.location="p/nocompat.html";
}
};
this.initialize=function(){
this.assertCompatibility();
if($Settings.isSoundEnabled()){
setTimeout(function(){
Webmail.UI.Sounds.initialize();
},100);
}
try{
document.execCommand("BackgroundImageCache",false,true);
}
catch(e){
}
_w=window;
_d=document;
_b=_d.body;
Event.observe(window,"resize",this.resize,this);
$Cache.initialize();
$Template.initialize();
$KeyEventManager.initialize();
$JavascriptPreload.initialize();
$Keyboard.initialize();
if(wack.Browser.is_ie){
Draggable.prototype._updateDrag=Draggable.prototype.updateDrag;
Draggable.prototype.updateDrag=function(_762,_763){
$("core_hack").update("...");
this._updateDrag(_762,_763);
};
}
this._initMainMenu();
$("splash").hide();
$("core").setStyle({position:"static",top:"0"});
this.resize();
$("Dialogs_tray").show();
if($Custom.isFoldersEnabled()){
$$SubMenu.__preload();
$$SubMenu.__load();
}
this._modules["Search"]=$$Search;
this._initModule("Search");
var _764=window.location.hash;
if(_764&&_764!="#"){
window.location.hash="#";
}else{
$$MainMenu.loadSection("email");
}
if($Custom.isCalendarEnabled()){
Webmail.Calendar.Reminders.initialize();
}
if($Custom.isContactsEnabled()){
Webmail.Contacts.Init.initialize();
}
$Mail.initialize();
this.resize();
var _765=10*60*1000;
var _766=CFG_SESS_EXPIRES*60*1000;
setInterval("Webmail.extendSession()",_766-_765);
if(wack.Browser.is_ie){
window.onbeforeprint=function(){
$Dispatcher.publish("Webmail.beforePrint");
};
window.onafterprint=function(){
$Dispatcher.publish("Webmail.afterPrint");
};
}
$AnalyticsBootstrap.initialize();
};
this.loadModule=function(key,args,_769){
$UI.clearStatus();
_769=_769||false;
if(!_769&&key==this._active_module_key){
return false;
}
if(!this._modules[key]){
var _76a=key.split(".");
var obj=Webmail.Modules;
var _76c=true;
for(i=0,ii=_76a.length;i<ii;i++){
if(obj[_76a[i]]){
obj=obj[_76a[i]];
}else{
_76c=false;
break;
}
}
if(_76c&&obj.exists!==false){
this._modules[key]=obj;
}else{
REQUIRE("combo/"+key.toLowerCase());
obj=Webmail.Modules;
for(i=0,ii=_76a.length;i<ii;i++){
obj=obj[_76a[i]];
}
this._modules[key]=obj;
}
}
var _76d=function(){
$Controller.loadModule(key,args,_769);
};
if(!this._unloadActiveModule(_76d)){
return false;
}
this._initModule(key);
if(this._working_elem){
this._working_elem.style.cursor="";
}
var _76e=this._module_containers[key];
var _76f=this._modules[key];
var _770=Object.extend({disable_scroll:false,help_id:"",enable_print:false,enable_search:false},_76f.config||{});
Webmail.setRightScrollEnable(!_770.disable_scroll);
$Help.setPage(_770.help_id);
if(_770.enable_search){
$Search.enable();
}else{
$Search.disable();
}
if(key!=$$Search.module_key){
$$Search.reset();
if(window.$$AdvSearch){
$$AdvSearch.close(true);
}
}
this._last_module_key=this._active_module_key;
this._active_module_key=key;
this._active_module=_76e;
Element.show(_76e);
if(_76f.__load){
_76f.__load(args);
}
if(_76f.__resize){
var arg=(key=="MessageList"?true:null);
_76f.__resize(arg);
}
return true;
};
this.backModule=function(){
if(this._last_module_key){
this.loadModule(this._last_module_key);
}
};
this.registerModule=function(key,_773){
if(!this._modules[key]){
this._modules[key]=_773;
if(_773.config&&_773.config.use_navmenu){
$$SubMenu.registerSection(key,_773);
}
}
};
this.resize=function(e){
if(e){
if(wack.Browser.is_ie&&(this._resize_timer||this._resize_init)){
this._resize_init=false;
if(this._resize_timer){
window.clearTimeout(this._resize_timer);
}
this._resize_timer=window.setTimeout("$Controller.resize.bind($Controller)()",50);
return;
}
}
$Controller._resize_init=true;
if(window.$Dialogs){
for(i=0;i<=$Dialogs.next_id;i++){
var _775=$("Dialogs_prompt_"+i);
if(_775&&_775.maximized){
$Dialogs.maximize(_775,true);
}
}
}
var wm=Webmail;
var wc=this;
var body=_ge("core_body");
var _779=_ge("core_header");
var _77a=_ge("core_footer");
if($Custom.isFoldersEnabled()){
var left=_ge("core_left");
}else{
var left=new Object;
left.offsetWidth=0;
}
var _77c=_ge("core_right");
var _77d=wack.Browser.getDimensions();
var _77e=_77d[0];
var _77f=_77d[1];
var _780=_779.offsetHeight||0;
var _781=_77a.offsetHeight||0;
var _782=_77e-body.offsetTop-_781;
Element.setDimensions(body,{height:_782});
Webmail.appHeight(_77e);
Webmail.appWidth(_77f);
if($Custom.isFoldersEnabled()){
Webmail.leftHeight(_782);
Webmail.leftWidth(left.offsetWidth);
}
Webmail.rightHeight(_782-20);
Webmail.rightWidth(_77f-left.offsetWidth-34);
var _783=(wack.Browser.is_ie?32:36);
Element.setDimensions(_77c,{width:Webmail.rightWidth()+_783});
if($Custom.isFoldersEnabled()){
var _784=$("core_left_handle");
_784.orig_top=body.offsetTop;
Element.setStyle(_784,{height:_782+"px",top:_784.orig_top+"px"});
$$SubMenu.__resize();
}
var _785=this._modules[this._active_module_key];
if(_785&&_785.__resize){
_785.__resize();
}
};
this.setWorkingElement=function(elem){
elem=$(elem);
if(!elem){
return;
}
this._working_elem=elem;
elem.style.cursor="wait";
};
this.getCurrentModule=function(){
return this._active_module_key;
};
this._boundLeftMenu=function(_787){
if(_787<10){
return false;
}
if(_787>(Webmail.appWidth()/2)){
return false;
}
return true;
};
this._initMainMenu=function(){
var _788=$$MainMenu.__preload();
$("core_nav").append(_788);
$$MainMenu.__load();
};
this._initModule=function(key){
if(!this._module_loads[key]){
var _78a=this._modules[key].__preload();
if(_78a){
Element.hide(_78a);
Element.append("core_right",_78a);
this._module_containers[key]=_78a;
this._module_loads[key]=true;
}
}
};
this._setLeftWidth=function(_78b){
Element.setStyle("core_left",{width:_78b+"px"});
$Prefs.setUserPref("left_width",_78b,true);
};
this._unloadActiveModule=function(_78c){
if(!this._active_module_key||!this._active_module){
return true;
}
var key=this._active_module_key;
var _78e=this._modules[key];
var _78f=true;
if(_78e.__unload){
_78f=_78e.__unload(_78c);
}
if(_78f!==false){
Element.hide(this._active_module);
}
return (_78f!==false);
};
};
}
if($Bootstrap.notLoaded("66ab5688fbd05fd2e3072db040e5ae9f")){
Framework.register("Webmail");
$WebmailData=$Data=Webmail.Data=new function(){
this.next_id=0;
this.iframes=[];
this.forms=[];
this._pending_batch=false;
this._batch=null;
this._batch_queue=[];
this._registered_jobs={};
this.doBatch=function(func,_791){
if(this._pending_batch){
this._batch_queue.push([func,_791]);
return;
}
var _792=new $Data.Batch(_791);
this._startBatch(_792);
func();
this._endBatch();
};
this.request=function(call,_794){
var job=new $Data.Job(call,$A(arguments).slice(2)||[],_794);
if(job.form_group){
job.form_group=$(job.form_group);
this._requestUpload(job.call,job.args,{callback:job.callback,errcapture:job.errcapture,form_group:job.form_group,max_filesize:job.max_filesize,reset:job.reset});
}else{
if(this._pending_batch){
this._batch.addJob(job);
}else{
var _796=new $Data.Batch();
_796.addJob(job);
_796.send();
return _796;
}
}
};
this.registerJob=function(_797,job){
if(!this._registered_jobs[job.call]){
this._registered_jobs[job.call]={};
}
var temp=this._registered_jobs[job.call][job.call_group]||[null,null];
var _79a=temp[0];
var _79b=temp[1];
if(_79a&&!_79a.completed&&_79b&&!_79b.completed){
_79a.abortJob(_79b);
}
this._registered_jobs[job.call][job.call_group]=[_797,job];
};
this._completeUploadRequest=function(id){
var _79d=$("Data_request_iframe_"+id);
var form=$("Data_request_form_"+id);
if(!_79d||!form){
return;
}
var _79f=form._errcapture;
var _7a0=form._callback;
var _7a1=_79d.contentWindow.response;
if(form._reset){
form.reset();
}
var _7a2=form.parentNode;
_7a2.insertBefore(form.lastChild,form);
Element.remove(form);
Element.remove(_79d);
_7a0(_7a1);
};
this._getForm=function(){
var form=null;
for(var i=0,ii=this.forms.length;i<ii;i++){
if(Element.isOrphan(this.forms[i])){
form=this.forms[i];
break;
}
}
if(!form){
form=Element.createHtml("<form enctype=\"multipart/form-data\"></form>");
this.forms.push(form);
}
return form;
};
this._getIframe=function(){
var _7a5=null;
for(var i=0,ii=this.iframes.length;i<ii;i++){
if(Element.isOrphan(this.iframes[i])){
_7a5=this.iframes[i];
break;
}
}
if(!_7a5){
_7a5=Element.create("iframe");
this.iframes.push(_7a5);
}
if(wack.Browser.is_safari){
_7a5.style.position="absolute";
_7a5.style.height=_7a5.style.width="1px";
_7a5.style.top=_7a5.style.left="-1000px";
}else{
_7a5.hide();
}
_7a5.src=Webmail.getBlankUrl();
return _7a5;
};
this._requestUpload=function(call,args,_7a9){
_7a9=Object.extend({callback:Prototype.emptyFunction,errcapture:WERR_FATAL,form_group:null,max_filesize:null,reset:false},_7a9||{});
var id=this.next_id++;
var _7ab=this._getIframe();
var _7ac="Data_request_iframe_"+id;
Element.append(_7a9.form_group,_7ab);
if(wack.Browser.is_ie){
_7ab.outerHTML="<iframe id=\""+_7ac+"\" name=\""+_7ac+"\" "+"src=\""+Webmail.getBlankUrl()+"\" style=\"display:none;\"></iframe>";
}else{
_7ab.id=_7ac;
_7ab.name=_7ac;
}
var form=this._getForm();
form.id="Data_request_form_"+id;
form.method="post";
form.target=_7ac;
form.action="router.php?files=1&id="+id;
form._errcapture=_7a9.errcapture;
form._callback=_7a9.callback;
form._reset=_7a9.reset;
var _7ae="";
if(_7a9.max_filesize){
_7ae="<input type='hidden' name='MAX_FILE_SIZE' "+"value=\""+_7a9.max_filesize+"\" />";
}
Element.update(form,["<input type=\"hidden\" name=\"",CFG_SESSION_NAME,"\" value=\"",Webmail.getSessionId(),"\" />",_7ae,"<input type=\"hidden\" name=\"call\" value=\"",call,"\" />","<input type=\"hidden\" name=\"args\" value=\"\" />"].join(""));
form.lastChild.value=JSON.stringify(args);
var _7af=_7a9.form_group.parentNode;
_7af.insertBefore(form,_7a9.form_group);
Element.append(form,_7a9.form_group);
form.submit();
};
this._startBatch=function(_7b0){
this._pending_batch=true;
this._batch=_7b0;
};
this._endBatch=function(_7b1){
this._batch.send();
this._pending_batch=false;
if(this._batch_queue.length>0){
this.doBatch.apply(this,this._batch_queue.pop());
}
};
};
}
if($Bootstrap.notLoaded("9dd191aa43da20525c178c942a712d8e")){
Framework.register("Webmail.Data");
Webmail.Data.Job=Class.create();
Webmail.Data.Job.prototype={aborted:false,completed:false,call:"",args:[],callback:Prototype.emptyFunction,err_callback:Prototype.emptyFunction,errcapture:null,form_group:null,call_group:null,handle_conn_err:true,reset:false,background:false,cluster:null,initialize:function(call,args,_7b4){
this.call=call;
this.args=args;
this.errcapture=WERR_FATAL;
if(!_7b4.request_type){
_7b4.request_type=CFG_AJAX_WRITE;
}
if(_7b4.request_type==CFG_AJAX_READ){
if(!_7b4.request_retries){
_7b4.request_retries=1;
}
}else{
_7b4.request_type==CFG_AJAX_WRITE;
if(!_7b4.request_retries){
_7b4.request_retries=0;
}
}
Object.extend(this,_7b4||{});
},abort:function(){
this.aborted=true;
this.callback=Prototype.emptyFunction;
},getCallInfo:function(){
return {call:this.call,args:this.args};
}};
}
if($Bootstrap.notLoaded("5a0e2c22ffbffc2edf3f4ef1283b307c")){
Framework.register("Webmail.Data");
Webmail.Data.Batch=Class.create();
Webmail.Data.Batch._background_queue=[];
Webmail.Data.Batch._pending_count=0;
Webmail.Data.Batch.prototype={aborted:false,completed:false,exception_occured:false,pending:false,callback:Prototype.emptyFunction,err_callback:Prototype.emptyFunction,handle_conn_err:null,jobs:[],resume_on_err:false,background:false,cluster:null,uid:null,retries_remaining:0,initialize:function(_7b5){
this.jobs=[];
Object.extend(this,_7b5||{});
},abort:function(){
this.aborted=true;
if(this.request){
this.request.transport.abort();
}
for(var i=0;i<this.jobs.length;i++){
var job=this.jobs[i];
if(!job.aborted){
job.abort();
}
}
this._done();
},abortJob:function(job){
for(var i=0;i<this.jobs.length;i++){
if(this.jobs[i]==job){
this.jobs[i].abort();
break;
}
}
if(this._getNumActiveJobs()==0){
this.abort();
}
},addJob:function(job){
if(this.jobs.length==0){
this.retries_remaining=job.request_retries;
}else{
if(job.request_retries<this.retries_remaining){
this.retries_remaining=job.request_retries;
}
}
this.jobs.push(job);
},getCalls:function(){
var _7bb=[];
for(var i=0,ii=this.jobs.length;i<ii;i++){
_7bb.push(this.jobs[i].call);
}
return _7bb;
},getQueryString:function(){
var _7bd=JSON.stringify(this.jobs.collect(function(job){
return job.getCallInfo();
}));
var _7bf={type:"batch",roe:this.resume_on_err,jobs:_7bd};
_7bf[CFG_SESSION_NAME]=Webmail.getSessionId();
return $H(_7bf).toQueryString();
},getResponse:function(){
},handleConnErr:function(){
if(this.handle_conn_err!==null){
return this.handle_conn_err;
}else{
for(var i=0;i<this.jobs.length;i++){
if(this.jobs[i].handle_conn_err){
return true;
}
}
return false;
}
},send:function(){
if(this.jobs.length==0){
this._finalize();
return;
}
for(var i=0;i<this.jobs.length;i++){
if(this.jobs[i].background){
this.background=true;
}
if(this.jobs[i].cluster!==null){
this.cluster=this.jobs[i].cluster;
}
if(this.jobs[i].call_group){
$Data.registerJob(this,this.jobs[i]);
}
}
if(!this.background){
$Data.Batch._pending_count++;
this._doSend();
return;
}
this.uid=""+(new Date).getTime()+""+Math.random();
$Data.Batch._background_queue.push(this);
if($Data.Batch._pending_count<2&&$Data.Batch._background_queue.length==1){
this._doSend();
}
},_done:function(){
this.pending=false;
if(this.background){
for(var i=0,ii=$Data.Batch._background_queue.length;i<ii;i++){
if($Data.Batch._background_queue[i].uid=this.uid){
$Data.Batch._background_queue.remove(i);
break;
}
}
}else{
$Data.Batch._pending_count--;
}
if($Data.Batch._background_queue.length>0&&$Data.Batch._pending_count<2){
var _7c3=$Data.Batch._background_queue[0];
if(!_7c3.pending){
_7c3._doSend();
}
}
},_doSend:function(_7c4){
_7c4=_7c4||false;
this.pending=true;
if(_7c4){
this.retries_remaining--;
}
var _7c5=this.getCalls().join("/");
var url="";
if(this.cluster!==null){
url=url+this.cluster+"/";
}
url=url+"router/"+_7c5;
this.request=new Ajax.Request(url,{method:"post",parameters:this.getQueryString(),onSuccess:this.cbSuccess.bind(this),onFailure:this.cbFailure.bind(this),onException:this.cbException.bind(this)});
},_finalize:function(){
this.callback(this);
this.completed=true;
},_finalizeError:function(_7c7){
var _7c7=_7c7||false;
for(var i=0;i<this.jobs.length;i++){
this.jobs[i].err_callback(_7c7);
}
this.err_callback(_7c7);
this.completed=true;
},_getNumActiveJobs:function(){
return this.jobs.length-this._getNumAbortedJobs();
},_getNumAbortedJobs:function(){
var _7c9=0;
for(var i=0;i<this.jobs.length;i++){
if(this.jobs[i].aborted){
_7c9++;
}
}
return _7c9;
},_validateResponse:function(_7cb){
if(this.handleConnErr()){
if(_7cb.status==0){
$UI.error(L("E.Connection"));
return false;
}
if(_7cb.responseText==""){
$UI.error(L("E.Unknown"));
return false;
}
}
return true;
},cbSuccess:function(_7cc){
if(this.aborted){
return;
}
try{
var _7cd=false;
var _7ce=_7cc.responseText.length;
var _7cf=_7cc.responseText.substring(_7ce-CFG_AJAX_CONFIRMATION.length,_7ce);
var _7d0=(_7cc.responseText.substr(0,1)==wm_FastClientData_IDENTIFIER);
if(_7ce==0||(_7cf!=CFG_AJAX_CONFIRMATION&&!_7d0)){
if(this.retries_remaining>0){
this._doSend(true);
return;
}else{
_7cd=true;
}
}
this._done();
if(!this._validateResponse(_7cc)){
this._finalizeError(true);
return;
}
var _7d1=_7cc.responseText;
if(_7d1.substr(0,1)==wm_FastClientData_IDENTIFIER){
var r=[Webmail.FastClientData.decode(_7d1)];
}else{
eval("var r = "+_7d1);
}
var _7d3=r;
}
catch(e){
if(this.handleConnErr()){
var _7d4="";
for(var i=0,ii=this.jobs.length;i<ii;i++){
_7d4+=this.jobs[i].call+"\n"+Debug.dump(this.jobs[i].args)+"\n";
}
var _7d6=e.name+". "+e.message+"\n----------------\nStatus: "+_7cc.status+"\n----------------\nResponse: "+_7cc.responseText+"\n----------------\nCalls: "+_7d4;
$UI.clearStatus();
Webmail.enable();
$UI.error(L("E.Unknown"),null,{technical:_7d6});
}
this._finalizeError(this.handleConnErr());
return;
}
var _7d7=false;
for(var i=0;i<_7d3.length;i++){
if(this.jobs[i].aborted){
continue;
}
if(_7d3[i]&&_7d3[i].exception){
this.exception_occured=true;
this.exception=_7d3[i].exception;
}
if(_7d3[i].exception&&((_7d3[i].level&this.jobs[i].errcapture)>0)){
try{
$UI.clearStatus();
}
catch(e){
}
if(_7d3[i].code==ERROR_LOGGED_OFF){
Webmail.handleLoggedOff(_7d3[i].message);
}else{
if($UI.error){
$UI.error(_7d3[i].message);
}else{
alert("Exception: ("+_7d3[i].code+") "+_7d3[i].message);
}
}
_7d7=true;
}else{
this.jobs[i].callback(_7d3[i]);
}
this.jobs[i].completed=true;
}
this._finalize(_7d7);
},cbFailure:function(obj,_7d9){
this._done();
if(this.aborted){
return;
}
$UI.clearStatus();
if(this.handleConnErr()){
var _7da=[12029,12152].isMember(obj.status);
if(_7da){
$UI.error(L("E.Connection"));
}else{
$UI.error(L("E.UnknownCode",obj.status));
}
}
this._finalizeError(this.handleConnErr());
},cbException:function(obj,_7dc){
this._done();
if(this.aborted){
return;
}
$UI.clearStatus();
if(_7dc.name&&_7dc.message&&_7dc.fileName&&_7dc.lineNumber){
alert(_7dc.name+": "+_7dc.message+"\n\n"+_7dc.fileName+" (line "+_7dc.lineNumber+")");
}else{
if(_7dc&&_7dc.number&&_7dc.number!=-2147418094){
alert("Unknown error:"+Debug.dump(_7dc));
}
}
this._finalizeError(true);
}};
}
if($Bootstrap.notLoaded("7541b6c85653a22475f3b82676947e6a")){
Framework.register("Webmail");
Webmail.FastClientData={decode:function(_7dd){
if(!_7dd){
return {};
}
_7dd=_7dd.substr(1);
var _7de=_7dd.split(wm_FastClientData_RECORD_SEP);
var _7df=_7de[0].split(wm_FastClientData_FIELD_SEP);
var _7e0=[];
for(var i=1;i<_7de.length;i++){
var _7e2=_7de[i].split(wm_FastClientData_FIELD_SEP);
var obj={};
for(var j=0;j<_7e2.length;j++){
obj[_7df[j]]=_7e2[j];
}
_7e0.push(obj);
}
return _7e0;
}};
}
if($Bootstrap.notLoaded("f2413dc8bc168ab2e3fe28f8b79b29d6")){
Framework.register("Webmail");
$Prefs=Webmail.Prefs=new function(){
this._prefs={user:$Preload["Prefs.user"],server:$Preload["Prefs.server"],domain:$Preload["Prefs.domain"]};
this.get=function(key,def,_7e7){
if(!defined(_7e7)){
return (this.getUserPref(key,def));
}else{
if(typeof _7e7!="object"){
_7e7=[_7e7];
}
for(var i=0,ii=_7e7.length;i<ii;i++){
switch(_7e7[i]){
case "DOMAIN":
var res=this.getDomainPref(key,"undefined");
break;
case "SERVER":
var res=this.getServerPref(key,"undefined");
break;
case "USER":
var res=this.getUserPref(key,"undefined");
break;
default:
var res="undefined";
}
if(res!="undefined"){
return res;
}
}
return def;
}
};
this.getDomainPref=function(key,def){
if(!Webmail.isAppWindow()){
return $Bootstrap.getAppWindow().$Prefs.getDomainPref(key,def);
}
if(typeof (def)=="undefined"){
def="";
}
if(!this._prefs||!this._prefs.domain){
return def;
}
if(typeof (this._prefs.domain[key])!="undefined"&&this._prefs.domain[key]!=null){
return this._prefs.domain[key];
}
return def;
};
this.getServerPref=function(key,def){
if(!Webmail.isAppWindow()){
return $Bootstrap.getAppWindow().$Prefs.getServerPref(key,def);
}
if(typeof (def)=="undefined"){
def="";
}
if(!this._prefs||!this._prefs.server){
return def;
}
var _7ee=this._prefs.server[key];
if(typeof (_7ee)!="undefined"&&_7ee!=null){
return _7ee;
}
return def;
};
this.getUserPref=function(key,def){
if(!Webmail.isAppWindow()){
return $Bootstrap.getAppWindow().$Prefs.getUserPref(key,def);
}
if(typeof (def)=="undefined"){
def="";
}
if(!this._prefs||!this._prefs.user){
return def;
}
var _7f1=this._prefs.user;
if(typeof (_7f1[key])!="undefined"&&_7f1[key]!=null){
return _7f1[key];
}
return def;
};
this.setUserPref=function(key,_7f3,_7f4,_7f5){
if(!Webmail.isAppWindow()){
return $Bootstrap.getAppWindow().$Prefs.setUserPref(key,_7f3,_7f4);
}
if(!this._prefs.user){
this._prefs.user={};
}
if(typeof (_7f3)=="string"){
_7f3=_7f3.urlDecode();
}
this._prefs.user[key]=_7f3;
if(_7f4){
$Data.request("Prefs.set",{callback:_7f5||Prototype.emptyFunction},"",key,_7f3,"PREF_USER");
}
};
this.isAutocompleteEnabled=function(){
return $Settings.isAutocompleteEnabled();
};
this.updateUserPref=function(key,_7f7){
this.setUserPref(key,_7f7);
};
};
}
if($Bootstrap.notLoaded("4819490d6d97ba166cdd8a50c4fc81ee")){
$Dispatcher=Webmail.Dispatcher=new function(){
this._subscriptions={};
this._allowable_subscriptions=["Calendar.changeColor","Calendar.Events.clearCache","Calendar.Events.deleteEvent","Calendar.Events.saveEvent","Calendar.Events.removeClientEvent","Calendar.Events.updateClientEvent","Calendar.Events.inviteRespond","Calendar.Shared.SubMenu.Expand","Calendar.Shared.SubMenu.Collapse","Calendar.toggleCalendar","Calendar.updateCalendars","Calendar.beginUpdateCalendars","CalendarGroup.startGetEventOccurrencesByRange","CalendarGroup.endGetEventOccurrencesByRange","Core.RightClick","Compose.sent","Contacts.addContact","Contacts.addFreqContacts","Contacts.deleteContacts","Contacts.importComplete","Contacts.removeFreqContacts","Contacts.updateContact","Contacts.updateProfile","Email.Folders.update","Folders.pending_call","Folders.setActive","Folders.status_change","Folders.update","Folders.newUnreadMessages","Message.change","Message.move","MessageList.page","Notes.delete","Notes.save","Settings.change.*","Tasks.deleteLists","Tasks.updateTaskLists","Webmail.afterPrint","Webmail.beforePrint","Widget.load"];
for(var i=0,ii=this._allowable_subscriptions.length;i<ii;i++){
this._subscriptions[this._allowable_subscriptions[i]]=[];
}
this.checkMail=function(){
$UI.showStatus(L("Mail.St.Check"));
$Mail.check(function(_7f9){
$UI.clearStatus();
});
};
this.checkExtMail=function(){
Webmail.Controller.loadModule("ExtMail");
};
this.clearActiveFolder=function(){
$$FolderManager.SubMenu.clearActiveFolder();
};
this.compose=function(_7fa,_7fb,uid,_7fd,_7fe,_7ff,_800,_801,_802,body,_804){
if(!$Bootstrap.isAppWindow()){
var _805=$Bootstrap.getAppWindow();
_805.$Dispatcher.compose(_7fa,_7fb,uid,_7fd,_7fe,_7ff,_800,_801,_802,body,_804);
return;
}
if(!_7fb){
_7fb=wm_Compose_NEW_MSG;
}
if(_802){
_802=String(_802).urlDecode();
}
if(body){
body=String(body).urlDecode();
}
var _806={event:_7fa,action:_7fb,uid:uid,folder:_7fd,to:_7fe,cc:_7ff,bcc:_800,msg_arr:_801,subject:_802,msg_body:body};
$$Compose.load(_806,_804);
};
this.getFolderIcon=function(_807){
return ($$SubMenu.image_root+$$SubMenu.icons.getIconFromFolder(_807));
};
this.loadFolder=function(_808){
if($MessageList.active()){
if(window.$$AdvSearch){
$$AdvSearch.close();
}
var _809={};
if(Keystroke.shift()){
_809.break_cache=true;
}
$MessageList.getMessages(_808,_809,function(_80a){
this.publish("Folders.setActive",_80a);
}.bind(this));
}else{
if($MessageList.folder()!=_808){
$MessageList.emptyList(_808);
}
Webmail.Controller.loadModule("MessageList",_808);
}
};
this.publish=function(_80b){
var _80c=this._subscriptions[_80b];
if(!_80c||_80c.length==0){
return;
}
var args=$A(arguments).slice(1);
for(var i=0,ii=_80c.length;i<ii;i++){
_80c[i].apply(null,args);
}
};
this.purgeFolder=function(_80f){
this.setFolderStatus(_80f,0,0);
if($MessageList.active()){
$MessageList.emptyList(_80f);
if($MessageList.folder()==CFG_FOLDER_TRASH&&!$Settings.isPurgePermanent()){
$MessageList.refillList();
}
}
};
this.setExternalAccounts=function(_810){
$$Email.setExternalButton(_810);
};
this.setFolderStatus=function(_811,_812,_813){
$FolderList.setFolderStatus(_811,_812,_813);
};
this.setMessageRead=function(uid,_815,_816){
var mb=$$MessageList.dom.getBody();
if(mb.childNodes){
for(var i=0,ii=mb.childNodes.length;i<ii;i++){
var tr=mb.childNodes[i];
if(tr.obj.id()==uid&&tr.obj.folder()==_815){
tr.obj.read(_816);
}
}
}
};
this.setPreviewPaneClear=function(_81a){
if($Search.active()){
$$Search.setPreviewPaneClear(_81a);
return;
}else{
if($MessageList.active()){
$$MessageList.setPreviewPaneClear(_81a);
return;
}
}
};
this.subscribe=function(_81b,func){
if(!this._subscriptions[_81b]){
var _81d=_81b.split(".");
_81d.pop();
var _81e=_81d.join(".");
if(this._subscriptions[_81e+".*"]){
this._subscriptions[_81b]=[];
}else{
throw ("\""+_81b+"\" is not a valid subscription");
return;
}
}
this._subscriptions[_81b].push(func);
};
this.updateMessageList=function(_81f){
if($MessageList.active()){
if($MessageList.folder()==_81f){
$MessageList.getMessages(_81f);
}
}
};
this.updateFolderSizes=function(){
$$FolderManager.updateSizes();
};
};
}
if($Bootstrap.notLoaded("7979a20c79bd3003a8663a374ed83a0d")){
Framework.register("Webmail");
$Settings=Webmail.Settings=new function(){
this._default_compose_type="plain/popup";
this.allow_change_password=$Preload["Settings.allow_change_password"];
this.allow_external_options=$Preload["Settings.allow_external_options"];
this.allow_incoming_options=$Preload["Settings.allow_incoming_options"];
this.allow_spam_options=$Preload["Settings.allow_spam_options"];
this.allow_quarantine_options=$Preload["Settings.allow_quarantine_options"];
this.get=function(_820,_821){
_821=_821||Prototype.emptyFunction;
$Data.request("Settings.get",{callback:_821,request_type:CFG_AJAX_READ},_820);
};
this.deleteInviteAfterAction=function(){
var _822=$Prefs.getUserPref("delete_invite_after_action","0");
if(_822=="1"){
return true;
}
return false;
};
this.getCalendarSharingType=function(){
return $Prefs.getDomainPref("calendar_sharing_type");
};
this.getContactsNameFormat=function(){
return $Prefs.getUserPref("contacts_personal_order",wm_Contacts_NAME_FIRST_LAST);
};
this.getComposeType=function(){
if(wack.Browser.is_safari){
return wm_Settings_COMPOSE_PLAIN;
}
var type=$Prefs.get("compose_window_type",this._default_compose_type);
type=this._splitComposeType(type)[0];
switch(type){
case "html":
return wm_Settings_COMPOSE_HTML;
case "plain":
return wm_Settings_COMPOSE_PLAIN;
default:
return false;
}
};
this.getComposeWindowType=function(){
var _824=wm_Settings_COMPOSE_PLAIN+"/"+wm_Settings_COMPOSE_POPUP;
var type=$Prefs.get("compose_window_type",_824);
type=this._splitComposeType(type)[1];
switch(type){
case "popup":
return wm_Settings_COMPOSE_POPUP;
case "popin":
return wm_Settings_COMPOSE_POPIN;
default:
return false;
}
};
this.getDateFormat=function(){
var _826=$Prefs.get("date_format",wm_Settings_DATE_AMERICAN,["USER","DOMAIN"]);
return _826;
};
this.getDefaultIdentity=function(){
var _827=$Prefs.get("compose_default_identity",0);
return _827;
};
this.getFontProperties=function(){
var _828=$Prefs.getUserPref("compose_font_size",CFG_COMPOSE_FONT_SIZE);
var _829={"8pt":1,"10pt":2,"12pt":3,"14pt":4,"18pt":5,"24pt":6,"36pt":7};
var _82a={family:$Prefs.getUserPref("compose_font_family",CFG_COMPOSE_FONT_FAMILY),size:_829[_828]||CFG_COMPOSE_FONT_SIZE_HTML,point:_828};
return _82a;
};
this.getHourFormat=function(){
var _82b=$Prefs.get("hour_format",wm_Settings_HOUR_12,["USER","DOMAIN"]);
return _82b;
};
this.getIdentities=function(){
var _82c=$Cache.getValue("identities");
return _82c;
};
this.getLanguage=function(){
return $Prefs.get("user_language","en_US",["USER","DOMAIN","SERVER"]);
};
this.getSignatures=function(){
var _82d=$Cache.getValue("signatures");
return _82d;
};
this.hasComposeWindowType=function(){
var type=$Prefs.get("compose_window_type","");
if(type.indexOf("/")==-1){
return false;
}else{
return true;
}
};
this.isAutocompleteEnabled=function(){
var _82f=$Prefs.getUserPref("autocomplete_enabled","1");
var _830=(_82f=="1"||_82f=="Both");
_830=_830&&$Custom.isAutocompleteEnabled();
return _830;
};
this.isBlockImagesEnabled=function(){
return Webmail.isQuarantine();
};
this.isChangePasswordEnabled=function(){
if($Bootstrap.getAppWindow().Webmail.isDemo()){
return false;
}
return $Bootstrap.getAppWindow().$Settings.allow_change_password;
},this.isComposeOptionsEnabled=function(){
return $Bootstrap.getAppWindow().$Custom.isComposeEnabled();
},this.isDeletePermanent=function(set){
if(typeof set=="undefined"){
return ($Prefs.getUserPref("mail_delete_to_trash",1)==1?false:true);
}else{
$Prefs.setUserPref("mail_delete_to_trash",!set);
}
};
this.isExternalOptionsEnabled=function(){
return $Bootstrap.getAppWindow().$Settings.allow_external_options;
},this.isHelpEnabled=function(){
if(Webmail.isQuarantine()){
return false;
}else{
if(Webmail.isDev()){
return true;
}
}
var _832=($Prefs.get("help_toggle",false,["SERVER","DOMAIN","USER"]));
if(_832==true){
return true;
}else{
return false;
}
};
this.isIncomingOptionsEnabled=function(){
return $Bootstrap.getAppWindow().$Settings.allow_incoming_options;
},this.isKeyboardShortcutsEnabled=function(){
var pref=($Prefs.getUserPref("keyboard_enabled",0)==1?true:false);
return (pref&&!Webmail.isQuarantine());
};
this.isPurgePermanent=function(set){
if(typeof set=="undefined"){
return ($Prefs.getUserPref("mail_purge_to_trash",1)==1?false:true);
}else{
$Prefs.setUserPref("mail_purge_to_trash",!set);
}
};
this.isPurgeToTrash=function(){
return ($Prefs.getUserPref("mail_purge_to_trash",1)==1?true:false);
};
this.isQuarantineOptionsEnabled=function(){
return $Bootstrap.getAppWindow().$Settings.allow_quarantine_options;
},this.isSettingsEnabled=function(){
return Webmail.getGlobal("show_settings");
};
this.isSoundEnabled=function(){
var _835=$Prefs.getUserPref("sound_enabled","1");
if(_835=="1"){
return true;
}
return false;
};
this.isSpamOptionsEnabled=function(){
return $Bootstrap.getAppWindow().$Settings.allow_spam_options;
},this.isSpellcheckDisabled=function(){
var _836=$Prefs.getUserPref("disable_browser_spellcheck",true);
if(_836==0){
_836=false;
}
return _836;
};
this.load=function(){
if(!this.settings_widget){
$UI.showStatus();
$Bootstrap.getAppWindow().REQUIRE("combo/settings");
this.settings_widget=$Widgets.Settings.factory();
}
this.settings_widget.show();
};
this.getNotesSort=function(){
return $Prefs.get("notes_sort",wm_Notes_SORT_SUBJECT|wm_Notes_SORT_ASC);
};
this.setComposeType=function(type){
type=(type==wm_Settings_COMPOSE_PLAIN?"plain":"html");
var old=$Prefs.getUserPref("compose_window_type",this._default_compose_type);
var _839=this._splitComposeType(old);
type=type+"/"+_839[1];
$Prefs.setUserPref("compose_window_type",type,true);
};
this.setComposeWindowType=function(type){
if(type==wm_Settings_COMPOSE_POPUP){
type=wm_Settings_COMPOSE_POPUP;
}else{
type=wm_Settings_COMPOSE_POPIN;
}
var old=$Prefs.getUserPref("compose_window_type",this._default_compose_type);
var _83c=this._splitComposeType(old);
type=_83c[0]+"/"+type;
$Prefs.setUserPref("compose_window_type",type,true);
};
this.setContactsNameFormat=function(_83d,_83e){
var _83f;
if(_83e){
_83f=true;
}else{
_83f=false;
}
$Prefs.setUserPref("contacts_personal_order",_83d,_83f,_83e);
};
this.setNotesSort=function(sort){
$Prefs.setUserPref("notes_sort",sort,true);
};
this.showFrequentContacts=function(){
var val=$Prefs.getUserPref("compose_show_frequent_contacts",0);
if(val==1){
return true;
}else{
return false;
}
};
this.usePreviewPane=function(){
return ($Prefs.getUserPref("disp_use_previewpane",1)==1?true:false);
};
this._splitComposeType=function(_842){
var _843=_842.split("/");
var mode=_843[0]||"plain";
var _845=_843[1]||"popup";
return [mode,_845];
};
this.cbChangeIdentities=null;
this._cbChangeIdentities=function(_846,_847){
$Cache.setValue("identities",_847);
};
this.cbChangeSignatures=null;
this._cbChangeSignatures=function(_848,_849){
$Cache.setValue("signatures",_849);
};
};
Object.bindCallbacks($Settings);
$Dispatcher.subscribe("Settings.change.identities",$Settings.cbChangeIdentities);
$Dispatcher.subscribe("Settings.change.signatures",$Settings.cbChangeSignatures);
}
if($Bootstrap.notLoaded("c53dc58ce15df9dd56c10f8c5f55c7f0")){
Framework.register("Webmail");
$Custom=Webmail.Custom={header_content:$Preload["Custom.header_content"],footer_content:$Preload["Custom.footer_content"],links_title:$Preload["Custom.links_title"],allow_autocomplete:$Preload["Custom.allow_ac"],allow_blacklist:$Preload["Custom.allow_blacklist"],allow_compose_html:$Preload["Custom.compose_html"],allow_mail_forward:$Preload["Custom.allow_mail_forward"],allow_move_messages:$Preload["Custom.allow_move_messages"],allow_safelist:$Preload["Custom.allow_safelist"],allow_settings:$Preload["Custom.allow_settings"],allow_var:$Preload["Custom.allow_var"],createLinksSection:function(_84a){
var _84b=Element.createHtml(["<div class=\"section\">","<div class=\"header\">","<h3>",this.links_title,"</h3>","</div>","<ul class=\"SubMenu_tree\"></ul>","</div>"].join(""));
var list=$(_84b.getElementsByTagName("ul")[0]);
for(var i=0,ii=_84a.length;i<ii;i++){
var icon=_84a[i].icon||"check-mail.gif";
var _84f=_84a[i].display;
var _850=Element.create("li");
_850.update(["<img style=\"visibility:hidden;\" src=\"images/blank.gif\" />","<a href=\"javascript:void(0);\" ","style=\"background-image:url(images/",icon,");\">","<span>",_84f,"</span></a>",].join(""));
_850.data={url:_84a[i].url,popup:_84a[i].popup,popup_height:_84a[i].popup_height,popup_width:_84a[i].popup_width};
var link=_850.getByTag("a")[0];
Event.observe(link,"click",this.evClickLink,this);
list.append(_850);
}
return _84b;
},getExtraLinks:function(){
return $LeftMenu.links||[];
},getFooterHeight:function(){
var _852=parseInt($Prefs.getServerPref("footer_height",0));
if(isNaN(_852)){
_852=0;
}
return _852;
},isAutocompleteEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_autocomplete;
},isBlacklistEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_blacklist;
},isCalendarEnabled:function(){
return $Bootstrap.getAppWindow().$Preload["Calendar.enabled"];
},isChangePasswordEnabled:function(){
if($Bootstrap.getAppWindow().Webmail.isDemo()){
return false;
}
return $Bootstrap.getAppWindow().$Custom.allow_change_password;
},isComposeEnabled:function(){
var ret=true;
if(Webmail.isQuarantine()){
ret=false;
}
return ret;
},isComposeHtmlEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_compose_html;
},isContactsEnabled:function(){
return $Bootstrap.getAppWindow().$Preload["Contacts.enabled"];
},isFoldersEnabled:function(){
return $Bootstrap.getAppWindow().$Preload["Folders.enabled"];
},isFullHeaderEnabled:function(){
var ret=true;
if(Webmail.isQuarantine()){
ret=false;
}
return ret;
},isKeyboardShortcutsEnabled:function(){
return !Webmail.isQuarantine();
},isMailForwardEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_mail_forward;
},isMailForwardEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_mail_forward;
},isNotesEnabled:function(){
return $Bootstrap.getAppWindow().$Preload["Notes.enabled"];
},isRecipientColumnEnabled:function(){
return Webmail.isDomainQuarantine();
},isReportSpamEnabled:function(){
var ret=true;
if(Webmail.isQuarantine()){
ret=false;
}
return ret;
},isSafelistEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_safelist;
},isSettingsEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_settings;
},isSpamOptionsEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_spam_options;
},isTasksEnabled:function(){
return $Bootstrap.getAppWindow().$Preload["Tasks.enabled"];
},isVacationEnabled:function(){
return $Bootstrap.getAppWindow().$Custom.allow_var;
},evClickLink:function(e){
var _857=Event.findElement(e,"li");
var data=_857.data;
var url=data.url;
var _85a=data.popup;
if(_85a){
var _85b=data.popup_height;
var _85c=data.popup_width;
if(_85b&&_85c){
wack.Browser.popup(url,_85b,_85c,0,0,true,true);
}else{
window.open(url,"");
}
}
}};
}
if($Bootstrap.notLoaded("954d3d0c0578e3d6e89e7dea6e1042bb")){
Framework.register("Webmail");
$Keyboard=Webmail.Keyboard={keyboard:null,initialize:function(){
Object.bindObservers(this);
Object.bindCallbacks(this);
this.keyboard=this.createKeyboardObject(this._getKeyMap(),this.evDocumentKeyPress);
$$MessageList.Keyboard.initialize();
},createKeyboardObject:function(map,_85e,b){
map=this._flattenMap(map);
var _860=new wack.Keyboard;
_860.b=b;
var _861=(Browser.is_ie?"keyup":"keypress");
Event.stopObserving(document,_861,_85e);
Event.observe(document,_861,_85e);
this._applyKeyboardMap(map,_860);
return _860;
},showHelp:function(){
if(this._help_widget&&$C(this._help_widget)&&Element.reallyVisible($C(this._help_widget))){
$Dialogs.unloadDialog($C(this._help_widget));
this._help_widget=null;
return;
}
$Widgets.load("KeyboardHelp");
this._help_widget=$Widgets.KeyboardHelp.factory();
var map=$$MessageList.Keyboard._getKeyMap(true);
wack.extend(map,this._getKeyMap());
this._help_widget.populate(map);
this._help_widget.show();
},_applyKeyboardMap:function(map,_864){
for(var i=0,ii=map.length;i<ii;i++){
if(map[i].ctrl){
_864.addCallbackWithCtrl(map[i].key,map[i].func);
}else{
_864.addCallback(map[i].key,map[i].func);
}
}
},_flattenMap:function(map){
var _867=[];
for(var s in map){
_867=Array.merge(_867,map[s].keys);
}
return _867;
},_getKeyMap:function(){
var map={webmail:{name:L("KeyboardHelp.Section.All"),keys:[{key:wack.Keyboard.KEY_ESCAPE,keydesc:L("Keyboard.Key.Esc"),desc:"Email.Keyboard.CloseDialog",func:this.cbCloseDialog},{key:"?",desc:"Email.Keyboard.Help",func:this.cbShowHelp}]}};
return map;
},cbCloseDialog:null,_cbCloseDialog:function(e){
if(!window.$Dialogs){
return;
}
var _86b=$Dialogs.getTopDialog();
if(!_86b){
return;
}
var _86c=$W(_86b);
if(_86c){
_86c.close(false);
return;
}
$Dialogs.unloadDialog(_86b);
},cbShowHelp:null,_cbShowHelp:function(e){
this.showHelp();
},evDocumentKeyPress:null,_evDocumentKeyPress:function(e){
if(!$Settings.isKeyboardShortcutsEnabled()){
return;
}
this.keyboard.handleEvent(e);
}};
}
if($Bootstrap.notLoaded("95512e96ec6eee6161c6b05f1ea1a549")){
$Loader=Webmail.Loader=Class.create();
$Loader.prototype={_curr_index:0,_groups:null,initialize:function(_86f){
Object.bindCallbacks(this);
this._groups=_86f;
this._loadNext();
},_loadNext:function(){
var _870=this._groups[this._curr_index];
if(_870){
REQUIRE(_870,{callback:this.cbLoaded,lazy:true,static_domain:true});
}
},cbLoaded:null,_cbLoaded:function(){
this._curr_index++;
this._loadNext();
}};
}
if($Bootstrap.notLoaded("f954aa8ec7fe3687d8e94d6c2dc5f475")){
Framework.register("Webmail");
$UI=Webmail.UI={_status_counter:new Object(),_status_no_key:"__no_key__",_timer:null,_tab_index:1,clearStatus:function(_871){
_871=Object.extend({matching_key:null},_871||{});
if(this._timer){
window.clearTimeout(this._timer);
}
var _872=true;
if(_871.matching_key){
var _873=_871.matching_key;
if(this._status_counter[_873]>0){
this._status_counter[_873]--;
if(this._status_counter[_873]==0){
delete this._status_counter[_873];
}
}
for(var key in this._status_counter){
if(this._status_counter[key]>0){
_872=false;
break;
}
}
}else{
delete this._status_counter;
this._status_counter=new Object();
}
if(_872){
Element.hide("loading");
}
},confirm:function(_875,_876){
var _877=new $DialogsPrompt(L("L.Confirm"),_875,false,{cancel:false});
_877.addButton(L("L.Yes"),_876,true);
_877.addButton(L("L.No"),Prototype.emptyFunction);
_877.show();
},createLink:function(_878,opts){
var _87a=Object.extend({class_name:false,id:false,styles:false},opts||{});
var _87b="<a href=\"#\"";
if(_87a.id){
_87b+=" id=\""+_87a.id+"\"";
}
if(_87a.class_name){
_87b+=" class=\""+_87a.class_name+"\"";
}
if(_87a.styles){
_87b+=" style=\""+_87a.styles+"\"";
}
if(typeof _878=="string"){
_87b+=">"+_878+"</a>";
}else{
_87b=Element.createHtml(_87b+"></a>");
Element.append(_87b,_878);
}
return _87b;
},disableContainer:function(_87c){
if(_87c._ui_disabled==true){
return false;
}
var _87d=_87c.getElementsByTagName("input");
for(var i=0,ii=_87d.length;i<ii;i++){
if(!_87d[i].disabled){
var type=_87d[i].type.toLowerCase();
if(type=="checkbox"||type=="radio"){
_87d[i]._ui_disabled=true;
_87d[i].disabled=true;
}
}
}
var mask=$UI.Alpha.newLayer("#FFF",50);
var _881=_87c.offsetHeight;
var _882=_87c.offsetWidth;
mask.className="screen";
mask.style.height=_881+"px";
mask.style.width=_882+"px";
if(wack.Browser.is_ie8){
var _883=Position.positionedOffset(_87c);
mask.style.position="absolute";
mask.style.top=_883[1]+"px";
}else{
mask.style.marginTop=-_881+"px";
}
var _884=_87c.nextSibling;
if(_884){
_87c.parentNode.insertBefore(mask,_884);
}else{
_87c.parentNode.appendChild(mask);
}
_87c._ui_disabled=true;
},enableContainer:function(_885){
if(!_885._ui_disabled){
return;
}
var _886=_885.getElementsByTagName("input");
for(var i=0,ii=_886.length;i<ii;i++){
if(_886[i]._ui_disabled==true){
_886[i]._ui_disabled=false;
_886[i].disabled=false;
}
}
_885._ui_disabled=false;
var mask=_885.nextSibling;
Element.remove(mask);
},error:function(_889,_88a,_88b){
REQUIRE("combo/dialogs");
var _88a=_88a||Prototype.emptyFunction;
var _88c=new Webmail.Dialogs.Error(_889,_88a,_88b);
var _88d=_88c.show();
return _88d;
},isDisabled:function(_88e){
return _88e._ui_disabled;
},load:function(func,e,tag){
if(wack.Browser.is_safari_1_3){
func();
return;
}
tag=tag||false;
var elem=null;
if(e){
if(tag){
elem=Event.findElement(e,tag);
}else{
elem=Event.element(e);
}
if(elem&&elem.style){
elem.style.cursor="wait";
}
}
var _893=function(){
Webmail.enable();
if(elem){
elem.style.cursor="";
}
};
Webmail.disable();
window.setTimeout(function(){
try{
func();
_893();
}
catch(e){
_893();
throw e;
}
},1);
},setTabIndexes:function(_894){
for(var i=0,ii=_894.length;i<ii;i++){
_894[i].tabIndex=this._tab_index;
this._tab_index++;
}
},showStatus:function(_896,_897){
_897=Object.extend({delay:null,working:true,show_message:false,matching_key:null},_897||{});
if(_897.delay){
var _898=_897.delay;
delete _897.delay;
this._timer=window.setTimeout(function(){
$UI.showStatus(_896,_897);
},_898);
return;
}
if(!_897.working){
this.clearStatus();
return;
}
if(!_897.show_message){
_896=L("L.Loading");
}
var _899=$("loading");
Element.update(_899.getElementsByTagName("span")[0],_896);
Element.show(_899);
if(_897.matching_key){
if(this._status_counter[_897.matching_key]){
this._status_counter[_897.matching_key]++;
}else{
this._status_counter[_897.matching_key]=1;
}
}else{
this._status_counter[this._status_no_key]=1;
}
}};
}
if($Bootstrap.notLoaded("eca56eaad8714bc210feca20a0d5b265")){
Framework.register("Webmail.UI");
$UI.AddRemoveList=function AddRemoveLists(_89a,_89b,_89c){
this._constructor=function(_89d,_89e,_89f){
if(typeof _89d=="string"){
this.containerId=_89d;
this.container=document.getElementById(this.containerId);
}else{
this.container=_89d;
this.containerId=this.container.id?this.container.id:"UnIdAddRemoveList";
}
this.numberOfDestinationLists=(_89e)?_89e:1;
this.list1DivId=this.containerId+"_List1Div";
this.list2DivId=this.containerId+"_List2Div";
this.list1Id=this.containerId+"_List1Id";
this.list2Id=this.containerId+"_List2Id";
this.list1Name=this.containerId+"_List1Name";
this.list2Name=this.containerId+"_List2Name";
this.addButtonId=this.containerId+"_AddButtonId";
this.addButtonName=this.containerId+"_AddButtonName";
this.removeButtonId=this.containerId+"_RemoveButtonId";
this.removeButtonName=this.containerId+"_RemoveButtonName";
this.captionName=this.containerId+"_CaptionName";
this.captionId=this.containerId+"_CaptionId";
this.list1=null;
this.list2=new Array();
this.addButton=new Array();
this.removeButton=new Array();
this.selectedItems=new Object();
this.itemData=new Array();
this.key="UnnamedKey";
this.changeListeners=new Array();
this.option={wording:{add:">",remove:L("L.Remove")},caption:new Array()};
Object.extend(this.option,_89f||{});
this._createContent();
};
this._createContent=function(){
var _8a0=this.option.caption.length>1?this.option.caption[0]:"";
var _8a1=Element.createHtml(["<div class='UI_ARList_source' id='",this.list1DivId,"'>","<div class='caption' name='",this.captionName,"_List1' id='",this.captionId,"_List1'>",_8a0,"</div>","<select multiple='' name='",this.list1Name,"' id='",this.list1Id,"'>","</select>","</div>"].join(""));
this.list1=_8a1.getElementsByTagName("select")[0];
this.container.appendChild(_8a1);
for(var i=0,ii=this.numberOfDestinationLists;i<ii;i++){
var _8a3=(i>0)?"_"+(i+1):"";
var _8a4=(this.option.caption.length>i+1)?this.option.caption[i+1]:"";
var _8a5=Element.createHtml(["<div class='UI_ARList_dest' id='",this.list2DivId,_8a3,"'>","<div id='",this.list2DivId,_8a3,"_Add'>","<input type='button' class='add' name='",this.addButtonName,_8a3,"' id='",this.addButtonId,_8a3,"' value='",this.option.wording.add,"' />","</div>","<div id='",this.list2DivId,_8a3,"_List'>","<div class='caption' name='",this.captionName,_8a3,"' id='",this.captionId,"_List2",_8a3,"'>",_8a4,"</div>","<select multiple='' name='",this.list2Name,_8a3,"'id='",this.list2Id,_8a3,"'>","</select><br/>","<input type='button' class='remove' name='",this.removeButtonName,_8a3,"' id='",this.removeButtonId,_8a3,"' value='",this.option.wording.remove,"' class='btn' />","</div>","</div>"].join(""));
var list=_8a5.getElementsByTagName("select")[0];
var _8a7=_8a5.getElementsByTagName("input");
var _8a8=_8a7[0];
var _8a9=_8a7[1];
this.container.appendChild(_8a5);
var _8aa={AddRemoveLists:this,listIndex:i};
Event.observe(_8a9,"click",function(){
this.AddRemoveLists._evRemoveButtonClick(this.listIndex);
}.bind(_8aa),this);
Event.observe(_8a8,"click",function(){
this.AddRemoveLists._evAddButtonClick(this.listIndex);
}.bind(_8aa),this);
this.list2.push(list);
this.addButton.push(_8a8);
this.removeButton.push(_8a9);
}
};
this._evRemoveButtonClick=function(_8ab){
if(!_8ab){
_8ab=0;
}
for(var i=0,ii=this.list2[_8ab].options.length;i<ii;i++){
if(this.list2[_8ab].options[i].selected){
var key=this.selectedItems[this.list2[_8ab].options[i].value];
this.selectedItems[this.list2[_8ab].options[i].value]=null;
if(key!=this.key){
this.list2[_8ab].remove(i);
--i;
--ii;
}
}
}
Form.Select.transfer(this.list2[_8ab],this.list1,{sorted:false});
this._evChange();
};
this._evAddButtonClick=function(_8ae){
if(!_8ae){
_8ae=0;
}
for(var i=0,ii=this.list1.options.length;i<ii;i++){
if(this.list1.options[i].selected){
this.selectedItems[this.list1.options[i].value]=this.key;
}
}
Form.Select.transfer(this.list1,this.list2[_8ae],{sorted:false});
this._evChange();
};
this.setKey=function(key){
this.key=key;
};
this._addItems=function(_8b1,_8b2,_8b3,_8b4){
if(_8b1==-1){
_8b1=this.list1.length;
}
if(!this.selectedItems[_8b3]){
if(_8b1<this.list1.length){
this.list1.options[_8b1].text=_8b2;
this.list1.options[_8b1].value=_8b3;
this.list1.options[_8b1].className=_8b4;
}else{
var _8b5=new Option(_8b2,_8b3);
_8b5.className=_8b4;
this.list1.options[_8b1]=_8b5;
}
return _8b1+1;
}else{
return _8b1;
}
};
this._removeItemsAfter=function(_8b6){
while(this.list1.length>_8b6){
this.list1.remove(_8b6);
}
};
this.clear=function(){
this.clearSourceList();
this.selectedItems=new Object();
};
this.clearDestinationLists=function(){
for(var i=0,ii=this.list2.length;i<ii;i++){
var _8b8=this.list2[i];
Form.Select.clear(_8b8);
}
};
this.clearSourceList=function(){
this.itemData=new Array();
};
this.refresh=function(){
var _8b9=0;
for(var i=0,ii=this.itemData.length;i<ii;i++){
var item=this.itemData[i];
_8b9=this._addItems(_8b9,item.name,item.value,item.style);
}
this._removeItemsAfter(_8b9);
};
this.appendItem=function(_8bc,_8bd,_8be){
this.itemData.push({name:_8bc,value:_8bd,style:_8be});
};
this.getChosenItems=function(_8bf){
if(!_8bf){
_8bf=0;
}
var out=new Array();
for(var i=0,ii=this.list2[_8bf].options.length;i<ii;i++){
out.push(this.list2[_8bf].options[i].value);
}
return out;
};
this.addChosenItems=function(_8c2,_8c3,_8c4,key,_8c6){
if(!_8c6){
_8c6=0;
}
this.selectedItems[_8c3]=key;
var _8c7=new Option(_8c2.escapeHTML({escape_newlines:false}),_8c3);
_8c7.className=_8c4;
Form.Select.append(this.list2[_8c6],_8c7);
};
this._evChange=function(){
for(var i=0,ii=this.changeListeners.length;i<ii;i++){
this.changeListeners[i]();
}
};
this.addChangeListener=function(_8c9){
this.changeListeners.push(_8c9);
};
this._constructor(_89a,_89b,_89c);
};
}
if($Bootstrap.notLoaded("2595911c3cbca31443ef759015ef2445")){
Framework.register("Webmail.UI");
Webmail.UI.Alpha=new function(){
this.layers=[];
this.newLayer=function(_8ca,_8cb){
var _8cc=this.getAvailableLayer();
Element.setStyle(_8cc,{backgroundColor:_8ca,filter:"Alpha(Opacity="+_8cb+")",opacity:""+(_8cb/100)});
return _8cc;
};
this.getAvailableLayer=function(){
for(var i=0,ii=this.layers.length;i<ii;i++){
if(Element.isOrphan(this.layers[i])){
this.layers[i].id="";
for(var s in this.layers[i].style){
try{
this.layers[i].style[s]="";
}
catch(e){
}
}
return this.layers[i];
}
}
var _8cf=Element.create("div");
this.layers.push(_8cf);
return _8cf;
};
};
}
if($Bootstrap.notLoaded("93fbb190801901ee7b93a085354ab117")){
Framework.register("Webmail.UI");
Webmail.UI.Grid=$UI_Grid=new function(){
this._hover_color=null;
this._hover_ele=null;
this._selected_class="Grid_selected_row";
this._last_clicked=false;
this._row_drag=false;
this._last_row_selected=null;
this._used_rows=[];
this._free_rows=[];
this._free_cells=[];
this._getRowCheckbox=function(row){
var _8d1=row.getElementsByTagName("input");
if(_8d1[0]){
return _8d1[0];
}else{
return false;
}
};
this._findCheckboxRow=function(elem){
var tag=elem.parentContainer;
while(elem.tagName&&elem.tagName!=tag){
elem=elem.parentNode;
}
if(elem){
return elem;
}
};
this.evHoverColorIn=function(e){
this._hover_ele=Event.findElement(e,"tr");
this.changeHoverColor(this._hover_ele,true);
};
this.evHoverColorOut=function(e){
this.changeHoverColor(this._hover_ele,false);
};
this.addHoverColor=function(ele){
if(!this._hover_color){
temp_hover=Element.create("div",{className:"Grid_hover_row",id:"temp_hover"});
temp_hover.style.display="none";
Element.append(document.body,temp_hover);
this._hover_color=wack.Browser.getCssProperty(temp_hover,"background-color",false);
}
Event.observe(ele,"mouseover",Webmail.UI.Grid.evHoverColorIn.bind(this));
Event.observe(ele,"mouseout",Webmail.UI.Grid.evHoverColorOut.bind(this));
};
this.addCheckDrag=function(_8d7,_8d8,_8d9,_8da){
var _8db;
var _8dc=function(_8dd,_8de){
$UI_Grid.checkDragCallback(_8dd,_8de);
if(typeof _8da=="function"){
_8da(_8dd,_8de);
}
};
if(_8d7.check_drag){
_8db=_8d7.check_drag;
}else{
_8db=new CheckDrag;
}
for(var i=0;i<_8d8.length;i++){
_8d8[i].parentContainer=_8d9;
}
this._selected_class="Grid_selected_row";
_8db.load(_8d8,_8dc);
_8d7.check_drag=_8db;
};
this.checkDragCallback=function(_8e0,_8e1){
var row=this._findCheckboxRow(_8e0);
this.checkSelectedRow(_8e0,_8e1);
if(Keystroke.shift()&&this._last_clicked){
var _8e3=row;
var _8e4=false;
while(_8e3.previousSibling){
_8e3=_8e3.previousSibling;
if(_8e3==this._last_clicked){
_8e4=true;
}
}
_8e3=row;
if(_8e4){
while(_8e3.previousSibling&&_8e3!=this._last_clicked){
_8e3=_8e3.previousSibling;
this.checkSelectedRow(this._getRowCheckbox(_8e3),_8e1);
}
}else{
while(_8e3.nextSibling&&_8e3!=this._last_clicked){
_8e3=_8e3.nextSibling;
this.checkSelectedRow(this._getRowCheckbox(_8e3),_8e1);
}
}
this._last_clicked=row;
}else{
this._last_clicked=row;
}
};
this.checkSelectedRow=function(_8e5,_8e6,_8e7){
if(_8e7){
_8e5.parentContainer=_8e7;
}
var row=this._findCheckboxRow(_8e5);
_8e5.checked=_8e6;
if(row&&row.tagName&&row.tagName.toLowerCase()=="table"){
rows=row.getElementsByTagName("TR");
for(var i=0;i<rows.length;i++){
this.highlightSelectedRow(rows[i],_8e6);
}
}else{
this.highlightSelectedRow(row,_8e6);
}
return;
};
this.changeHoverColor=function(row,_8eb){
if(_8eb==true){
if($MessageList.active()){
row.style.cursor="pointer";
}
row.style.backgroundColor=this._hover_color;
}else{
row.style.backgroundColor="";
}
};
this.clearCheckedRows=function(_8ec){
var rows=_8ec.getElementsByTagName("tr");
for(var i=0;i<rows.length;i++){
rows[i].checked=false;
this.highlightSelectedRow(rows[i],false);
}
};
this.clearContent=function(grid){
var _8f0=grid.content_cell;
var rows=_8f0.rows;
for(var i=rows.length-1;i>=0;i--){
var _8f3=rows[i].cells;
for(var j=_8f3.length-1;j>=0;j--){
var _8f5=_8f3[j];
_8f5.innerHTML="";
_8f5.val="";
this._free_cells.push(_8f5);
rows[i].removeChild(_8f5);
}
_8f0.removeChild(rows[i]);
}
};
this.create=function(_8f6,_8f7,_8f8){
var _8f9=Element.create("div");
var _8fa=_8f6.length;
var _8f7=_8f7||"";
var _8f8=_8f8||"";
var _8fb="";
if(_8f7){
_8fb="width:"+_8f7+";";
}
var _8fc;
if(_8f8){
_8fc="height:"+_8f8+";";
}
var _8fd=Element.create("table",{className:"UI_Grid"});
var _8fd=Element.createHtml(["<table cellspacing=0 cellpadding=0 border=0 class=\"UI_Grid\" style=\""+_8fb+"\">","<thead></thead>","<tbody>","<tr>","<td colspan="+(_8fa+1)+">","<div class=\"Grid_UI_content\" style=\"width: 100%; "+_8fc+"\">","<table cellspacing=0 cellpadding=0 border=0 width=\"100%\" class=\"UI_GRID_tbl\">","<tbody></tbody>","</table>","</div>","</td>","</tr>","</tbody>","</table>"].join(""));
Element.append(_8f9,_8fd);
_8f9.sort_links=new Array();
var _8fe=this._makeRow();
Element.append(_8fd.firstChild,_8fe);
for(var i=0;i<_8f6.length;i++){
var _900=this._makeCell();
Element.setStyle(_900,_8f6[i].properties);
Element.append(_8fe,_900);
if(_8f6[i].sortable){
var _901=Element.createHtml("<span style=\"cursor:pointer;\">"+_8f6[i].display+"</span>");
}else{
var _901=Element.createHtml("<span>"+_8f6[i].display+"</span>");
}
Element.append(_900,_901);
if(_8f6[i].sortable){
var _902=Element.createHtml("<span style=\"margin-left: 5px; cursor: pointer;\">"+"<img src=\"images/dir-down-solid.gif\">"+"</span>");
_902.sort_type="asc";
_901.sort_type="asc";
_902.evCallBack=_8f6[i].sortCallback;
_901.evCallBack=_8f6[i].sortCallback;
_901.arrow=_902;
Event.observe(_902,"click",this.evSort.bind(this));
Event.observe(_901,"click",this.evSort.bind(this));
_902.style.display="none";
Element.append(_900,_902);
_8f9.sort_links.push(_902);
}
}
if(_8f9.sort_links[0]){
_8f9.sort_links[0].style.display="";
}
var _900=this._makeCell();
Element.setStyle(_900,{width:"20px"});
Element.append(_8fe,_900);
_8f9.content_cell=_8fd.childNodes[1].rows[0].cells[0].firstChild.firstChild.firstChild;
return _8f9;
};
this.populate=function(grid,data){
var _905=grid.content_cell;
for(var i=0,len=data.length;i<len;i++){
var _907=data[i];
var _908=_907.click_ev||false;
var _909=this._makeRow(_908);
_909.val=_907.val;
Element.append(_905,_909);
var cols=_907.cols;
for(var j=0;j<cols.length;j++){
var _90c=cols[j].click_ev||false;
var _90d=this._makeCell(_90c);
_90d.val=cols[j].val;
Element.setStyle(_90d,cols[j].properties);
Element.append(_909,_90d);
var _90e=Element.createHtml("<div>"+cols[j].display+"</div>");
Element.append(_90d,_90e);
}
}
};
this.highlightSelectedRow=function(elem,_910){
if(_910&&elem.className.indexOf(this._selected_class)==-1){
Element.addClassName(elem,this._selected_class);
}else{
if(!_910){
Element.removeClassName(elem,this._selected_class);
}
}
return;
};
this._makeRow=function(_911){
var row=this._free_rows.pop();
if(!row){
row=Element.create("tr");
this.addHoverColor(row);
if(_911){
if(_911=="default"){
Event.observe(row,"mousedown",this.evRowMouseDown.bind(this));
Event.observe(row,"mouseup",this.evRowMouseUp.bind(this));
Event.observe(row,"mouseover",this.evRowMouseOver.bind(this));
}else{
Event.observe(row,"click",_911);
}
}
}
Element.show(row);
return row;
};
this._makeCell=function(_913){
var cell=this._free_cells.pop();
if(!cell){
cell=Element.create("td");
if(_913){
if(_913=="default"){
Event.observe(cell,"click",_913);
}else{
Event.observe(cell,"click",this.evColClick.bind(this));
}
}
}
Element.show(cell);
return cell;
};
this._removeCell=function(cell){
cell.innerHTML="";
cell.val="";
this._free_cells.push(cell);
Element.remove(cell);
};
this._removeRow=function(row){
this._free_rows.push(row);
row.checked=false;
row.val="";
this.highlightSelectedRow(row,false);
Element.remove(row);
};
this.evRowMouseDown=function(e){
this._row_drag=true;
var row=Event.findElement(e,"tr");
var _919=Event.findElement(e,"table");
var _91a=e.ctrlKey;
if(!this._last_row_selected){
this._last_row_selected=row;
}
if(e.shiftKey){
var rows=_919.getElementsByTagName("tr");
var _91c=this._last_row_selected.rowIndex;
var _91d=row.rowIndex;
if(_91c>_91d){
var _91e=_91d;
var end=_91c;
}else{
var _91e=_91c;
var end=_91d;
}
var _920=rows[_91c].checked;
for(var i=_91e;i<=end;i++){
this.highlightSelectedRow(rows[i],_920);
rows[i].checked=_920;
}
}else{
if(e.ctrlKey){
this.highlightSelectedRow(row,!row.checked);
row.checked=!row.checked;
}else{
this.clearCheckedRows(_919);
row.checked=true;
this.highlightSelectedRow(row,true);
}
}
this._last_row_selected=row;
};
this.evRowMouseUp=function(e){
this._row_drag=false;
};
this.evRowMouseOver=function(e){
if(this._row_drag){
var row=Event.findElement(e,"tr");
if(this._last_row_selected){
var _925=this._last_row_selected.checked;
}else{
_925=true;
}
this.highlightSelectedRow(row,_925);
row.checked=_925;
this._last_row_selected=row;
}
};
this.evColClick=function(e){
var cell=Event.findElement(e,"td");
this.highlightSelectedRow(cell,!cell.checked);
cell.checked=!cell.checked;
};
this.evSort=function(e){
var tbl=Event.findElement(e,"table");
var par=tbl.parentNode;
var _92b=par.sort_links;
for(var i=0,len=_92b.length;i<len;i++){
_92b[i].style.display="none";
}
var elem=Event.findElement(e,"span");
if(elem.sort_type=="asc"){
elem.sort_type="desc";
if(elem.firstChild&&elem.firstChild.src){
elem.firstChild.src="images/dir-up-solid.gif";
}
if(elem.arrow){
elem.arrow.firstChild.src="images/dir-up-solid.gif";
}
}else{
elem.sort_type="asc";
if(elem.firstChild&&elem.firstChild.src){
elem.firstChild.src="images/dir-down-solid.gif";
}
if(elem.arrow){
elem.arrow.firstChild.src="images/dir-down-solid.gif";
}
}
elem.style.display="";
if(elem.arrow){
elem.arrow.sort_type=elem.sort_type;
elem.arrow.style.display="";
}
elem.evCallBack(elem.sort_type);
};
};
}
if($Bootstrap.notLoaded("984b837d68885bd8d157ca588b028137")){
Framework.register("Webmail.UI");
function ListTextboxPair(_92e,_92f,_930){
this._constructor=function(_931,_932,_933){
if(typeof _931=="string"){
this.parentId=_931;
this.parent=document.getElementById(this.parentId);
}else{
this.parent=_931;
this.parentId=(this.parent.id)?this.parent.id:"UnnamedDropdownTextboxPairId";
}
this.list=null;
this.textboxes=new Array();
this.container=null;
this.containerId=this.parentId+"_ContainerId";
this.listId=this.parentId+"_ListId";
this.textboxId=this.parentId+"_TextboxId";
this.textboxName=this.parentId+"_Textbox";
this.data=new Object();
this.initData=new Object();
this.className=new Object();
this.isMultiLineTextbox=_933;
this.previousListIndex=0;
this.numberOfTextbox=(_932)?_932:1;
this.listChangeListeners=new Array();
this.textboxFocusListeners=new Array();
this.container=this._createContainer();
this.list=this.container.getElementsByTagName("select")[0];
var _934=null;
if(this.isMultiLineTextbox){
_934=this.container.getElementsByTagName("textarea");
}else{
_934=this.container.getElementsByTagName("input");
}
this.evListChanged=this._evListChanged.bind(this);
Event.observe(this.list,"change",this.evListChanged,true);
for(i=0,ii=_934.length;i<ii;i++){
Event.observe(_934[i],"blur",this.evListChanged,true);
Event.observe(_934[i],"focus",this._evTextboxFocus.bindAsEventListener(this),true);
this.textboxes.push(_934[i]);
}
this.parent.appendChild(this.container);
};
this._createContainer=function(){
var _935="";
for(i=0,ii=this.numberOfTextbox;i<ii;i++){
var id=this.textboxId+"_"+(i+1);
var name=this.textboxName+"_"+(i+1);
if(this.isMultiLineTextbox){
_935+="<textarea id='"+id+"' name='"+name+"'></textarea>";
}else{
_935+="<input type='text' id='"+id+"' value='' name='"+name+"'/>";
}
}
var _938=Element.createHtml(["<div id='",this.containerId,"'>","<select id='",this.listId,"'>","</select>",_935,"</div>"].join(""));
return _938;
};
this.appendItem=function(_939,_93a){
var _93b=new Option(_939,_93a);
Form.Select.append(this.list,_93b);
this._saveCurrentItemValues(_93a,"");
for(i=0,ii=this.textboxes.length;i<ii;i++){
this.setClassName(_93a,i,"");
}
};
this.setClassName=function(_93c,_93d,_93e){
var tmp=this.className[_93c];
if(!tmp){
this.className[_93c]=new Array();
}
this.className[_93c][_93d]=_93e;
this._updateStyle(_93c);
};
this._updateStyle=function(_940){
if(_940==this.getCurrentKey()){
for(var i=0,ii=this.textboxes.length;i<ii;i++){
this.textboxes[i].className=this.className[_940][i];
}
}
};
this._evTextboxFocus=function(e){
var _943=Event.findElement(e,"input");
var _944=0;
for(var j=0,jj=this.textboxes.length;j<jj;j++){
if(_943==this.textboxes[j]){
_944=j;
break;
}
}
for(var i=0,ii=this.textboxFocusListeners.length;i<ii;i++){
this.textboxFocusListeners[i](_944,_943);
}
};
this.setAllTextboxesMaxChars=function(_947){
for(var j=0,jj=this.textboxes.length;j<jj;j++){
this.textboxes[j].maxLength=_947;
}
};
this.setTextboxMaxChars=function(_949,_94a){
this.textboxes[_949].maxLength=_94a;
};
this.enableAllTextboxes=function(bool){
for(var i=0,ii=this.textboxes.length;i<ii;i++){
this.textboxes[i].disabled=!bool;
}
};
this._saveCurrentItemValues=function(_94d,_94e){
var tmp=new Array();
for(var i=0,ii=this.textboxes.length;i<ii;i++){
if(_94e){
tmp.push("");
}else{
tmp.push(this.textboxes[i].value);
}
}
this.data[_94d]=tmp;
};
this._loadCurrentItemValues=function(_951){
var tmp=this.data[_951];
if(tmp){
for(var i=0,ii=tmp.length;i<ii;i++){
this.textboxes[i].value=tmp[i];
}
}else{
for(var i=0,ii=this.textboxes.length;i<ii;i++){
this.textboxes[i].value="";
}
}
this._updateStyle(_951);
};
this._evListChanged=function(){
var _954=this.list.options[this.previousListIndex].value;
this._saveCurrentItemValues(_954);
var _955=this.getCurrentKey();
this._loadCurrentItemValues(_955);
this.previousListIndex=this.list.selectedIndex;
for(var i=0,ii=this.listChangeListeners.length;i<ii;i++){
this.listChangeListeners[i](_954,_955);
}
};
this.addListChangeListener=function(_957){
this.listChangeListeners.push(_957);
};
this.addTextboxFocusListener=function(_958){
this.textboxFocusListeners.push(_958);
};
this.getValues=function(){
return this.data;
};
this.getValue=function(_959,_95a){
var out="";
if(this.className[_959]){
if(this.className[_959][_95a]==""){
out=this.data[_959][_95a];
}
}
return out;
};
this.isEmpty=function(){
var data=this.getValues();
for(var _95d in data){
for(var i=0,ii=data[_95d].length;i<ii;i++){
var _95f=data[_95d][i];
if(this.className[_95d][i]==""){
if(typeof _95f=="string"&&_95f.trim().length>0){
return false;
}
}
}
}
return true;
};
this.setValue=function(_960,_961,_962){
if(this.data[_960]){
this.data[_960][_961]=_962;
var _963=this.getCurrentKey();
if(_960==_963){
this.textboxes[_961].value=_962;
}
}
};
this.getCurrentKey=function(){
return this.list.options[this.list.selectedIndex].value;
};
this._constructor(_92e,_92f,_930);
}
}
if($Bootstrap.notLoaded("3ff78a09d4a5f44e2605cff1f62f5108")){
Framework.register("Webmail.UI");
_LiveGridNameTable=new Array();
_LiveGridRefTable=new Array();
_live_grid_event_table=new Object();
$UI.CheckAllCheckboxesAjaxHandler=function(_964){
this.liveGrid=_964;
this.getContent=function(cell){
if(cell.innerHTML){
return cell.innerHTML;
}
switch(cell.childNodes.length){
case 0:
return "";
case 1:
return cell.firstChild.nodeValue;
default:
return cell.childNodes[1].nodeValue;
}
};
this.ajaxUpdate=function(_966){
if(this.liveGrid.isAjaxProcessing==true){
var _967=_966.getElementsByTagName("error");
if(_967.length>0){
this.liveGrid._onError(this.getContent(_967[0]));
}else{
var ids=_966.getElementsByTagName("id");
for(i=0,ii=ids.length;i<ii;i++){
var _969=this.getContent(ids[i]).split("^");
var data=_969[0];
var id=_969[1];
var name=_969[2];
this.liveGrid.selected_rows[id]=data;
this.liveGrid.selected_names[id]=name;
}
this.liveGrid._updateGrid();
}
this.liveGrid._onCheckAllCheckboxesAjaxComplete();
}
};
};
$UI.GetIdsAjaxHandler=function(_96d){
this.live_grid=_96d;
this.getContent=function(cell){
if(cell.innerHTML){
return cell.innerHTML;
}
switch(cell.childNodes.length){
case 0:
return "";
case 1:
return cell.firstChild.nodeValue;
default:
return cell.childNodes[1].nodeValue;
}
};
this.ajaxUpdate=function(_96f){
var _970=_96f.getElementsByTagName("error");
if(_970.length>0){
this.live_grid._onError(this.getContent(_970[0]));
}else{
var _971=_96f.getAttribute("requestId");
if(_971==this.live_grid.wrapper_request_id-1){
if(this.live_grid.get_ids_timer){
clearTimeout(this.live_grid.get_ids_timer);
}
var ids=_96f.getElementsByTagName("id");
for(i=0,ii=ids.length;i<ii;i++){
var _973=this.getContent(ids[i]).split("^");
var data=_973[0];
var id=_973[1];
this.live_grid.selectRow(id,data);
}
this.live_grid._updateGrid();
}else{
}
}
this.live_grid._onStopLoading();
};
};
function LiveGrid(_976,_977,url,_979){
this._constructor=function(_97a,url,_97c,_97d){
Object.bindObservers(this);
this.divId=_97a;
this.gridName=_97a;
this.tableId=this.gridName+"_data";
this.checkAllId=this.gridName+"_checkall";
this.checkboxName=this.gridName+"_chk";
this.getAllIdAjaxhandler=this.gridName+"_getAllCheckboxIds";
this.get_ids_ajax_name=this.gridName+"_getIds";
this.grid_rows=null;
this.url=url;
this.columns=_97c;
this.grid=null;
this.selected_rows=new Object();
this.selected_names=new Array();
this.scrollListeners=new Array();
this.clickListeners=new Array();
this.check_listeners=new Array();
this.startLoadingListeners=new Array();
this.stopLoadingListeners=new Array();
this.errorListeners=new Array();
this.row_click_listeners=new Array();
this.row_dblclick_listeners=new Array();
this.checkAllCheckbox=null;
this.timeout=30*1000;
this.isAjaxProcessing=false;
this.checkAllCheckboxesTimeoutId=null;
this.keyword="";
this.mode="";
this.options=null;
this.clickedRowId=null;
this.resize_delay=300;
this.resize_timer=null;
this.get_ids_timer=null;
this.wrapper_request_id=1;
this.mouse_down_on_row_id=null;
this.constant={SCROLL_UP:10,SCROLL_DOWN:11};
this.options={prefetchBuffer:true,onRefreshComplete:this._updateGrid.bind(this),onscroll:this._onScrollEvent.bind(this),menuEvent:null,canSortDefault:false,requestParameters:null,canSortSpec:{type:"raw",canSort:true},columnSpecs:this._getColumnSpec(this.columns),largeBufferSize:3,canHideDefault:false,rowHighlights:false,allowColResize:false,nearLimitFactor:0.5,sortDescendImg:"images/dir-up-solid.gif",sortAscendImg:"images/dir-down-solid.gif",footerSpace:0,sortCol:0,sortDir:"desc",hdrIconsFirst:false,max_rows:0,click_selection:false,mode:"",ignored_double_click_elements:["A","INPUT"]};
Object.extend(this.options,_97d||{});
this.mode=this.options.mode;
this.options.requestParameters=new Array();
this.options.requestParameters.push("name="+this.gridName);
this.options.requestParameters.push("mode="+this.mode);
this.options.requestParameters.push(CFG_SESSION_NAME+"="+Webmail.getSessionId());
this._createTable(this.divId,this.tableId,this.columns);
Rico.imgDir="./";
if(this.options.max_rows==0){
var _97e=16;
var _97f=50;
var _980=screen.height;
var _981=(Webmail.appHeight()-Webmail.rightHeight())+parseInt($Custom.getFooterHeight());
var _982=_980-_981-_97f;
this.options.max_rows=parseInt(_982/_97e);
}
this.grid=new Rico.LiveGrid(this.tableId,this.options.max_rows,1,url,this.options);
this.grid.addShowMessageListener(this._onStartLoading.bind(this));
this.grid.addClearMessageListener(this._onStopLoading.bind(this));
this.grid.addErrorMessageListener(this._onError.bind(this));
this.grid.addRowClickListener(function(_983){
if(wack.Browser.is_safari_1_3){
_live_grid_event_table[this.gridName]=_983;
setTimeout("_LGRowClick('"+this.gridName+"');",0);
}else{
this._evRowClick(_983);
}
}.bindAsEventListener(this));
this.grid.addRowDblClickListener(this.evRowDblClick);
var _984=document.getElementById(this.gridName+"_data_tab1");
var _985=_984.getElementsByTagName("tbody");
this.grid_rows=_985[0].getElementsByTagName("tr");
if(!this.options.fixed_size){
Event.observe(window,"resize",this._resize.bind(this),false);
}
if(this.options.click_selection){
ajaxEngine.registerRequest(this.get_ids_ajax_name,this.url);
ajaxEngine.registerAjaxObject(this.get_ids_ajax_name,new $UI.GetIdsAjaxHandler(this));
Event.observe(_985[0],"mousedown",this.evMouseDown,true);
Event.observe(_985[0],"mouseup",this.evMouseUp,true);
var _986=this.grid_rows.length;
if(_986>10){
var _987=function(_988){
this._evMouseOver(_988,this.constant.SCROLL_UP);
}.bindAsEventListener(this);
var _989=function(_98a){
this._evMouseOver(_98a,this.constant.SCROLL_DOWN);
}.bindAsEventListener(this);
Event.observe(this.grid_rows[0],"mouseover",_987,true);
Event.observe(this.grid_rows[1],"mouseover",_987,true);
Event.observe(this.grid_rows[_986-1],"mouseover",_989,true);
Event.observe(this.grid_rows[_986-2],"mouseover",_989,true);
}
}
_LiveGridNameTable.push(this.gridName);
_LiveGridRefTable.push(this);
checkAllCheckbox=document.getElementsByName(this.checkAllId);
if(checkAllCheckbox.length==0){
checkAllCheckbox=document.getElementsByTagName("input");
for(i=0,ii=checkAllCheckbox.length;i<ii;i++){
if(checkAllCheckbox[i]&&checkAllCheckbox[i].id==this.checkAllId){
this.checkAllCheckbox=checkAllCheckbox[i];
this.checkAllCheckbox.type="checkbox";
this.checkAllCheckbox.name=this.checkAllId;
}
}
}else{
this.checkAllCheckbox=checkAllCheckbox[1];
}
if(this.checkAllCheckbox){
Event.observe(this.checkAllCheckbox,"click",function(){
this._onCheckAllEvent(this.checkAllCheckbox.checked);
}.bind(this),this);
ajaxEngine.registerRequest(this.getAllIdAjaxhandler,this.url);
ajaxEngine.registerAjaxObject(this.getAllIdAjaxhandler,new $UI.CheckAllCheckboxesAjaxHandler(this));
}
};
this.setMode=function(mode){
this.mode=mode;
this.keyword="";
this.grid.setRequestParams("name="+this.gridName,"mode="+this.mode,CFG_SESSION_NAME+"="+Webmail.getSessionId());
this.grid.scrollToRow(0);
};
this.setWidth=function(_98c){
this.grid.setWidth(_98c);
};
this.filter=function(_98d){
this.keyword=_98d;
this.grid.setRequestParams("search="+this.keyword,"name="+this.gridName,"mode="+this.mode,CFG_SESSION_NAME+"="+Webmail.getSessionId());
this.grid.resetContentsNoFlashing();
this.clickedRowId=null;
this.grid.fetchBuffer(0);
this.uncheckAllCheckboxes();
};
this.refresh=function(){
this.clickedRowId=null;
this.uncheckAllCheckboxes();
this.grid.resetContentsNoFlashingButNotScrollToTop(false);
var _98e=this.grid.getCurrentRow();
this.grid.requestContentRefresh(_98e);
};
this.getCheckedCheckboxContent=function(){
return this.getSelectedContent();
};
this.getCheckedCheckboxData=function(){
return this.getSelectedData();
};
this.getCheckedCheckboxes=function(){
var out=new Array();
for(var id in this.selected_rows){
if(this.selected_rows[id]!=null&&this.selected_rows[id].length>0){
out.push(id.unescapeHTML());
}
}
return out;
};
this.checkAllCheckboxes=function(){
this._onStartLoading();
this.checkAllCheckbox.disabled=true;
this._setAjaxProcessing(true);
ajaxEngine.sendRequest(this.getAllIdAjaxhandler,"custom=getAllCheckboxIds","name="+this.gridName,"search="+this.keyword,"mode="+this.mode,"requestId="+this.wrapper_request_id,CFG_SESSION_NAME+"="+Webmail.getSessionId());
this.wrapper_request_id++;
this.checkAllCheckboxesTimeoutId=setTimeout(this._onCheckAllCheckboxesAjaxTimeout.bind(this),this.timeout);
};
this.uncheckAllCheckboxes=function(){
this.clearAllSelections();
this.checkAllCheckbox.checked=false;
this._updateGrid();
};
this.addScrollListener=function(_991){
this.scrollListeners.push(_991);
};
this.addStartLoadingListener=function(_992){
this.startLoadingListeners.push(_992);
};
this.addStopLoadingListener=function(_993){
this.stopLoadingListeners.push(_993);
};
this.addClickListener=function(_994){
this.clickListeners.push(_994);
};
this.addErrorListener=function(_995){
this.errorListeners.push(_995);
};
this.addRowClickListener=function(_996){
this.row_click_listeners.push(_996);
};
this.addRowDblClickListener=function(_997){
this.row_dblclick_listeners.push(_997);
};
this.addCheckListener=function(_998){
this.check_listeners.push(_998);
};
this._setAjaxProcessing=function(bool){
this.isAjaxProcessing=bool;
};
this._getFirstSortableColumn=function(_99a){
for(i=0,ii=_99a.length;i<ii;i++){
var _99b=_99a[i][1];
if(_99b){
return i;
}
}
return 0;
};
this._getColumnSpec=function(_99c){
var spec=new Array();
for(i=0,ii=_99c.length;i<ii;i++){
var _99e=_99c[i][1];
if(_99e){
spec.push("canSortSpec");
}else{
spec.push("specDefault");
}
}
return spec;
};
this._evRowClick=function(_99f){
for(var i=0,ii=this.row_click_listeners.length;i<ii;i++){
this.row_click_listeners[i](_99f);
}
};
this._evRowDblClick=function(_9a1){
var _9a2=Event.element(_9a1);
if(_9a2){
if(this.options.ignored_double_click_elements.indexOf(_9a2.tagName)==-1){
for(var i=0,ii=this.row_dblclick_listeners.length;i<ii;i++){
this.row_dblclick_listeners[i](_9a1);
}
}
}
};
this._evMouseOver=function(_9a4,_9a5){
if(this.mouse_down_on_row_id!=null){
if(_9a5==this.constant.SCROLL_UP){
this.grid.scrollUp();
}else{
if(_9a5==this.constant.SCROLL_DOWN){
this.grid.scrollDown();
}
}
}
};
this._evMouseDown=function(_9a6){
var row=Event.findElement(_9a6,"tr");
this.mouse_down_on_row_id=this._getRowId(row);
};
this._evMouseUp=function(_9a8){
this._clearBrowserSelection();
var row=Event.findElement(_9a8,"tr");
var _9aa=this.clickedRowId;
this.clickedRowId=this._getRowId(row);
if(this.options.click_selection){
if(_9a8.shiftKey&&this.clickedRowId!=null){
if(this.clickedRowId){
this._ajaxGetId(_9aa,this.clickedRowId);
this.selectRow(this.clickedRowId,this._getRowId2(row));
}
}else{
if(_9a8.ctrlKey){
this.selectRow(this.clickedRowId,this._getRowId2(row));
this._updateGrid();
}else{
if(this.clickedRowId&&this.mouse_down_on_row_id&&this.clickedRowId!=this.mouse_down_on_row_id){
this._ajaxGetId(this.mouse_down_on_row_id,this.clickedRowId);
this.selectRow(this.clickedRowId,this._getRowId2(row));
this.selectRow(this.mouse_down_on_row_id,this._getRowId2(row));
}else{
if(this.clickedRowId){
this.clearAllSelections();
this.selectRow(this.clickedRowId,this._getRowId2(row));
this._updateGrid();
}
}
}
}
}
this.mouse_down_on_row_id=null;
};
this._ajaxGetId=function(_9ab,_9ac){
this._onStartLoading();
var sort=this.grid.getCurrentSortedColumn();
ajaxEngine.sendRequest(this.get_ids_ajax_name,"custom=getIds","name="+this.gridName,"search="+this.keyword,"mode="+this.mode,"offset="+_9ab+"/"+_9ac,"requestId="+this.wrapper_request_id,sort.query_string);
if(this.get_ids_timer){
clearTimeout(this.get_ids_timer);
}
this.get_ids_timer=setTimeout(this._onGetIdsAjaxTimeout.bind(this),this.timeout);
this.wrapper_request_id++;
};
this._evChecked=function(){
for(var i=0,ii=this.check_listeners.length;i<ii;i++){
this.check_listeners[i]();
}
};
this.hightlightRow=function(_9af){
this.clickedRowId=_9af;
this._updateCheckboxesAndClickedRow();
};
this._getRowId=function(tr){
var _9b1=null;
var divs=tr.getElementsByTagName("div");
if(divs.length>2&&divs[1]){
_9b1=divs[1].getAttribute("rid");
}
return _9b1;
};
this._getRowId2=function(tr){
var _9b4=null;
var divs=tr.getElementsByTagName("div");
if(divs.length>2&&divs[1]){
_9b4=divs[1].getAttribute("rid2");
}
return _9b4;
};
this.getSelectedContent=function(){
var out=new Array();
for(var id in this.selected_rows){
if(this.selected_rows[id]!=null&&this.selected_rows[id]!="_!"){
out.push(this.selected_names[id]);
}
}
return out;
};
this.getSelectedData=function(){
var out=new Array();
for(var id in this.selected_rows){
if(this.selected_rows[id]!=null&&this.selected_rows[id]!="_!"){
out.push(this.selected_rows[id].unescapeHTML());
}
}
return out;
};
this.getSelectedIds=function(){
var out=new Array();
for(var id in this.selected_rows){
if(this.selected_rows[id]!=null&&this.selected_rows[id]!="_!"){
out.push(id.unescapeHTML());
}
}
return out;
};
this.selectRow=function(id,data){
if(this.options.click_selection){
if(this.selected_rows[id]==null){
this.selected_rows[id]=data?data:"_!";
}else{
this.selected_rows[id]=null;
}
}else{
this.selected_rows[id]=data;
}
};
this.clearAllSelections=function(){
this.selected_rows=new Object();
this.selected_names=new Array();
};
this._onClickEvent=function(_9be,_9bf,_9c0,_9c1){
this.hightlightRow(_9c0);
for(var i=0,ii=this.clickListeners.length;i<ii;i++){
this.clickListeners[i](_9bf,_9c0,_9c1);
}
};
this._onScrollEvent=function(){
from=this.grid.getCurrentRow()+1;
to=from+this.grid.metaData.getPageSize()-1;
total=this.grid.metaData.getTotalRows();
if(to>total){
to=total;
}
if(from>to){
from=to;
}
for(i=0,ii=this.scrollListeners.length;i<ii;i++){
this.scrollListeners[i](from,to,total);
}
};
this._onStartLoading=function(){
for(i=0,ii=this.startLoadingListeners.length;i<ii;i++){
this.startLoadingListeners[i]();
}
};
this._onStopLoading=function(){
for(i=0,ii=this.stopLoadingListeners.length;i<ii;i++){
this.stopLoadingListeners[i]();
}
};
this._onError=function(_9c3){
for(i=0,ii=this.errorListeners.length;i<ii;i++){
this.errorListeners[i](_9c3);
}
};
this._onCheckEvent=function(_9c4,data,_9c6,_9c7){
if(_9c7==true){
this.selected_rows[_9c4]=data;
this.selected_names[_9c4]=_9c6;
}else{
this.selected_rows[_9c4]=null;
this.selected_names[_9c4]=null;
if(this.checkAllCheckbox){
this.checkAllCheckbox.checked=false;
}
}
this._updateCheckboxesAndClickedRow();
this._evChecked();
};
this._onGetIdsAjaxTimeout=function(){
this._onError("Timeout");
};
this._onCheckAllCheckboxesAjaxTimeout=function(){
this._onError("Timeout");
this.checkAllCheckbox.checked=false;
this._onCheckAllCheckboxesAjaxComplete();
};
this._onCheckAllCheckboxesAjaxComplete=function(){
this.checkAllCheckbox.disabled=false;
this._setAjaxProcessing(false);
this._onStopLoading();
clearTimeout(this.checkAllCheckboxesTimeoutId);
};
this._onCheckAllEvent=function(_9c8){
if(_9c8){
this.checkAllCheckboxes();
}else{
this.uncheckAllCheckboxes();
}
};
this._updateGrid=function(){
this._updateCheckboxesAndClickedRow();
};
this._updateCheckboxesAndClickedRow=function(){
for(var i=0,ii=this.grid_rows.length;i<ii;i++){
var row=this.grid_rows[i];
var _9cb=row.getElementsByTagName("input");
var _9cc=(_9cb.length>0)?_9cb[0]:null;
var _9cd=_9cc?this.selected_rows[_9cc.id]:null;
var _9ce=this._getRowId(row);
var _9cf=this.selected_rows[_9ce];
if((_9cf!=null&&_9cf.length>0)||(_9cd!=null&&_9cd.length>0)){
if(row){
Element.addClassName(row,"LiveGrid_SelectedRow");
}
if(_9cc){
_9cc.checked=true;
}
}else{
if(_9cc){
_9cc.checked=false;
}
if(row){
Element.removeClassName(row,"LiveGrid_SelectedRow");
}
}
if(this.options.click_selection==false){
if(row&&((_9ce&&_9ce==this.clickedRowId)||(_9cc&&_9cc.checked==false&&_9cc.id==this.clickedRowId))){
Element.addClassName(row,"LiveGrid_SelectedRow");
}
}
}
};
this._createTable=function(_9d0,_9d1,_9d2){
var _9d3=document.createElement("table");
_9d3.className="ricoLiveGrid";
_9d3.id=_9d1;
var _9d4=document.createElement("thead");
var tr=document.createElement("tr");
for(var i=0,ii=_9d2.length;i<ii;i++){
var _9d7=_9d2[i][0];
var _9d8=_9d2[i][2];
var _9d9=_9d2[i][3];
var th=document.createElement("th");
th.className=_9d8;
th.id=_9d8;
if(_9d9=="checkbox"){
var _9db=document.createElement("input");
_9db.type="checkbox";
_9db.id=this.checkAllId;
_9db.name=this.checkAllId;
this.tmp=_9db;
th.appendChild(_9db);
}else{
th.innerHTML=_9d2[i][0];
}
tr.appendChild(th);
}
_9d4.appendChild(tr);
_9d3.appendChild(_9d4);
var _9dc=document.getElementById(_9d0);
_9dc.appendChild(_9d3);
};
this._resize=function(){
if(this.resize_timer){
clearTimeout(this.resize_timer);
}
this.resize_timer=setTimeout("_getLiveGrid(\""+this.gridName+"\").grid.sizeDivs();",this.resize_delay);
};
this._clearBrowserSelection=function(){
if(window.getSelection){
var _9dd=window.getSelection();
if(_9dd&&typeof _9dd.removeAllRanges=="function"){
window.getSelection().removeAllRanges();
}
}else{
if(document.selection){
document.selection.empty();
}
}
};
this._constructor(_976,_977,url,_979);
}
function _getLiveGrid(_9de){
for(i=0,ii=_LiveGridNameTable.length;i<ii;i++){
if(_LiveGridNameTable[i]==_9de){
return _LiveGridRefTable[i];
}
}
return null;
}
function _LGChk(_9df,_9e0,id,data,_9e3,_9e4){
Event.stopPropagation(_9df);
if(wack.Browser.is_safari_1_3){
_live_grid_event_table[_9e0]=null;
}
if((grid=_getLiveGrid(_9e0))!=null){
grid._onCheckEvent(id,data,_9e3,_9e4);
}
}
function _LGClk(_9e5,_9e6,_9e7,id,data){
Event.stop(_9e5);
if((grid=_getLiveGrid(_9e6))!=null){
grid._onClickEvent(_9e5,_9e7,id,data);
}else{
alert(_9e6+" not found");
}
}
function _LGRowClick(_9ea){
if((grid=_getLiveGrid(_9ea))!=null){
var _9eb=_live_grid_event_table[_9ea];
if(_9eb!=null){
grid._evRowClick(_9eb);
}
}else{
alert(gridName+" not found");
}
}
}
if($Bootstrap.notLoaded("7e9dee371fb4dd71f89e06f3f59ebc5e")){
Framework.register("Webmail.UI");
function LiveTextBox(_9ec,_9ed,_9ee,text){
this._constructor=function(_9f0,_9f1,_9f2,text){
if(typeof _9f0=="string"){
this.divId=_9f0;
this.divObj=document.getElementById(this.divId);
}else{
this.divObj=_9f0;
this.divId=(this.divObj.id)?this.divObj.id:"UnnamedLiveTextboxId";
}
this.name=this.divId+"_LiveTextBox_name";
this.id=this.divId+"_LiveTextBox_id";
this.className=this.divId+"_LiveTextBox_Class";
this.lastVale="";
this.timer=null;
this.timeout=_9f2;
this.action=_9f1;
this.firstTime=true;
this.textbox=null;
this.initValue=text;
this.textbox=document.createElement("input");
this.textbox.name=this.name;
this.textbox.id=this.id;
this.textbox.className=this.className;
this.textbox.value=this.initValue;
Event.observe(this.textbox,"keyup",this._onKeyUp.bind(this),this);
Event.observe(this.textbox,"focus",function(){
if(this.firstTime){
this.textbox.value="";
}
this.firstTime=false;
}.bind(this),this);
this.divObj.appendChild(this.textbox);
};
this._doAction=function(){
if(this.action){
var _9f4=this.textbox.value;
this.action(_9f4);
}
};
this._onKeyUp=function(){
this.textbox.className="";
if(this.timer==null){
this.timer=setTimeout(this._doAction.bind(this),this.timeout);
}else{
if(this.timer){
clearTimeout(this.timer);
this.timer=setTimeout(this._doAction.bind(this),this.timeout);
}
}
};
this.getTextValue=function(){
return this.textbox.value;
};
this.setTextValue=function(_9f5){
this.textbox.value=_9f5;
this.firstTime=false;
this._doAction();
};
this.setTextboxMaxChars=function(_9f6){
this.textbox.maxLength=_9f6;
};
this.getTextboxElement=function(){
return this.textbox;
};
this.reset=function(){
this.textbox.className=this.className;
this.textbox.value=this.initValue;
this.firstTime=true;
};
this._constructor(_9ec,_9ed,_9ee,text);
}
}
if($Bootstrap.notLoaded("4f79fc36ac1ea80ba9b2ae85b451086d")){
Framework.register("Webmail.UI");
Webmail.UI.Menu=Class.create();
Object.extend(Webmail.UI.Menu,{active_menu:null,initialized:false,initialize:function(){
if(this.intialized){
return;
}
this.initialized=true;
this.evItemClick=this._evItemClick.bindAsEventListener(this);
},_evItemClick:function(e){
var elem=Event.element(e);
var _9f9=Event.findElement(e,"li");
var data=_9f9._data;
$UI.load(function(){
(data.onclick||Prototype.emptyFunction)();
},e);
},evItemClick:null});
Webmail.UI.Menu.prototype={options:{},shown:false,_menu_container:null,initialize:function(menu,_9fc){
$UI.Menu.initialize();
this.options=Object.extend({top_element:null},_9fc||{});
var _9fd=this._menu_container=Element.create("div",{className:"UI_Menu"});
if(wack.Browser.is_ie6){
var _9fe=Element.createHtml("<iframe frameborder=\"0\" src=\""+Webmail.getBlankUrl()+"\"></iframe>");
_9fd.append(_9fe);
}
var _9ff=$UI.Alpha.newLayer("#000",40);
var list=this.drawMenu(menu);
if(_9ff){
_9ff.className="shadow";
_9fd.append(_9ff,list).hide();
}
$(document.body).append(_9fd);
},disableItem:function(id){
this._setItemEnabled(id,false);
},drawMenu:function(data){
var list=Element.create("ul");
for(var i=0,ii=data.length;i<ii;i++){
var curr=data[i];
var _a06=Element.create("li");
_a06._data=curr;
_a06.update(["<a href=\"javascript:void(0);\"><div>"+curr.text+"</div></a>","<span class=\"disabled\">",curr.text,"</span>"].join(""));
var link=_a06.firstChild;
Event.observe(link,"click",$UI.Menu.evItemClick);
if(curr.disabled){
_a06.addClassName("disabled");
}
if(i==0){
_a06.addClassName("first");
}else{
if(i==(ii-1)){
_a06.addClassName("last");
}
}
if(curr.visible===false){
_a06.hide();
}
list.append(_a06);
_a06=null;
}
return list;
},enableItem:function(id){
this._setItemEnabled(id,true);
},hide:function(){
this.shown=false;
this._menu_container.hide();
$UI.Menu.active_menu=null;
},hideItem:function(id){
this._setItemVisible(id,false);
},show:function(){
this.shown=true;
this._menu_container.show();
if($UI.Menu.active_menu){
$UI.Menu.active_menu.hide();
}
$UI.Menu.active_menu=this;
this._watchDocument(true);
var _a0a;
if((_a0a=this.options.top_element)){
var _a0b=Position.cumulativeOffset(_a0a);
var _a0c=_a0a.offsetHeight;
this._menu_container.setStyle({left:_a0b[0]+"px",top:_a0b[1]+_a0c+"px"});
if(!this._menu_container.drawn){
this._menu_container.drawn=true;
var _a0d=this._menu_container.getElementsByTagName("iframe")[0];
if(_a0d){
$(_a0d).setStyle({height:this._menu_container.offsetHeight+"px"});
}
}
}
},showItem:function(id){
this._setItemVisible(id,true);
},_findItem:function(id){
var _a10=this._menu_container.getElementsByTagName("li");
for(var i=0,ii=_a10.length;i<ii;i++){
if(_a10[i]._data.id==id){
return $(_a10[i]);
}
}
return false;
},_setItemEnabled:function(id,_a13){
var _a14=this._findItem(id);
if(!_a14){
return;
}
if(_a13){
_a14.removeClassName("disabled");
}else{
_a14.addClassName("disabled");
}
},_setItemVisible:function(id,_a16){
var _a17=this._findItem(id);
if(!_a17){
return;
}
if(_a16){
_a17.show();
}else{
_a17.hide();
}
},_watchDocument:function(_a18){
if(_a18){
if(!this.evDocumentWatch){
this.evDocumentWatch=this._evDocumentWatch.bindAsEventListener(this);
}
Event.observe(document,"click",this.evDocumentWatch);
Event.observe(document,"blur",this.evDocumentWatch);
}else{
if(this.evDocumentWatch){
Event.stopObserving(document,"click",this.evDocumentWatch);
Event.stopObserving(document,"blur",this.evDocumentWatch);
}
}
},_evDocumentWatch:function(e){
if($UI.Menu.active_menu){
$UI.Menu.active_menu.hide();
$UI.Menu.active_menu=null;
}
this._watchDocument(false);
},evDocumentWatch:null};
}
if($Bootstrap.notLoaded("c0d04d98fba4b7b145d91528fa495b23")){
Framework.register("Webmail.UI");
Webmail.UI.Pager={element_pool:[],createPager:function(_a1a,_a1b,_a1c,_a1d){
_a1d=Object.extend({callback:Prototype.emptyFunction,emptytext:"",reduced_range:false,right_align:false,show_range:true},_a1d||{});
var _a1e=this._getContainer();
_a1e._start=_a1a;
_a1e._limit=_a1b;
_a1e._total=_a1c;
_a1e._callback=_a1d.callback;
var _a1a=_a1a;
if(_a1d.reduced_range!==false){
var end=Number(_a1a)+Number(_a1d.reduced_range)-1;
_a1e._reduced=_a1d.reduced_range;
}else{
_a1e._reduced=false;
var end=_a1a+_a1b-1;
}
var _a1c=_a1c;
if(end>_a1c){
end=_a1c;
}
if(_a1d.show_range){
var _a20=(_a1c>0?L("Pager.Range",_a1a,end,_a1c):_a1d.emptytext);
_a20=_a20.replace(/ /g,"&nbsp;");
Element.update(_a1e._range,_a20);
}
if(_a1c<=_a1b){
var _a21="links one_page";
}else{
if(_a1a==1){
var _a21="links first_page";
}else{
if(end==_a1c){
var _a21="links last_page";
}else{
var _a21="links";
}
}
}
_a1e._links.className=_a21;
_a1e._range.style.width="auto";
return _a1e;
},goToNextPage:function(_a22){
var _a23=_a22._limit;
if(_a22._reduced){
var _a24=_a22._start+_a22._reduced;
}else{
var _a24=_a22._start+_a23;
}
if(_a24>_a22._total){
return false;
}
this._navigate(_a22,_a24,_a23);
return true;
},goToPreviousPage:function(_a25){
if(_a25._start<=1){
return false;
}
var _a26=_a25._limit;
var _a27=_a25._start-_a26;
if(_a27<=1){
_a27=1;
}
this._navigate(_a25,_a27,_a26);
return true;
},_findContainer:function(_a28){
while(!_a28.pager&&_a28!=document.body){
_a28=_a28.parentNode;
}
if(_a28==document.body){
_a28=null;
}
return _a28;
},_getContainer:function(){
var _a29=null;
for(var i=0,ii=this.element_pool.length;i<ii;i++){
if(Element.isOrphan(this.element_pool[i])){
_a29=this.element_pool[i];
break;
}
}
if(!_a29){
_a29=Element.createHtml(["<table class=\"UI_Pager\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">","<tbody>","<tr><td>","<span class=\"range\">","</span>","<span class=\"links\">","<a href=\"javascript:void(0);\" class=\"first\">",L("Pager.First"),"</a>","<span class=\"sep\">|</span>","<a href=\"javascript:void(0);\" class=\"previous\">",L("Pager.Previous"),"</a>","<span class=\"sep\">|</span>","<a href=\"javascript:void(0);\" class=\"next\">",L("Pager.Next"),"</a>","<span class=\"sep\">|</span>","<a href=\"javascript:void(0);\" class=\"last\">",L("Pager.Last"),"</a>","</span>","</td></tr>","</tbody>","</table>"].join(""));
_a29.pager=true;
_a29._range=_a29.firstChild.firstChild.firstChild.firstChild;
_a29._links=_a29.firstChild.firstChild.firstChild.childNodes[1];
var _a2b=_a29.getElementsByTagName("a");
var _a2c=_a2b[0];
var prev=_a2b[1];
var next=_a2b[2];
var last=_a2b[3];
Event.observe(_a2c,"click",this.evFirst,this);
Event.observe(prev,"click",this.evPrev,this);
Event.observe(next,"click",this.evNext,this);
Event.observe(last,"click",this.evLast,this);
this.element_pool.push(_a29);
}
return _a29;
},_navigate:function(_a30,_a31,_a32){
if(_a30._callback){
_a30._callback(_a31,_a32);
}
},evFirst:function(e){
$AN(76);
var _a34=this._findContainer(Event.element(e));
var _a35=_a34._limit;
if(_a34._start<=1){
Event.stop(e);
return;
}
this._navigate(_a34,1,_a35);
},evPrev:function(e){
$AN(81);
var _a37=this._findContainer(Event.element(e));
this.goToPreviousPage(_a37);
},evNext:function(e){
$AN(79);
var _a39=this._findContainer(Event.element(e));
this.goToNextPage(_a39);
},evLast:function(e){
$AN(77);
var _a3b=this._findContainer(Event.element(e));
var _a3c=_a3b._limit;
var _a3d=_a3b._total;
var _a3e=(parseInt(_a3d/_a3c)*_a3c)+1;
if(_a3e>_a3d){
_a3e=_a3e-_a3c;
if(_a3e>_a3d){
Event.stop(e);
return;
}
}
this._navigate(_a3b,_a3e,_a3c);
}};
}
if($Bootstrap.notLoaded("c8f0e3f7c63b47a7e5d805bb3d7ff725")){
Framework.register("Webmail.UI");
function SimpleSubMenu(name){
this._constructor=function(name){
this.name=name;
this.containerId=this.name+"_SubMenuContainer";
this.contentId=this.name+"_SubMenuContent";
this.container=null;
this.sections=null;
this.sectionButtons=null;
this.items=null;
this.observers=null;
this._initLayout();
this._initData();
};
this.addSection=function(_a41){
this.sections.push(_a41);
this.items[this.sections.length-1]=new Array();
this.sectionButtons[this.sections.length-1]=new Array();
};
this.removeSection=function(_a42){
var _a43=this._findSection(_a42);
this.sectionButtons[_a43]=new Array();
this.sections[_a43]=null;
this.items[_a43]=new Array();
};
this.removeSectionItem=function(_a44,_a45){
var _a46=this._findSection(_a44);
for(var i=0,ii=this.items[_a46].length;i<ii;i++){
if(this.items[_a46][i]!=null){
if(this.items[_a46][i].key==_a45){
this.items[_a46][i]=null;
}
}
}
};
this.addSectionButton=function(_a48,_a49,_a4a,_a4b){
var _a4c=this._findSection(_a48);
this.sectionButtons[_a4c].push({handler:_a49,tooltip:_a4a,style:_a4b});
};
this._findSection=function(_a4d){
var _a4e=-1;
for(i=_a4e,ii=this.sections.length;i<ii;i++){
if(this.sections[i]==_a4d){
_a4e=i;
break;
}
}
return _a4e;
};
this.addSectionItem=function(_a4f,_a50,_a51,_a52,_a53){
var _a54=this._findSection(_a4f);
this.items[_a54].push({key:_a50,name:_a51,handler:_a52,style:_a53});
};
this.clear=function(){
Element.remove(this.content);
this._initData();
this._initLayout();
this.create();
};
this.refresh=function(){
Element.remove(this.content);
this._initLayout();
this.create();
};
this._initLayout=function(){
if(!this.container){
this.container=Element.create("div",{className:this.subMenuContainerId});
}
if(this.observers){
for(var i=0,ii=this.observers.length;i<ii;i++){
var _a56=this.observers[i].element;
var _a57=this.observers[i].handler;
Event.stopObserving(_a56,"click",_a57,this);
}
}
this.content=Element.create("div",{className:this.contentId});
this.container.append(this.content);
};
this._initData=function(){
this.sections=new Array();
this.sectionButtons=new Array();
this.items=new Array();
this.observers=new Array();
};
this.create=function(){
for(var i=0,ii=this.sections.length;i<ii;i++){
var _a59=this.sections[i];
if(_a59==null){
continue;
}
var _a5a="";
for(var j=0,jj=this.sectionButtons[i].length;j<jj;j++){
var _a5c=this.sectionButtons[i][j].style;
var _a5d=this.sectionButtons[i][j].tooltip;
_a5a+="<img align='right' src='images/blank.gif' class='"+_a5c+"' alt='"+_a5d+"' title='"+_a5d+"' />";
}
var _a5e=Element.createHtml(["<div class='section'>","<div class='header'>",_a5a,"<h3>",_a59,"</h3>","</div>","</div>"].join(""));
var _a5f=_a5e.getElementsByTagName("img");
for(var j=0,jj=this.sectionButtons[i].length;j<jj;j++){
Event.observe(_a5f[j],"click",this.sectionButtons[i][j].handler,this);
}
var _a60="";
for(var j=0,jj=this.items[i].length;j<jj;j++){
if(this.items[i][j]==null){
continue;
}
var id="SubMenu_"+this.name+"_"+this.items[i][j].key;
var name=this.items[i][j].name;
var _a5c=this.items[i][j].style;
if(!_a5c){
_a5c="";
}
_a60+="<li class='"+_a5c+"'><a href='javascript:void(0);'><span id='"+id+"'>"+name+"</span></a></li>";
}
var tree=Element.createHtml(["<ul class='SubMenu_tree'>",_a60,"</ul>"].join(""));
var _a64=tree.getElementsByTagName("li");
var _a65=0;
for(var j=0,jj=this.items[i].length;j<jj;j++){
if(this.items[i][j]==null){
continue;
}
var obj={handler:this.items[i][j].handler,subMenu:this};
var _a67=this._evItemClick.bindAsEventListener(obj);
var _a68=_a64[_a65++];
Event.observe(_a68,"click",_a67,this);
this.observers.push({element:_a68,handler:_a67});
}
_a5e.append(tree);
this.content.append(_a5e);
}
this.container.append(this.content);
return this.container;
};
this._evItemClick=function(e){
var _a6a=this.subMenu.container.getElementsByTagName("li");
for(var i=0,ii=_a6a.length;i<ii;i++){
Element.removeClassName(_a6a[i],"active");
}
var li=Event.findElement(e,"li");
if(li){
Element.addClassName(li,"active");
}
this.handler(e);
};
this.highlightSectionItem=function(_a6d){
var _a6e="SubMenu_"+this.name+"_"+_a6d;
var _a6f=this.container.getElementsByTagName("li");
for(var i=0,ii=_a6f.length;i<ii;i++){
Element.removeClassName(_a6f[i],"active");
var span=_a6f[i].getElementsByTagName("span");
if(span.length>0){
if(span[0].id==_a6e){
Element.addClassName(_a6f[i],"active");
}
}
}
};
this._constructor(name);
}
}
if($Bootstrap.notLoaded("25158d2ddc125f6c894b9428ff97ec09")){
Framework.register("Webmail.UI");
Webmail.UI.Sounds={_soundManager:null,_isFlashInstalled:null,_inited:false,initialize:function(){
if(wack.Browser.detectFlashVersion(8,0,0)){
this.createFlash();
}else{
this.createEmbed();
}
this._inited=true;
},play:function(_a72){
if(this._inited){
if(this._isFlashInstalled){
_soundManager.stop(_a72);
_soundManager.play(_a72);
}else{
var elem=$(_a72);
try{
elem.Play();
}
catch(e){
}
}
}else{
this.initialize();
}
},createFlash:function(){
this._isFlashInstalled=true;
_soundManager=new Webmail.UI.Sounds.SoundManager(Webmail.getGlobal("local_base_uri")+CFG_SWF_PATH);
_soundManager.onload=function(){
_soundManager.createSound(CFG_SOUND_ID,Webmail.getGlobal("local_base_uri")+CFG_SOUND_PATH);
};
_soundManager.onerror=function(){
Webmail.UI.Sounds.createEmbed();
};
_soundManager.beginDelayedInit();
},createEmbed:function(){
this._isFlashInstalled=false;
var _a74=(document.body?document.body:document.getElementsByTagName("div")[0]);
var _a75=Element.createHtml(["<div id=\"SoundEmbed\">","</div>"].join(""));
_a74.appendChild(_a75);
_a75.innerHTML=["<embed src=\"",Webmail.getGlobal("local_base_uri"),CFG_SOUND_PATH,"\" autostart=false width=0 height=0 id=\"",CFG_SOUND_ID,"\" enablejavascript=true>"].join("");
},SoundManager:function(_a76,smID){
var self=this;
this.version="V2.0b.20070415";
this.url=(_a76||"soundmanager2.swf");
this.debugMode=false;
this.useConsole=true;
this.consoleOnly=false;
this.nullURL="data/null.mp3";
this.defaultOptions={"autoLoad":true,"stream":false,"autoPlay":false,"onid3":null,"onload":null,"whileloading":null,"onplay":null,"whileplaying":null,"onstop":null,"onfinish":null,"onbeforefinish":null,"onbeforefinishtime":5000,"onbeforefinishcomplete":null,"onjustbeforefinish":null,"onjustbeforefinishtime":200,"multiShot":false,"pan":0,"volume":100};
this.allowPolling=false;
this.enabled=false;
this.o=null;
this.id=(smID||"sm2movie");
this.oMC=null;
this.sounds=[];
this.soundIDs=[];
this.isIE=(navigator.userAgent.match(/MSIE/));
this.isSafari=(navigator.userAgent.match(/safari/i));
this.debugID="soundmanager-debug";
this._debugOpen=true;
this._didAppend=false;
this._appendSuccess=false;
this._didInit=false;
this._disabled=false;
this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");
this._debugLevels=!self.isSafari?["debug","info","warn","error"]:["log","log","log","log"];
this.getMovie=function(smID){
return self.isIE?window[smID]:(self.isSafari?document[smID]:document.getElementById(smID));
};
this.loadFromXML=function(_a7a){
try{
self.o._loadFromXML(_a7a);
}
catch(e){
self._failSafely();
return true;
}
};
this.createSound=function(_a7b){
if(!self._didInit){
throw new Error("soundManager.createSound(): Not loaded yet - wait for soundManager.onload() before calling sound-related methods");
}
if(arguments.length==2){
_a7b={"id":arguments[0],"url":arguments[1]};
}
var _a7c=self._mergeObjects(_a7b);
self._writeDebug("soundManager.createSound(): \"<a href=\"#\" onclick=\"soundManager.play('"+_a7c.id+"');return false\" title=\"play this sound\">"+_a7c.id+"</a>\" ("+_a7c.url+")",1);
if(self._idCheck(_a7c.id,true)){
self._writeDebug("sound "+_a7c.id+" already defined - exiting",2);
return false;
}
self.sounds[_a7c.id]=new Webmail.UI.Sounds.SMSound(self,_a7c);
self.soundIDs[self.soundIDs.length]=_a7c.id;
try{
self.o._createSound(_a7c.id,_a7c.onjustbeforefinishtime);
}
catch(e){
self._failSafely();
return true;
}
if(_a7c.autoLoad||_a7c.autoPlay){
self.sounds[_a7c.id].load(_a7c);
}
if(_a7c.autoPlay){
self.sounds[_a7c.id].playState=1;
}
};
this.destroySound=function(sID){
if(!self._idCheck(sID)){
return false;
}
for(var i=self.soundIDs.length;i--;){
if(self.soundIDs[i]==sID){
delete self.soundIDs[i];
continue;
}
}
self.sounds[sID].unload();
delete self.sounds[sID];
};
this.load=function(sID,_a80){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].load(_a80);
};
this.unload=function(sID){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].unload();
};
this.play=function(sID,_a83){
if(!self._idCheck(sID)){
if(typeof _a83!="Object"){
_a83={url:_a83};
}
if(_a83&&_a83.url){
self._writeDebug("soundController.play(): attempting to create \""+sID+"\"",1);
_a83.id=sID;
self.createSound(_a83);
}else{
return false;
}
}
self.sounds[sID].play(_a83);
};
this.start=this.play;
this.setPosition=function(sID,_a85){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].setPosition(_a85);
};
this.stop=function(sID){
if(!self._idCheck(sID)){
return false;
}
self._writeDebug("soundManager.stop("+sID+")",1);
self.sounds[sID].stop();
};
this.stopAll=function(){
self._writeDebug("soundManager.stopAll()",1);
for(var _a87 in self.sounds){
if(self.sounds[_a87] instanceof Webmail.UI.Sounds.SMSound){
self.sounds[_a87].stop();
}
}
};
this.pause=function(sID){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].pause();
};
this.resume=function(sID){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].resume();
};
this.togglePause=function(sID){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].togglePause();
};
this.setPan=function(sID,nPan){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].setPan(nPan);
};
this.setVolume=function(sID,nVol){
if(!self._idCheck(sID)){
return false;
}
self.sounds[sID].setVolume(nVol);
};
this.setPolling=function(_a8f){
if(!self.o||!self.allowPolling){
return false;
}
self._writeDebug("soundManager.setPolling("+_a8f+")");
self.o._setPolling(_a8f);
};
this.disable=function(){
if(self._disabled){
return false;
}
self._disabled=true;
self._writeDebug("soundManager.disable(): Disabling all functions - future calls will return false.",1);
for(var i=self.soundIDs.length;i--;){
self._disableObject(self.sounds[self.soundIDs[i]]);
}
self.initComplete();
self._disableObject(self);
};
this.getSoundById=function(sID,_a92){
if(!sID){
throw new Error("SoundManager.getSoundById(): sID is null/undefined");
}
var _a93=self.sounds[sID];
if(!_a93&&!_a92){
self._writeDebug("\""+sID+"\" is an invalid sound ID.",2);
}
return _a93;
};
this.onload=function(){
};
this.onerror=function(){
};
this._idCheck=this.getSoundById;
this._disableObject=function(o){
for(var _a95 in o){
if(typeof o[_a95]=="function"&&typeof o[_a95]._protected=="undefined"){
o[_a95]=function(){
return false;
};
}
}
_a95=null;
};
this._failSafely=function(){
var _a96="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";
var _a97="You may need to whitelist this location/domain eg. file:///C:/ or C:/ or mysite.com, or set ALWAYS ALLOW under the Flash Player Global Security Settings page. Note that this seems to apply only to file system viewing.";
var _a98="<a href=\""+_a96+"\" title=\""+_a97+"\">view/edit</a>";
var _a99="<a href=\""+_a96+"\" title=\"Flash Player Global Security Settings\">FPGSS</a>";
if(!self._disabled){
self._writeDebug("soundManager: JS-&gt;Flash communication failed. Possible causes: flash/browser security restrictions ("+_a98+"), insufficient browser/plugin support, or .swf not found",2);
self._writeDebug("Verify that the movie path of <em>"+self.url+"</em> is correct (<a href=\""+self.url+"\" title=\"If you get a 404/not found, fix it!\">test link</a>)",1);
if(self._didAppend){
if(!document.domain){
self._writeDebug("Loading from local file system? (document.domain appears to be null, this URL path may need to be added to 'trusted locations' in "+_a99+")",1);
self._writeDebug("Possible security/domain restrictions ("+_a98+"), should work when served by http on same domain",1);
}
}
self.disable();
}
};
this._createMovie=function(smID,_a9b){
if(self._didAppend&&self._appendSuccess){
return false;
}
self._didAppend=true;
var html=["<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"16\" height=\"16\" id=\""+smID+"\"><param name=\"movie\" value=\""+_a9b+"\"><param name=\"quality\" value=\"high\"><param name=\"allowScriptAccess\" value=\"always\" /></object>","<embed name=\""+smID+"\" id=\""+smID+"\" src=\""+_a9b+"\" width=\"1\" height=\"1\" quality=\"high\" allowScriptAccess=\"always\"></embed>"];
var _a9d="<div id=\""+self.debugID+"-toggle\" style=\"position:fixed;_position:absolute;right:0px;bottom:0px;_top:0px;width:1.2em;height:1.2em;line-height:1.2em;margin:2px;padding:0px;text-align:center;border:1px solid #999;cursor:pointer;background:#fff;color:#333;z-index:706\" title=\"Toggle SM2 debug console\" onclick=\"soundManager._toggleDebug()\">-</div>";
var _a9e="<div id=\""+self.debugID+"\" style=\"display:"+(self.debugMode&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))?"block":"none")+";opacity:0.85\"></div>";
var _a9f="soundManager._createMovie(): appendChild/innerHTML set failed. Serving application/xhtml+xml MIME type? Browser may be enforcing strict rules, not allowing write to innerHTML. (PS: If so, this means your commitment to XML validation is going to break stuff now, because this part isn't finished yet. ;))";
var _aa0="<div style=\"position:absolute;left:-256px;top:-256px;width:1px;height:1px\" class=\"movieContainer\">"+html[self.isIE?0:1]+"</div>"+(self.debugMode&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))&&!document.getElementById(self.debugID)?"x"+_a9e+_a9d:"");
var _aa1=(document.body?document.body:document.getElementsByTagName("div")[0]);
if(_aa1){
self.oMC=document.createElement("div");
self.oMC.className="movieContainer";
self.oMC.style.position="absolute";
self.oMC.style.left="-256px";
self.oMC.style.width="1px";
self.oMC.style.height="1px";
try{
_aa1.appendChild(self.oMC);
var _aa2=self.isIE;
self.oMC.innerHTML=html[_aa2?0:1];
self._appendSuccess=true;
}
catch(e){
throw new Error(_a9f);
}
if(!document.getElementById(self.debugID)&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))){
var _aa3=document.createElement("div");
_aa3.id=self.debugID;
_aa3.style.display=(self.debugMode?"block":"none");
if(self.debugMode){
try{
var oD=document.createElement("div");
_aa1.appendChild(oD);
oD.innerHTML=_a9d;
}
catch(e){
throw new Error(_a9f);
}
}
_aa1.appendChild(_aa3);
}
_aa1=null;
}
self._writeDebug("-- SoundManager 2 Version "+self.version.substr(1)+" --",1);
self._writeDebug("soundManager._createMovie(): trying to load <a href=\""+_a9b+"\" title=\"Test this link (404=bad)\">"+_a9b+"</a>",1);
};
this._writeDebug=function(_aa5,_aa6){
if(!self.debugMode){
return false;
}
if(self._hasConsole&&self.useConsole){
console[self._debugLevels[_aa6]||"log"](_aa5);
if(self.useConsoleOnly){
return true;
}
}
var sDID="soundmanager-debug";
try{
var o=document.getElementById(sDID);
if(!o){
return false;
}
var p=document.createElement("div");
p.innerHTML=_aa5;
o.insertBefore(p,o.firstChild);
}
catch(e){
}
o=null;
};
this._writeDebug._protected=true;
this._writeDebugAlert=function(_aaa){
alert(_aaa);
};
this._toggleDebug=function(){
var o=document.getElementById(self.debugID);
var oT=document.getElementById(self.debugID+"-toggle");
if(!o){
return false;
}
if(self._debugOpen){
oT.innerHTML="+";
o.style.display="none";
}else{
oT.innerHTML="-";
o.style.display="block";
}
self._debugOpen=!self._debugOpen;
};
this._toggleDebug._protected=true;
this._debug=function(){
self._writeDebug("soundManager._debug(): sounds by id/url:",0);
for(var i=0,j=self.soundIDs.length;i<j;i++){
self._writeDebug(self.sounds[self.soundIDs[i]].sID+" | "+self.sounds[self.soundIDs[i]].url,0);
}
};
this._mergeObjects=function(_aae,oAdd){
var o1=_aae;
var o2=(typeof oAdd=="undefined"?self.defaultOptions:oAdd);
for(var o in o2){
if(typeof o1[o]=="undefined"){
o1[o]=o2[o];
}
}
return o1;
};
this.createMovie=function(sURL){
if(sURL){
self.url=sURL;
}
self._initMovie();
};
this._initMovie=function(){
if(self.o){
return false;
}
self.o=self.getMovie(self.id);
if(!self.o){
self._createMovie(self.id,self.url);
self.o=self.getMovie(self.id);
}
if(self.o){
self._writeDebug("soundManager._initMovie(): Got "+self.o.nodeName+" element ("+(self._didAppend?"created via JS":"static HTML")+")",1);
}
};
this.initComplete=function(){
if(self._didInit){
return false;
}
self._didInit=true;
self._writeDebug("-- SoundManager 2 "+(self._disabled?"failed to load":"loaded")+" ("+(self._disabled?"security/load error":"OK")+") --",1);
if(self._disabled){
self._writeDebug("soundManager.initComplete(): calling soundManager.onerror()",1);
self.onerror.apply(window);
return false;
}
self._writeDebug("soundManager.initComplete(): calling soundManager.onload()",1);
try{
self.onload.apply(window);
}
catch(e){
self._writeDebug("soundManager.onload() threw an exception: "+e.message,2);
throw e;
}
self._writeDebug("soundManager.onload() complete",1);
};
this.init=function(){
if(window.removeEventListener){
window.removeEventListener("load",self.beginInit,false);
}else{
if(window.detachEvent){
window.detachEvent("onload",self.beginInit);
}
}
try{
self.o._externalInterfaceTest();
self._writeDebug("Flash ExternalInterface call (JS -&gt; Flash) succeeded.",1);
if(!self.allowPolling){
self._writeDebug("Polling (whileloading/whileplaying support) is disabled.",1);
}
self.setPolling(true);
self.enabled=true;
}
catch(e){
self._failSafely();
self.initComplete();
return false;
}
self.initComplete();
};
this.beginDelayedInit=function(){
setTimeout(self.beginInit,200);
};
this.beginInit=function(){
self.createMovie();
self._initMovie();
setTimeout(self.init,1000);
};
this.destruct=function(){
if(self.isSafari){
for(var i=self.soundIDs.length;i--;){
if(self.sounds[self.soundIDs[i]].readyState==1){
self.sounds[self.soundIDs[i]].unload();
}
}
}
self.disable();
};
},SMSound:function(oSM,_ab6){
var self=this;
var sm=oSM;
this.sID=_ab6.id;
this.url=_ab6.url;
this.options=sm._mergeObjects(_ab6);
this.id3={};
self.resetProperties=function(_ab9){
self.bytesLoaded=null;
self.bytesTotal=null;
self.position=null;
self.duration=null;
self.durationEstimate=null;
self.loaded=false;
self.loadSuccess=null;
self.playState=0;
self.paused=false;
self.readyState=0;
self.didBeforeFinish=false;
self.didJustBeforeFinish=false;
};
self.resetProperties();
this.load=function(_aba){
self.loaded=false;
self.loadSuccess=null;
self.readyState=1;
self.playState=(_aba.autoPlay||false);
var _abb=sm._mergeObjects(_aba);
if(typeof _abb.url=="undefined"){
_abb.url=self.url;
}
try{
sm._writeDebug("loading "+_abb.url,1);
sm.o._load(self.sID,_abb.url,_abb.stream,_abb.autoPlay,_abb.whileloading?1:0);
}
catch(e){
sm._writeDebug("SMSound().load(): JS-&gt;Flash communication failed.",2);
}
};
this.unload=function(){
sm._writeDebug("SMSound().unload(): \""+self.sID+"\"");
self.setPosition(0);
sm.o._unload(self.sID,sm.nullURL);
self.resetProperties();
};
this.play=function(_abc){
if(!_abc){
_abc={};
}
if(_abc.onfinish){
self.options.onfinish=_abc.onfinish;
}
if(_abc.onbeforefinish){
self.options.onbeforefinish=_abc.onbeforefinish;
}
if(_abc.onjustbeforefinish){
self.options.onjustbeforefinish=_abc.onjustbeforefinish;
}
var _abd=sm._mergeObjects(_abc);
if(self.playState==1){
var _abe=_abd.multiShot;
if(!_abe){
sm._writeDebug("SMSound.play(): \""+self.sID+"\" already playing? (one-shot)",1);
return false;
}else{
sm._writeDebug("SMSound.play(): \""+self.sID+"\" already playing (multi-shot)",1);
}
}
if(!self.loaded){
if(self.readyState==0){
sm._writeDebug("SMSound.play(): .play() before load request. Attempting to load \""+self.sID+"\"",1);
_abd.stream=true;
_abd.autoPlay=true;
self.load(_abd);
}else{
if(self.readyState==2){
sm._writeDebug("SMSound.play(): Could not load \""+self.sID+"\" - exiting",2);
return false;
}else{
sm._writeDebug("SMSound.play(): \""+self.sID+"\" is loading - attempting to play..",1);
}
}
}else{
sm._writeDebug("SMSound.play(): \""+self.sID+"\"");
}
if(self.paused){
self.resume();
}else{
self.playState=1;
self.position=(_abd.offset||0);
if(_abd.onplay){
_abd.onplay.apply(self);
}
self.setVolume(_abd.volume);
self.setPan(_abd.pan);
if(!_abd.autoPlay){
sm.o._start(self.sID,_abd.loop||1,self.position);
}
}
};
this.start=this.play;
this.stop=function(bAll){
if(self.playState==1){
self.playState=0;
self.paused=false;
if(sm.defaultOptions.onstop){
sm.defaultOptions.onstop.apply(self);
}
sm.o._stop(self.sID);
}
};
this.setPosition=function(_ac0){
sm.o._setPosition(self.sID,_ac0/1000,self.paused||!self.playState);
};
this.pause=function(){
if(self.paused){
return false;
}
sm._writeDebug("SMSound.pause()");
self.paused=true;
sm.o._pause(self.sID);
};
this.resume=function(){
if(!self.paused){
return false;
}
sm._writeDebug("SMSound.resume()");
self.paused=false;
sm.o._pause(self.sID);
};
this.togglePause=function(){
sm._writeDebug("SMSound.togglePause()");
if(!self.playState){
self.play({offset:self.position/1000});
return false;
}
if(self.paused){
sm._writeDebug("SMSound.togglePause(): resuming..");
self.resume();
}else{
sm._writeDebug("SMSound.togglePause(): pausing..");
self.pause();
}
};
this.setPan=function(nPan){
if(typeof nPan=="undefined"){
nPan=0;
}
sm.o._setPan(self.sID,nPan);
self.options.pan=nPan;
};
this.setVolume=function(nVol){
if(typeof nVol=="undefined"){
nVol=100;
}
try{
sm.o._setVolume(self.sID,nVol);
}
catch(e){
}
self.options.volume=nVol;
};
this._whileloading=function(_ac3,_ac4,_ac5){
self.bytesLoaded=_ac3;
self.bytesTotal=_ac4;
self.duration=_ac5;
self.durationEstimate=parseInt((self.bytesTotal/self.bytesLoaded)*self.duration);
if(self.readyState!=3&&self.options.whileloading){
self.options.whileloading.apply(self);
}
};
this._onid3=function(_ac6,_ac7){
sm._writeDebug("SMSound()._onid3(): \""+this.sID+"\" ID3 data received.");
var _ac8=[];
for(var i=0,j=_ac6.length;i<j;i++){
_ac8[_ac6[i]]=_ac7[i];
}
self.id3=sm._mergeObjects(self.id3,_ac8);
if(self.options.onid3){
self.options.onid3.apply(self);
}
};
this._whileplaying=function(_aca){
if(isNaN(_aca)||_aca==null){
return false;
}
self.position=_aca;
if(self.playState==1){
if(self.options.whileplaying){
self.options.whileplaying.apply(self);
}
if(self.loaded&&self.options.onbeforefinish&&self.options.onbeforefinishtime&&!self.didBeforeFinish&&self.duration-self.position<=self.options.onbeforefinishtime){
sm._writeDebug("duration-position &lt;= onbeforefinishtime: "+self.duration+" - "+self.position+" &lt= "+self.options.onbeforefinishtime+" ("+(self.duration-self.position)+")");
self._onbeforefinish();
}
}
};
this._onload=function(_acb){
_acb=(_acb==1?true:false);
sm._writeDebug("SMSound._onload(): \""+self.sID+"\""+(_acb?" loaded.":" failed to load (or loaded from cache - weird bug) - [<a href=\""+self.url+"\">test URL</a>]"));
self.loaded=_acb;
self.loadSuccess=_acb;
self.readyState=_acb?3:2;
if(self.options.onload){
self.options.onload.apply(self);
}
};
this._onbeforefinish=function(){
if(!self.didBeforeFinish){
self.didBeforeFinish=true;
if(self.options.onbeforefinish){
self.options.onbeforefinish.apply(self);
}
}
};
this._onjustbeforefinish=function(_acc){
if(!self.didJustBeforeFinish){
self.didJustBeforeFinish=true;
if(self.options.onjustbeforefinish){
self.options.onjustbeforefinish.apply(self);
}
}
};
this._onfinish=function(){
sm._writeDebug("SMSound._onfinish(): \""+self.sID+"\"");
self.playState=0;
self.paused=false;
if(self.options.onfinish){
self.options.onfinish.apply(self);
}
if(self.options.onbeforefinishcomplete){
self.options.onbeforefinishcomplete.apply(self);
}
self.setPosition(0);
self.didBeforeFinish=false;
self.didJustBeforeFinish=false;
};
}};
}
if($Bootstrap.notLoaded("a9324ef9a4b396553516c3e15c6ad577")){
Framework.register("Webmail.UI");
Webmail.UI.TabPanel=Class.create();
Webmail.UI.TabPanel.prototype={_active_tab:null,_container:null,initialize:function(_acd){
Object.bindObservers(this);
Object.bindCallbacks(this);
this._container=_acd;
$Templates.setDom(_acd);
var tabs=_acd.dom("tabs").getElementsByTagName("a");
for(var i=0,ii=tabs.length;i<ii;i++){
tabs[i]._index=i;
Event.observe(tabs[i],"click",this.evTabClick);
}
var _ad0=Element.createHtml("<div class=\"filler\"> </div>");
_acd.dom("tabs").appendChild(_ad0);
var _ad1=Element.createHtml("<div style=\"clear:both;\"></div>");
_acd.dom("tabs").appendChild(_ad1);
var _ad2=_acd.dom("panels").childNodes;
for(var i=0,ii=_ad2.length;i<ii;i++){
_ad2[i].style.display="none";
}
},removeTab:function(_ad3){
var _ad4=this._container.dom("panels").childNodes[_ad3];
var tab=this._container.dom("tabs").getElementsByTagName("a")[_ad3];
tab.style.display="none";
},selectTab:function(_ad6){
if(this._active_tab!=null){
var _ad7=this._container.dom("panels").childNodes[this._active_tab];
_ad7.style.display="none";
var _ad8=this._container.dom("tabs").getElementsByTagName("a")[this._active_tab];
Element.removeClassName(_ad8,"selected");
if(_ad8.nextSibling){
Element.removeClassName(_ad8.nextSibling,"selected_sibling");
}
}
this._active_tab=_ad6;
var _ad7=this._container.dom("panels").childNodes[_ad6];
_ad7.style.display="";
var _ad8=this._container.dom("tabs").getElementsByTagName("a")[_ad6];
Element.addClassName(_ad8,"selected");
if(_ad8.nextSibling){
Element.addClassName(_ad8.nextSibling,"selected_sibling");
}
},evTabClick:null,_evTabClick:function(e){
var tab=Event.findElement(e,"a");
this.selectTab(tab._index);
}};
}
if($Bootstrap.notLoaded("933eb5244e7a7154c5321fc571c878ab")){
Framework.register("Webmail.UI");
Webmail.UI.TabSet=Class.create();
Webmail.UI.TabSet.prototype={_active:null,_tabs:[],initialize:function(){
Object.bindObservers(this);
},addTab:function(tab,_adc){
this._tabs.push(tab);
_adc.style.display="none";
tab.__container=_adc;
Event.observe(tab,"click",this.evTabClick);
},selectTab:function(tab){
if(this._active){
this._active.removeClassName("selected");
this._active.__selected=false;
if(this._active.nextSibling){
this._active.nextSibling.removeClassName("next");
}
this._active.__container.style.display="none";
}
this._active=tab;
this._active.__selected=true;
tab.__container.style.display="";
Element.addClassName(tab,"selected");
if(tab.nextSibling){
Element.addClassName(tab.nextSibling,"next");
}
},evTabClick:null,_evTabClick:function(e){
var tab=Event.findElement(e,"div");
this.selectTab(tab);
}};
}
if($Bootstrap.notLoaded("46ff29e7a7a54b526be122c3e72b1ef7")){
Framework.register("Webmail.UI");
Webmail.UI.Tabs={createTabset:function(tabs,_ae1){
_ae1=Object.extend({onclick:null,allow_reclick:false},_ae1||{});
var list=Element.create("ul",{className:"UI_Tabs"});
list._options=_ae1;
list._active_key=null;
for(tab in tabs){
var curr=tabs[tab];
var _ae4=Element.create("li");
_ae4.innerHTML="<div>"+curr.text+"</div>";
_ae4._tabkey=tab;
this.evTabClick=this._evTabClick.bindAsEventListener(this);
Event.observe(_ae4,"click",this.evTabClick);
if(curr.menu&&curr.menu.length>0){
var _ae5=Element.create("img");
_ae5.src="images/blank.gif";
this.evArrowClick=this._evArrowClick.bindAsEventListener(this);
Event.observe(_ae5,"click",this.evArrowClick);
_ae4._menu_opts=curr.menu;
$(_ae4.firstChild).append(_ae5);
}
list.append(_ae4);
curr=_ae4=null;
}
$(list.firstChild).addClassName("first");
return list;
},disableMenuItem:function(_ae6,_ae7,_ae8){
this._setMenuItemEnabled(_ae6,_ae7,_ae8,false);
},disableTab:function(_ae9,_aea){
this._setTabEnabled(_ae9,_aea,false);
},enableMenuItem:function(_aeb,_aec,_aed){
this._setMenuItemEnabled(_aeb,_aec,_aed,true);
},enableTab:function(_aee,_aef){
this._setTabEnabled(_aee,_aef,true);
},hideMenuItem:function(_af0,_af1,_af2){
this._setMenuItemVisible(_af0,_af1,_af2,false);
},setActiveTab:function(_af3,key){
if(_af3._active_key){
var _af5=this._findTab(_af3,_af3._active_key);
if(_af5){
_af5.removeClassName("active");
if(_af5.nextSibling){
$(_af5.nextSibling).removeClassName("active_sibling");
}
}
}
_af3._active_key=key;
var _af6=this._findTab(_af3,key);
if(_af6){
_af6.addClassName("active");
if(_af6.nextSibling){
$(_af6.nextSibling).addClassName("active_sibling");
}
}
},showMenuItem:function(_af7,_af8,_af9){
this._setMenuItemVisible(_af7,_af8,_af9,true);
},_findTab:function(_afa,key){
var _afc=_afa.childNodes;
for(var i=0,ii=_afc.length;i<ii;i++){
if(_afc[i]._tabkey==key){
return $(_afc[i]);
}
}
return null;
},_setMenuItemEnabled:function(_afe,_aff,_b00,_b01){
var tab=this._findTab(_afe,_aff);
if(!tab){
return;
}
if(_b01){
tab._menu.enableItem(_b00);
}else{
tab._menu.disableItem(_b00);
}
},_setMenuItemVisible:function(_b03,_b04,_b05,_b06){
var tab=this._findTab(_b03,_b04);
if(!tab){
return;
}
if(!tab._menu){
for(var i=0,ii=tab._menu_opts.length;i<ii;i++){
if(tab._menu_opts[i].id==_b05){
tab._menu_opts[i].visible=_b06;
break;
}
}
return;
}
if(_b06){
tab._menu.showItem(_b05);
}else{
tab._menu.hideItem(_b05);
}
},_setTabEnabled:function(_b09,_b0a,_b0b){
var tab=this._findTab(_b09,_b0a);
if(!tab){
return;
}
if(_b0b){
if(wack.Browser.is_safari){
tab.removeClassName("disabled");
}else{
tab.show();
}
}else{
if(wack.Browser.is_safari){
tab.addClassName("disabled");
}else{
tab.hide();
}
}
},_evArrowClick:function(e){
var tab=Event.findElement(e,"li");
if(tab._menu_opts){
tab._menu=new $UI.Menu(tab._menu_opts,{top_element:tab});
tab._menu_opts=null;
}
if(tab._menu){
if(tab._menu.shown){
tab._menu.hide();
}else{
tab._menu.show();
}
}
Event.stop(e);
},evArrowClick:null,_evTabClick:function(e){
var tab=Event.findElement(e,"li");
var _b11=tab.parentNode;
if(!_b11._options.allow_reclick&&tab._tabkey==_b11._active_key){
return;
}
$UI.load(function(){
if(_b11._options.onclick){
_b11._options.onclick(tab._tabkey);
}else{
this.setActiveTab(_b11,tab._tabkey);
}
}.bind(this),e,"li");
},evTabClick:null};
}
if($Bootstrap.notLoaded("282fe445b09f84e7681e9c85318e0614")){
Framework.register("Webmail.UI.Decorators");
Webmail.UI.Decorators.DefaultText=Class.create();
Webmail.UI.Decorators.DefaultText.prototype={initialize:function(_b12,text){
_b12.__default__=text;
_b12.getValue=function(raw){
return $UI.Decorators.DefaultText.getValue(_b12,raw);
};
_b12.setValue=function(v){
$UI.Decorators.DefaultText.setValue(_b12,v);
};
_b12.setDefault=function(d){
$UI.Decorators.DefaultText.setDefault(_b12,d);
};
Event.observe(_b12,"focus",$UI.Decorators.DefaultText.evFocus);
Event.observe(_b12,"blur",$UI.Decorators.DefaultText.evBlur);
_b12.setValue("");
}};
wack.extend(Webmail.UI.Decorators.DefaultText,{getValue:function(_b17,raw){
if(_b17.value==_b17.__default__){
return "";
}else{
var _b19=_b17.value;
if(!raw){
_b19=_b19.replace(/\r/g,"");
}
return _b19;
}
},setDefault:function(_b1a,text){
_b1a.__default__=text;
_b1a.setValue("");
},setValue:function(_b1c,_b1d){
if(_b1d){
_b1c.value=_b1d;
this._setStyle(_b1c,false);
}else{
_b1c.value=_b1c.__default__;
this._setStyle(_b1c,true);
}
},_setStyle:function(_b1e,_b1f){
if(_b1f){
Element.addClassName(_b1e,"defaulted");
}else{
Element.removeClassName(_b1e,"defaulted");
}
},evBlur:null,_evBlur:function(e){
var _b21=Event.element(e);
_b21.setValue(_b21.value);
},evFocus:null,_evFocus:function(e){
var _b23=Event.element(e);
if(_b23.value==_b23.__default__){
_b23.value="";
this._setStyle(_b23,false);
}
}});
Object.bindObservers(Webmail.UI.Decorators.DefaultText);
}
if($Bootstrap.notLoaded("52005397c8da151fbe44e975a44d87d5")){
Framework.register("Webmail.UI.Decorators");
Webmail.UI.Decorators.LabelPair=Class.create();
Webmail.UI.Decorators.LabelPair.prototype={_next_id:0,_paired:[],initialize:function(){
Object.bindObservers(this);
},addButton:function(){
},addLabel:function(){
},evClickLabel:null,_evClickLabel:function(e){
}};
}
if($Bootstrap.notLoaded("361515646bbb8ba52928953b6d6eb730")){
Framework.register("Webmail.UI.Decorators");
Webmail.UI.Decorators.RadioCheckboxes=Class.create();
Webmail.UI.Decorators.RadioCheckboxes.prototype={_next_id:0,_checkboxes:[],initialize:function(){
Object.bindObservers(this);
},addGroup:function(_b25){
this._next_id++;
for(var i=0,ii=_b25.length;i<ii;i++){
this._checkboxes.push(_b25[i]);
_b25[i]._radio_group=this._next_id;
Event.observe(_b25[i],"click",this.evCheckboxClick);
}
},evCheckboxClick:null,_evCheckboxClick:function(e){
var cbox=Event.element(e);
var _b29=cbox._radio_group;
if(!cbox.checked){
return;
}
for(var i=0,ii=this._checkboxes.length;i<ii;i++){
if(this._checkboxes[i]._radio_group!=_b29){
this._checkboxes[i].checked=false;
}
}
}};
}
if($Bootstrap.notLoaded("8702684de42bfa2b8b658aa3d9db24c6")){
Framework.register("Webmail.UI.Decorators");
Webmail.UI.Decorators.TextEnter=Class.create();
Webmail.UI.Decorators.TextEnter.prototype={initialize:function(_b2b,_b2c,_b2d){
Event.observe(_b2b,"keypress",function(e){
if(e.keyCode==Event.KEY_RETURN){
Function.release(function(){
_b2c(e);
});
}
});
}};
}
if($Bootstrap.notLoaded("14c7fc951a82c98b4e0c384d05dda6b5")){
Framework.create("Webmail.Calendar.Reminders",{_cache:false,_reminder_win:null,initialize:function(){
Object.bindCallbacks(this);
$Dispatcher.subscribe("Calendar.Events.saveEvent",this.cbUpdateReminders);
$Dispatcher.subscribe("Calendar.Events.deleteEvent",this.cbUpdateReminders);
$Dispatcher.subscribe("Calendar.Events.inviteRespond",this.cbUpdateReminders);
this._updateReminderCache("init");
new wack.BigInterval(function(){
this._updateReminderCache("interval");
}.bind(this),60*24);
setTimeout(function(){
setInterval(this._doReminders.bind(this),60000);
this._doReminders();
}.bind(this),((60-(new Date).getSeconds())%60)*1000);
},deletePopupReminderOccurrences:function(_b2f,_b30){
this._clearCache();
_b2f=JSON.parse(_b2f);
$Data.doBatch(function(){
$Data.request("Calendar.deletePopupReminderOccurrences",{callback:_b30},_b2f);
this._updateReminderCache();
}.bind(this));
},getPastPopupReminders:function(_b31,dt,src){
src=src||null;
$Data.request("Calendar.getPastPopupReminderOccurrences",{callback:_b31,handle_conn_err:false,background:true},dt,src);
},snooze:function(_b34,_b35,_b36){
_b36=_b36||Prototype.emptyFunction;
if(typeof _b34!="object"){
_b34=JSON.parse(_b34);
}
this._clearCache();
$Data.doBatch(function(){
$Data.request("Calendar.snooze",{callback:_b36},_b34,_b35);
this._updateReminderCache();
}.bind(this));
},_clearCache:function(){
this._cache=false;
},_createWindow:function(_b37){
return $Popup.create({height:270,width:420,title:L("Calendar.F.Reminder.S"),onload:function(win){
win.Calendar_POPUP_REMINDER_INTERVAL=Calendar_POPUP_REMINDER_INTERVAL;
win.REQUIRE("combo/reminder_popup");
win.Webmail.Popups.Reminder.create(_b37);
},show_loading:false});
},_doReminders:function(){
var _b39=this._getPastPopupReminders();
if(this._isPopupOpen()||_b39.length>0){
if(!this._isPopupOpen()){
this._reminder_win=this._createWindow(_b39);
}else{
try{
this._reminder_win.Webmail.Popups.Reminder.instance.populate(_b39);
}
catch(e){
}
}
}
},_getPastPopupReminders:function(){
var _b3a=[];
var now=new Date();
for(var i=0;i<this._cache.length;i++){
var _b3d=newDateTime(this._cache[i].occurrence.display_dt);
if(_b3d<=now){
_b3a.push(this._cache[i]);
}
}
return _b3a;
},_isPopupOpen:function(){
return (this._reminder_win&&!this._reminder_win.closed);
},_updateReminderCache:function(src){
src=src||"nosrc";
var _b3f=(new Date).add(0,0,0,0,Calendar_POPUP_REMINDER_INTERVAL);
this.getPastPopupReminders(function(_b40){
if(!_b40.exception){
this._cache=_b40;
}
}.bind(this),_b3f.format("%Y-%m-%d %H:%i:59"),src);
},cbUpdateReminders:null,_cbUpdateReminders:function(_b41){
if(_b41){
this._updateReminderCache();
}
}});
}
if($Bootstrap.notLoaded("4e0de030ed29aef3003f3f44d485fc5d")){
Framework.register("Webmail.Locale");
if(typeof window.$Locale=="undefined"){
$Locale=Webmail.Locale;
}
Webmail.Locale.DateTime={americanDateFromInput:function(_b42){
if($Settings.getDateFormat()==wm_Settings_DATE_INTL){
return wack.DateTime.intlToAmerican(_b42);
}else{
return _b42;
}
},basicDate:function(date){
return this._formatDate(date,{intl:"%d/%m/%Y",american:"%m/%d/%Y"});
},basicTime:function(date){
return date.format(this._getTimeFormat());
},fullYear:function(date){
return date.format("%Y");
},fullDisplay:function(date,_b47){
if(_b47==true){
var _b48="";
}else{
var _b48=this._getTimeFormat();
}
return this._formatDate(date,{intl:"%l %j %M, %Y "+_b48,american:"%l %M %j, %Y "+_b48});
},fullDayDate:function(date){
return this._formatDate(date,{intl:"%l, %j %M, %Y",american:"%l, %M %j, %Y"});
},longDayDate:function(date){
return this._formatDate(date,{intl:"%l, %j %F",american:"%l, %F %j"});
},shortDayDate:function(date){
return this._formatDate(date,{intl:"%D, %j %F",american:"%D, %F %j"});
},shortDayShortDate:function(date){
return this._formatDate(date,{intl:"%D %j/%n",american:"%D %n/%j"});
},_formatDate:function(date,_b4e){
var _b4f;
if($Settings.getDateFormat()==wm_Settings_DATE_INTL){
_b4f=_b4e.intl;
}else{
_b4f=_b4e.american;
}
return date.format(_b4f);
},_getTimeFormat:function(){
if($Settings.getHourFormat()==wm_Settings_HOUR_24){
return "%H:%i";
}else{
return "%g:%i %a";
}
}};
}
if($Bootstrap.notLoaded("c826d4b2efb37ef9947738d4fe84c3ba")){
Framework.register("Webmail");
$Help=Webmail.Help={POPUP_HEIGHT:600,POPUP_WIDTH:500,_type:0,_id:null,setPage:function(_b50){
return;
var _b51=_b50.split(":");
this._type=_b51[0]||0;
this._id=_b51[1]||"";
},show:function(){
$AN(43);
var _b52={};
_b52[0]="getallcategories";
_b52[HELP_CONTEXT]="contextsensitive";
_b52[HELP_CATEGORY]="getcategory";
_b52[HELP_TOPIC]="getspecifictopic";
var url="p/help/webmail_help.php?"+"action="+_b52[this._type]+"&id="+(this._id||"");
url=Webmail.makeSidUrl(url);
wack.Browser.popup(url,this.POPUP_HEIGHT,this.POPUP_WIDTH,null,null,true,true);
}};
}
if($Bootstrap.notLoaded("10a75335a494f5b6732f926cab1b94ee")){
wack.depends("Webmail");
$Templates=Webmail.Templates={setDom:function(elem,_b55){
elem._dom_config=_b55;
elem._dom_cache={};
if(!_b55){
this._findElements(elem);
}
elem.dom=function(key){
return $Templates._callDom(elem,key);
};
return elem;
},_callDom:function(elem,key){
if(elem._dom_cache[key]){
return elem._dom_cache[key];
}
if(typeof (elem._dom_config)=="undefined"){
return false;
}
if(typeof (elem._dom_config[key])=="string"){
this._parseDomString(elem,key);
}
if(typeof elem._dom_config[key]=="undefined"){
return false;
}
return (elem._dom_cache[key]=elem._dom_config[key](elem));
},_findElements:function(elem,root){
var ref=null;
if(!root){
if((ref=elem.getAttribute("_ref"))){
elem._dom_cache[ref]=elem;
}
}
root=root||elem;
var _b5c=elem.childNodes;
for(var i=0,ii=_b5c.length;i<ii;i++){
if(_b5c[i].getAttribute&&(ref=_b5c[i].getAttribute("_ref"))){
root._dom_cache[ref]=_b5c[i];
}
if(_b5c[i].childNodes.length>0){
this._findElements(_b5c[i],root);
}
}
},_parseDomString:function(elem,key){
var _b60=["childNodes","firstChild","lastChild","previousSibling","nextSibling","parentNode","cells","rows"];
var _b61="";
var path=elem._dom_config[key].substr(1);
var _b63=path.split("/");
for(var i=0,ii=_b63.length;i<ii;i++){
var _b65=_b63[i].indexOf("[");
var tag="";
if(_b65==-1){
_b65=false;
tag=_b63[i];
}else{
tag=_b63[i].substring(0,_b65);
}
if(_b60.include(tag)){
_b61+="."+tag;
}else{
if(elem._dom_config[tag]){
if(typeof (elem._dom_config[tag])=="string"){
this._parseDomString(elem,tag);
}
_b61+=".dom(\""+tag+"\")";
}else{
if(tag!=""){
_b61+=".getElementsByTagName(\""+tag+"\")";
}
}
}
if(_b65!==false){
_b61+=_b63[i].substr(_b65);
}
}
elem._dom_config[key]=new Function("elem","return elem"+_b61+";");
}};
}
if($Bootstrap.notLoaded("13be185875e99cb6068ca985568d905c")){
wack.depends("Webmail");
$Widget=Webmail.Widgets=Class.create();
$Widget.prototype={container:null};
}
if($Bootstrap.notLoaded("6dec31d1404e927f9cd9194968f98b0c")){
wack.depends("Webmail");
$Widgets=Webmail.Widgets={clearStatus:function(){
$UI.clearStatus.apply($UI,arguments);
},create:function(_b67,_b68,_b69){
parent_prototype=Object.copy((_b68||$Widget).prototype);
parent_copy=wack.extend({},parent_prototype);
var base=function(){
};
base.prototype=Object.extend(parent_prototype,_b67);
if(_b69){
base.prototype.superclass=parent_copy;
}
Object.extend(base,this.Attributes);
return base;
},load:function(_b6b){
REQUIRE("widgets/"+_b6b.replace(/\./g,"_"));
},error:function(){
$UI.error.apply($UI,arguments);
},showStatus:function(){
$UI.showStatus.apply($UI,arguments);
}};
$Widgets.Attributes={_cache:null,factory:function(){
if(!this._cache){
this._cache=[];
}
if(this._cache.length>0){
var _b6c=this._cache.pop();
_b6c.reset.apply(_b6c,arguments);
return _b6c;
}else{
var _b6c=new this();
_b6c.initialize.apply(_b6c,arguments);
_b6c.container.__widget__=_b6c;
return _b6c;
}
},destroy:function(_b6d){
if(!this._cache){
this._cache=[];
}
this._cache.push(_b6d);
}};
function $C(_b6e){
return _b6e.container;
}
function $W(_b6f){
if(_b6f.__widget__){
return _b6f.__widget__;
}else{
if(_b6f.container){
return _b6f;
}else{
if(_b6f.constructor==Array){
var _b70=[];
for(var i=0;i<_b6f.length;i++){
_b70.push($W(_b6f[i]));
}
return _b70;
}else{
return null;
}
}
}
}
}
if($Bootstrap.notLoaded("e5abc2544e72eb2449411e6cb25871d6")){
$AnalyticsBootstrap=Webmail.AnalyticsBootstrap={initialize:function(){
if(this._shouldLogCurrentSession()){
this._require();
}
},_require:function(){
new $Loader(["js/analytics","js/analytics_list"]);
},_shouldLogCurrentSession:function(){
if(Webmail.isDev()){
return true;
}
if(CFG_ANALYTICS_SAMPLE_RATIO>0){
var _b72=1/CFG_ANALYTICS_SAMPLE_RATIO;
var r=Math.floor((Math.random()*_b72)+1);
if(r==1){
return true;
}
}
return false;
}};
$AN=function(_b74){
if(!$Bootstrap.isAppWindow()){
var _b75=$Bootstrap.getAppWindow();
if(_b75){
_b75.$AN(_b74);
}
}
};
$Analytics={add:function(_b76,_b77){
if(!$Bootstrap.isAppWindow()){
var _b78=$Bootstrap.getAppWindow().$Analytics;
if(_b78){
_b78.add(_b76,_b77);
}
}
}};
}
if($Bootstrap.notLoaded("4502fc2726a60cc713475ead23760067")){
$Contacts=Framework.create("Webmail.Contacts",new function(){
try{
this.INIT_SORTING_COLUMN=$Preload["Contacts.INIT_SORTING_COLUMN"];
this.MAX_GROUP_MEMBERS=$Preload["Contacts.MAX_GROUP_MEMBERS"];
}
catch(e){
this.INIT_SORTING_COLUMN=null;
this.MAX_GROUP_MEMBERS=250;
}
this.currentMode=null;
this.addGroup=function(_b79,_b7a,ids){
Webmail.Data.request("Contacts.addGroup",{callback:function(_b7c){
_b79(_b7c);
}.bind(this)},_b7a,ids);
Webmail.Contacts.AutoComplete.addEntry(_b7a);
};
this.addIndividual=function(_b7d,_b7e,_b7f){
Webmail.Data.request("Contacts.addIndividual",{callback:function(_b80){
if(!_b80.exception){
$Dispatcher.publish("Contacts.addContact",_b80,_b7e.standard);
$Dispatcher.publish("Contacts.addFreqContacts",_b7e,_b80);
}
if(_b7d){
_b7d(_b80);
}
}.bind(this),form_group:_b7f},_b7e);
};
this.decode=function(_b81){
if(_b81==null){
_b81="";
}else{
if(typeof _b81=="string"){
_b81=_b81.replace(/\r/g,"");
_b81=_b81.trim();
}else{
if(typeof _b81=="array"){
for(var i=0,ii=_b81.length;i<ii;i++){
_b81[i]=this.decode(_b81[i]);
}
}else{
if(typeof _b81=="object"){
for(var key in _b81){
if(typeof _b81[key]=="string"){
_b81[key]=this.decode(_b81[key]);
}else{
if(typeof _b81[key]=="array"){
_b81[key]=this.decode(_b81[key]);
}else{
if(typeof _b81[key]=="object"){
_b81[key]=this.decode(_b81[key]);
}
}
}
}
}
}
}
}
return _b81;
};
this.encode=function(_b84){
if(typeof _b84=="string"){
_b84=_b84.trim().urlEncode();
}else{
if(typeof _b84=="array"){
for(var i=0,ii=_b84.length;i<ii;i++){
_b84[i]=this.encode(_b84[i]);
}
}else{
if(typeof _b84=="object"){
for(var key in _b84){
if(typeof _b84[key]=="string"){
_b84[key]=this.encode(_b84[key]);
}else{
if(typeof _b84[key]=="array"){
_b84[key]=this.encode(_b84[key]);
}else{
if(typeof _b84[key]=="object"){
_b84[key]=this.encode(_b84[key]);
}
}
}
}
}
}
}
return _b84;
};
this.exists=function(_b87,id){
$Data.request("Contacts.exists",{callback:_b87,request_type:CFG_AJAX_READ},id);
};
this.existsByEmail=function(_b89,_b8a){
$Data.request("Contacts.existsByEmail",{callback:_b89,request_type:CFG_AJAX_READ},_b8a);
};
this.get=function(_b8b,id){
$Data.request("Contacts.get",{callback:_b8b,request_type:CFG_AJAX_READ},id);
};
this.getAddressDisplay=function(_b8d,name){
if(!_b8d){
return "";
}
var name=name||"";
name=name.replace(/"/g,"").escapeHTML();
_b8d=_b8d.escapeHTML();
var _b8f="<span title=\""+_b8d+"\">"+_b8d+"</span>";
if(name.trim()!=""){
_b8f="<span title=\""+_b8d+"\">"+name+"</span>";
}
return _b8f;
};
this.getCurrentMode=function(){
return this.currentMode;
};
this.getDefaultMode=function(){
return wm_Contacts_MY_CONTACTS_MODE;
};
this.getModeName=function(mode){
var name="no name";
if(mode==wm_Contacts_MY_CONTACTS_MODE){
name=L("Contacts.General.MyContacts");
}else{
if(mode==wm_Contacts_COMPANY_DIRECTORY_MODE){
name=L("Contacts.General.CompanyDirectory");
}
}
return name;
};
this.getRange=function(_b92,type,_b94,_b95,_b96,_b97,_b98){
Webmail.Data.request("Contacts.getRange",{callback:function(_b99){
_b92(this.decode(_b99));
}.bind(this)},type,_b94,_b95,_b96,_b97,_b98);
};
this.getUploadedContact=function(_b9a,_b9b){
Webmail.Data.request("Contacts.getUploadedContact",{callback:function(_b9c){
_b9a(_b9c);
}.bind(this)},_b9b);
};
this.isActive=function(){
return ($Controller.getCurrentModule()=="Contacts");
};
this.normalizeContactStr=function(val){
var _b9e=-1;
var _b9f=-1;
_b9e=val.indexOf("\"");
if(_b9e>=0){
var _ba0=val.substr(_b9e+1,val.length);
var _b9f=_ba0.indexOf("\"");
if(_b9f>=0){
_ba0=_ba0.substring(0,_b9f);
var _ba1=_ba0.urlencode().replace("\"","&quot;");
val=val.replace("\""+_ba0+"\"","&quot;"+_ba1+"&quot;");
val=$Contacts.normalizeContactStr(val);
}
}
return val.replace(/&quot;/g,"\"");
};
this.remove=function(_ba2,ids){
Webmail.Data.request("Contacts.remove",{callback:function(_ba4){
if(!_ba4.exception){
$Dispatcher.publish("Contacts.deleteContacts",ids);
$Dispatcher.publish("Contacts.removeFreqContacts",ids);
}
_ba2(_ba4);
}.bind(this)},ids);
};
this.saveUploadedContacts=function(_ba5,_ba6){
Webmail.Data.request("Contacts.saveUploadedContacts",{callback:function(_ba7){
_ba5(_ba7);
}.bind(this)},_ba6);
};
this.showContacts=function(mode){
this.currentMode=mode;
$$Contacts.setLiveGridMode(this.currentMode);
};
this.updateGroup=function(_ba9,id,_bab,ids){
Webmail.Data.request("Contacts.updateGroup",{callback:function(_bad){
_ba9(_bad);
}.bind(this)},id,_bab,ids);
Webmail.Contacts.AutoComplete.removeEntry(id);
Webmail.Contacts.AutoComplete.addEntry(id,_bab);
};
this.updateIndividual=function(_bae,data,_bb0){
Webmail.Data.request("Contacts.updateIndividual",{callback:function(_bb1){
if(!_bb1.exception){
var id=data.standard.id;
$Dispatcher.publish("Contacts.updateContact",id,data.standard);
$Dispatcher.publish("Contacts.addFreqContacts",data,_bb1);
}
if(_bae){
_bae(_bb1);
}
}.bind(this),form_group:_bb0},data);
};
this.updateProfile=function(_bb3,data,_bb5){
Webmail.Data.request("Contacts.updateProfile",{callback:function(_bb6){
if(!_bb6.exception){
var id=data.standard.id=data.standard.id.urldecode();
$Dispatcher.publish("Contacts.updateProfile",id,data.standard);
}
if(_bb3){
_bb3(_bb6);
}
}.bind(this),form_group:_bb5},this.encode(data));
};
this.uploadContacts=function(_bb8,_bb9){
Webmail.Data.request("Contacts.uploadContacts",{callback:function(_bba){
_bb8(_bba);
}.bind(this),form_group:_bb9});
};
this.cbSubAddFreqContacts=function(data,_bbc){
var _bbd=$Cache.getValue("freq_contacts");
if(_bbd==null){
return;
}
var _bbe=data.standard.favorite;
var _bbf=false;
if(data.id){
var _bc0=false;
for(var i=0,ii=_bbd.length;i<ii;i++){
if(_bbd[i].id==data.id){
if(!_bbe){
_bbf=true;
}
_bc0=true;
break;
}
}
if(!_bc0&&_bbe){
_bbf=true;
}
}else{
if(_bbe){
_bbf=true;
}
}
if(_bbf){
$Cache.resetValue("freq_contacts");
}
};
this.cbSubRemoveFreqContacts=function(ids){
var _bc3=$Cache.getValue("freq_contacts");
if(_bc3==null){
return;
}
var _bc4=false;
for(var i=0,ii=_bc3.length;i<ii;i++){
for(var j=0,jj=ids.length;j<jj;j++){
if(_bc3[i].id==ids[j]){
_bc4=true;
break;
}
}
}
if(_bc4){
$Cache.resetValue("freq_contacts");
}
};
$Dispatcher.subscribe("Contacts.addFreqContacts",this.cbSubAddFreqContacts.bind(this));
$Dispatcher.subscribe("Contacts.removeFreqContacts",this.cbSubRemoveFreqContacts.bind(this));
});
}
if($Bootstrap.notLoaded("dd9e1cdfb403e7ea8c457ae1e3de8e74")){
Framework.register("Webmail.Contacts");
Webmail.Contacts.AutoComplete={_contacts_data:{},_contacts_data_size:0,_delay_timer:null,_frequency:0.05,_search_cache:{},_search_cache_keys:[],_use_backend:false,_frequency_min:0,_total_frequency:null,addEntry:function(id,name,_bc9,fav,freq){
name=name||"";
_bc9=_bc9||"";
var _bcc=name.toLowerCase()+" "+_bc9.toLowerCase();
if(!this._contacts_data[id]){
this._contacts_data[id]={frequency:parseInt(freq,10),favorite:fav,name:name,email:_bc9,search_index:_bcc,search_strings:[]};
}
this._contacts_data_size++;
},getAllEntries:function(){
return this._contacts_data;
},getEntry:function(id){
return this._contacts_data[id];
},getFilteredResults:function(_bce,_bcf,_bd0){
if(window!=$Bootstrap.getAppWindow()){
return $Bootstrap.getAppWindow().$Contacts.AutoComplete.getFilteredResults(_bce,_bcf,_bd0);
}
if(this._delay_timer){
clearTimeout(this._delay_timer);
}
_bce=_bce.toLowerCase().trim();
if(this._use_backend){
if(this.isCached(_bce)){
this._delay_timer=setTimeout(function(){
_bd0(this._filterContactsList(_bce,_bcf));
}.bind(this),this._frequency*1000);
}else{
this._delay_timer=setTimeout(function(){
$Data.request("Contacts.searchAutocomplete",{callback:function(_bd1){
if(_bd1.length!=0){
this._updateCache(_bd1,_bce);
_bd0(this._filterContactsList(_bce,_bcf));
}
}.bind(this),background:true},_bce);
}.bind(this),CFG_CONTACTS_LARGE_DELAY*1000);
}
}else{
this._delay_timer=setTimeout(function(){
_bd0(this._filterContactsList(_bce,_bcf));
}.bind(this),this._frequency*1000);
}
},initialize:function(){
Object.bindCallbacks(this);
$Dispatcher.subscribe("Contacts.addContact",this.cbSubContactsAddContact);
$Dispatcher.subscribe("Contacts.deleteContacts",this.cbSubContactsDeleteContacts);
$Dispatcher.subscribe("Contacts.updateContact",this.cbSubContactsUpdateContact);
$Dispatcher.subscribe("Contacts.updateProfile",this.cbSubContactsUpdateProfile);
$Dispatcher.subscribe("Contacts.importComplete",this.cbSubContactsImportComplete);
$Dispatcher.subscribe("Compose.sent",this.cbSubComposeSent);
},isCached:function(_bd2){
var _bd3=true;
if(!this._findCachedContactsByKey(_bd2)){
_bd3=false;
}
return _bd3;
},isVirtualEnabled:function(){
if($Prefs.getUserPref("autocomplete_recent",1)){
return true;
}else{
return false;
}
},loadCache:function(){
this._getAutoCompleteData(function(_bd4){
if(!_bd4.exception){
var _bd5=[];
if(_bd4.use_backend!==undefined){
this._use_backend=_bd4.use_backend;
}else{
_bd5=_bd4;
}
if(_bd4.use_backend){
this._updateFrequencyTotal(_bd4.freq_total);
}
if(_bd5.length>0){
this._updateFrequencyTotal(parseInt(_bd5[0].freq,10));
for(var x=1;x<_bd5.length;x++){
this.addEntry(_bd5[x].id,_bd5[x].name,_bd5[x].email,_bd5[x].fav,_bd5[x].freq);
}
}
}
}.bind(this));
},reloadCache:function(){
this._clearCache();
this.loadCache();
},removeEntry:function(id){
try{
delete this._contacts_data[id];
this._contacts_data_size--;
}
catch(e){
}
},_clearCache:function(){
try{
delete this._contacts_data;
delete this._search_cache;
delete this._search_cache_keys;
}
catch(e){
}
this._contacts_data={};
this._search_cache={};
this._search_cache_keys=[];
},_createSortPrefix:function(data,_bd9){
var _bda=data.search_index;
var _bdb="";
var _bdc="";
if(data.favorite==1){
_bdb=wm_Contacts_Autocomplete_SORT_FAVORITE+"";
}else{
_bdb=wm_Contacts_Autocomplete_SORT_NOTFAVORITE+"";
}
var _bdd=_bda.substr(_bd9-1,1);
if(_bd9==0){
_bdc+=wm_Contacts_Autocomplete_FOUND_FIRSTNAME;
}else{
if(_bdd==" "){
_bdc+=wm_Contacts_Autocomplete_FOUND_LASTNAME;
}else{
if(_bdd=="|"){
_bdc+=wm_Contacts_Autocomplete_FOUND_EMAILNAME;
}else{
if(_bdd=="@"){
_bdc+=wm_Contacts_Autocomplete_FOUND_DOMAIN;
}else{
_bdb=wm_Contacts_Autocomplete_SORT_NOTFAVORITE+"";
_bdc+=wm_Contacts_Autocomplete_FOUND_INSTR;
}
}
}
}
return _bdb+_bdc;
},_filterContactsList:function(_bde,_bdf){
if(!this._use_backend){
var _be0=this._contacts_data;
}else{
var _be0=this._findCachedContactsByKey(_bde);
}
var _be1=[];
for(var curr in _be0){
var _be3=this._contacts_data[curr];
if(!this.isVirtualEnabled()&&curr.substr(0,2)=="__"){
var _be4=-1;
}else{
var _be5=_be3.search_index;
if(_bde){
var _be4=_be5.indexOf(_bde);
}else{
var _be4=true;
}
}
if(_be4!==-1){
var _be6=this._createSortPrefix(_be3,_be4);
_be1.push({name:_be3.name,email:_be3.email,frequency:_be3.frequency,sortstr:_be6+"_"+_be5});
}
}
var _be7=this._frequency_min;
_be1=_be1.sort(function(a,b){
var _bea=(a.frequency>=_be7);
var _beb=(b.frequency>=_be7);
if(_bea&&!_beb){
return -1;
}else{
if(_beb&&!_bea){
return 1;
}
}
if(a.sortstr<b.sortstr){
return -1;
}else{
if(b.sortstr<a.sortstr){
return 1;
}else{
return 0;
}
}
});
var _bec=[];
for(var i=0,ii=Math.min(_bdf,_be1.length);i<ii;i++){
_bec.push(_be1[i]);
}
return _bec;
},_findCachedContactsByKey:function(_bee){
var _bef=false;
if(!this._search_cache[_bee]){
for(var key in this._search_cache){
if(_bee.substr(0,key.length)==key){
_bef=this._search_cache[key];
break;
}
}
}else{
_bef=this._search_cache[_bee];
}
return _bef;
},_getAutoCompleteData:function(_bf1){
$Data.request("Contacts.getAutoCompleteData",{callback:function(_bf2){
_bf1(_bf2);
}.bind(this),background:true,handle_conn_err:false});
},_updateCache:function(_bf3,_bf4){
if(!this._search_cache[_bf4]){
this._search_cache[_bf4]={};
this._search_cache_keys.push(_bf4);
for(var c_id in _bf3){
var _bf6=_bf3[c_id];
if(!this._contacts_data[_bf6.id]){
this.addEntry(_bf6.id,_bf6.name,_bf6.email,_bf6.fav,_bf6.freq);
}
this._contacts_data[_bf6.id].search_strings.push(_bf4);
this._search_cache[_bf4][_bf6.id]=this._contacts_data[_bf6.id];
}
}
while(this._contacts_data_size>30000){
var _bf7=this._search_cache_keys.shift();
var _bf8=this._search_cache[_bf7];
for(var id in _bf8){
for(var x=0;x<_bf8[id].search_strings.length;x++){
if(_bf8[id].search_strings[x]==_bf7){
_bf8[id].search_strings.splice(x,1);
break;
}
}
if(_bf8[id].search_strings.length==0){
this.removeEntry(id);
}
}
try{
delete this._search_cache[_bf7];
}
catch(e){
}
}
},_updateFrequencies:function(_bfb){
var _bfc=this._total_frequency;
var _bfd=0;
for(var e in _bfb){
_bfd++;
}
var _bff={};
if(_bfd>0){
for(var i in this._contacts_data){
var _c01=this._contacts_data[i];
var _c02=this._contacts_data[i].email;
if(typeof (_bfb[_c02])!=="undefined"){
var _c03=_c01.frequency;
var _c04=_bfb[_c02].frequency;
if(i.substr(0,2)=="__"){
var name=_bfb[_c02].name||_c01.name;
this.removeEntry(i);
this.addEntry(i,_bfb[_c02].name,_c02,_c01.favorite,_c04);
}else{
this._contacts_data[i].frequency=_c04;
}
_bfc=_bfc-_c03+_c04;
_bff[_c02]=true;
}
}
for(var _c02 in _bfb){
if(!_bff[_c02]){
if(this._use_backend){
this._clearCache();
return;
}
var _c06=_bfb[_c02];
this.addEntry("__"+_c02,_c06.name,_c02,0,_c06.frequency);
}
}
}
this._updateFrequencyTotal(_bfc);
},_updateFrequencyTotal:function(_c07){
this._total_frequency=_c07;
this._frequency_min=_c07*wm_Contacts_Recent_SIGNIF_FACTOR;
},cbSubComposeSent:null,_cbSubComposeSent:function(_c08){
if(window!=$Bootstrap.getAppWindow()){
return;
}
if(_c08.exception){
return;
}
var _c09=[];
for(var i=0,ii=_c08.length;i<ii;i++){
_c09.push({email:_c08[i].email,name:_c08[i].name});
}
$Data.request("Contacts.updateRecentContacts",{callback:function(_c0b){
if(_c0b.exception){
return;
}
this._updateFrequencies(_c0b);
}.bind(this),handle_conn_err:false,background:true},_c09);
},cbSubContactsAddContact:null,_cbSubContactsAddContact:function(){
this.reloadCache();
},cbSubContactsDeleteContacts:null,_cbSubContactsDeleteContacts:function(){
this.reloadCache();
},cbSubContactsImportComplete:null,_cbSubContactsImportComplete:function(){
this.reloadCache();
},cbSubContactsUpdateContact:null,_cbSubContactsUpdateContact:function(){
this.reloadCache();
},cbSubContactsUpdateProfile:null,_cbSubContactsUpdateProfile:function(){
this.reloadCache();
}};
Webmail.Contacts.AutoComplete.initialize();
}
if($Bootstrap.notLoaded("71ea77509f152d082d9afd7ec9e9d687")){
Framework.register("Webmail.Contacts");
Webmail.Contacts.Init={_available_modes:[],_curr_mode:null,_constants:[],initialize:function(){
this._constants=$Preload["Contacts.constants"].split(",");
var _c0c={};
_c0c[wm_Contacts_MY_CONTACTS_MODE]=L("Contacts.General.MyContacts");
if($Preload["Contacts.COMPANY_DIRECTORY_AVAILABLE"]){
_c0c[wm_Contacts_COMPANY_DIRECTORY_MODE]=L("Contacts.General.CompanyDirectory");
}
for(var mode in _c0c){
this._available_modes.push({mode:mode,mode_name:_c0c[mode]});
}
if(this.hasMode(wm_Contacts_COMPANY_DIRECTORY_MODE)==false){
$$MainMenu.hideMenuItem("contacts","company_directory");
}
$Contacts.AutoComplete.loadCache();
},getAvailableModes:function(){
return this._available_modes;
},hasMode:function(mode){
var _c0f=this.getAvailableModes();
for(var i=0,ii=_c0f.length;i<ii;i++){
if(_c0f[i].mode==mode){
return true;
}
}
return false;
}};
}
if($Bootstrap.notLoaded("481bf97362adf61c255b6844e8e4e40c")){
Framework.register("Webmail.Widgets");
$Widgets.ContextMenu=$Widgets.create({_data:null,_element:null,_menu:null,_menu_items:null,_show_menu:null,hide:function(){
this._menu.hide();
},initialize:function(elem,_c12){
Object.bindObservers(this);
Object.bindCallbacks(this);
this.options=_c12||{};
this.container={};
this._elem=elem;
Event.observe(this._elem,"contextmenu",this.evRightClick);
this._show_menu=true;
},evRightClick:null,_evRightClick:function(e){
if(Keystroke.shift()){
return;
}
if((wack.Browser.is_safari&&wack.Browser.is_mac)&&e.button==2){
return;
}
var elem=this._findClickedElement(e);
if(!elem){
return;
}
if(this._show_menu){
this._data=this._getData(elem);
if(!this._data){
return;
}
if(!this._menu){
this._menu_items=this._getMenuItems();
this._menu=$Widgets.Menu.factory(this._menu_items,{onclick:this.hide.bind(this)});
}
var _c15=$C(this._menu);
document.body.appendChild(_c15);
this._menu.show(this._menu_items);
var _c16=wack.Browser.getDimensions();
var _c17=Element.getDimensions(_c15.dom("content"));
var _c18=Event.pointerY(e);
var _c19=Event.pointerX(e);
var left=_c19;
var top=_c18;
if((_c19+_c17.width+10)>=_c16[1]){
left=_c19-_c17.width;
}
if((_c18+_c17.height+10)>=_c16[0]){
top=_c18-_c17.height;
}
_c15.style.position="absolute";
_c15.style.top=top+"px";
_c15.style.left=left+"px";
$Dispatcher.publish("Core.RightClick",this);
}
Event.stop(e);
this._show_menu=true;
}});
$Widgets.ContextMenu=wack.extend($Widgets.ContextMenu,{_inited:false,_active:null,cbSubRightClick:null,_cbSubRightClick:function(_c1c){
if(this._active!=_c1c){
this.evDocumentClick();
}
this._active=_c1c;
if(this._inited==true){
return;
}
this._inited=true;
Event.observe(document,"click",this.evDocumentClick);
},evDocumentClick:null,_evDocumentClick:function(e){
if(!this._active){
return;
}
this._active.hide();
this._active=null;
}});
Object.bindObservers($Widgets.ContextMenu);
Object.bindCallbacks($Widgets.ContextMenu);
$Dispatcher.subscribe("Core.RightClick",$Widgets.ContextMenu.cbSubRightClick);
}
if($Bootstrap.notLoaded("50587e8fc33b251e9a12c3269edb345a")){
Framework.register("Webmail");
$FolderList=Webmail.FolderList=new function(){
this.cache={folders:$Preload["FolderList.folders"],inbox:$Preload["FolderList.cache.inbox"]};
this._processed_regular=false;
this._pending_changes={};
this.addSetting=function(_c1e,_c1f,_c20){
if(this.cache.folders){
for(var i=0,ii=this.cache.folders.length;i<ii;i++){
if(this.cache.folders[i].raw==_c1e){
this.cache.folders[i][_c1f]=_c20;
return true;
}
}
}
return false;
};
this.changeFolderStatus=function(_c22,_c23,_c24){
for(var i=0,ii=this.cache.folders.length;i<ii;i++){
if(this.cache.folders[i].raw==_c22){
var _c26=this.cache.folders[i].total||0;
var _c27=this.cache.folders[i].unread||0;
var _c28=_c26+_c23;
var _c29=_c27+_c24;
if(_c28<0){
_c28=0;
}
if(_c29<0){
_c29=0;
}
this.cache.folders[i].total=_c28;
this.cache.folders[i].unread=_c29;
if(_c22==CFG_FOLDER_INBOX){
Webmail.updateTitlebar();
}
$$FolderManager.SubMenu.setFolderCounts(_c22,_c28,_c29);
$$FolderManager.setFolderCounts(_c22,_c28,_c29);
return;
}
}
};
this.compareUnread=function(_c2a,_c2b){
var f1=parseInt(_c2a.unread);
var f2=parseInt(_c2b.unread);
if(f1<f2){
return 1;
}else{
if(f1>f2){
return -1;
}else{
if(_c2a.path<_c2b.path){
return -1;
}else{
if(_c2a.path>_c2b.path){
return 1;
}else{
return 0;
}
}
}
}
};
this.createFolder=function(_c2e,_c2f,_c30){
$UI.showStatus(L("Folders.St.Create"));
_c2e=String(_c2e);
_c2f=String(_c2f);
var _c31;
$Data.doBatch(function(){
$Data.request("FolderList.createFolder",{callback:function(_c32){
_c31=_c32;
}},_c2e,_c2f);
$FolderList.updateFolders();
},{callback:function(_c33){
if(!_c31.exception){
$FolderList.setFolderStatus(_c31,0,0);
}
if(_c30){
_c30(_c31);
}
$UI.clearStatus();
}});
};
this.deleteFolders=function(_c34,_c35){
if(_c34.length>0){
var _c36;
$UI.showStatus(L("Folders.St.Delete"));
$Data.doBatch(function(){
$Data.request("FolderList.deleteFolders",{callback:function(_c37){
_c36=_c37;
}},_c34);
$FolderList.updateFolders();
},{callback:function(_c38){
$UI.clearStatus();
if(_c35&&_c36){
_c35(_c36);
}
}});
}
};
this.getAllUnread=function(_c39){
var _c3a=0;
var _c3b=this.cache.folders;
var _c3c=false;
for(var i=0,ii=_c3b.length;i<ii;i++){
if(_c39){
if($FolderList.isSpam(_c3b[i].raw)||$FolderList.isTrash(_c3b[i].raw)){
_c3c=true;
}
}
if(!_c3c){
_c3a+=_c3b[i].unread||0;
}
_c3c=false;
}
return _c3a;
};
this.getFolders=function(){
var me=$Bootstrap.getAppWindow().$FolderList;
if(me._processed_regular){
var _c3f=me.cache.folders;
}else{
var _c3f=me._processFolders(me.cache.folders);
me._processed_regular=true;
}
return _c3f.slice(0);
};
this.getIndentLevel=function(_c40){
var _c41=_c40;
_c40=_c40.replace(CFG_FOLDER_PREFIX,"");
var _c42=_c40.split(".");
var _c43=_c42.length-1;
if(_c43<0){
_c43=0;
}
return _c43;
};
this.getName=function(_c44){
if(typeof _c44=="undefined"){
return false;
}
for(var i=0,ii=this.cache.folders.length;i<ii;i++){
if(this.cache.folders[i].raw==_c44){
var name=this.cache.folders[i].name;
if(typeof name!="undefined"){
return name;
}
}
}
switch(_c44){
case CFG_FOLDER_INBOX:
return L("Folders.N.Inbox");
break;
case CFG_FOLDER_DRAFTS:
return L("Folders.N.Drafts");
break;
case CFG_FOLDER_SENT:
return L("Folders.N.Sent");
break;
case CFG_FOLDER_SPAM:
return L("Folders.N.Spam");
break;
case CFG_FOLDER_TRASH:
return L("Folders.N.Trash");
break;
default:
var _c47=_c44.split(".").pop();
return _c47;
break;
}
};
this.getUnreadMessages=function(_c48){
return this.getNewMessages(_c48);
};
this.getNewMessages=function(_c49){
_c49=_c49.raw||_c49;
if(this.cache.folders){
for(var i=0,ii=this.cache.folders.length;i<ii;i++){
if(this.cache.folders[i].raw==_c49){
var _c4b=this.cache.folders[i].unread;
if(typeof _c4b!="undefined"){
return _c4b;
}
}
}
}
if(_c49==CFG_FOLDER_INBOX&&this.cache.inbox){
return this.cache.inbox.unread;
}
return null;
};
this.getFolderChildren=function(_c4c){
_c4c+=".";
var _c4d=new Array();
for(var i=0;i<this.cache.folders.length;i++){
var _c4f=this.cache.folders[i].raw;
if(_c4f.indexOf(_c4c)!=-1){
_c4d.push(_c4f);
}
}
return _c4d;
};
this.getDropdownOptions=function(opts){
var _c51=Object.extend({include_special:false,indent_char:"&nbsp;",tab_width:2,ret_array:false},opts||{});
var _c52=(_c51.ret_array?[]:"");
var _c53=this.getFolders();
var i=0;
for(i,ii=_c53.length;i<ii;i++){
if(!_c51.include_special&&this.isPermanentFolder(_c53[i].raw)){
continue;
}
var _c55=$FolderList.getIndentLevel(_c53[i].raw);
var _c56=String.repeat(_c51.indent_char,_c55*_c51.tab_width);
var _c57=_c56+_c53[i].name.replace("&","&amp;");
_c57=_c57.replace(/>/g,"&gt;");
_c57=_c57.replace(/</g,"&lt;");
if(_c51.ret_array){
var _c58={"text":_c57,"path":_c53[i].raw};
_c52.push(_c58);
}else{
_c52+="<option value=\""+_c53[i].raw+"\">"+_c57+"</option>";
}
}
return _c52;
};
this.getFolderSize=function(_c59){
var _c5a=this.cache.folder_sizes;
if(defined(_c5a)&&defined(_c5a[_c59])){
return _c5a[_c59];
}else{
return false;
}
};
this.getParent=function(_c5b){
var _c5c=_c5b.lastIndexOf(".");
if(_c5c==-1){
return "";
}
var _c5d=_c5b.substring(0,_c5c);
return _c5d;
};
this.getPrefetchFolderArray=function(){
var _c5e=this.getFolders();
_c5e.quicksort(this.compareUnread);
var _c5f=[];
var _c60=0;
for(var i=0;_c60<=CFG_FOLDER_PREFETCH_LIMIT&&i<_c5e.length;i++){
if(_c5e[i].unread<CFG_FOLDER_PREFETCH_UNREAD_LIMIT){
_c5f.push(_c5e[i].raw);
if(_c5e[i].total>0){
_c60++;
}
}
}
return _c5f;
};
this.getSetting=function(_c62,_c63,_c64){
if(this.cache.folders){
for(var i=0,ii=this.cache.folders.length;i<ii;i++){
if(this.cache.folders[i].raw==_c62){
return this.cache.folders[i][_c63];
}
}
}
return _c64||false;
};
this.getTotalMessages=function(_c66){
_c66=_c66.raw||_c66;
if(this.cache.folders){
for(var i=0,ii=this.cache.folders.length;i<ii;i++){
if(this.cache.folders[i].raw==_c66){
var _c68=this.cache.folders[i].total;
if(typeof _c68!="undefined"){
return _c68;
}
}
}
}
if(_c66==CFG_FOLDER_INBOX&&this.cache.inbox){
return this.cache.inbox.total;
}
return null;
};
this.isInbox=function(_c69){
return (_c69==CFG_FOLDER_INBOX);
};
this.isDraft=function(_c6a){
var _c6b=CFG_FOLDER_DRAFTS;
if(_c6a==_c6b||this.isWithin(_c6a,_c6b)){
return true;
}else{
return false;
}
};
this.isSent=function(_c6c){
return (this.isWithin(_c6c,CFG_FOLDER_SENT));
};
this.isSpam=function(_c6d){
return (this.isWithin(_c6d,CFG_FOLDER_SPAM));
};
this.isPermanentFolder=function(_c6e){
var perm=[CFG_FOLDER_DRAFTS,CFG_FOLDER_SENT,CFG_FOLDER_SPAM,CFG_FOLDER_TRASH];
if(_c6e==CFG_FOLDER_INBOX){
return true;
}else{
for(var i=0,ii=perm.length;i<ii;i++){
if(_c6e==perm[i]){
return true;
}
}
}
return false;
};
this.isTrash=function(_c71){
return (this.isWithin(_c71,CFG_FOLDER_TRASH));
};
this.isWithin=function(_c72,_c73){
if(_c72&&_c72.substr(0,_c73.length+1)==_c73+"."){
return true;
}else{
if(_c72&&_c72==_c73){
return true;
}else{
if(_c73=="folders_main"&&_c72.substring(0,CFG_FOLDER_INBOX.length)==CFG_FOLDER_INBOX){
return true;
}
return false;
}
}
};
this.moveFolders=function(_c74,dest,_c76){
if(_c74.length>0){
var _c77=$$FolderManager._getNewFolderNames(_c74,dest);
var _c78;
$UI.showStatus(L("Folders.St.Move"));
$Data.doBatch(function(){
$Data.request("FolderList.moveFolders",{callback:function(_c79){
_c78=_c79;
}},_c74,dest);
$FolderList.updateFolders();
},{callback:function(_c7a){
$UI.clearStatus();
if(_c76){
if(!_c7a.exception){
for(var i=0;i<_c77.length;i++){
$FolderList.setFolderStatus(_c77[i].name,_c77[i].total,_c77[i].unread);
}
}
_c76(_c78);
}
}});
}
};
this.purgeFolder=function(_c7c){
var _c7d=!$Settings.isPurgePermanent();
$UI.showStatus(L("Folder.St.Purge"));
$Data.request("FolderList.purgeFolder",{callback:function(_c7e){
if(!_c7e.exception){
if(_c7d&&_c7c!=CFG_FOLDER_TRASH&&_c7c!=CFG_FOLDER_SPAM){
var _c7f=$FolderList.getTotalMessages(_c7c);
var _c80=$FolderList.getUnreadMessages(_c7c);
$FolderList.changeFolderStatus(CFG_FOLDER_TRASH,_c7f,_c80);
}
$FolderList.setFolderStatus(_c7c,0,0);
$Dispatcher.purgeFolder(_c7c);
}
$UI.clearStatus();
}},_c7c);
};
this.renameFolder=function(_c81,_c82,_c83){
var _c84=$FolderList.getTotalMessages(_c81);
var _c85=$FolderList.getUnreadMessages(_c81);
var _c86=$FolderList.getFolderChildren(_c81);
_c86.push(_c81);
var _c87=new Array();
for(var i=0;i<_c86.length;i++){
_c87.push({name:_c86[i],total:$FolderList.getTotalMessages(_c86[i]),unread:$FolderList.getUnreadMessages(_c86[i])});
}
var _c89;
$UI.showStatus(L("Folders.St.Rename"));
$Data.doBatch(function(){
$Data.request("FolderList.renameFolder",{callback:function(_c8a){
_c89=_c8a;
}},_c81,_c82);
$FolderList.updateFolders();
},{callback:function(_c8b){
if(_c89&&!_c89.exception){
for(var i=0;i<_c87.length;i++){
$FolderList.setFolderStatus(_c87[i].name.replace(_c81,_c89),_c87[i].total,_c87[i].unread);
}
}
if(_c83){
_c83(_c89||_c8b);
}
$UI.clearStatus();
}});
};
this.restoreFolderStatus=function(_c8d){
for(var i=0;i<_c8d.length;i++){
this.setFolderStatus(_c8d[i].name,_c8d[i].total,_c8d[i].unread);
}
};
this.sanitizeFolderName=function(_c8f){
if(!this.validateFolderName(_c8f)){
_c8f=_c8f.replace(/["\\\/\.]+/g,"_");
}
return _c8f;
};
this.saveFolderStatus=function(_c90){
var _c91=new Array();
for(var i=0;i<this.cache.folders.length;i++){
var _c93=this.cache.folders[i];
var _c94=false;
for(var j=0;j<_c90;j++){
if(this.cache.folders[i].length==_c90[j]){
_c94=true;
break;
}
}
if(!_c94){
_c91.push({name:_c93.raw,total:_c93.total,unread:_c93.unread});
}
}
return _c91;
};
this.setFolderStatus=function(_c96,_c97,_c98){
for(var i=0,ii=this.cache.folders.length;i<ii;i++){
if(this.cache.folders[i].raw==_c96){
if(this._pending_changes[_c96]){
_c97+=this._pending_changes[_c96].total;
_c98+=this._pending_changes[_c96].unread;
delete (this._pending_changes[_c96]);
}
if(_c97<0){
_c97=0;
}
if(_c98<0){
_c98=0;
}
this.cache.folders[i].total=_c97;
var _c9a=this.cache.folders[i].unread;
this.cache.folders[i].unread=_c98;
if(_c96==CFG_FOLDER_INBOX){
Webmail.updateTitlebar();
}
$$FolderManager.SubMenu.setFolderCounts(_c96,_c97,_c98);
$$FolderManager.setFolderCounts(_c96,_c97,_c98);
return;
}
}
};
this.updateFolders=function(_c9b){
var _c9c=this.saveFolderStatus(this.cache.folders["regular"]);
$Data.request("LeftMenu.getFolderList",{callback:function(_c9d){
this.cache.folders=_c9d;
this._processed_regular=false;
this.restoreFolderStatus(_c9c);
$Dispatcher.publish("Email.Folders.update");
if(_c9b){
_c9b();
}
}.bind(this),request_type:CFG_AJAX_READ});
};
this.updateSizes=function(_c9e){
var _c9f=this.getFolders();
var _ca0="folder_sizes";
if(!this.cache[_ca0]){
this.cache[_ca0]={};
}
var _ca1=[];
for(var i=0,ii=_c9f.length;i<ii;i++){
_ca1.push(String(_c9f[i].raw));
}
$UI.showStatus(L("Folders.St.Sizes"));
$Data.request("FolderList.getFolderSizes",{callback:function(_ca3){
if(!_ca3.exception){
this.cache[_ca0]=_ca3;
$Dispatcher.updateFolderSizes();
if(_c9e){
_c9e(_ca3);
}
}
$UI.clearStatus();
}.bind(this),request_type:CFG_AJAX_READ},_ca1);
};
this.validateFolderName=function(_ca4){
var _ca5=/["\/\\\.\~]+/;
if(!_ca4||_ca5.test(_ca4)){
return false;
}else{
return true;
}
};
this._processFolders=function(_ca6){
return _ca6;
};
this.cbSubStatusChange=null;
this._cbSubStatusChange=function(_ca7,_ca8,_ca9){
_ca8=_ca8||0;
_ca9=_ca9||0;
if(!this._pending_changes[_ca7]){
this._pending_changes[_ca7]={total:_ca8,unread:_ca9};
}else{
this._pending_changes[_ca7].total+=_ca8;
this._pending_changes[_ca7].unread+=_ca9;
}
this.changeFolderStatus(_ca7,_ca8,_ca9);
};
this.cbSubUpdate=null;
this._cbSubUpdate=function(_caa,_cab,_cac){
this.setFolderStatus(_caa,_cab,_cac);
};
this.cbSubMessageMove=null;
this._cbSubMessageMove=function(_cad,_cae){
var _caf={};
var _cb0=0;
var _cb1=0;
for(var i=0,ii=_cad.length;i<ii;i++){
if(!_caf[_cad[i].folder]){
_caf[_cad[i].folder]={total:0,unread:0};
}
if(_cad[i].unread){
_caf[_cad[i].folder].unread++;
_cb1++;
}
_caf[_cad[i].folder].total++;
_cb0++;
}
for(folder in _caf){
$Dispatcher.publish("Folders.status_change",folder,-_caf[folder].total,-_caf[folder].unread);
}
if(_cae){
$Dispatcher.publish("Folders.status_change",_cae,_cb0,_cb1);
}
};
this.cbSubOutboundCall=null;
this._cbSubOutboundCall=function(){
delete (this._pending_changes);
this._pending_changes={};
};
};
Object.bindCallbacks($FolderList);
$Dispatcher.subscribe("Folders.status_change",$FolderList.cbSubStatusChange);
$Dispatcher.subscribe("Folders.update",$FolderList.cbSubUpdate);
$Dispatcher.subscribe("Message.move",$FolderList.cbSubMessageMove);
$Dispatcher.subscribe("Folders.pending_call",$FolderList.cbSubOutboundCall);
}
if($Bootstrap.notLoaded("2a0496890bd8b1e84b388161ffb93767")){
Framework.register("Webmail.Widgets");
$Widgets.ContextMenu.Folders=$Widgets.create({_buildFilterData:function(){
var data=this._data;
var _cb4={criteria:[],action:{action:"move",params:{folder:this._data.raw}}};
return _cb4;
},_findClickedElement:function(e){
var _cb6=Event.findElement(e,"a");
if(!_cb6||(_cb6==document)){
return false;
}
if(_cb6.getAttribute("isfolder")=="true"){
return _cb6;
}else{
return false;
}
},_getData:function(elem){
var _cb8=elem.parentNode;
var _cb9=_cb8._folder;
return _cb9;
},_getMenuItems:function(){
var _cba=[{label:L("Folders.L.AddFolder"),callback:this.cbAddFolder},{new_section:true},{label:function(){
return L("L.Delete")+" \""+this._data.name+"\"";
}.bind(this),callback:this.cbDeleteFolder,disabled:this._isPermanent.bind(this)},{label:function(){
return L("Folders.L.Edit")+" \""+this._data.name+"\"";
}.bind(this),callback:this.cbEditFolder,disabled:this._isPermanent.bind(this)},{label:function(){
return L("Folders.Menu.Move")+" \""+this._data.name+"\"";
}.bind(this),callback:this.cbMoveFolder,disabled:this._isPermanent.bind(this)},{label:function(){
return L("Folders.L.FilterInto")+" \""+this._data.name+"\"";
}.bind(this),callback:this.cbAddFilter,disabled:this._isInbox.bind(this)},{label:function(){
return L("Folders.L.Purge")+" \""+this._data.name+"\"";
}.bind(this),callback:this.cbPurgeFolder}];
return _cba;
},_isInbox:function(){
return $FolderList.isInbox(this._data.raw);
},_isPermanent:function(){
return $FolderList.isPermanentFolder(this._data.raw);
},cbAddFilter:null,_cbAddFilter:function(){
$AN(134);
REQUIRE("combo/settings");
var data=this._buildFilterData();
var _cbc=(data?L("Settings.Filters.F.EditTitle"):L("Settings.Filters.F.AddTitle"));
var form=$Widgets.Settings.Email.FilterForm.factory({self_saving:true});
form.show(_cbc);
form.populate(data);
},cbAddFolder:null,_cbAddFolder:function(){
$AN(26);
$Widgets.load("Email.FolderForm");
var form=$Widgets.Email.FolderForm.factory();
form.populate(null,this._data.raw);
form.show();
},cbDeleteFolder:null,_cbDeleteFolder:function(){
$AN(29);
if(confirm(L("Folders.Confirm.Delete"))){
var _cbf=[this._data.raw];
var _cc0=$FolderList.getFolderChildren(this._data.raw);
for(var i=0,ii=_cc0.length;i<ii;i++){
_cbf.push(_cc0[i]);
}
$FolderList.deleteFolders(_cbf,function(_cc2){
if(_cc2.exception){
$UI.error(_cc2.message);
}
}.bind(this));
}
},cbEditFolder:null,_cbEditFolder:function(){
$AN(39);
$$FolderManager.edit.showForm(this._data);
},cbMoveFolder:null,_cbMoveFolder:function(){
$AN(34);
$Widgets.load("FolderPicker");
var _cc3=$Widgets.FolderPicker.factory({callback:this.cbMoveFolderChoose});
_cc3.show();
},cbMoveFolderChoose:null,_cbMoveFolderChoose:function(_cc4){
var _cc5=[this._data.raw];
var dest=_cc4;
$FolderList.moveFolders(_cc5,dest,function(_cc7){
if(_cc7.exception){
$UI.error(_cc7.message);
}
});
},cbPurgeFolder:null,_cbPurgeFolder:function(){
$AN(37);
var raw=this._data.raw;
if($Settings.isPurgePermanent()||raw==CFG_FOLDER_TRASH||raw==CFG_FOLDER_SPAM){
var _cc9=L("Folders.Confirm.PurgeFolderPerm");
}else{
var _cc9=L("Folders.Confirm.PurgeFolder");
}
if(confirm(_cc9)){
$FolderList.purgeFolder(raw,function(_cca){
if(_cca.exception){
$UI.error(_cca.message);
}
});
}
}},$Widgets.ContextMenu);
}
if($Bootstrap.notLoaded("b51fe8e58bd9acec0aecc3b4f016df24")){
Framework.register("Webmail");
Webmail.AbstractPrefetcher=wack.Class.create();
Webmail.AbstractPrefetcher.prototype={_options:{prefetch_buffer:null,interval_sleep_time:null},interval_timer:null,_list:null,_exclusion_list:null,_active:false,initialize:function(list,_ccc,_ccd){
this._exclusion_list=_ccc||new wack.List();
this._options=wack.extend({prefetch_buffer:1,interval_sleep_time:60},_ccd||{});
this._list=new wack.List();
var _cce;
list=list||new wack.List();
while(_cce=list.shiftTopItem()){
this.addPrefetchItem(_cce);
}
},addPrefetchItem:function(item){
if(this._list&&!this._list.contains(item)&&!this._exclusion_list.contains(item)){
this._list.add(item);
return true;
}
return false;
},start:function(){
if(this._current_timer){
window.clearInterval(this.interval_timer);
}
this._active=true;
this.prefetchNextItems();
},stop:function(){
this._active=false;
if(this.interval_timer){
window.clearInterval(this.interval_timer);
}
},completeFetch:function(_cd0){
},prefetchNextItems:function(){
if(this._active&&!this._list.isEmpty()){
var _cd1;
var _cd2=[];
while((_cd2.length<this._options.prefetch_buffer)&&(_cd1=this._list.shiftTopItem())){
_cd2.push(_cd1);
}
this.sendRequest(_cd2,this.cbProcessFetchResponse);
}
},sendRequest:function(item,_cd4){
},cbInt_resumePrefetch:null,_cbInt_resumePrefetch:function(){
if(!this._list.isEmpty()){
window.clearInterval(this._interval_timer);
this.prefetchNextItems();
}
},cbProcessFetchResponse:null,_cbProcessFetchResponse:function(_cd5){
this.completeFetch(_cd5);
if(!this._list.isEmpty()){
setTimeout(function(){
this.prefetchNextItems();
}.bind(this),CFG_FOLDER_PREFETCH_WAIT);
}else{
this._interval_timer=window.setInterval(this.cbInt_resumePrefetch,this._options.interval_sleep_time*1000);
}
}};
}
if($Bootstrap.notLoaded("db3a66e5945692459bd96d11f5327781")){
Framework.register("Webmail");
$MessageList=Webmail.MessageList=new function(){
this.is_dragging=false;
this.is_loading_folder=false;
this.msg_cache=$Preload["MessageList.msg_cache"];
this._folder_path=$Preload["MessageList.folder"];
this._total=$Preload["MessageList.total"];
this._unseen=$Preload["MessageList.unseen"];
this._start=1;
this._cache={};
this.active=function(){
if($Controller._active_module_key=="MessageList"&&!this.isSearch()){
return true;
}else{
return false;
}
};
this.checkFolder=function(_cd6){
if(this.active()&&this.folder()==_cd6){
$MessageList.refillList();
}
};
this.deleteMessages=function(_cd7,_cd8,_cd9,_cda){
var _cdb=false;
if(_cd7.folder){
_cd7=[_cd7];
_cdb=true;
}
$Data.request("Mail.deleteMessages",{callback:function(_cdc){
if(!_cdc.exception){
if(!_cda){
var _cdd=($Settings.isDeletePermanent()||_cd9?null:CFG_FOLDER_TRASH);
$Bootstrap.getAppWindow().$Dispatcher.publish("Message.move",_cd7,_cdd,_cdb);
}
if(_cd8){
_cd8(_cdc);
}
$UI.clearStatus();
}else{
if(_cdc.code==Mail_ERROR_QUOTA){
REQUIRE("combo/dialogs");
var _cde=new $DialogsPrompt(L("Mlist.E.Quota"),L("Mlist.E.Delete.Quota"),function(){
$UI.clearStatus();
});
_cde.addButton(L("L.Yes"),function(){
$MessageList.deleteMessages(_cd7,function(_cdf){
if(typeof _cdf=="object"){
_cdf.force=true;
}else{
_cdf={};
_cdf.force=true;
}
_cd8(_cdf);
},true);
}.bind(this));
_cde.show();
}else{
$UI.error(_cdc.message+" ("+_cdc.code+")",function(){
$UI.clearStatus();
});
}
}
}},_cd7,_cd9);
};
this.emptyList=function(_ce0){
if(this.folder()==_ce0){
$$MessageList.clearList();
}
};
this.flagMessages=function(_ce1,flag,_ce3){
_ce3=_ce3||Prototype.emptyFunction;
$Data.request("Mail.setFlag",{callback:function(_ce4){
var sort=$MessageList.sort();
if(sort==10||sort==11){
$MessageList.refillList();
}
_ce3(_ce4);
}},_ce1,flag);
};
this.folder=function(_ce6){
if(typeof _ce6=="undefined"){
return (this.isSearch()?this._search_path:this._folder_path);
}else{
this.isSearch()?this._search_path=_ce6:this._folder_path=_ce6;
}
};
this.forwardMessages=function(_ce7){
$Dispatcher.compose(false,wm_Compose_FWD_MULTIPLE,false,false,false,false,false,_ce7);
};
this.getMessages=function(_ce8,_ce9,_cea){
_ce9=Object.extend({background:false,prefix:null,break_cache:false,ignore_errors:false,sort:-1,start:1},_ce9||{});
if(this.isSearch()){
this.isSearch(false);
$$MessageList.clearList();
$$MessageList.showMessageList();
}
var _ceb=[];
var _cec=false;
var _ced=false;
var _cee=false;
if(this.folder()==_ce8&&this.start()==_ce9.start&&_ce9.sort=="-1"&&!_ce9.break_cache){
if(!_ce9.background){
$UI.showStatus(L("Mlist.St.GetMail"));
}
_ceb=$MessageList.getFoldersCachedUids(_ce8);
}else{
var _cee=true;
$$MessageList.last_clicked=false;
var _cef=this.getFullCache(_ce8);
var _cf0=(this.hasCache(_ce8)&&_ce9.start==1&&_ce9.sort==-1&&!_ce9.break_cache&&(_cef["sort"]==this.sort()||this.folder()!=_ce8));
if(_cf0){
$$MessageList.clearList();
if(_cef["unread"]<$FolderList.getUnreadMessages(_ce8)){
$UI.showStatus(L("Mlist.St.GetMail"));
}
var _cf1=($FolderList.isWithin(_ce8,CFG_FOLDER_SENT)||$FolderList.isWithin(_ce8,CFG_FOLDER_DRAFTS));
$$MessageList.fillList(_cef["messages"],{use_to_field:_cf1});
$$MessageList.resetScroll();
_ce9.sort=_cef["sort"];
this.total(_cef["total"]);
this.unseen($FolderList.getUnreadMessages(_ce8));
_ceb=$MessageList.getFoldersCachedUids(_ce8);
_ced=true;
}else{
if(_ce9.sort==-1){
$$MessageList.setPreviewPaneClear(true);
$$MessageList.current_message=false;
}
this.loadingFolder(true);
$UI.showStatus(L("Mlist.St.GetMail"));
_cec=true;
}
if(_cea){
_cea({folder:_ce8,msgs:_cef["messages"],show_num:_cef["show_num"],sort:_ce9.sort,start:_ce9.start,total:_cef["total"],unseen:_cef["unread"]});
}
}
this.folder(_ce8);
this.start(_ce9.start);
this.sort(_ce9.sort);
if(_ced){
$$MessageList.updateHeader();
}
if(_cee){
$$MessageList.updateDropdowns(true);
}
var _cf2=function(r){
if($Controller.getCurrentModule()!="MessageList"||$MessageList.folder()!=r["folder"]){
return;
}
if(_cec){
var uid=false;
if($MessageList.sort()!="-1"&&$$MessageList.current_message){
uid=$$MessageList.current_message.obj.getUniqueId();
}
$$MessageList.clearList(uid);
}
$MessageList.sort(r["sort"]);
$MessageList.start(r["start"]);
$MessageList.total(r["total"]);
$MessageList.unseen(r["unseen"]);
$Dispatcher.publish("Folders.update",_ce8,r["total"],r["unseen"]);
$MessageList.cbGetMessages(r["msgs"]);
if(_ce9.sort!="-1"&&$$MessageList.current_message){
$$MessageList.centerOnMessage($$MessageList.current_message,$$MessageList.dom.getListContainer());
}
$UI.clearStatus();
}.bind(this);
$Dispatcher.publish("Folders.pending_call");
$Data.request("MessageList.getMessages",{background:_ce9.background,callback:function(_cf5){
_cf2(_cf5);
if(_cea){
_cea(_cf5);
}
}.bind(this),call_groups:"MessageList.load",handle_conn_err:!_ce9.ignore_errors,request_type:CFG_AJAX_READ},_ce8,_ceb,_ce9);
};
this.prefetchFolderMessageHeaders=function(_cf6,_cf7,_cf8){
_cf8=_cf8||Prototype.emptyFunction;
_cf7=Object.extend({background:true,prefix:null,sort:-1,start:1,update:true,cluster:"prefetch"},_cf7||{});
var _cf9={};
if(_cf7.update){
_cf9=$MessageList.getFoldersCachedUids(_cf6);
}
$Data.request("MessageList.prefetchFolderMessageHeaders",{background:_cf7.background,callback:_cf8,call_groups:"MessageList.load",handle_conn_err:false,request_type:CFG_AJAX_READ,cluster:_cf7.cluster},_cf6,_cf9,_cf7);
};
this.getUniqueId=function(_cfa,uid){
var _cfc=uid+"|"+_cfa;
return _cfc;
};
this.getUniqueIdParts=function(uid){
var _cfe=uid.split("|");
var _cff={id:_cfe[0],folder:_cfe[1]};
return _cff;
};
this.isAscending=function(){
return !(this.sort()%2==0);
};
this.isSearch=function(s){
if(typeof s=="undefined"){
if(typeof this._search_status=="undefined"){
this._search_status=false;
}
return this._search_status;
}else{
this._search_status=s;
}
};
this.isUnread=function(_d01){
var _d02=this.getUniqueId(_d01.folder,_d01.id);
var _d03=$$MessageList.getCurrentList();
if(_d03[_d02]){
return !_d03[_d02].obj.read();
}else{
if(this.isCachable(_d01.folder)){
var _d04=this.getCache(_d01.folder);
if(_d04&&_d04[_d02]){
return !_d04[_d02]["seen"];
}
}
}
return null;
};
this.loadingFolder=function(_d05){
if(typeof _d05=="undefined"){
return this.is_loading_folder;
}else{
this.is_loading_folder=_d05;
}
};
this.markAsRead=function(_d06,read,_d08){
_d08=_d08||Prototype.emptyFunction;
$Data.request("Mail.setReadStatus",{callback:_d08},_d06,read);
};
this.moveMessages=function(_d09,_d0a,_d0b){
var _d0c=false;
if(_d09.folder){
_d09=[_d09];
_d0c=true;
}
var _d0a=_d0a;
$Data.request("Mail.moveMessages",{callback:function(_d0d){
if(!_d0d.exception){
if(_d0b){
_d0b(_d0d);
}
$UI.clearStatus();
$Bootstrap.getAppWindow().$Dispatcher.publish("Message.move",_d09,_d0a,_d0c);
}else{
if(_d0d.code==Mail_ERROR_QUOTA){
$UI.error(L("Mlist.E.Move.Quota"),function(){
$UI.clearStatus();
$("Search_move_dd").selectedIndex=0;
$("move_dd").selectedIndex=0;
});
}else{
$UI.error(L("E.UnknownCode",_d0d.code),function(){
$UI.clearStatus();
$("Search_move_dd").selectedIndex=0;
$("move_dd").selectedIndex=0;
});
}
}
}},_d09,_d0a);
};
this.moveToTrash=function(m){
var mln=$MessageList;
if(typeof m=="undefined"){
return ($Prefs.getUserPref("mail_delete_to_trash",1)==1?true:false);
}else{
mln._move_to_trash=$Prefs.setUserPref("mail_delete_to_trash",(m?1:0),false);
}
};
this.previewPane=function(p){
if(typeof p=="undefined"){
return $Settings.usePreviewPane();
}else{
$Prefs.setUserPref("disp_use_previewpane",(p?1:0),false);
if($("message_list")){
$$MessageList.usePreviewPane(p,true);
}
}
};
this.refillList=function(){
if(this.isSearch()){
return;
}
this.getMessages(this.folder(),{ignore_errors:true,start:this.start(),background:true});
};
this.reportNotSpam=function(_d11,_d12){
var _d13=false;
if(_d11.folder){
_d11=[_d11];
_d13=true;
}
$Data.request("Mail.reportNotSpam",{callback:function(_d14){
if(_d14.exception){
$UI.clearStatus();
$UI.error(_d14.message);
}else{
if(_d12){
_d12(_d14);
}
$UI.clearStatus();
var _d15=[];
for(var i=0,ii=_d11.length;i<ii;i++){
if(_d11[i].folder==CFG_FOLDER_SPAM||Webmail.isQuarantine()){
_d15.push(_d11[i]);
}
}
if(_d15.length>0){
$Bootstrap.getAppWindow().$Dispatcher.publish("Message.move",_d15,CFG_FOLDER_INBOX,_d13);
}
}
}.bind(this)},_d11);
};
this.reportSpam=function(_d17,_d18){
_d18=_d18||Prototype.emptyFunction;
var _d19=false;
if(_d17.folder){
_d17=[_d17];
_d19=true;
}
$Data.request("Mail.reportSpam",{callback:function(_d1a){
if(_d1a.exception){
$UI.clearStatus();
$UI.error(_d1a.message);
}else{
$UI.clearStatus();
var _d1b=[];
for(var i=0,ii=_d17.length;i<ii;i++){
if(_d17[i].folder!=CFG_FOLDER_SPAM){
_d17[i].unread=false;
_d1b.push(_d17[i]);
}
}
if(_d1b.length>0){
$Bootstrap.getAppWindow().$Dispatcher.publish("Message.move",_d1b,CFG_FOLDER_SPAM,_d19);
}
if(_d18){
_d18(_d1a);
}
}
}.bind(this)},_d17);
};
this.showNum=function(s){
if(typeof s=="undefined"){
return Number($Prefs.getUserPref("mail_per_page",50));
}else{
$Prefs.setUserPref("mail_per_page",s,false);
}
};
this.sort=function(s){
if(typeof s=="undefined"){
return $FolderSettings.getSetting(this.folder(),"sort");
}else{
$FolderSettings.changeSetting(this.folder(),"sort",s);
return s;
}
};
this.start=function(s){
if(typeof s=="undefined"){
return (this._start?this._start:0);
}else{
this._start=Number(s);
}
};
this.total=function(t){
if(typeof t=="undefined"){
return (this._total);
}else{
this._total=Number(t);
}
};
this.unseen=function(u){
if(typeof u=="undefined"){
return (this._unseen?this._unseen:0);
}else{
this._unseen=Number(u);
}
};
this.zipMessages=function(_d22,_d23){
var _d24=$("Mlist_zip_fetch")||Element.createHtml(["<iframe style=\"height:0;width:0;border:0;margin:0;\" id=\"Mlist_zip_fetch\" name=\"Mlist_zip_fetch\">","</iframe>"].join(""));
var _d25=$("Mlist_zip_form")||Element.createHtml(["<form style=\"height:0;width:0;border:0;margin:0;\" action=\"archive/fetch.php\" method=\"post\" id=\"Mlist_zip_form\" target=\"Mlist_zip_fetch\">","<input type=\"hidden\" name=\"",CFG_SESSION_NAME,"\" value=\"",Webmail.getSessionId(),"\" />","<input name=\"msg_list\" type=\"hidden\" />","</form>"].join(""));
Element.append(window.document.body,_d24,_d25);
$("Mlist_zip_form").msg_list.value=JSON.stringify(_d22);
$("Mlist_zip_form").submit();
return;
};
this.createCache=function(_d26){
this._cache[_d26]={messages:[],sort:null,total:null,unread:null};
};
this.hasCache=function(_d27){
var _d28=this.getFullCache(_d27);
if(!_d28){
return false;
}
if(_d28.messages.length==0&&_d28.sort===null&&_d28.total===null&&_d28.unread===null){
return false;
}
return true;
};
this.getCache=function(_d29){
if(this.isCachable(_d29)){
if(!this._cache[_d29]){
this.createCache(_d29);
}
return this._cache[_d29]["messages"];
}
return false;
};
this.getFoldersCachedUids=function(_d2a){
if(!this._cache[_d2a]){
return [];
}
var _d2b=[];
for(var uid in this._cache[_d2a].messages){
_d2b.push(uid);
}
return _d2b;
};
this.getFullCache=function(_d2d){
if(this.isCachable(_d2d)){
if(!this._cache[_d2d]){
this.createCache(_d2d);
}
return this._cache[_d2d];
}
return false;
};
this.removeFromCache=function(_d2e,uid){
if(this.isCachable(_d2e)){
if(this._cache[_d2e]){
var _d30=this.getUniqueId(_d2e,uid);
delete (this._cache[_d2e]["messages"][_d30]);
}
}
};
this.setCache=function(list,_d32,_d33){
if(!this._cache[_d32]){
this.createCache(_d32);
}
for(option in _d33){
if(option=="messages"){
for(msg in this._cache[_d32][option]){
delete (this._cache[_d32][option][msg]);
}
}
delete (this._cache[_d32][option]);
}
this._cache[_d32]=Object.extend({messages:list,sort:this._cache[_d32]["sort"],total:this._cache[_d32]["total"],unread:this._cache[_d32]["unread"]},_d33||{});
return true;
};
this.isCachable=function(_d34,_d35){
var _d36=[CFG_FOLDER_INBOX];
return true;
};
this.updateCachedMsg=function(_d37,uid,_d39){
var _d3a=this.getUniqueId(_d37,uid);
if(!this.isCachable(_d37,_d3a)){
return;
}
var _d3b=this.getFullCache(_d37);
var _d3c=_d3b["messages"];
var _d3d=false;
if(_d3c[_d3a]){
for(property in _d39){
if(_d3c[_d3a][property]!=_d39[property]){
_d3c[_d3a][property]=_d39[property];
_d3d=true;
if(property=="read"){
if(_d39["read"]){
_d3b["unread"]--;
}else{
_d3b["unread"]++;
}
}
}
}
}
if(_d3d){
this.setCache(_d3c,_d37,{unread:_d3b["unread"]});
}
};
this.cbGetMessages=null;
this._cbGetMessages=function(_d3e){
var _d3f=false;
if(this.start()==1&&this.isCachable(this.folder())){
_d3f=this.folder();
}
var _d40=($FolderList.isWithin(this.folder(),CFG_FOLDER_SENT)||$FolderList.isWithin(this.folder(),CFG_FOLDER_DRAFTS));
$$MessageList.fillList(_d3e,{cache_ref:_d3f,use_to_field:_d40});
this.loadingFolder(false);
$$MessageList.updateHeader();
};
this.cbSubSettingsChange=null;
this._cbSubSettingsChange=function(_d41){
if(this.active()){
$UI.showStatus();
this.refillList();
}
};
};
Object.bindCallbacks($MessageList);
$Dispatcher.subscribe("Settings.change.mail_per_page",$MessageList.cbSubSettingsChange);
}
if($Bootstrap.notLoaded("7a5f15a5ee806ebf0d0fe649bf3cf63b")){
Framework.register("Webmail.Modules");
$$MessageList=Webmail.Modules.MessageList=new function(){
this.config={disable_scroll:true,enable_search:true};
this.current_message=null;
this.current_message_loaded=null;
this.last_clicked=false;
this.first_load=true;
this.header=null;
this.pending_resize=false;
this._enable_keystrokes=true;
this._util_bar_left=null;
this._last_r_height=null;
this._folders_to_prefetch=[];
this._folder_prefetch_timer=null;
this._extra_rows=[];
this._current_list={};
this._email_widget=null;
this._message_row_height=20;
this.__preload=function(){
Object.bindCallbacks(this);
Object.bindObservers(this);
$Dispatcher.subscribe("Folders.status_change",this.cbSubFolderStatusChange);
$Dispatcher.subscribe("Email.Folders.update",this.cbSubUpdateFolders);
$Dispatcher.subscribe("Message.change",this.cbSubMessageChange);
$Dispatcher.subscribe("Message.move",this.cbSubMessageMove);
$Dispatcher.subscribe("Settings.change.preview_pane",this.cbSubSettingsPreviewPane);
var _d42=Element.create("div",{id:"message_list"});
var _d43=Element.create("div",{id:"MList"});
$Widgets.ContextMenu.Messages.factory(_d43);
var _d44=Element.create("div",{id:"p_pane"});
var _d45=Element.create("div",{id:"MList_handle"});
Element.append(_d42,_d43,_d44,_d45);
var _d46=Element.createHtml(["<div class=\"p_pane_blank\" id=\"p_pane_blank\">","<div>",L("Mlist.PreviewPane"),"</div>","</div>"].join(""));
this.dom.setPreviewPane(_d44);
this.dom.setBlankPane(_d46);
Element.append(_d44,_d46);
this._p_pane_proportion=0.5;
this.init.makePreviewResizable(_d45);
var _d47=Element.create("div",{className:"hover_msg",id:"test_div"});
_d47.style.display="none";
Element.append(_d42,_d47);
var _d48=this.createHeader();
var _d49=this.createBody();
this.dom.setListContainer(_d49);
Element.append(_d43,_d48,_d49);
Keystroke.enable(true);
if(CFG_MESSAGE_PREFETCH_ENABLE){
var _d4a=new Webmail.Modules.Message.Prefetcher(null,{prefetch_buffer:CFG_MESSAGE_PREFETCH_PER_REQUEST,prefetch_interval:CFG_MESSAGE_PREFETCH_INTERVAL});
_d4a.start();
}
return _d42;
};
this.__load=function(_d4b){
var _d4c=false;
if(this.first_load){
$Dispatcher.setFolderStatus(_d4b,$FolderList.getTotalMessages(_d4b),$FolderList.getNewMessages(_d4b));
_d4b=-1;
this.first_load=false;
_d4c=true;
}
this.header.dom("toolbar_left").append($$Email.getUtilityBar());
var _d4d=true;
if(_d4b!=-1){
if(typeof _d4b!="undefined"){
if(_d4b!=$MessageList.folder()){
$$MessageList.clearList();
}else{
$$MessageList.Keyboard.Cursor.clear();
this.resetScroll();
}
var _d4e={};
if(Keystroke.shift()){
_d4e.break_cache=true;
}
$MessageList.getMessages(_d4b,_d4e);
}else{
_d4d=false;
this.updateHeader();
}
if($MessageList.previewPane()){
this.setPreviewPaneClear(true);
}
}
if($Custom.isFoldersEnabled()){
$$SubMenu.loadSection($$FolderManager.SubMenu);
if(_d4d){
$Dispatcher.loadFolder($MessageList.folder());
}
$$FolderManager.SubMenu.setActiveFolder($MessageList.folder());
}
$$MessageList.usePreviewPane($MessageList.previewPane(),_d4c);
};
this.__resize=function(_d4f){
_d4f=_d4f||false;
this._resizeHeight(_d4f);
this._resizeWidth();
if(this.dom.getBlankPane()&&this._email_widget){
this._email_widget.resize();
}
};
this.init={makePreviewResizable:function(_d50){
function snapVertical(x,y){
if(y<100){
y=100;
}
return [0,y];
}
function startResize(_d53){
Element.addClassName(_d53,"MList_handle_active");
Webmail.enableWindow(false);
}
function endResize(_d54){
Element.removeClassName(_d54,"MList_handle_active");
Webmail.enableWindow(true);
Element.setDimensions($$MessageList.dom.getPreviewPane(),{height:Webmail.rightHeight()-_d54.offsetTop});
this._resizeHeightBar();
}
_d50.style.position="absolute";
new Draggable(_d50,{altDelta:true,snap:snapVertical,starteffect:startResize,endeffect:endResize.bind($$MessageList)});
}};
this._boundPreviewPane=function(h){
return ((h>50)&&(h<Webmail.rightHeight()-50));
};
this._reportNotSpam=function(_d56,_d57){
var _d58=this.getCheckedRows(_d56);
if(_d58.length==0){
return;
}
$UI.showStatus();
$MessageList.reportNotSpam(_d58,_d57);
};
this._reportSpam=function(_d59,_d5a){
var _d5b=this.getCheckedRows(_d59);
if(_d5b.length==0){
return;
}
$UI.showStatus();
$MessageList.reportSpam(_d5b,_d5a);
};
this._resizeHeight=function(_d5c){
var _d5d=$("MList_container");
var _d5e=Webmail.rightHeight()+18;
if(!_d5c&&this._last_r_height==_d5e){
return;
}
this._last_r_height=_d5e;
if(this.usePreviewPane()){
var _d5f=$("MList");
var _d60=Number(Math.round(_d5e*(1-this._p_pane_proportion)));
var _d61=_d60-_d5d.offsetTop;
if(_d60>0&&parseInt(_d5f.style.height)!=_d60){
_d5f.style.height=_d60+"px";
}
var _d62=_d5e-_d60;
var _d63=$$MessageList.dom.getPreviewPane();
var _d64=$("MList_handle");
if(_d62>0){
_d63.style.height=_d62+"px";
_d64.style.top=_d60+"px";
}
}else{
var _d61=_d5e-_d5d.offsetTop;
}
if(_d61>0&&parseInt(_d5d.style.height)!=_d61){
_d5d.style.height=_d61+"px";
}
};
this._resizeHeightBar=function(){
if(this.usePreviewPane()){
this._p_pane_proportion=$$MessageList.dom.getPreviewPane().offsetHeight/Webmail.rightHeight();
}
this._resizeHeight(true);
if(this.dom.getBlankPane()&&this._email_widget){
this._email_widget.resize();
}
};
this._resizeWidth=function(){
var _d65=wack.Browser.getDimensions()[1];
var _d66=$("Search_widget");
var _d67=this.header.dom("toolbar_left");
var _d68=Webmail.rightWidth();
if($Custom.isRecipientColumnEnabled()){
var ext=155;
}else{
var ext=0;
}
var _d6a=_d68-(408+ext);
var tb=$$MessageList.dom.getBody();
if(!tb.childNodes){
return;
}
if(tb.childNodes[0]){
var _d6c=tb.childNodes[0].obj._sub.offsetWidth;
if(_d6c==50&&_d6a<=50){
return;
}
}
if(_d6a<50){
_d6a=50;
}
for(var i=0,ii=tb.childNodes.length;i<ii;i++){
var tr=tb.childNodes[i];
tr.obj._sub.style.width=_d6a+"px";
}
this.header.dom("subject").firstChild.style.width=_d6a+"px";
if(_d66&&_d67){
Element.setDimensions(_d66,{width:_d65-Position.cumulativeOffset(_d67)[0]-_d67.offsetWidth-15});
}
};
this.blurPreviewPane=function(){
if(this._email_widget){
this._email_widget.blur();
}
};
this.changeMsgCount=function(_d6f,_d70,_d71,_d72,_d73){
if(typeof _d72!="undefined"){
var _d74=(_d73?0:_d6f);
$Dispatcher.publish("Folders.status_change",_d72,-_d70,-_d74);
}
$Dispatcher.publish("Folders.status_change",_d71,_d70,_d6f);
};
this.checkAll=function(_d75){
var mb=this.dom.getBody();
if(!mb||!mb.firstChild){
return;
}
this.header.dom("checkbox").checked=_d75;
for(var i=0,ii=mb.childNodes.length;i<ii;i++){
var tr=mb.childNodes[i];
if(!tr.obj.visible()){
return;
}
tr.obj.checked(_d75);
}
};
this.clearCheckedMessages=function(cont){
if(!cont||!cont.childNodes||cont.childNodes.length==0){
return false;
}
for(var i=0,ii=cont.childNodes.length;i<ii;i++){
var ro=cont.childNodes[i];
if(!ro.obj.visible()){
break;
}
ro.obj.checked(false);
}
};
this.clearList=function(_d7c){
if(wack.Browser.is_firefox){
this.resetScroll();
}
var _d7d=this.getCurrentList();
var uid=_d7c||false;
for(msg_uid in _d7d){
if(!uid||msg_uid!=uid){
this.removeRow(_d7d[msg_uid]);
}
}
var body=this.dom.getBody();
for(var i=body.childNodes.length-1;i>=0;i--){
if(!uid||body.childNodes[i].obj.getUniqueId()!=uid){
this.removeRow(body.childNodes[i]);
}
}
if($MessageList.previewPane()&&!(_d7c&&_d7d[uid].obj.selected()==true)){
this.setPreviewPaneClear(true);
this.current_message=false;
}
this.header.dom("checkbox").checked=false;
if(!wack.Browser.is_firefox){
this.resetScroll();
}
};
this.createList=function(){
var m=Element.create("tbody",{id:"messages_body"});
this.dom.setBody(m);
var list=$MessageList.msg_cache;
m.check_drag=new CheckDrag;
this.fillList(list,{cache_ref:"INBOX"});
$UI.clearStatus();
return m;
};
this.createBody=function(){
var body=this.createList();
var _d84=Element.create("div",{id:"MList_container"});
_d84.innerHTML="<table id=\"MList_table\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"></table>";
if(_d84.firstChild.firstChild){
_d84.firstChild.removeChild(_d84.firstChild.firstChild);
}
Element.append(_d84.firstChild,body);
return _d84;
};
this.createHeader=function(){
this.header=Element.create("div",{id:"msglist_header_div",className:"small"});
var _d85=$FolderList.getDropdownOptions({include_special:true});
var _d86="<div class=\"toolbar\"><div class=\"toolbar_left\" _ref=\"toolbar_left\" id=\"MList_toolbar_left\"></div><div class=\"toolbar_right\" _ref=\"toolbar_right\"></div></div><div id=\"MList_action_row\" class=\"grid_action_bar\"><div class=\"left\"><img src=\"images/blank.gif\" class=\"arrow_up_rt\" /><input type=\"button\" class=\"btn\" value=\""+L("Mlist.L.Delete")+"\" _ref=\"delete\" id=\"delete_button\"><span class=\"notspam\">"+L("Mlist.Action.Or")+"&nbsp;&nbsp;<input type=\"button\" class=\"btn\" value=\""+L("Mlist.L.NotSpam")+"\" _ref=\"notspam\" id=\"notspam_button\"></span>"+L("Mlist.Action.Or")+"&nbsp;&nbsp;"+$$MessageList.getOptionsDropdown("Mlist_action_dd","options")+"&nbsp;&nbsp;<span class=\"move_dd\" _ref=\"move_dd\">"+L("Mlist.Action.Or")+"&nbsp;&nbsp;<select id=\"move_dd\" _ref=\"move\"><option value=\"null\">"+L("Mlist.Action.Move")+"</option><option value=\"null\">--------------------</option>"+_d85+"</select></span></div><div class=\"left\"><span id=\"MList_pager\" _ref=\"pager\"></span></div><div class=\"right\" id=\"MList_page_range\" _ref=\"range\"></div><div class=\"clear\"></div></div><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"small\" width=\"100%\"><tr height=\"15px\" id=\"MList_header\" class=\"column_header_row\"><td class=\"header_check_cell\"><input type=\"checkbox\" id=\"header_checkbox\" _ref=\"checkbox\"></td><td class=\"MessageRow_priority_cell\"><img src=\"images/blank.gif\" class=\"Mlist_header_prio\" /></td><td id=\"read_header\" _ref=\"read\" class=\"MessageRow_icon_cell\"><img src=\"images/blank.gif\" _ref=\"read_icon\" class=\"Mlist_header_envelope\" /></td><td id=\"flag_header\" _ref=\"flag\" class=\"MessageRow_flag_cell\"><img src=\"images/blank.gif\" class=\"Mlist_header_flag\" /></td><td class=\"MessageRow_attach_cell\"><img src=\"images/blank.gif\" class=\"Mlist_header_attach\" /></td><td id=\"recipient_header\" _ref=\"recipient\"><div class=\"MessageRow_recipient_div\">"+L("Mlist.L.Recipient")+"</div></td><td id=\"from_header\" _ref=\"from\"><div class=\"MessageRow_from_div\">"+L("Mlist.L.From")+"</div></td><td id=\"subject_header\" _ref=\"subject\"><div class=\"MessageRow_subject_div\">"+L("Mlist.L.Subject")+"</div></td><td id=\"date_header\" _ref=\"date\" class=\"MessageRow_date_cell\"><div class=\"MessageRow_date_div\">"+L("Mlist.L.Sent")+"</div></td><td id=\"size_header\" _ref=\"size\" class=\"MList_header_size_cell\"><div class=\"MessageRow_size_div\">"+L("Mlist.L.Size")+"</div></td></tr></table>";
this.header.innerHTML=_d86;
$Templates.setDom(this.header);
if(!$Custom.isRecipientColumnEnabled()){
Element.remove($(this.header.dom("recipient")));
}
this._util_bar_left=$(this.header.dom("toolbar_left"));
this._util_bar_left.append($$Email.getUtilityBar());
Event.observe(this.header.dom("options"),"change",this.evClickDropdown.bind(this));
Event.observe(this.header.dom("options"),"focus",this.evDisableKeystrokes.bind(this));
Event.observe(this.header.dom("options"),"blur",this.evEnableKeystrokes.bind(this));
Event.observe(this.header.dom("move"),"change",this.evMoveDropdown.bind(this));
Event.observe(this.header.dom("move"),"focus",this.evDisableKeystrokes.bind(this));
Event.observe(this.header.dom("move"),"blur",this.evEnableKeystrokes.bind(this));
Event.observe(this.header.dom("delete"),"click",this.evClickDelete.bind(this));
Event.observe(this.header.dom("notspam"),"click",this.evClickNotSpam.bind(this));
Event.observe(this.header.dom("checkbox"),"click",this.evClickCheckAll.bind(this));
var _d87=["read","flag","from","subject","date","size"];
for(var i=0,ii=_d87.length;i<ii;i++){
Event.observe(this.header.dom(_d87[i]),"click",this.evClickColumnHeader);
}
this.sort_arrow=Element.createHtml("<img src=\"images/blank.gif\" />");
this.updateHeader();
return this.header;
};
this.deleteCheckedMessages=function(){
var _d89=this.dom.getBody();
this.header.dom("checkbox").checked=false;
if(Keystroke.shift()){
Keystroke.shift(false);
if(confirm(L("Mlist.Confirm.Delete"))){
this.deleteMessages(_d89,null,true);
}
}else{
this.deleteMessages(_d89,null);
}
};
this.deleteMessages=function(_d8a,_d8b,_d8c){
_d8c=_d8c|false;
var _d8d=this.getCheckedRows(_d8a);
if(_d8d.length==0||_d8d==false){
return;
}
$UI.showStatus(L("Mlist.S.Deleting"),true);
$MessageList.deleteMessages(_d8d,_d8b,_d8c);
};
this.dom={_blank_pane:false,_list_container:false,_messages_body:false,_preview_pane:false,getBlankPane:function(){
if(!this._blank_pane){
this._blank_pane=$("p_pane_blank");
}
return this._blank_pane;
},getBody:function(){
if(!this._messages_body){
this._messages_body=$("messages_body");
}
return this._messages_body;
},getListContainer:function(){
if(!this._list_container){
this._list_container=$("MList_container");
}
return this._list_container;
},getPreviewPane:function(){
if(!this._preview_pane){
this._preview_pane=$("p_pane");
}
return this._preview_pane;
},setBlankPane:function(_d8e){
this._blank_pane=_d8e;
},setBody:function(_d8f){
this._messages_body=_d8f;
},setListContainer:function(_d90){
this._list_container=_d90;
},setPreviewPane:function(_d91){
this._preview_pane=_d91;
}};
this.fetchSiblings=function(_d92){
var _d93=this.current_message.obj;
var _d94=this.getCurrentObjects();
for(x=0;x<_d94.length;x++){
if(_d94[x].id()==_d93.id()&&_d94[x].folder()==_d93.folder()){
var _d92=x;
var _d95=x-2;
var end=x+2;
break;
}
}
var _d97=[];
for(x=_d95;x<=end;x++){
if(_d94[x]){
if(!$MessageCache.isCached(_d94[x].folder(),_d94[x].id())){
_d97.push({folder:_d94[x].folder(),uid:_d94[x].id()});
}
}
}
if(_d97.length>0){
$Message.getMultiple(_d97,{for_cache:true,callback:function(_d98){
if(!_d98.exception){
for(var _d99 in _d98){
$MessageCache.addToCache(_d98[_d99].folder,_d98[_d99].uid,_d98[_d99]);
}
}
}});
}
};
this.fillList=function(_d9a,_d9b){
if(_d9a.length==0){
_d9a={};
}
var _d9b=Object.extend({cache_ref:false,use_to_field:false},_d9b||{});
var _d9c=false;
if(_d9b.cache_ref){
var _d9c=$MessageList.getCache(_d9b.cache_ref);
}
var body=this.dom.getBody();
var _d9e=this.getCurrentList();
for(uid in _d9e){
if(_d9a&&typeof _d9a[uid]=="undefined"){
this.removeRow(_d9e[uid]);
delete _d9e[uid];
}
}
var _d9f=0;
var _da0=[];
for(uid in _d9a){
_da0.push(uid);
if(_d9a[uid]&&typeof _d9e[uid]=="undefined"){
var _da1=this.getRow();
_da1.obj.fillRow(_d9a[uid],{use_to_field:_d9b.use_to_field});
_d9e[uid]=_da1;
if(!body.childNodes[_d9f]){
if(_d9e[uid].parentNode){
Element.remove(_d9e[uid]);
}
Element.append(body,_d9e[uid]);
}else{
if(body.childNodes[_d9f]!=_d9e[uid]){
if(_d9e[uid].parentNode){
Element.remove(_d9e[uid]);
}
body.insertBefore(_d9e[uid],body.childNodes[_d9f]);
}
}
}else{
if(_d9e[uid]){
if(body.childNodes[_d9f]&&body.childNodes[_d9f].obj.getUniqueId()!=uid){
var row=_d9e[uid];
if(row.parentNode){
Element.remove(row);
}
if(body.childNodes[_d9f]){
body.insertBefore(row,body.childNodes[_d9f]);
}else{
Element.append(body,row);
}
}
if(body.childNodes[_d9f]){
body.childNodes[_d9f].obj.showDate();
}
if(_d9c&&_d9a[uid]){
_d9a[uid]["read"]=_d9e[uid].obj.read();
}
}
}
if(_d9c&&!_d9a[uid]){
_d9a[uid]=_d9c[uid];
}
_d9f++;
}
this.setCurrentList(_d9e);
if(_d9c){
$MessageList.setCache(_d9a,_d9b.cache_ref,{sort:$MessageList.sort(),total:$MessageList.total(),unread:$MessageList.unseen()});
}
var _da3=true;
if(this.pending_resize){
this.pending_resize=false;
this._resizeWidth();
}
};
this.findMessage=function(_da4,uid){
var _da6=$MessageList.getUniqueId(_da4,uid);
var _da7=this.getCurrentList();
if(_da7&&_da7[_da6]){
return _da7[_da6];
}
return null;
};
this.flagMessages=function(_da8,flag){
if(!_da8||_da8.childNodes.length==0){
return;
}
var _daa=[];
for(var i=0,ii=_da8.childNodes.length;i<ii;i++){
var tr=_da8.childNodes[i];
if(tr.obj.checked()&&tr.obj.visible()){
if(tr.obj.checked()&&tr.obj.flag()!=flag){
_daa.push({folder:tr.obj.folder(),id:tr.obj.id()});
tr.obj.checked(false);
tr.obj.flag(flag);
}else{
if(tr.obj.checked()){
tr.obj.checked(false);
}
}
}
}
if(_daa.length>0){
var _dad=Prototype.emptyFunction;
$MessageList.flagMessages(_daa,flag,_dad);
}
};
this.forwardMessages=function(_dae){
var _daf=this.getCheckedRows(_dae);
if(_daf.length==0){
return;
}
$MessageList.forwardMessages(_daf);
};
this.getCheckedRows=function(cont,_db1){
cont=cont||this.dom.getBody();
if(!cont||!cont.childNodes||cont.childNodes.length==0){
return false;
}
var _db2=[];
for(var i=0,ii=cont.childNodes.length;i<ii;i++){
var row=cont.childNodes[i];
if(!row.obj.visible()){
break;
}
if(row.obj.checked()){
if(_db1){
_db2.push(row);
}else{
_db2.push({folder:row.obj.folder(),id:row.obj.id(),unread:!row.obj.read()});
}
}
}
return _db2;
};
this.getCurrentList=function(){
return this._current_list;
};
this.getCurrentUids=function(_db5){
var _db6=this.getCurrentObjects(_db5);
var _db7=[];
for(var x=0;x<_db6.length;x++){
_db7.push(_db6[x].getUniqueId());
}
return _db7;
};
this.getCurrentObjects=function(_db9){
var _dba=[];
if(!_db9){
var list=this.getCurrentList();
for(uid in list){
_dba.push(list[uid].obj);
}
}else{
var body=this.dom.getBody();
for(var i=0,ii=body.childNodes.length;i<ii;i++){
_dba.push(body.childNodes[i].obj);
}
}
return _dba;
};
this.getFirstRow=function(){
var row=this.dom.getBody().rows[0];
return row;
};
this.getLastMessage=function(){
var row=this.dom.getBody().lastChild;
return row;
};
this.isCurrentMessage=function(_dc0,uid){
for(var _dc2 in this._current_list){
var key=_dc0+"|"+uid;
if(_dc2==key){
return true;
}
}
return false;
};
this.getNextMessage=function(_dc4){
if(!_dc4){
return false;
}
if(_dc4.obj&&_dc4.obj.next()&&_dc4.obj.next().obj.visible()){
return _dc4.obj.next();
}else{
if(_dc4.obj&&_dc4.obj.previous()&&_dc4.obj.previous().obj.visible()){
return _dc4.obj.previous();
}else{
return false;
}
}
};
this.getOpenMessage=function(){
return this.current_message;
};
this.getOptionsDropdown=function(id,ref){
if($Custom.isComposeEnabled()){
var _dc7="<option value=\"forward\">"+L("Mlist.Action.Forward")+"</option>";
}else{
var _dc7="";
}
if($Custom.isReportSpamEnabled()){
var _dc8="<option value=\"reportspam\">"+L("Mlist.Action.ReportSpam")+"</option>";
}else{
var _dc8="";
}
var _dc9=["<select id=\""+id+"\" "+(ref?"_ref=\""+ref+"\"":"")+">","<option value=\"null\">"+L("Mlist.Action.Select")+"</option>","<option value=\"null\">--------------------</option>",_dc7,"<option value=\"mark_flagged\">"+L("Mlist.Action.AddFlag")+"</option>","<option value=\"mark_unflagged\">"+L("Mlist.Action.RemFlag")+"</option>","<option value=\"mark_read\">"+L("Mlist.Action.MarkRead")+"</option>","<option value=\"mark_unread\">"+L("Mlist.Action.MarkUnread")+"</option>",_dc8,"<option value=\"zip\">"+L("Mlist.Action.Zip")+"</option>","</select>",].join("");
return _dc9;
};
this.getPager=function(){
return this.header.dom("pager").firstChild;
},this.getRow=function(){
if(this._extra_rows.length>0){
var row=this._extra_rows.pop();
row.obj.checked(false);
if(row.obj.selected()){
row.obj.selected(false);
}
return row;
}
this.pending_resize=true;
var _dcb=$$MessageList.evClickMessage.bindAsEventListener($$MessageList);
var _dcc=new $$MessageRow({click_handler:_dcb});
$UI_Grid.addCheckDrag(this.dom.getBody(),[_dcc.getCheckbox()],"TR",$$MessageRow.checkDragCallback);
return _dcc.getContainer();
};
this.handleAction=function(_dcd,body,_dcf){
switch(_dcd){
case "null":
break;
case "mark_flagged":
$AN(56);
this.flagMessages(body,true);
break;
case "mark_unflagged":
$AN(59);
this.flagMessages(body,false);
break;
case "mark_read":
$AN(91);
this.markAsRead(body,true);
break;
case "mark_unread":
$AN(94);
this.markAsRead(body,false);
break;
case "notspam":
$AN(88);
this._reportNotSpam(body,_dcf);
break;
case "reportspam":
$AN(85);
var _dd0=this.getCheckedRows(body);
if(_dd0.length==0||!confirm(L("Mlist.C.ReportSpam.P"))){
this.clearCheckedMessages(body);
break;
}
this._reportSpam(body,_dcf);
break;
case "zip":
$AN(98);
this.zipMessages(body);
break;
case "forward":
$AN(116);
this.forwardMessages(body);
this.clearCheckedMessages(body);
break;
default:
break;
}
};
this.isPreviewPaneFocused=function(){
return (this._email_widget&&this._email_widget.hasFocus());
};
this.isUnread=function(_dd1){
var uid=_dd1.id+"|"+_dd1.folder;
var _dd3=$$MessageList.getCurrentList();
if(_dd3[uid]){
return !_dd3[uid].obj.read();
}else{
if(this.isCachable(_dd1.folder)){
var _dd4=this.getCache(_dd1.folder);
if(_dd4&&_dd4[uid]){
return !_dd4[uid]["seen"];
}
}
}
return null;
};
this.markAsRead=function(_dd5,_dd6){
_dd5=_dd5||this.dom.getBody();
if(!_dd5||_dd5.childNodes.length==0){
return;
}
var _dd7=[];
for(var i=0,ii=_dd5.childNodes.length;i<ii;i++){
var tr=_dd5.childNodes[i];
if(tr.obj.checked()&&tr.obj.visible()){
if(tr.obj.checked()&&tr.obj.read()!=_dd6){
_dd7.push({folder:tr.obj.folder(),id:tr.obj.id()});
tr.obj.checked(false);
tr.obj.read(_dd6);
}else{
if(tr.obj.checked()){
tr.obj.checked(false);
}
}
}
}
if(_dd7.length>0){
var _dda=Prototype.emptyFunction;
$MessageList.markAsRead(_dd7,_dd6,_dda);
var _ddb={};
for(var i=0,ii=_dd7.length;i<ii;i++){
if(!_ddb[_dd7[i]["folder"]]){
_ddb[_dd7[i]["folder"]]=1;
}else{
_ddb[_dd7[i]["folder"]]+=1;
}
}
for(folder in _ddb){
$$MessageList.changeMsgCount((_dd6?-_ddb[folder]:_ddb[folder]),0,folder);
}
}
};
this.moveMessages=function(_ddc,_ddd,_dde,_ddf){
_ddd=_ddd||this.dom.getBody();
$UI.showStatus(L("Mlist.St.Move"));
var _de0=this.getCheckedRows(_ddd);
if(_de0==false||_de0.length==0){
if(_dde){
_dde.selectedIndex=0;
}
$UI.clearStatus();
return;
}
var i=0;
while(_de0[i]){
if(_de0[i].folder==_ddc){
_de0.splice(i,1);
}else{
i++;
}
}
$MessageList.moveMessages(_de0,_ddc,_ddf);
};
this.openMessage=function(tr,type,_de4){
if(!tr||!tr.obj){
return;
}
if(this.current_message&&this.current_message!=tr){
this.current_message.obj.selected(false);
}
this.current_message=tr;
this.current_message_loaded=new Date;
tr.obj.is_search=$Search.active();
if(type==$Widgets.Email.VIEW_PREVIEW){
tr.obj.selected(true);
}
var _de5=false;
if(!tr.obj.read()){
_de5=true;
tr.obj.read(true);
}
var _de6=tr.obj.folder();
var uid=tr.obj.id();
var _de8={folder:_de6,uid:uid,force_plain:Keystroke.alt(),unread:_de5};
if(type==$Widgets.Email.VIEW_PREVIEW){
if(!this._email_widget){
$Widgets.load("Email");
this._email_widget=$Widgets.Email.factory({view:$Widgets.Email.VIEW_PREVIEW});
}
$UI.showStatus();
this._email_widget.populate(wack.extend(_de8,{callback:function(_de9){
$UI.clearStatus();
if(_de9.exception){
this.current_message=null;
tr.obj.selected(false);
return;
}
if($MessageList.active()){
this.setPreviewPaneClear(false);
var _dea=this.dom.getPreviewPane();
}else{
if($Search.active()){
$$Search.setPreviewPaneClear(false);
var _dea=$("Search_ppane");
}
}
if(_dea){
_dea.append($C(this._email_widget));
}
this._email_widget.resize();
var _deb=false;
if(_de9._from_cache){
if(this._email_widget._unread===null||this._email_widget._unread){
var cb=(_de4?function(_ded){
$MessageList.refillList();
}:Prototype.emptyFunction);
$Mail.setReadStatus({folder:_de6,id:uid},true,cb);
_deb=true;
this._email_widget._unread=false;
}
}
if(_de4&&!_deb){
$MessageList.refillList();
}
}.bind(this)}));
this.scrollToMessage(this.current_message);
}else{
if(type==$Widgets.Email.VIEW_FULL){
$$Message.read(_de8);
}else{
if(type==$Widgets.Email.VIEW_POPUP){
$$Message.popup(_de8);
}
}
}
};
this.removeRows=function(_dee,_def,_df0){
_df0=_df0||function(){
return true;
};
var i=0;
var _df2={};
if(!_dee[0]){
_dee=array(_dee);
}
while(_def.childNodes[i]){
var row=_def.childNodes[i];
if(!row.obj.visible()){
break;
}
for(var j=0,jj=_dee.length;j<jj;j++){
if((row.obj.id()==_dee[j]["id"])&&(row.obj.folder()==_dee[j]["folder"])){
if(_df0(row)){
this.removeRow(row);
i--;
}else{
row.obj.checked(false);
}
break;
}
}
i++;
}
return true;
};
this.removeRow=function(row){
if(row.parentNode){
Element.remove(row);
}
if(row==this.current_message){
$$MessageList.current_message=false;
$$MessageList.setPreviewPaneClear(true);
}
var _df6=row.obj.folder();
var uid=row.obj.id();
var _df8=$MessageList.getUniqueId(_df6,uid);
if(this._current_list[_df8]){
delete (this._current_list[_df8]);
}
this._extra_rows.push(row);
$UI_Grid.changeHoverColor(row,false);
};
this.resetScroll=function(){
this.dom.getListContainer().scrollTop=0;
};
this.scrollToMessage=function(msg){
if(!msg){
return;
}
var _dfa=$Search.active()?$$Search._search_body:$("MList_container");
if(msg.offsetTop>(_dfa.scrollTop+_dfa.offsetHeight-msg.offsetHeight)){
var _dfb=msg.offsetHeight?msg.offsetHeight:this._message_row_height;
if(msg.offsetHeight==0){
_dfb=this._message_row_height;
}
_dfa.scrollTop=msg.offsetTop-_dfa.offsetHeight+_dfb;
return;
}
if(msg.offsetTop<_dfa.scrollTop){
_dfa.scrollTop=msg.offsetTop;
}
};
this.centerOnMessage=function(_dfc,_dfd){
_dfd=_dfd||this.dom.getListContainer();
if(!_dfd){
return;
}
if(_dfc.offsetTop>_dfd.offsetHeight){
var _dfe=_dfd.offsetHeight/2;
_dfe-=this._message_row_height;
_dfd.scrollTop=_dfc.offsetTop-_dfe;
}
return true;
};
this.selectNextMessage=function(){
if(!this.current_message||this.current_message.obj.is_search!=$Search.active()){
return;
}
var _dff=this.current_message.obj.next();
if(!_dff&&_dff.obj.visible()){
this.openMessage(_dff,$Widgets.Email.VIEW_PREVIEW);
}
};
this.selectPreviousMessage=function(){
if(!this.current_message||this.current_message.obj.is_search!=$Search.active()||!$MessageList.previewPane()){
return;
}
var _e00=this.current_message.obj.previous();
if(!_e00){
return;
}
this.openMessage(_e00,$Widgets.Email.VIEW_PREVIEW);
};
this.setCurrentList=function(list){
if(this._current_list){
delete (this._current_list);
}
this._current_list=list;
return true;
};
this.setPreviewPaneClear=function(_e02){
var _e03=this.dom.getBlankPane();
if(_e02){
var _e04=$$MessageList.dom.getPreviewPane();
if(_e04.firstChild==_e03){
return;
}
if(_e04.firstChild){
Element.remove(_e04.firstChild);
}
Element.append(_e04,_e03);
if(this.current_message){
this.current_message.obj.selected(false);
}
this.current_message=null;
}else{
if(_e03&&_e03.parentNode==this.dom.getPreviewPane()){
Element.remove(_e03);
}
}
};
this.showMessageList=function(){
$("search_header").style.display="none";
$("search_div").style.display="none";
};
this.updateDropdowns=function(_e05){
_e05=_e05||false;
var mln=$MessageList;
if(_e05){
if(!Webmail.isQuarantine()){
var _e07=$("Mlist_action_dd");
if($FolderList.isSpam($MessageList.folder())){
_e07.options[7]=new Option(L("Mlist.Action.NotSpam"),"notspam");
}else{
_e07.options[7]=new Option(L("Mlist.Action.ReportSpam"),"reportspam");
}
_e07.options[8]=new Option(L("Mlist.Action.Zip"),"zip");
}
}else{
var _e08=$FolderList.getDropdownOptions({include_special:true,indent_char:" ",ret_array:true});
var _e09=$("move_dd");
var _e0a=$("Search_move_dd");
Element.hide(_e09);
Element.hide(_e0a);
Form.Select.clear(_e09);
Form.Select.insert(_e09,{value:"null",text:L("Folders.D.Move")});
Form.Select.insert(_e09,{value:"null",text:"---------------"});
for(var i=0,ii=_e08.length;i<ii;i++){
Form.Select.insert(_e09,{value:_e08[i].path,text:_e08[i].text.replace("&amp;","&")});
}
Form.Select.clear(_e0a);
Form.Select.insert(_e0a,{value:"null",text:L("Folders.D.Move")});
Form.Select.insert(_e0a,{value:"null",text:"---------------"});
for(var a=0,aa=_e08.length;a<aa;a++){
Form.Select.insert(_e0a,{value:_e08[a].path,text:_e08[a].text.replace("&amp;","&")});
}
Element.show(_e09);
Element.show(_e0a);
}
};
this.updateHeader=function(){
if(this.sort_arrow.parentNode){
Element.remove(this.sort_arrow);
}
var _e0d=$MessageList.folder();
if($FolderList.isWithin(_e0d,CFG_FOLDER_DRAFTS)){
var _e0e=L("Mlist.L.To");
var _e0f=L("Mlist.L.Saved");
}else{
if($FolderList.isWithin(_e0d,CFG_FOLDER_SENT)){
var _e0e=L("Mlist.L.To");
var _e0f=L("Mlist.L.Sent");
}else{
var _e0e=L("Mlist.L.From");
var _e0f=L("Mlist.L.Sent");
}
}
if(this.header.dom("from").firstChild.innerHTML!=_e0e){
this.header.dom("from").firstChild.innerHTML=_e0e;
}
if(this.header.dom("date").firstChild.innerHTML!=_e0f){
this.header.dom("date").firstChild.innerHTML=_e0f;
}
this.header.dom("read_icon").className="Mlist_header_envelope";
var sort=$MessageList.sort();
this.sort_arrow.className=($MessageList.isAscending()?"Mlist_header_up_arrow":"Mlist_header_down_arrow");
switch(String(sort)){
case "0":
case "1":
Element.append(this.header.dom("date").firstChild,this.sort_arrow);
break;
case "2":
case "3":
Element.append(this.header.dom("from").firstChild,this.sort_arrow);
break;
case "4":
case "5":
Element.append(this.header.dom("subject").firstChild,this.sort_arrow);
break;
case "6":
case "7":
Element.append(this.header.dom("size").firstChild,this.sort_arrow);
break;
default:
break;
}
this.updatePager();
this.updateRange();
};
this.updatePager=function(){
var _e11=$MessageList.folder();
var _e12=$FolderList.getTotalMessages(_e11);
var _e13=$MessageList.start();
var _e14=$MessageList.showNum();
while(_e13>_e12){
_e13=_e13-$MessageList.showNum();
}
var _e15=this.header.dom("pager");
if(_e15.firstChild){
Element.remove(_e15.firstChild);
}
var _e16=$UI.Pager.createPager(_e13,_e14,_e12,{callback:this.cbPage,show_range:false});
_e15.appendChild(_e16);
};
this.updateRange=function(){
var _e17=$MessageList.folder();
var _e18=$FolderList.getTotalMessages(_e17);
var _e19=$MessageList.start();
var _e1a=$MessageList.showNum();
var _e1b=this.header.dom("range");
if(_e18>0){
var _e1c=L("Mlist.L.ViewRange",_e19,Math.min(_e18,_e19+_e1a-1),_e18);
}else{
var _e1c="";
}
_e1b.innerHTML=_e1c;
};
this.usePreviewPane=function(v,_e1e){
var mln=$MessageList;
var ml=$$MessageList;
if(typeof v=="undefined"){
return mln.previewPane();
}else{
if(v!=$MessageList.previewPane()||_e1e){
$("MList").style.height="0px";
$("MList_handle").style.display=(v?"":"none");
ml.dom.getPreviewPane().style.display=(v?"":"none");
ml.__resize(true);
if(ml.current_message){
ml.current_message.obj.selected(false);
ml.current_message=false;
}
}
}
};
this.zipMessages=function(_e21){
var _e22=this.getCheckedRows(_e21);
if(_e22.length==0){
return;
}
if(!_e21||_e21.childNodes.length==0){
return;
}
for(var i=0,ii=_e21.childNodes.length;i<ii;i++){
var tr=_e21.childNodes[i];
if(tr.obj.checked()){
tr.obj.checked(false);
}
}
$MessageList.zipMessages(_e22);
};
this.cbPage=null;
this._cbPage=function(_e25,_e26){
this._current_start=_e25;
$MessageList.getMessages($MessageList.folder(),{start:_e25},function(_e27){
$Dispatcher.publish("MessageList.page",_e27);
}.bind(this));
};
this.cbSubMessageChange=null;
this._cbSubMessageChange=function(_e28,uid,_e2a,_e2b){
if($Search.active()){
var _e2c=$$Search._body;
for(var i=0,ii=_e2c.childNodes.length;i<ii;i++){
var tr=_e2c.childNodes[i];
if(tr.obj.id()==uid&&tr.obj.folder()==_e28){
if(tr.obj[_e2a]){
tr.obj[_e2a](_e2b);
}
break;
}
}
}
var _e2f=this.getCurrentList();
var _e30=$MessageList.getUniqueId(_e28,uid);
if(_e2f[_e30]&&_e2f[_e30].obj[_e2a]){
_e2f[_e30].obj[_e2a](_e2b);
return;
}
var _e31={};
_e31[_e2a]=_e2b;
$MessageList.updateCachedMsg(_e28,uid,_e31);
};
this.cbSubMessageMove=null;
this._cbSubMessageMove=function(_e32,_e33,_e34){
if(!$MessageList.active()&&!$Search.active()&&!$$Message.active()){
return;
}
if($MessageList.folder()==CFG_FOLDER_SPAM){
var _e34=false;
}
var _e35=(this._email_widget?true:false);
if(_e35){
var _e36=this._email_widget.getFolder();
var _e37=this._email_widget.getUid();
}
var _e38=null;
var _e39={};
for(var i=0,ii=_e32.length;i<ii;i++){
$MessageList.removeFromCache(_e32[i].folder,_e32[i].id);
if(this.current_message&&this.current_message.obj.is_search==$Search.active()){
if(_e35&&_e36==_e32[i].folder&&_e37==_e32[i].id){
if($MessageList.previewPane()&&_e34){
_e38=this.getNextMessage(this.current_message);
}
if(!_e38){
if($MessageList.active()){
this.setPreviewPaneClear(true);
}else{
$$Search.setPreviewPaneClear(true);
}
}
}
}
_e39[_e32[i].folder]=true;
}
if(_e33){
_e39[_e33]=true;
}
this.removeRows(_e32,this.dom.getBody());
if(_e38){
var _e3b=$MessageList.active();
this.openMessage(_e38,$Widgets.Email.VIEW_PREVIEW,_e3b);
}else{
if($MessageList.active()&&_e39[$MessageList.folder()]){
$MessageList.refillList();
}
}
};
this.cbSubFolderStatusChange=null;
this._cbSubFolderStatusChange=function(_e3c,_e3d,_e3e){
if($MessageList.active()&&$MessageList.folder()==_e3c){
this.updatePager();
this.updateRange();
}
};
this.cbSubUpdateFolders=null;
this._cbSubUpdateFolders=function(){
this.updateDropdowns();
};
this.cbSubSettingsPreviewPane=null;
this._cbSubSettingsPreviewPane=function(_e3f){
$MessageList.previewPane(_e3f);
};
this.evClickDropdown=function(e){
elem=Event.element(e);
var body=this.dom.getBody();
var _e42;
switch(elem.value){
case "notspam":
case "reportspam":
_e42=function(_e43){
$MessageList.refillList();
};
break;
}
this.handleAction(elem.value,body,_e42);
elem.selectedIndex=0;
$("header_checkbox").checked=false;
};
this.evClickCheckAll=function(e){
var cs=Event.element(e).checked;
this.checkAll(cs);
};
this.evClickColumnHeader=null;
this._evClickColumnHeader=function(e){
if($MessageList.isSearch()){
return;
}
var sort=$MessageList.sort();
if(typeof sort=="undefined"||sort=="unsorted"||sort==-1){
return;
}
var elem=Event.findElement(e,"td");
switch(elem.id){
case "from_header":
sort=="3"?sort="2":sort="3";
break;
case "subject_header":
sort=="5"?sort="4":sort="5";
break;
case "date_header":
sort=="0"?sort="1":sort="0";
break;
case "size_header":
sort=="6"?sort="7":sort="6";
break;
case "read_header":
sort="8";
break;
case "flag_header":
sort="10";
break;
default:
return;
break;
}
$Analytics.add("mail_sort","click_"+elem.id);
if(this.current_message&&this.current_message.obj){
id=this.current_message.obj.id();
}else{
id=-1;
this.current_message=null;
}
$MessageList.getMessages($MessageList.folder(),{start:1,sort:sort,selected_uid:id});
};
this.evClickDelete=null;
this._evClickDelete=function(e){
$AN(50);
var _e4a=this.dom.getBody();
this.header.dom("checkbox").checked=false;
if(Keystroke.shift()){
Keystroke.shift(false);
if(confirm(L("Mlist.Confirm.Delete"))){
this.deleteMessages(_e4a,null,true);
}
}else{
this.deleteMessages(_e4a,null);
}
};
this.evClickNotSpam=null;
this._evClickNotSpam=function(e){
var _e4c=this.dom.getBody();
var _e4d=this.getCheckedRows(_e4c);
if(_e4d.length==0){
return;
}
var _e4e=function(_e4f){
$MessageList.refillList();
};
this._reportNotSpam(_e4c,_e4e);
};
this.evClickMessage=function(e){
if($MessageList.loadingFolder()){
return;
}
var elem=Event.findElement(e,"td");
var _e52=elem.name;
var _e53=null;
if(!elem.tagName){
return;
}
if(_e52=="check_cont"||_e52=="pri_cont"||_e52=="icon_cont"||_e52=="flag_cont"||_e52=="att_cont"){
return;
}
if(e.obj){
if($MessageList.previewPane()){
var type=$Widgets.Email.VIEW_PREVIEW;
}else{
var type=$Widgets.Email.VIEW_FULL;
}
var tr=e;
}else{
var tr=$$MessageRow.findContainer(elem);
if($MessageList.active()&&Event.type(e)=="dblclick"&&tr.obj.folder()==CFG_FOLDER_DRAFTS){
$Dispatcher.compose(null,wm_Compose_RESUME_DRAFT,tr.obj.id(),tr.obj.folder());
return;
}
var type;
if(Event.type(e)=="dblclick"){
type=$Widgets.Email.VIEW_POPUP;
}else{
if($MessageList.previewPane()==1){
if(this.current_message){
var msg=this.current_message.obj;
if(msg.id()==tr.obj.id()&&msg.folder()==tr.obj.folder()&&msg.is_search==$Search.active()){
return;
}
}
type=$Widgets.Email.VIEW_PREVIEW;
}else{
type=$Widgets.Email.VIEW_FULL;
}
}
}
if(type==$Widgets.Email.VIEW_POPUP){
$AN(73);
}else{
$AN(72);
}
this.openMessage(tr,type);
if(!CFG_MESSAGE_PREFETCH_ENABLE&&type==$Widgets.Email.VIEW_PREVIEW){
this.fetchSiblings();
}
};
this.evDisableKeystrokes=function(){
$$MessageList._enable_keystrokes=false;
};
this.evEnableKeystrokes=function(){
$$MessageList._enable_keystrokes=true;
};
this.evMoveDropdown=function(e){
$AN(65);
var elem=Event.findElement(e,"select");
var _e59=elem.value;
if(_e59=="null"||_e59==$MessageList.folder()){
elem.selectedIndex=0;
return;
}
var _e5a=this.dom.getBody();
this.header.dom("checkbox").checked=false;
var _e5b=function(_e5c){
elem.selectedIndex=0;
};
this.moveMessages(_e59,_e5a,elem,_e5b);
};
};
}
if($Bootstrap.notLoaded("ac2befdcede5d723ae73378b1a04cbcd")){
Framework.register("Webmail.Modules.MessageList");
$$MessageList.Keyboard=Webmail.Modules.MessageList.Keyboard={keyboard:null,initialize:function(){
Object.bindObservers(this);
Object.bindCallbacks(this);
var map=this._getKeyMap($Settings.isKeyboardShortcutsEnabled());
this.keyboard=$Keyboard.createKeyboardObject(map,this.evDocumentKeyPress);
},clearCursor:function(){
$$MessageList.Keyboard.Cursor.clear();
},_compose:function(_e5e){
if(!_e5e){
$Dispatcher.compose();
return;
}
var row=$$MessageList.Keyboard.Cursor.getCursorRow();
if(!row){
row=$$MessageList.getOpenMessage();
}
if(!row){
return;
}
var uid=row.obj.id();
var _e61=row.obj.folder();
$Dispatcher.compose(null,_e5e,uid,_e61);
},_getKeyMap:function(_e62){
var map;
if(_e62){
map=this._getKeyMapAdvanced();
}else{
map=this._getKeyMapBasic();
}
return map;
},_getKeyMapAdvanced:function(){
var _e64=L("Keyboard.Key.Shift");
var map={actions:{name:L("Email.Keyboard.Section.Action"),keys:[{key:"c",desc:"Email.Keyboard.ComposeNew",func:this.cbComposeMessage},{key:"R",keydesc:_e64+" + R",desc:"Email.Keyboard.Reply",func:this.cbReply},{key:"A",keydesc:_e64+" + A",desc:"Email.Keyboard.ReplyAll",func:this.cbReplyAll},{key:"F",keydesc:_e64+" + F",desc:"Email.Keyboard.Forward",func:this.cbForward},{key:"r",desc:"Email.Keyboard.QuickReply",func:this.cbQuickReply},{key:"a",desc:"Email.Keyboard.QuickReplyAll",func:this.cbQuickReplyAll},{key:"m",desc:"Email.Keyboard.MoveMessages",func:this.cbMoveMessages},{key:"d",desc:"Email.Keyboard.DeleteMessages",func:this.cbDeleteMessages},{key:wack.Keyboard.KEY_DELETE,keydesc:L("Keyboard.Key.Delete"),desc:"Email.Keyboard.DeleteOpenMessage",func:this.cbDeleteOpenMessage},{key:"K",keydesc:_e64+" + K",desc:"Email.Keyboard.CheckMail",func:this.cbCheckEmail},{key:"O",keydesc:_e64+" + O",desc:"Email.Keyboard.PopupMessage",func:this.cbPopupMessage},{key:"o",keydesc:"o / "+L("Keyboard.Key.Enter"),desc:"Email.Keyboard.OpenMessage",func:this.cbPreviewMessage},{key:wack.Keyboard.KEY_ENTER,func:this.cbPreviewMessage},{key:"f",desc:"Email.Keyboard.ToggleFlags",func:this.cbToggleFlag},{key:"u",desc:"Email.Keyboard.MarkUnread",func:this.cbMarkUnread},{key:"x",keydesc:"x / "+L("Keyboard.Key.Space"),desc:"Email.Keyboard.ToggleCheckbox",func:this.cbToggleCheckbox},{key:wack.Keyboard.KEY_SPACE,func:this.cbToggleCheckbox},{key:"X",keydesc:_e64+" + X",desc:"Email.Keyboard.CheckMultiple",func:this.cbSelectMultipleMessages},{key:"*a",desc:"Email.Keyboard.SelectAll",func:this.cbSelectAllMessages},{key:"*n",desc:"Email.Keyboard.DeselectAll",func:this.cbDeselectAllMessages}]},navigation:{name:L("Email.Keyboard.Section.Nav"),keys:[{key:"j",keydesc:L("Keyboard.Key.Down")+" / j",desc:"Email.Keyboard.NextMessage",func:this.cbDown},{key:wack.Keyboard.KEY_ARROW_DOWN,func:this.cbDown},{key:"k",keydesc:L("Keyboard.Key.Up")+" / k",desc:"Email.Keyboard.PrevMessage",func:this.cbUp},{key:wack.Keyboard.KEY_ARROW_UP,func:this.cbUp},{key:"n",desc:"Email.Keyboard.CursorDown",func:this.cbCursorDown},{key:"p",desc:"Email.Keyboard.CursorUp",func:this.cbCursorUp},{key:"G",keydesc:_e64+" + G",desc:"Email.Keyboard.GoLastMessage",func:this.cbLastMessage},{key:"gd",desc:"Email.Keyboard.GoDrafts",func:this.cbGoFolderDrafts},{key:"gf",desc:"Email.Keyboard.GoFolder",func:this.cbGoFolder},{key:"gg",desc:"Email.Keyboard.GoFirstMessage",func:this.cbFirstMessage},{key:"gi",desc:"Email.Keyboard.GoInbox",func:this.cbGoFolderInbox},{key:"gn",desc:"Email.Keyboard.NextPage",func:this.cbNextPage},{key:"gp",desc:"Email.Keyboard.PrevPage",func:this.cbPrevPage},{key:"gs",desc:"Email.Keyboard.GoSent",func:this.cbGoFolderSent},{key:"gt",desc:"Email.Keyboard.GoTrash",func:this.cbGoFolderTrash},{key:"zz",desc:"Email.Keyboard.CenterMessage",func:this.cbCenterOnCursor},{key:"/",desc:"Email.Keyboard.FocusSearch",func:this.cbFocusSearch}]}};
return map;
},_getKeyMapBasic:function(){
return {basic:{name:"",keys:[{key:wack.Keyboard.KEY_ARROW_UP,func:this.cbUp},{key:wack.Keyboard.KEY_ARROW_DOWN,func:this.cbDown},{key:wack.Keyboard.KEY_DELETE,func:this.cbDeleteOpenMessage}]}};
},_goToNextMessage:function(open){
$$MessageList.Keyboard.Cursor.move($$MessageList.Keyboard.Cursor.NEXT);
var row=$$MessageList.Keyboard.Cursor.getCursorRow();
if(open){
this._openMessage(row);
}else{
$$MessageList.scrollToMessage(row);
}
},_goToPreviousMessage:function(open){
$$MessageList.Keyboard.Cursor.move($$MessageList.Keyboard.Cursor.PREVIOUS,open);
var row=$$MessageList.Keyboard.Cursor.getCursorRow();
if(open){
this._openMessage(row);
}else{
$$MessageList.scrollToMessage(row);
}
},_loadFolder:function(_e6a){
$Dispatcher.loadFolder(_e6a);
if(_e6a.toUpperCase()=="INBOX"){
_e6a="INBOX";
}
$$FolderManager.SubMenu.setActiveFolder(_e6a);
},_openMessage:function(row){
if(!row){
return false;
}
if(!$MessageList.previewPane()){
return false;
}
$$MessageList.openMessage(row,$Widgets.Email.VIEW_PREVIEW);
return true;
},_showQuickReply:function(row,_e6d){
$Widgets.load("Compose.QuickReply");
var form=$Widgets.Compose.QuickReply.factory({reply_all:_e6d,id:row.obj.id(),folder:row.obj.folder(),subject:row.obj._sub.innerHTML});
form.show();
},cbCenterOnCursor:null,_cbCenterOnCursor:function(e){
var row=$$MessageList.Keyboard.Cursor.getCursorRow();
if(row){
$$MessageList.centerOnMessage(row);
}
},cbCheckEmail:null,_cbCheckEmail:function(e){
$AN(45);
$Dispatcher.checkMail();
},cbComposeMessage:null,_cbComposeMessage:function(e){
$AN(103);
this._compose();
},cbCursorDown:null,_cbCursorDown:function(e){
this._goToNextMessage(false);
},cbCursorUp:null,_cbCursorUp:function(e){
this._goToPreviousMessage(false);
},cbDeleteOpenMessage:null,_cbDeleteOpenMessage:function(){
$AN(54);
var row=$$MessageList.getOpenMessage();
if(row){
var obj=row.obj;
$UI.showStatus();
$MessageList.deleteMessages({folder:obj.folder(),id:obj.id()},function(){
$UI.clearStatus();
},false);
}
},cbDeleteMessages:null,_cbDeleteMessages:function(e){
$AN(52);
$$MessageList.deleteCheckedMessages();
},cbDeselectAllMessages:null,_cbDeselectAllMessages:function(e){
$$MessageList.checkAll(false);
},cbDown:null,_cbDown:function(e){
this._goToNextMessage(true);
},cbFirstMessage:null,_cbFirstMessage:function(e){
$$MessageList.Keyboard.Cursor.move($$MessageList.Keyboard.Cursor.FIRST);
var row=$$MessageList.getFirstRow();
this._openMessage(row);
},cbFocusSearch:null,_cbFocusSearch:function(e){
$AN(126);
$$Search.focus();
},cbForward:null,_cbForward:function(e){
$AN(113);
this._compose(wm_Compose_FORWARD);
},cbGoFolder:null,_cbGoFolder:function(e){
$Widgets.load("FolderPicker");
var _e7f=$Widgets.FolderPicker.factory({callback:function(_e80){
if(_e80==$MessageList.folder()){
return;
}
this._loadFolder(_e80);
}.bind(this)});
_e7f.show();
},cbGoFolderDrafts:null,_cbGoFolderDrafts:function(e){
this._loadFolder(CFG_FOLDER_DRAFTS);
},cbGoFolderInbox:null,_cbGoFolderInbox:function(e){
this._loadFolder(CFG_FOLDER_INBOX);
},cbGoFolderSent:null,_cbGoFolderSent:function(e){
this._loadFolder(CFG_FOLDER_SENT);
},cbGoFolderTrash:null,_cbGoFolderTrash:function(e){
this._loadFolder(CFG_FOLDER_TRASH);
},cbLastMessage:null,_cbLastMessage:function(e){
$$MessageList.Keyboard.Cursor.move($$MessageList.Keyboard.Cursor.LAST);
var row=$$MessageList.getLastMessage();
this._openMessage(row);
},cbMarkUnread:null,_cbMarkUnread:function(e){
$AN(96);
$$MessageList.markAsRead(null,false);
},cbMoveMessages:null,_cbMoveMessages:function(e){
$AN(64);
if($$MessageList.getCheckedRows().length==0){
return;
}
$Widgets.load("FolderPicker");
var _e89=$Widgets.FolderPicker.factory({callback:function(_e8a){
if(_e8a==$MessageList.folder()){
return;
}
$$MessageList.moveMessages(_e8a);
}.bind(this)});
_e89.show();
},cbNextPage:null,_cbNextPage:function(e){
$AN(78);
if($UI.Pager.goToNextPage($$MessageList.getPager())){
this.clearCursor();
}
},cbPopupMessage:null,_cbPopupMessage:function(e){
$AN(74);
var row=$$MessageList.getOpenMessage();
if(!row){
return;
}
$$MessageList.openMessage(row,$Widgets.Email.VIEW_POPUP);
},cbPreviewMessage:null,_cbPreviewMessage:function(e){
var row=$$MessageList.Keyboard.Cursor.getCursorRow();
this._openMessage(row);
},cbPrevPage:null,_cbPrevPage:function(e){
$AN(80);
if($UI.Pager.goToPreviousPage($$MessageList.getPager())){
this.clearCursor();
}
},cbQuickReply:null,_cbQuickReply:function(e){
$AN(110);
var _e92=$$MessageList.Keyboard.Cursor.getCursorRow();
if(!_e92){
return;
}
this._showQuickReply(_e92,false);
},cbQuickReplyAll:null,_cbQuickReplyAll:function(e){
$AN(112);
var _e94=$$MessageList.Keyboard.Cursor.getCursorRow();
if(!_e94){
return;
}
this._showQuickReply(_e94,true);
},cbReply:null,_cbReply:function(e){
$AN(104);
this._compose(wm_Compose_REPLY);
},cbReplyAll:null,_cbReplyAll:function(e){
$AN(107);
this._compose(wm_Compose_REPLY_ALL);
},cbSelectAllMessages:null,_cbSelectAllMessages:function(e){
$$MessageList.checkAll(true);
},cbSelectMultipleMessages:null,_cbSelectMultipleMessages:function(e){
var _e99=$$MessageList.Keyboard.Cursor.getCursorRow();
if(!_e99){
return;
}
if(_e99.obj.checked()){
return;
}
var _e9a=true;
var rows=$$MessageList.getCurrentObjects(_e9a);
var _e9c=false;
var _e9d=false;
for(var i=0;i<rows.length;i++){
if(rows[i].checked()){
_e9c=true;
}else{
if(_e99.obj.id()==rows[i].id()){
_e9d=true;
}
}
if(_e9c||_e9d){
rows[i].checked(true);
}
if(_e9c&&_e9d){
break;
}
}
},cbSubSettingsChange:null,_cbSubSettingsChange:function(){
this.initialize();
},cbToggleCheckbox:null,_cbToggleCheckbox:function(e){
var row=$$MessageList.Keyboard.Cursor.getCursorRow();
if(row){
var _ea1=row.obj.checked();
row.obj.checked(!_ea1);
}
},cbToggleFlag:null,_cbToggleFlag:function(e){
$AN(58);
var row=$$MessageList.Keyboard.Cursor.getCursorRow();
if(row){
row.obj.toggleFlag();
}
},cbUp:null,_cbUp:function(e){
this._goToPreviousMessage(true);
},evDocumentKeyPress:null,_evDocumentKeyPress:function(e){
if(!$MessageList.active()){
return;
}
if(typeof $Dialogs!="undefined"&&!$Dialogs.isKeyboardAllowed()){
return;
}
var _ea6=this.keyboard.getKeyPressed(e);
var _ea7=$$MessageList.isPreviewPaneFocused();
if(_ea7&&(_ea6==wack.Keyboard.KEY_ARROW_UP||_ea6==wack.Keyboard.KEY_ARROW_DOWN)){
return;
}
if(_ea7){
$$MessageList.blurPreviewPane();
}
this.keyboard.handleEvent(e);
}};
Object.bindCallbacks($$MessageList.Keyboard);
$Dispatcher.subscribe("Settings.change.keyboard_shortcuts_enabled",$$MessageList.Keyboard.cbSubSettingsChange);
}
if($Bootstrap.notLoaded("f06bc85c3455707672f5ed258e0e6715")){
Framework.register("Webmail.Modules.MessageList.Keyboard");
$$MessageList.Keyboard.Cursor=Webmail.Modules.MessageList.Keyboard.Cursor={CURSOR_CLASS:"keyboard_cursor",NEXT:1,PREVIOUS:2,FIRST:4,LAST:8,_cursor_row:null,_last_folder:null,clear:function(){
if(this._cursor_row){
Element.removeClassName(this._cursor_row.obj.getCheckboxCell(),this.CURSOR_CLASS);
this._cursor_row=null;
}
},getCursorRow:function(){
return this._cursor_row;
},isCursorRow:function(row){
var _ea9=false;
if(this._cursor_row){
_ea9=(row.id()==this._cursor_row.obj.id());
}
return _ea9;
},move:function(_eaa){
if(typeof _eaa=="object"){
var row=_eaa;
}else{
var row=this._getRow(_eaa);
}
if(!row||row==this._cursor_row){
return;
}
this.clear();
Element.addClassName(row.obj.getCheckboxCell(),this.CURSOR_CLASS);
this._cursor_row=row;
},_getFirstRow:function(){
return $$MessageList.getFirstRow();
},_getLastRow:function(){
return $$MessageList.getLastMessage();
},_getNextRow:function(){
var row=$$MessageList.current_message;
if(this._cursor_row){
row=this._cursor_row.obj.next();
}else{
if(row){
row=row.obj.next();
}else{
row=$$MessageList.getFirstRow();
}
}
return row;
},_getPreviousRow:function(){
if(!$$MessageList.getFirstRow()){
return;
}
var row=$$MessageList.getOpenMessage();
if(this._cursor_row){
row=this._cursor_row;
}
if(row){
row=row.obj.previous();
}
return row;
},_getRow:function(_eae){
var row;
switch(_eae){
case this.PREVIOUS:
row=this._getPreviousRow();
break;
case this.NEXT:
row=this._getNextRow();
break;
case this.FIRST:
row=this._getFirstRow();
break;
case this.LAST:
row=this._getLastRow();
break;
}
return row;
},_isRowAffected:function(row,msgs){
var uid=row.obj.id();
var _eb3=row.obj.folder();
for(var i=0;i<msgs.length;i++){
if(msgs[i].id==uid&&msgs[i].folder==_eb3){
return true;
}
}
return false;
},_moveToPreviousRow:function(_eb5){
if(!this._cursor_row){
return false;
}
var _eb6=this._cursor_row.obj.previous();
while(_eb6&&this._isRowAffected(_eb6,_eb5)){
_eb6=_eb6.obj.previous();
}
if(_eb6){
$$MessageList.Keyboard.Cursor.move(_eb6);
$$MessageList.scrollToMessage(_eb6);
return true;
}else{
return false;
}
},cbSubFolderSetActive:null,_cbSubFolderSetActive:function(_eb7){
if(_eb7.folder==this._last_folder){
return;
}
this._last_folder=_eb7.folder;
this.clear();
},cbSubMessageChange:null,_cbSubMessageChange:function(_eb8,uid){
var _eba=$$MessageList.getCurrentList();
var _ebb=$MessageList.getUniqueId(_eb8,uid);
if(_eba[_ebb]){
this.move(_eba[_ebb]);
}
},cbSubMessageMove:null,_cbSubMessageMove:function(_ebc){
if(this._cursor_row&&this._isRowAffected(this._cursor_row,_ebc)&&!this._moveToPreviousRow(_ebc)){
this.clear();
}
},cbSubSettingsChange:null,_cbSubSettingsChange:function(){
if(!$Settings.isKeyboardShortcutsEnabled()){
this.clear();
}
}};
Object.bindCallbacks($$MessageList.Keyboard.Cursor);
$Dispatcher.subscribe("Folders.setActive",$$MessageList.Keyboard.Cursor.cbSubFolderSetActive);
$Dispatcher.subscribe("Message.move",$$MessageList.Keyboard.Cursor.cbSubMessageMove);
$Dispatcher.subscribe("Message.change",$$MessageList.Keyboard.Cursor.cbSubMessageChange);
$Dispatcher.subscribe("Settings.change.keyboard_shortcuts_enabled",$$MessageList.Keyboard.Cursor.cbSubSettingsChange);
}
if($Bootstrap.notLoaded("30068b1e3b3a5c53f8843d8f1479256a")){
Framework.register("Webmail.Modules.MessageList");
$$MessageRow=Webmail.Modules.MessageList.MessageRow=function(opts){
var _ebe=Object.extend({click_handler:false},opts||{});
this._row=$$MessageRow._createRow();
this._row.obj=this;
this._row.name="container";
this._cbx=this._row.firstChild.firstChild;
this._cbx.container=this._row.firstChild;
this._pri=this._row.childNodes[1].firstChild;
this._pri.container=this._row.childNodes[1];
this._icon=this._row.childNodes[2].firstChild.firstChild;
this._icon.container=this._row.childNodes[2];
this._flag=this._row.childNodes[3].firstChild.firstChild;
this._flag.container=this._row.childNodes[3];
this._att=this._row.childNodes[4].firstChild;
this._att.container=this._row.childNodes[4];
if($Custom.isRecipientColumnEnabled()){
this._recipient=this._row.childNodes[5].firstChild;
this._recipient_container=this._row.childNodes[5];
var i=1;
}else{
var i=0;
}
this._from=this._row.childNodes[5+i].firstChild;
this._from.container=this._row.childNodes[5+i];
this._sub=this._row.childNodes[6+i].firstChild;
this._sub.container=this._row.childNodes[6+i];
this._folder_div=this._row.childNodes[7+i].firstChild;
this._date=this._row.childNodes[8+i].firstChild;
this._date.container=this._row.childNodes[8+i];
this._size=this._row.childNodes[9+i].firstChild;
this._size.container=this._row.childNodes[9+i];
$UI.Grid.addHoverColor(this._row);
if(_ebe.click_handler){
Event.observe(this._row,"click",_ebe.click_handler);
Event.observe(this._row,"dblclick",_ebe.click_handler);
}
Event.observe(this._flag,"click",this.evToggleFlag.bindAsEventListener(this));
Event.observe(this._icon.container,"mousedown",this.evToggleRead.bindAsEventListener(this));
var _ec0=$$MessageRow.makeDraggable(this._from);
var _ec1=$$MessageRow.makeDraggable(this._sub);
var _ec2=$$MessageRow.makeDraggable(this._date);
var _ec3=$$MessageRow.makeDraggable(this._size);
this._cbx.container.name="check_cont";
this._pri.container.name="pri_cont";
this._icon.container.name="icon_cont";
this._flag.container.name="flag_cont";
this._att.container.name="att_cont";
this._is_read=true;
this._flagged=false;
this._deleted=false;
this._visible=true;
this._selected=false;
this._replied=false;
this._forwarded=false;
this._folder=false;
this._recipient_email=false;
this._recipient_name=false;
this._from_email=false;
this._from_name=false;
this._score=false;
this._select_flag=false;
this._flag_color=false;
this._flag_list={red:"red_flag",yellow:"yellow_flag",green:"green_flag",blue:"blue_flag",purple:"purple_flag"};
};
$$MessageRow.prototype={checked:function(s){
if(typeof s=="undefined"){
return this._cbx.checked;
}else{
$UI_Grid.checkSelectedRow(this._cbx,s);
if(s){
if(!Element.hasClassName(this._row,"MessageRow_selected")){
Element.addClassName(this._row,"MessageRow_selected");
}
}else{
if(!this.selected()){
Element.removeClassName(this._row,"MessageRow_selected");
}
}
}
},emptyRow:function(){
this.visible(false);
},fillRow:function(ma,opts){
var _ec7=Object.extend({use_to_field:false,show_folder:false},opts||{});
if(this.checked()){
this.checked(false);
}
Element.removeClassName(this._row,"Grid_selected_row");
if(this.selected()){
this.selected(false);
}
if(!this.visible()){
this.visible(true);
}
this.id(ma["id"]);
var pri=this._pri;
var _ec9="";
var _eca=ma["priority"]||"0";
if(_eca!="0"){
_eca=_eca.slice(0,1);
}
if(_eca=="5"){
_ec9="MessageRow_prio_low";
}else{
if(_eca=="1"||_eca=="2"){
_ec9="MessageRow_prio_high";
}
}
if(_ec9){
pri.style.visibility="";
pri.className="MessageRow_priority_image "+_ec9;
}else{
pri.style.visibility="hidden";
}
if(ma["replied"]!=this.replied()){
this.replied(ma["replied"],true);
}
if(ma["forwarded"]!=this.forwarded()){
this.forwarded(ma["forwarded"],true);
}
if(ma["deleted"]!=this.deleted()){
this.deleted(ma["deleted"]);
}
if(ma["color"]){
this._flag_color=ma["color"];
}else{
this._flag_color=false;
}
this.flag(ma["flagged"],true);
this.read(ma["read"],true);
var att=this._att;
att.style.visibility=(ma["attach"]?"visible":"hidden");
if($Custom.isRecipientColumnEnabled()){
this._recipient.innerHTML=this._getAddressDisplay(ma["recipient"]);
}
if(opts.use_to_field){
var _ecc=ma["to"];
}else{
var _ecc=ma["from"];
}
if(_ecc[0]){
this._from_email=_ecc[0].email;
this._from_name=_ecc[0].personal||this._from_email;
}
this._from.innerHTML=this._getAddressDisplay(_ecc);
var sub=this._sub;
sub.innerHTML=ma["subject"];
this.setDateTime(ma["datetime"]);
this.showDate();
var size=this._size;
size.innerHTML=ma["size"];
this.folder(ma["folder"],ma["folder_disp"]);
if(opts.show_folder){
this.showFolder();
}else{
this.hideFolder();
}
if(ma["score"]){
this.score(ma["score"]);
}
},flag:function(f,_ed0){
if(typeof f=="undefined"){
return this._flagged;
}else{
this._flagged=f;
for(color in this._flag_list){
if(Element.hasClassName(this._flag,this._flag_list[color])){
Element.removeClassName(this._flag,this._flag_list[color]);
}
}
if(f){
switch(this._flag_color){
case Mail_YELLOW_FLAG:
Element.addClassName(this._flag,this._flag_list.yellow);
break;
case Mail_GREEN_FLAG:
Element.addClassName(this._flag,this._flag_list.green);
break;
case Mail_BLUE_FLAG:
Element.addClassName(this._flag,this._flag_list.blue);
break;
case Mail_PURPLE_FLAG:
Element.addClassName(this._flag,this._flag_list.purple);
break;
default:
Element.addClassName(this._flag,this._flag_list.red);
break;
}
}
if(!_ed0){
$MessageList.updateCachedMsg(this.folder(),this.id(),{color:this._flag_color,flagged:this._flagged});
}
}
},folder:function(n,d){
if(typeof n=="undefined"){
return this._folder;
}else{
this._folder=n;
this._folder_disp=d;
}
},forwarded:function(f,_ed4){
if(typeof f=="undefined"){
return this._forwarded;
}else{
this._forwarded=f;
if(this.read()){
var me=$$MessageRow;
if(this._replied&&f){
this._icon.className="fwd_reply";
}else{
this._icon.className=(f?"forward":"read_mail");
}
}
if(!_ed4){
$MessageList.updateCachedMsg(this.folder(),this.id(),{forwarded:this._forwarded});
}
}
},from:function(){
var _ed6={name:this._from_name,email:this._from_email};
return _ed6;
},getCheckbox:function(){
return this._cbx;
},getCheckboxCell:function(){
var _ed7=this._cbx.parentNode;
while(_ed7!=null&&_ed7.tagName.toLowerCase()!="td"){
_ed7=_ed7.parentNode;
}
return _ed7;
},getContainer:function(){
return this._row;
},getUniqueId:function(){
return $MessageList.getUniqueId(this.folder(),this.id());
},hasAttachment:function(show){
if(typeof show=="undefined"){
return (this._att.style.visibility=="visible"?true:false);
}else{
if(!this.visible()){
return;
}
if(show){
this._row.style.display="";
}else{
if(!this.hasAttachment()){
if(this.checked()){
this.checked(false);
}
this._row.style.display="none";
}
}
}
},hideFolder:function(){
Element.addClassName(this._folder_div,"MessageRow_folder_hidden");
},id:function(n){
if(typeof n=="undefined"){
return this._id;
}else{
this._id=n;
}
},next:function(){
return (this._row.nextSibling?this._row.nextSibling:false);
},previous:function(){
return (this._row.previousSibling?this._row.previousSibling:false);
},read:function(r,_edb){
if(typeof r=="undefined"){
return this._is_read;
}else{
var me=$$MessageRow;
this._is_read=r;
if(r){
Element.removeClassName(this._row,"MessageRow_unread_msg");
var icon;
if(this.replied()&&this.forwarded()){
icon="fwd_reply";
}else{
if(this.replied()){
icon="reply";
}else{
if(this.forwarded()){
icon="forward";
}else{
icon="read_mail";
}
}
}
this._icon.className=icon;
}else{
Element.addClassName(this._row,"MessageRow_unread_msg");
this._icon.className="new_mail";
}
if(!_edb){
$MessageList.updateCachedMsg(this.folder(),this.id(),{read:r});
}
}
},remNode:function(){
this.visible(false);
this.checked(false);
this.selected(false);
var next=this.next();
if(next&&next.obj.visible()){
var c=this._row.parentNode;
c.removeChild(this._row);
c.appendChild(this._row);
}
$UI_Grid.changeHoverColor(this._row,false);
},replied:function(r,_ee1){
if(typeof r=="undefined"){
return this._replied;
}else{
this._replied=r;
if(this.read()){
var me=$$MessageRow;
if(this._forwarded&&r){
this._icon.className="fwd_reply";
}else{
this._icon.className=(r?"reply":"read_mail");
}
}
if(!_ee1){
$MessageList.updateCachedMsg(this.folder(),this.id(),{replied:this._replied});
}
}
},score:function(s){
if(typeof s=="undefined"){
return this._score;
}else{
this._score=s;
}
},selected:function(s){
if(typeof s=="undefined"){
return this._selected;
}else{
this._selected=s;
if(s){
Element.addClassName(this._row,"MessageRow_selected");
}else{
if(!this.checked()){
Element.removeClassName(this._row,"MessageRow_selected");
}
}
}
},setDateTime:function(_ee5){
if(this._date_time){
delete (this._date_time);
}
this._date_time=$DateTime.create(null,null,_ee5);
},showDate:function(){
if(!this._date_time){
var date="";
}else{
var date=this._date_time.getSimpleDisplay();
}
if(this._date.innerHTML!=date){
this._date.innerHTML=date;
}
},showFolder:function(){
var _ee7=this._folder_disp;
_ee7=_ee7.split(".");
var _ee8=_ee7[_ee7.length-1];
if(_ee8==CFG_FOLDER_INBOX){
_ee8=L("Mlist.Folder.Inbox");
}
this._folder_div.innerHTML=_ee8;
Element.removeClassName(this._folder_div,"MessageRow_folder_hidden");
},toggleFlag:function(){
this.flag(!this.flag());
this._flag_color=false;
var _ee9=function(){
var sort=$MessageList.sort();
if(sort==10||sort==11){
$MessageList.refillList();
}
};
$Mail.setFlag({id:this.id(),folder:this.folder()},this.flag(),_ee9);
},deleted:function(s){
if(typeof s=="undefined"){
return this._deleted;
}else{
this._deleted=s;
if(s){
Element.addClassName(this._row,"MessageRow_deleted");
}else{
Element.removeClassName(this._row,"MessageRow_deleted");
}
}
},visible:function(v){
if(typeof v=="undefined"){
return this._visible;
}else{
this._visible=v;
this._row.style.display=(v?"":"none");
}
},_getAddressDisplay:function(data){
if(typeof (data)!="array"&&typeof (data)!="object"){
data=[{email:data}];
}
var list=[];
for(var k=0,kk=data.length;k<kk;k++){
var curr=data[k];
var _ef1=curr.email;
var name=curr.personal||_ef1;
if(!_ef1){
continue;
}
list.push("<span alt=\""+_ef1+"\" title=\""+_ef1+"\">"+name+"</span>");
}
var _ef3=list.join(", ");
return _ef3;
},evSetFlag:function(e){
var elem=Event.findElement(e,"li");
var row=$$MessageRow.findContainer(elem.parentNode.parentNode.flag_row);
for(color in this._flag_list){
if(Element.hasClassName(elem,this._flag_list[color])){
switch(color){
case "green":
row.obj._flag_color=Mail_GREEN_FLAG;
break;
case "purple":
row.obj._flag_color=Mail_PURPLE_FLAG;
break;
case "blue":
row.obj._flag_color=Mail_BLUE_FLAG;
break;
case "yellow":
row.obj._flag_color=Mail_YELLOW_FLAG;
break;
default:
row.obj._flag_color=false;
break;
}
}
}
row.obj.flag(true);
$$MessageRow.open_dialog=false;
$Dialogs.unloadDialog(elem.parentNode.parentNode);
var _ef7=function(){
var sort=$MessageList.sort();
if(sort==10||sort==11){
$MessageList.refillList();
}
};
$Mail.setFlag({id:row.obj.id(),folder:row.obj.folder()},true,_ef7,row.obj._flag_color);
},evToggleFlag:function(e){
this.toggleFlag();
if(this.flag()){
$AN(57);
}else{
$AN(60);
}
},evToggleRead:function(e){
if(Keystroke.key("u")){
alert("Folder: "+this.folder()+"\nUID: "+this.id());
}else{
this.read(!this.read());
var _efb=Prototype.emptyFunction;
$Dispatcher.publish("Folders.status_change",this.folder(),0,(this.read()?-1:1));
$Mail.setReadStatus({id:this.id(),folder:this.folder()},this.read(),_efb);
if(this.read()){
$AN(92);
}else{
$AN(95);
}
}
}};
$$MessageRow._createTemplate=function(){
var _efc=Element.create("tr",{className:"MessageRow"});
var _efd=Element.create("td",{className:"Grid_row_check_cell"});
var _efe=Element.create("input",{type:"checkbox"});
Element.append(_efd,_efe);
var _eff=Element.create("td",{className:"MessageRow_priority_cell"});
var _f00=Element.create("img",{className:"MessageRow_priority_image",src:"images/blank.gif"});
_f00.style.visibility="hidden";
Element.append(_eff,_f00);
var _f01=Element.create("td",{className:"MessageRow_icon_cell"});
var _f02=Element.create("div",{className:"MessageRow_icon_div"});
var _f03=Element.create("img",{className:"read_envelope",src:"images/blank.gif"});
Element.append(_f02,_f03);
Element.append(_f01,_f02);
var _f04=Element.create("td",{className:"flag_cell"});
var _f05=Element.create("div",{className:"flag_div"});
var _f06=Element.create("img",{className:"flag_image",src:"images/blank.gif"});
Element.append(_f05,_f06);
Element.append(_f04,_f05);
var _f07=Element.create("td",{className:"MessageRow_attach_cell"});
var _f08=Element.create("img",{className:"MessageRow_attach_image",src:"images/blank.gif"});
_f08.style.visibility="hidden";
Element.append(_f07,_f08);
if($Custom.isRecipientColumnEnabled()){
var _f09=Element.create("td");
var _f0a=Element.create("div",{className:"MessageRow_recipient_div Email_draggable"});
Element.append(_f09,_f0a);
}
var _f0b=Element.create("td");
var _f0c=Element.create("div",{className:"MessageRow_from_div Email_draggable"});
Element.append(_f0b,_f0c);
var _f0d=Element.create("td");
var _f0e=Element.create("div",{className:"MessageRow_subject_div Email_draggable"});
Element.append(_f0d,_f0e);
var _f0f=Element.create("td");
var _f10=Element.create("div",{className:"MessageRow_folder Email_draggable"});
Element.append(_f0f,_f10);
var _f11=Element.create("td",{className:"MessageRow_date_cell"});
var _f12=Element.create("div",{className:"MessageRow_date_div Email_draggable"});
Element.append(_f11,_f12);
var _f13=Element.create("td",{className:"MessageRow_size_cell"});
var _f14=Element.create("div",{className:"MessageRow_size_div Email_draggable"});
Element.append(_f13,_f14);
Element.append(_efc,_efd,_eff,_f01,_f04,_f07);
if($Custom.isRecipientColumnEnabled()){
Element.append(_efc,_f09);
}
Element.append(_efc,_f0b,_f0d,_f0f,_f11,_f13);
return _efc;
};
$$MessageRow._createRow=function(){
if(!$$MessageRow._template){
$$MessageRow._template=$$MessageRow._createTemplate();
}
var row=$$MessageRow._template.cloneNode(true);
row.firstChild.firstChild.type="checkbox";
return row;
};
$$MessageRow.evClearDialogs=function(){
if($$MessageRow.open_dialog){
if(wack.Browser.is_linux&&wack.Browser.is_firefox&&$$MessageRow.just_opened){
$$MessageRow.just_opened=false;
return;
}
$Dialogs.unloadDialog($$MessageRow.open_dialog);
$$MessageRow.open_dialog=false;
}
};
$$MessageRow.findContainer=function(elem){
while(elem.name!="container"&&elem.nodeName.toLowerCase()!="document.body"){
elem=elem.parentNode;
}
if(elem.nodeName.toLowerCase()=="document.body"){
return false;
}
return elem;
};
$$MessageRow.checkDragCallback=function(_f17,_f18){
var tr=$$MessageRow.findContainer(_f17);
tr.obj.checked(_f18);
};
$$MessageRow.makeDraggable=function(elem){
var _f1b=new Draggable(elem,{delay:200,revert:true,reverteffect:function(elem,top,left){
elem.style.top=elem.style.left=0;
elem=$(elem);
elem.removeClassName("Email_drag_active");
elem.style.cursor=elem.style.position="";
Element.append(elem._parent,elem);
$MessageList.is_dragging=false;
},ghosting:true,starteffect:function(elem){
Position.includeScrollOffsets=true;
elem=$(elem);
elem.addClassName("Email_drag_active");
elem.style.cursor="move";
elem._contents=elem.innerHTML;
elem._parent=elem.parentNode;
var tr=$$MessageRow.findContainer(elem._parent);
if(tr.obj.checked()){
var msgs=$$MessageList.getCheckedRows(tr.parentNode);
var _f22=msgs.length;
elem.msgs=msgs;
}else{
_f22=0;
elem.msgs=tr.obj.id();
}
var _f23=Element.create("div");
_f23.style.zIndex=200000;
if(_f22==0||_f22==1){
_f23.innerHTML=L("Mlist.S.Move1Item");
}else{
_f23.innerHTML=L("Mlist.S.MoveItems",_f22);
}
elem.innerHTML="";
Element.append(document.body,elem);
elem.append(_f23);
$MessageList.is_dragging=true;
},endeffect:function(elem){
Position.includeScrollOffsets=false;
elem=$(elem);
elem.removeClassName("Email_drag_active");
elem.style.cursor="";
Element.append(elem._parent,elem);
elem.innerHTML=elem._contents;
elem._parent=null;
elem._contents=null;
$MessageList.is_dragging=false;
},change:function(_f25){
_f25.offset=[8,8];
}});
elem.style.position="";
};
$$MessageRow.dropMessageInFolder=function(_f26,_f27){
$$MessageList.header.dom("checkbox").checked=false;
var tr=$$MessageRow.findContainer(_f27._parent);
var _f29=tr.obj.folder();
if(_f29==_f26){
return;
}
var _f2a=$$MessageList.getCheckedRows(tr.parentNode);
if((_f2a.length==0)||(!tr.obj.checked())){
var _f2b=tr.obj.id();
var _f2c={folder:_f29,id:_f2b,unread:!tr.obj.read()};
_f2a=[_f2c];
}
var _f2d=$$MessageList.dom.getBody();
$UI.showStatus(L("Mlist.St.Move"));
$MessageList.moveMessages(_f2a,_f26);
};
Event.observe(window.document,"click",$$MessageRow.evClearDialogs.bindAsEventListener(this));
}
if($Bootstrap.notLoaded("a6f7f0793fd076926d061c44201cf545")){
Framework.create("Webmail.Modules.MessageList.Prefetcher",wack.Class.create());
Webmail.Modules.MessageList.Prefetcher.prototype=wack.extend(new Webmail.AbstractPrefetcher(),{initialize:function(list,_f2f,_f30,_f31){
_f31.subscribe("Folders.newUnreadMessages",this.cbSub_addPrefetchItem);
Object.bindCallbacks(this);
this._exclusion_list=_f2f||new Webmail.Modules.MessageList.Prefetcher.FolderExclusionList();
this._options=Object.extend({prefetch_buffer:1,interval_sleep_time:60},_f30||{});
this._list=new Webmail.Modules.MessageList.Prefetcher.FolderList();
if(list){
var item;
while(item=list.shiftTopItem()){
if($FolderList.getTotalMessages(item)<=0){
$MessageList.setCache([],item,{sort:-1,total:0,unread:0});
}else{
this.addPrefetchItem(item);
}
}
}
},start:function(){
if(this._current_timer){
window.clearInterval(this.interval_timer);
}
this._active=true;
this.prefetchNextItems();
},stop:function(){
this._active=false;
if(this.interval_timer){
window.clearInterval(this.interval_timer);
}
},sendRequest:function(item,_f34){
if(item.length==0){
return;
}
var _f35={background:true,cluster:"prefetch",update:$MessageList.hasCache(item[0])};
$MessageList.prefetchFolderMessageHeaders(item[0],_f35,_f34);
},completeFetch:function(_f36){
if($MessageList.hasCache(_f36.folder)){
var _f37={};
var _f38=$MessageList.getCache(_f36.folder);
var _f39=0;
for(var uid in _f38){
if(_f39>50){
break;
}
if(!_f36.msgs[uid]){
_f36.msgs[uid]=_f38[uid];
}
_f39++;
}
}
$MessageList.setCache(_f36.msgs,_f36.folder,{sort:_f36.sort,total:_f36.total,unread:_f36.unseen});
},cbSub_addPrefetchItem:null,_cbSub_addPrefetchItem:function(item){
this.addPrefetchItem(item);
}});
}
if($Bootstrap.notLoaded("a51f032869a42149c3212f2dea31f4fd")){
Framework.register("Webmail.Modules.MessageList.Prefetcher");
Webmail.Modules.MessageList.Prefetcher.FolderExclusionList=Class.create();
Webmail.Modules.MessageList.Prefetcher.FolderExclusionList.prototype=wack.extend(new wack.List(),{initialize:function(){
},matches:function(item,_f3d){
if(item.match(_f3d)){
return true;
}
return false;
}});
}
if($Bootstrap.notLoaded("8930c279007b27f965e085ad6894c01d")){
Framework.register("Webmail.Modules.MessageList.Prefetcher");
Webmail.Modules.MessageList.Prefetcher.FolderList=wack.Class.create();
Webmail.Modules.MessageList.Prefetcher.FolderList.prototype=wack.extend(new wack.List(),{initialize:function(){
},addItemToList:function(item,list){
if(!this.contains(item)){
list.push(item);
}
}});
}
if($Bootstrap.notLoaded("685c17811d7d3e93f4612f53c466c7bc")){
Framework.register("Webmail.Widgets");
$Widgets.ContextMenu.Messages=$Widgets.create({fpicker:null,msg_row:null,settings_widget:null,hide:function(){
if(this.msg_row){
Element.removeClassName(this.msg_row,"Grid_hover_row");
}
this._menu.hide();
},_buildFilterData:function(){
var data=this._data;
var _f41={criteria:[],action:[]};
if(!data.multiple){
_f41.criteria.push({field:wm_MailFilter_FIELD_FROM,string:data.messages[0].from.email});
_f41.criteria.push({field:wm_MailFilter_FIELD_SUBJECT,string:data.messages[0].subject});
}
return _f41;
},_drawFlags:function(){
var _f42=Element.createHtml("<div class=\"flags\"><span class=\"label\">"+L("Mlist.Action.Flag")+":</span><a class=\"flag_red\" href=\"javascript:void(0);\" _ref=\"flag_red\">&nbsp;</a><a class=\"flag_green\" href=\"javascript:void(0);\" _ref=\"flag_green\">&nbsp;</a><a class=\"flag_purple\" href=\"javascript:void(0);\" _ref=\"flag_purple\">&nbsp;</a><a class=\"flag_blue\" href=\"javascript:void(0);\" _ref=\"flag_blue\">&nbsp;</a><a class=\"flag_yellow\" href=\"javascript:void(0);\" _ref=\"flag_yellow\">&nbsp;</a><a class=\"flag_grey\" href=\"javascript:void(0);\" _ref=\"flag_grey\">&nbsp;</a></div>");
Event.observe(_f42,"click",this.evSetFlag);
return _f42;
},_findClickedElement:function(e){
this.msg_row=Event.findElement(e,"tr");
if(!this.msg_row||(this.msg_row==document)||(this.msg_row.id=="MList_header")){
this.msg_row=null;
return false;
}
Element.addClassName(this.msg_row,"Grid_hover_row");
return this.msg_row;
},_getData:function(elem){
var _f45=false;
if(elem.obj.checked()){
if(this.options.search){
cont=$$Search.dom.getBody();
rows=$$Search.getCheckedRows(cont,true);
}else{
var cont=$$MessageList.dom.getBody();
var rows=$$MessageList.getCheckedRows(cont,true);
}
if(rows.length>1){
_f45=true;
}
var _f48=[];
for(var i=0,ii=rows.length;i<ii;i++){
_f48.push({id:rows[i].obj.id(),folder:rows[i].obj.folder(),from:rows[i].obj.from(),read:rows[i].obj.read(),elem:rows[i]});
}
}else{
var _f48=[{id:elem.obj.id(),folder:elem.obj.folder(),from:elem.obj.from(),read:elem.obj.read(),subject:elem.obj._sub.innerHTML,elem:elem}];
}
var data={multiple:_f45,messages:_f48};
return data;
},_getMenuItems:function(){
var _f4b=[{label:L("Message.Link.NewWindow"),callback:this.cbOpenNew,isdefault:true,disabled:this._isMultiple.bind(this)},{label:L("Message.Link.Delete"),callback:this.cbDelete},{label:L("Mlist.Action.MarkRead"),callback:this.cbMarkRead},{label:L("Mlist.Action.MarkUnread"),callback:this.cbMarkNew},{label:L("Message.Link.NotSpam"),callback:this.cbReportNotSpam,show:function(){
return $FolderList.isSpam(this._data.messages[0].folder)||Webmail.isQuarantine();
}.bind(this)},{label:L("Message.Link.Spam"),callback:this.cbReportSpam,show:function(){
if(!$Custom.isReportSpamEnabled()){
return false;
}else{
if(!($FolderList.isSpam(this._data.messages[0].folder))){
return true;
}else{
return false;
}
}
}.bind(this)},{new_section:true},{label:L("Message.Link.Reply"),callback:this.cbReply,disabled:this._isMultiple.bind(this),show:function(){
return $Custom.isComposeEnabled();
}},{label:L("Message.Link.ReplyAll"),callback:this.cbReplyAll,disabled:this._isMultiple.bind(this),show:function(){
return $Custom.isComposeEnabled();
}},{label:L("Message.Link.Forward"),callback:this.cbForward,show:function(){
$Custom.isComposeEnabled();
}},{label:L("Webmail.L.Print"),callback:this.cbPrint,disabled:this._isMultiple.bind(this)},{label:L("Message.Link.QuickReply"),callback:this.cbQuickReply,disabled:this._isMultiple.bind(this),show:function(){
return $Custom.isComposeEnabled();
}},{new_section:true},{custom:this._drawFlags(),callback:null},{label:L("Mlist.Action.AddSender")+"...",callback:this.cbAddSender,disabled:this._isMultiple.bind(this),show:function(){
return $Custom.isContactsEnabled();
}},{label:L("Mlist.Action.Move")+"...",callback:this.cbMoveTo,show:function(){
return $Custom.isFoldersEnabled();
}},{label:L("Settings.Filtering.Add")+"...",callback:this.cbAddFilter,disabled:this._isMultiple.bind(this),show:function(){
return $Settings.isIncomingOptionsEnabled();
}}];
return _f4b;
},_isMultiple:function(){
return this._data.multiple;
},cbAddFilter:null,_cbAddFilter:function(){
$AN(133);
REQUIRE("combo/settings");
var data=this._buildFilterData();
var _f4d=(data?L("Settings.Filters.F.EditTitle"):L("Settings.Filters.F.AddTitle"));
var form=$Widgets.Settings.Email.FilterForm.factory({self_saving:true});
form.show(_f4d);
form.populate(data);
},cbAddSender:null,_cbAddSender:function(){
$AN(20);
REQUIRE("combo/contacts");
var _f4f=this._data.messages[0];
var name=(_f4f.from.name?_f4f.from.name:"");
var _f51=(_f4f.from.email?_f4f.from.email:"");
var _f52=new $$Contacts.AddContactDialog({standard:{email:_f51,firstname:name},custom:false});
_f52.addErrorListener(function(msg){
$$Contacts._onError(msg,function(){
_f52.enableDialog(true);
});
_f52.enableDialog(false);
}.bind(this));
_f52.show();
},cbDelete:null,_cbDelete:function(){
$AN(53);
var _f54=[];
var _f55=this._data.messages;
for(var i=0,ii=_f55.length;i<ii;i++){
_f54.push({folder:_f55[i].folder,id:_f55[i].id});
}
$UI.showStatus();
$MessageList.deleteMessages(_f54);
},cbForward:null,_cbForward:function(){
var _f57=[];
var _f58=this._data.messages;
for(var i=0,ii=_f58.length;i<ii;i++){
_f57.push({folder:_f58[i].folder,id:_f58[i].id});
}
if(this._isMultiple()){
$AN(117);
$MessageList.forwardMessages(_f57);
}else{
$AN(115);
$Dispatcher.compose(null,wm_Compose_FORWARD,_f57[0].id,_f57[0].folder);
}
},cbMarkNew:null,_cbMarkNew:function(){
$AN(97);
var _f5a=[];
var _f5b=this._data.messages;
for(var i=0,ii=_f5b.length;i<ii;i++){
if(_f5b[i].read){
_f5a.push({folder:_f5b[i].folder,id:_f5b[i].id});
_f5b[i].elem.obj.read(false);
}
}
$MessageList.markAsRead(_f5a,false);
$Dispatcher.publish("Folders.status_change",_f5b[0].folder,0,_f5a.length);
},cbMarkRead:null,_cbMarkRead:function(){
$AN(93);
var _f5d=[];
var _f5e=this._data.messages;
for(var i=0,ii=_f5e.length;i<ii;i++){
if(!(_f5e[i].read)){
_f5d.push({folder:_f5e[i].folder,id:_f5e[i].id});
_f5e[i].elem.obj.read(true);
}
}
$MessageList.markAsRead(_f5d,true);
$Dispatcher.publish("Folders.status_change",_f5e[0].folder,0,-_f5d.length);
},cbMoveTo:null,_cbMoveTo:function(){
$AN(67);
$Widgets.load("FolderPicker");
var _f60=$Widgets.FolderPicker.factory({callback:this.cbMoveToChoose});
_f60.show();
},cbMoveToChoose:null,_cbMoveToChoose:function(_f61){
var _f62=[];
var _f63=this._data.messages;
for(var i=0,ii=_f63.length;i<ii;i++){
_f62.push({folder:_f63[i].folder,id:_f63[i].id,unread:!(_f63[i].read)});
}
$UI.showStatus();
$MessageList.moveMessages(_f62,_f61);
},cbOpenNew:null,_cbOpenNew:function(){
$AN(75);
var _f65=this._data.messages[0];
var _f66={folder:_f65.folder,uid:_f65.id,unread:!(_f65.read)};
$$Message.popup(_f66);
},cbPrint:null,_cbPrint:function(){
$AN(84);
var _f67=this._data.messages[0];
var _f68=$$MessageList._email_widget;
if((_f68!=null)&&(_f68.getUid()==_f67.id)){
$$MessageList._email_widget.print();
}else{
var _f69={folder:_f67.folder,uid:_f67.id,unread:!(_f67.read),printOnLoad:true};
$$Message.popup(_f69);
}
},cbQuickReply:null,_cbQuickReply:function(){
$AN(111);
var _f6a=this._data.messages[0];
$Widgets.load("Compose.QuickReply");
var _f6b=$Widgets.Compose.QuickReply.factory(_f6a);
_f6b.show();
},cbReply:null,_cbReply:function(){
$AN(106);
var _f6c=this._data.messages[0];
$Dispatcher.compose(null,wm_Compose_REPLY,_f6c.id,_f6c.folder);
},cbReplyAll:null,_cbReplyAll:function(){
$AN(109);
var _f6d=this._data.messages[0];
$Dispatcher.compose(null,wm_Compose_REPLY_ALL,_f6d.id,_f6d.folder);
},cbReportNotSpam:null,_cbReportNotSpam:function(){
$AN(90);
var _f6e=[];
var _f6f=this._data.messages;
for(var i=0,ii=_f6f.length;i<ii;i++){
_f6e.push({folder:_f6f[i].folder,id:_f6f[i].id});
}
$UI.showStatus();
$MessageList.reportNotSpam(_f6e);
},cbReportSpam:null,_cbReportSpam:function(){
$AN(87);
var _f71=[];
var _f72=this._data.messages;
for(var i=0,ii=_f72.length;i<ii;i++){
_f71.push({folder:_f72[i].folder,id:_f72[i].id});
}
var msg=(_f72.length>1?"Mlist.C.ReportSpam.P":"Mlist.C.ReportSpam");
if(!confirm(L(msg))){
return;
}
$UI.showStatus();
$MessageList.reportSpam(_f71);
},evSetFlag:null,_evSetFlag:function(e){
$AN(55);
var elem=Event.findElement(e,"a");
var flag,color;
switch(elem.className){
case "flag_red":
flag=true;
color=null;
break;
case "flag_green":
flag=true;
color=Mail_GREEN_FLAG;
break;
case "flag_purple":
flag=true;
color=Mail_PURPLE_FLAG;
break;
case "flag_blue":
flag=true;
color=Mail_BLUE_FLAG;
break;
case "flag_yellow":
flag=true;
color=Mail_YELLOW_FLAG;
break;
default:
flag=false;
color=null;
break;
}
var _f78=[];
var _f79=this._data.messages;
for(var i=0,ii=_f79.length;i<ii;i++){
_f78.push({folder:_f79[i].folder,id:_f79[i].id});
_f79[i].elem.obj._flag_color=color;
_f79[i].elem.obj.flag(flag);
}
$Mail.setFlag(_f78,flag,function(){
var sort=$MessageList.sort();
if(sort==10||sort==11){
$MessageList.refillList();
}
},color);
}},$Widgets.ContextMenu);
}
if($Bootstrap.notLoaded("8c9810847b0553066c0ceb964345fde8")){
Framework.register("Webmail.Modules");
$$Message=Webmail.Modules.Message={config:{disable_scroll:true,enable_print:true,enable_search:true},_email_widget:null,_popups:[],__preload:function(){
this.container=Element.createHtml(["<div class=\"Message_container\">","<div class=\"toolbar\"></div>","<div class=\"title_bar\" style=\"overflow:hidden\">","<div class=\"title_bar_heading\" ","style=\"float:left;position:relative;padding-left:10px;width:80%;\">","</div>","<div style=\"float:right;position:relative;padding-right:10px;\">","<a href=\"javascript:void(0);\">",L("Message.ShowHeader"),"</a>","</div>","</div>","<div></div>","</div>"].join(""));
$Templates.setDom(this.container,{toolbar:"/firstChild",title_bar:"/childNodes[1]",title_left:"/title_bar/firstChild",title_right:"/title_bar/lastChild",subject:"/title_left",header_link:"/title_right/a[0]",wrapper:"/lastChild"});
var dom=this.container.dom;
if(Webmail.isQuarantine()){
Element.hide(dom("header_link"));
}else{
Event.observe(dom("header_link"),"click",this.evToggleFullHeader);
}
this.container.dom("toolbar").appendChild($$Email.getUtilityBar());
this.read();
this.container.dom("wrapper").appendChild($C(this._email_widget));
return this.container;
},__load:function(_f7d){
this.container.dom("toolbar").appendChild($$Email.getUtilityBar());
if(!_f7d){
return;
}
if(this._email_widget.options){
if(this._email_widget.getFolder()==_f7d.folder&&this._email_widget.getUid()==_f7d.uid){
this._email_widget.resize();
return;
}
}
this.read(_f7d);
},__resize:function(){
if(!this.container){
return;
}
var dom=this.container.dom;
var _f7f=dom("wrapper");
var _f80=Position.positionedOffset(_f7f)[1];
_f7f.style.display="none";
var _f81=_f7f.parentNode.offsetHeight;
var _f82=_f81-_f80;
if(_f82<=0){
return;
}
_f7f.style.height=_f82+"px";
_f7f.style.display="";
this._email_widget.resize();
},active:function(){
if($Controller._active_module_key=="Message"){
return true;
}else{
return false;
}
},popup:function(_f83){
this._popups.push($Popup.create({height:CFG_COMPOSE_WINDOW_HEIGHT,width:CFG_COMPOSE_WINDOW_WIDTH,onload:function(win){
win.REQUIRE("combo/email_popup");
win.$$Message._doPopup.bind(win.$$Message)(_f83);
},onresize:function(win){
if(win.$$Message){
win.$$Message.evPopupResize.bind(win.$$Message)();
}
},show_loading:true}));
},print:function(){
window.print();
},read:function(_f86){
if(!this._email_widget){
$Widgets.load("Email");
this._email_widget=$Widgets.Email.factory({onchange:this.cbEmailChange,view:$Widgets.Email.VIEW_FULL});
}
if(!_f86){
return;
}
$UI.showStatus();
this._email_widget.populate({folder:_f86.folder,uid:_f86.uid,unread:_f86.unread,callback:function(_f87){
if(_f87.exception){
return;
}
if(_f87._from_cache){
$Mail.setReadStatus({folder:_f86.folder,id:_f86.uid},true,function(){
});
}
if(!this.active()){
$Controller.loadModule("Message");
}
this.cbEmailChange();
}.bind(this)});
},_doPopup:function(_f88){
container_html_arr=["<div class=\"Message_container\">","<div class=\"popup_titlebar\">"];
if($Custom.isFullHeaderEnabled()){
container_html_arr=container_html_arr.concat(["<a href=\"javascript:void(0);\">",L("Message.ShowHeader"),"</a>","<span class=\"sep\">|</span>"]);
}
container_html_arr=container_html_arr.concat(["<a href=\"javascript:void(0);\">",L("Webmail.L.Print"),"</a>","</div>","<div>","</div>","</div>"]);
this.container=Element.createHtml(container_html_arr.join(""));
var _f89={wrapper:"/lastChild",title_bar:"/firstChild"};
if($Custom.isFullHeaderEnabled()){
_f89.header_link="/title_bar/a[0]";
_f89.print_link="/title_bar/a[1]";
}else{
_f89.print_link="/title_bar/a[0]";
}
$Templates.setDom(this.container,_f89);
var dom=this.container.dom;
if($Custom.isFullHeaderEnabled()){
Event.observe(dom("header_link"),"click",this.evToggleFullHeader);
}
Event.observe(dom("print_link"),"click",this.evPrint);
this._email_widget=$Widgets.Email.factory({view:$Widgets.Email.VIEW_POPUP});
dom("wrapper").appendChild($C(this._email_widget));
this._email_widget.populate({folder:_f88.folder,uid:_f88.uid,pid:_f88.pid,callback:function(_f8b){
if(_f8b.exception){
window.close();
return;
}
Element.append(document.body,this.container);
this.__resize();
if(_f88.printOnLoad==true){
this.print();
}
}.bind(this)});
},cbEmailChange:null,_cbEmailChange:function(){
if(this.container){
this.container.dom("subject").innerHTML=this._email_widget.getSubject();
}
},cbSubMessageMove:null,_cbSubMessageMove:function(_f8c){
for(var p=0;p<this._popups.length;p++){
var _f8e=this._popups[p];
if(_f8e&&!_f8e.closed){
var _f8f=_f8e.$$Message._email_widget.getFolder();
var uid=_f8e.$$Message._email_widget.getUid();
for(var i=0,ii=_f8c.length;i<ii;i++){
if(_f8c[i].folder==_f8f&&_f8c[i].id==uid){
Function.release(function(){
_f8e.close();
});
this._popups.remove(p);
p--;
break;
}
}
}else{
this._popups.remove(p);
p--;
}
}
if(this.active()&&_f8c[0]&&this._email_widget.getFolder()==_f8c[0].folder&&this._email_widget.getUid()==_f8c[0].id){
$Controller.backModule();
$$MessageList.removeRows(_f8c,$$MessageList.dom.getBody());
$MessageList.refillList();
}
},cbSubUpdateFolders:null,_cbSubUpdateFolders:function(){
if(this.active()){
this._email_widget._setFolderDropdown();
}
for(var i=0,ii=this._popups.length;i<ii;i++){
var _f93=this._popups[i];
if(_f93&&!_f93.closed){
_f93.$$Message._email_widget._setFolderDropdown();
}
}
},evPrint:null,_evPrint:function(){
$AN(83);
this.print();
},evPopupResize:null,_evPopupResize:function(){
this.__resize();
},evToggleFullHeader:null,_evToggleFullHeader:function(e){
var link=Event.findElement(e,"a");
if(link._shown){
$AN(62);
link._shown=false;
this._email_widget.toggleFullHeader(false);
link.innerHTML=L("Message.ShowHeader");
}else{
$AN(61);
link._shown=true;
this._email_widget.toggleFullHeader(true);
link.innerHTML=L("Message.HideHeader");
}
}};
Object.bindCallbacks($$Message);
Object.bindObservers($$Message);
$Dispatcher.subscribe("Message.move",$$Message.cbSubMessageMove);
$Dispatcher.subscribe("Email.Folders.update",$$Message.cbSubUpdateFolders);
}
if($Bootstrap.notLoaded("519b17dea995fec925c35c94deeebb01")){
Framework.register("Webmail.Modules.Message");
Framework.create("Webmail.Modules.Message.Prefetcher",wack.Class.create());
Webmail.Modules.Message.Prefetcher.prototype=wack.extend(new Webmail.AbstractPrefetcher(),{_current_folder:null,_current_request:null,initialize:function(list,_f97){
Object.bindCallbacks(this);
this._options=Object.extend({prefetch_buffer:1,interval_sleep_time:60},_f97||{});
this._list=list||new Webmail.Modules.Message.Prefetcher.MessageList();
$Dispatcher.subscribe("Folders.setActive",this.cbSub_switchActiveFolder);
$Dispatcher.subscribe("MessageList.page",this.cbSub_pageFolder);
},addMessages:function(_f98,_f99){
if(_f99){
this._list.clear();
}
var _f9a={};
for(var uid in _f98.msgs){
if(_f98.msgs[uid]==false){
var _f9c=$MessageList.getUniqueIdParts(uid);
}else{
var _f9c=_f98.msgs[uid];
}
if(!$MessageCache.isCached(_f9c.folder,_f9c.id)){
_f9c.uid=_f9c.id;
this._list.add(_f9c);
}
}
},setCurrentFolder:function(_f9d){
this._current_folder=_f9d;
},_cancelCurrentRequest:function(){
if(this._current_request){
this._current_request.abort();
}
},cbAddMessages:null,_cbAddMessages:function(_f9e){
this.addMessages(_f9e);
},cbSub_switchActiveFolder:null,_cbSub_switchActiveFolder:function(_f9f){
var _fa0=_f9f.folder;
if(this._current_folder!=_fa0){
this._cancelCurrentRequest();
}
this.setCurrentFolder(_fa0);
if(_f9f.total>0){
this.cbAddMessages(_f9f);
this.prefetchNextItems();
}
},cbSub_pageFolder:null,_cbSub_pageFolder:function(_fa1){
this._cancelCurrentRequest();
this.addMessages(_fa1,true);
this.prefetchNextItems();
},completeFetch:function(_fa2){
if(_fa2){
for(uid in _fa2){
$MessageCache.addToCache(_fa2[uid].folder,_fa2[uid].uid,_fa2[uid]);
}
}
},prefetchNextItems:function(){
var _fa3=[];
var _fa4=false;
while((_fa3.length<this._options.prefetch_buffer)&&!_fa4){
var _fa5=this._list.shiftTopItem(this._current_folder);
if(_fa5){
_fa3.push({folder:_fa5.folder,uid:_fa5.uid});
}else{
_fa4=true;
}
}
if(_fa3.length>0){
this.sendRequest(_fa3,this.cbProcessFetchResponse);
}else{
this._interval_timer=window.setInterval(this.cbInt_resumePrefetch,this._options.interval_sleep_time*1000);
}
},sendRequest:function(_fa6,_fa7){
this._current_request=$Message.getMultiple(_fa6,{callback:_fa7,prefetch:true});
}});
}
if($Bootstrap.notLoaded("0ea70f6195797fd5908202f8d79412d9")){
Framework.register("Webmail.Modules.Message.Prefetcher");
Webmail.Modules.Message.Prefetcher.MessageList=wack.Class.create();
Webmail.Modules.Message.Prefetcher.MessageList.prototype=wack.extend(new wack.List(),{initialize:function(){
this._list={};
},contains:function(item){
if(this._list[item.folder]){
for(var i=0;i<this._list[item.folder].length;i++){
if(this.matches(item,this._list[item.folder][i])){
return true;
}
}
}
return false;
},isEmpty:function(){
var _faa=0;
for(var _fab in this._list){
_faa=_faa+this._list[_fab].length;
}
if(_faa==0){
return true;
}else{
return false;
}
},shiftTopItem:function(_fac){
if(this._list[_fac]){
return this._list[_fac].shift();
}
return false;
},addItemToList:function(item,list){
if(!this.contains(item)){
if(!list[item.folder]){
list[item.folder]=[];
}
list[item.folder].push(item);
}
},removeItemFromList:function(item,list){
if(list[item.folder]){
var _fb1=new Webmail.Modules.Message.Prefetcher.MessageList();
for(var x=0;x<list[item.folder].length;x++){
if(!list.matches(item,list[item.folder][x])){
_fb1.add(list[item.folder][x]);
}
}
list=_fb1;
}
},matches:function(item,_fb4){
if((item.folder==_fb4.folder)&&(item.uid==_fb4.uid)){
return true;
}
return false;
}});
}
if($Bootstrap.notLoaded("16666ae5bdf167927a186394d8759e0a")){
Framework.register("Webmail");
$MessageCache=Webmail.MessageCache={_cache:{},_cache_list:{},_enabled:true,_folder:null,_max_folders:2,_messages_retrieving:[],_pending_request:null,_recent_folders:[],_always_cache:{},addToCache:function(_fb5,uid,data){
if(window!=$Bootstrap.getAppWindow()){
return;
}
if(!this._cache[_fb5]){
this._cache[_fb5]={size:0,messages:{}};
}
if(!this._cache[_fb5].messages[uid]){
this._cache[_fb5].size++;
}
this._cache[_fb5].messages[uid]=data;
this.cleanCache();
return true;
},clearCache:function(){
this._cache={};
},cleanCache:function(){
if(window!=$Bootstrap.getAppWindow()){
return $Bootstrap.getAppWindow().MessageCache.cleanCache();
}
for(var _fb8 in this._cache){
var _fb9=1;
if(this._cache[_fb8].size>CFG_MESSAGE_PREFETCH_LIMIT){
for(var uid in this._cache[_fb8].messages){
if(!$$MessageList.isCurrentMessage(uid,_fb8)){
this._removeMessage(_fb8,uid);
}
if(this._cache[_fb8].size<=CFG_MESSAGE_PREFETCH_LIMIT){
break;
}
}
}
}
},disableCaching:function(){
this._enabled=false;
},getCachedMsg:function(_fbb,uid){
if(window!=$Bootstrap.getAppWindow()){
return $Bootstrap.getAppWindow().$MessageCache.getCachedMsg(_fbb,uid);
}
if(this.isCached(_fbb,uid)){
return this._cache[_fbb].messages[uid];
}
return false;
},isCached:function(_fbd,uid){
if(window!=$Bootstrap.getAppWindow()){
return $Bootstrap.getAppWindow().$MessageCache.isCached(_fbd,uid);
}
if(this._cache[_fbd]&&this._cache[_fbd].messages[uid]&&!this._cache[_fbd].messages[uid]["uncachable"]){
return true;
}
return false;
},isEnabled:function(){
return this._enabled;
},_removeMessage:function(_fbf,uid){
if(this.isCached(_fbf,uid)){
delete this._cache[_fbf].messages[uid];
this._cache[_fbf].size--;
}
},cbSubMessageMove:null,_cbSubMessageMove:function(_fc1){
for(var i=0,ii=_fc1.length;i<ii;i++){
this._removeMessage(_fc1[i].folder,_fc1[i].id);
}
},cbSubSettingsChange:null,_cbSubSettingsChange:function(val){
this.clearCache();
}};
$MessageCache._always_cache[CFG_FOLDER_INBOX]=true;
Object.bindCallbacks($MessageCache);
$Dispatcher.subscribe("Message.move",$MessageCache.cbSubMessageMove);
$Dispatcher.subscribe("Settings.change.allow_html_mail",$MessageCache.cbSubSettingsChange);
$Dispatcher.subscribe("Settings.change.attachments_inline",$MessageCache.cbSubSettingsChange);
}
if($Bootstrap.notLoaded("48e051150adf1b2e813b92c95d304b2d")){
Framework.register("Webmail.Widgets");
$Widgets.ContextMenu.EmailContact=$Widgets.create({_findClickedElement:function(e){
var link=Event.findElement(e,"a");
if(!link||link.getAttribute("_email_contact")!="true"){
return false;
}
return link;
},_getData:function(elem){
var data={name:elem.getAttribute("_name"),email:elem.getAttribute("_email")};
return data;
},_getMenuItems:function(){
var _fc8=$Bootstrap.getAppWindow();
var _fc9=[{label:function(){
return L("Contacts.General.SendEmail")+" ("+this._data.email+")";
}.bind(this),callback:this.cbSendEmail,isdefault:true,show:function(){
return $Custom.isComposeEnabled();
}},{label:L("Contacts.Add"),callback:this.cbAddContact,disabled:function(){
return window!=_fc8;
},show:function(){
return $Custom.isContactsEnabled();
}},{label:L("LeftMenu.L.Search"),callback:this.cbSearch,disabled:function(){
return window!=_fc8;
}}];
if(Browser.is_ie){
_fc9.push({label:L("Email.Menu.CopyEmail"),callback:this.cbCopyEmail});
}
return _fc9;
},cbAddContact:null,_cbAddContact:function(){
$AN(19);
REQUIRE("combo/contacts");
var _fca=new $$Contacts.AddContactDialog({standard:{email:this._data.email,firstname:this._data.name},custom:false});
_fca.addErrorListener(function(msg){
$$Contacts._onError(msg,function(){
_fca.enableDialog(true);
});
_fca.enableDialog(false);
}.bind(this));
_fca.show();
},cbCopyEmail:null,_cbCopyEmail:function(){
if(window.clipboardData&&clipboardData.setData){
clipboardData.setData("Text",this._data.email);
}
},cbSearch:null,_cbSearch:function(){
$AN(125);
$$Search.search("simple",this._data.email);
},cbSendEmail:null,_cbSendEmail:function(){
$AN(100);
$Widgets.Email.evAddressClick(this._data.email);
}},$Widgets.ContextMenu);
}
if($Bootstrap.notLoaded("40d47cbde0d0729709f811e7d60bb02a")){
Framework.register("Webmail");
$Message=Webmail.Message={get:function(_fcc,uid,pid,_fcf){
_fcf=wack.extend({background:false,callback:null,call_group:null,force_plain:false,get_siblings:false,use_cache:true,prefetch:false,block_images:$Settings.isBlockImagesEnabled()},_fcf||{});
if(_fcf.use_cache){
if(!pid&&!_fcf.force_plain&&$MessageCache.isCached(_fcc,uid)){
if(_fcf.callback){
var _fd0=$MessageCache.getCachedMsg(_fcc,uid);
_fd0._from_cache=true;
_fcf.callback(_fd0);
}
return;
}
}
var _fd1={background:_fcf.background,callback:function(_fd2){
if(_fcf.callback){
_fcf.callback(_fd2);
}
}.bind(this),call_group:_fcf.call_group,handle_conn_err:false};
$Data.request("MessageView.getMessage",_fd1,_fcc,uid,pid||0,{force_plain:_fcf.force_plain,get_siblings:_fcf.get_siblings,prefetch:_fcf.prefetch,block_images:_fcf.block_images});
},getMultiple:function(_fd3,_fd4){
_fd4=wack.extend({background:true,callback:null,call_group:null,first_call:false,for_caching:false,force_plain:false,get_siblings:false,use_cache:true,prefetch:false,block_images:$Settings.isBlockImagesEnabled()},_fd4||{});
var _fd5="MessageView.getMessages";
if(_fd4.prefetch){
_fd5="MessageView.getPrefetchMessages";
}
var _fd6=$Data.request(_fd5,{background:_fd4.background,callback:function(_fd7){
if(_fd4.callback){
_fd4.callback(_fd7);
}
},call_group:_fd4.call_group,handle_conn_err:!_fd4.background,cluster:"prefetch"},_fd3,null,{first_call:_fd4.first_call,for_caching:_fd4.for_caching,force_plain:_fd4.force_plain,get_siblings:_fd4.get_siblings,prefetch:_fd4.prefetch,block_images:_fd4.block_images});
return _fd6;
},_getFromCache:function(_fd8,uid){
var _fda=this._cache[_fd8][uid];
return _fda;
},_parseUidList:function(_fdb){
var _fdc={};
for(var i=0,ii=_fdb.length;i<ii;i++){
_fdc[_fdb[i]]=true;
}
return _fdc;
}};
Object.bindCallbacks($Message);
}
if($Bootstrap.notLoaded("27d3480de8e7ccc3bd2d0ae100d44f4b")){
if(!window["Webmail"]){
Webmail={};
}
$Popup=Webmail.Popup={default_height:600,default_width:600,popup_windows:new Array(),_showing_err:false,_popup_data:{},_c:{},_r:{},create:function(_fde){
if(this._showing_err){
return null;
}
_fde=Object.extend({height:$Popup.default_height,width:$Popup.default_width,title:"",onload:function(win){
return Prototype.emptyFunction;
},onresize:function(win){
return Prototype.emptyFunction;
},show_loading:true},_fde||{});
var h=(new Date()).getTime();
var url="popup.html#"+h;
var win=wack.Browser.popup(url,_fde.height,_fde.width,0,0,true,true);
if(!win){
if(!this._showing_err){
this._showing_err=true;
alert(L("L.PopupWarning"));
this._showing_err=false;
}
return;
}
win._options=_fde;
win._ready=true;
$Bootstrap.getAppWindow().$Popup._c[h]=_fde;
$Bootstrap.getAppWindow().$Popup._r[h]=true;
return win;
},evWindowLoad:function(){
if(window._options.show_loading){
var _fe4=document.getElementById("loading");
_fe4.style.display="";
var _fe5=_fe4.getElementsByTagName("div")[1];
var span=_fe5.getElementsByTagName("span")[0];
span.innerHTML=$Bootstrap.getAppWindow().L("L.Loading");
}
setTimeout(function(){
var main=$Bootstrap.getAppWindow();
var _fe8=main.Webmail.getGlobal("constants");
for(var i=0,ii=_fe8.length;i<ii;i++){
window[_fe8[i]]=main[_fe8[i]];
}
var _fea=main.wcv__vars;
for(var i=0,ii=_fea.length;i<ii;i++){
window[_fea[i]]=main[_fea[i]];
}
document.body.className=main.document.body.className;
window._wm__app_win_ptr=main;
window.session_id=main.Webmail.getSessionId();
window._options.onload(window);
},1);
},evWindowResize:function(){
window._options.onresize(window);
}};
}
if($Bootstrap.notLoaded("e4f728f68305dc53f0f833aa72737c0d")){
Framework.register("Webmail");
$Compose=Webmail.Compose={_new_cache:{},getFrequentContacts:function(_feb){
var _fec=$Bootstrap.getAppWindow().$Compose;
if(_fec==this){
$Data.request("Compose.getFrequentContacts",{callback:function(_fed){
_feb(_fed);
},request_type:CFG_AJAX_READ});
}else{
return _fec.getFrequentContacts(_feb);
}
},getMessage:function(_fee,_fef,_ff0,uid,_ff2,_ff3){
_ff2=_ff2||Prototype.emptyFunction;
_ff3=_ff3||false;
var _ff4=this._getMessageCache(_fee);
if(_ff4){
_fef(_ff4);
return;
}
$Data.request("Compose.getMessage",{callback:function(_ff5){
this._setMessageCache(_fee,_ff5);
_fef(_ff5);
}.bind(this),err_callback:_ff2,request_type:CFG_AJAX_READ},_fee,_ff0,uid,_ff3);
},_getMessageCache:function(_ff6){
if(window!=$Bootstrap.getAppWindow()){
return $Bootstrap.getAppWindow().$Compose._getMessageCache(_ff6);
}
var _ff7=$Settings.getComposeType();
if(_ff6==wm_Compose_NEW_MSG&&this._new_cache[_ff7]){
return this._new_cache[_ff7];
}
return false;
},_setMessageCache:function(_ff8,_ff9){
if(window!=$Bootstrap.getAppWindow()){
$Bootstrap.getAppWindow().$Compose._setMessageCache(_ff8,_ff9);
return;
}
if(_ff8==wm_Compose_NEW_MSG){
var _ffa=$Settings.getComposeType();
this._new_cache[_ffa]=_ff9;
}
},cbClearCache:null,_cbClearCache:function(){
if(window!=$Bootstrap.getAppWindow()){
$Bootstrap.getAppWindow().$Compose.cbClearCache();
return;
}
this._new_cache={};
}};
Object.bindCallbacks($Compose);
if(window==$Bootstrap.getAppWindow()){
$Dispatcher.subscribe("Settings.change.identities",$Compose.cbClearCache);
$Dispatcher.subscribe("Settings.change.signatures",$Compose.cbClearCache);
$Dispatcher.subscribe("Settings.change.signature_use",$Compose.cbClearCache);
}
}
if($Bootstrap.notLoaded("65a97e534eaabd11b858c8148270079c")){
Framework.register("Webmail.Modules");
$$Compose=Webmail.Modules.Compose={load:function(_ffb,type,_ffd){
_ffb=wack.extend({action:wm_Compose_NEW_MSG,folder:null,uid:null,to:null,cc:null,bcc:null,subject:null,msg_body:null,msg_arr:null},_ffb||{});
type=type||$Settings.getComposeWindowType();
if(wack.Browser.is_ie6){
type=wm_Settings_COMPOSE_POPUP;
}
this._render(type,_ffb,_ffd);
},_render:function(type,data,_1000){
if(data.exception){
$UI.error(data.message);
return;
}
var _1001=(window!=$Bootstrap.getAppWindow());
if(_1001||type==wm_Settings_COMPOSE_POPUP){
$$Compose.Popup.load(data,_1000);
}else{
$$Compose.Popin.load(data,_1000);
}
}};
Object.bindCallbacks($$Compose);
}
if($Bootstrap.notLoaded("79b23293ba89938763368da5eae02daf")){
$$Compose.Popin={load:function(_1002,_1003){
if(_1003){
this._createAndPopulate(_1003,true);
}else{
$UI.showStatus();
$Compose.getMessage(_1002.action,function(_1004){
$UI.clearStatus();
var data=wack.extend(_1002,_1004);
this._createAndPopulate(data,false);
}.bind(this),_1002.folder,_1002.uid,null,_1002.msg_arr);
}
},_createAndPopulate:function(data,_1007){
$Widgets.load("Compose");
REQUIRE("combo/dialogs");
var _1008=$Widgets.Compose.factory({onclose:this.cbOnClose,onchange:this.cbOnChange,onconnerr:this.cbOnConnErr,ondisable:this.cbOnDisable,onenable:this.cbOnEnable,onsave:this.cbOnSave,onfolderchange:this.cbOnFolderChange,onbeforesend:this.cbOnBeforeSend,onsend:this.cbOnSend,onspellcheckstart:this.cbOnSpellcheckStart,onspellcheckend:this.cbOnSpellcheckEnd});
if(_1007){
_1008.unserialize(data);
}else{
_1008.populate(data);
}
$Widgets.Dialog.load($C(_1008),{center:true,close:true,onclose:this.cbDialogClose,minimize:true,movable:true,popout:true,popout_callback:this.cbPopout,shadow:true,title:_1008.getTitle(),titlebar:true});
_1008.resize();
_1008.focus();
$Dispatcher.publish("Widget.load","Compose.Popin",_1008);
},cbDialogClose:null,_cbDialogClose:function(_1009){
var _100a=$W(_1009.getContent());
if(_100a.isBusy()){
return;
}
if(_100a.isDirty()){
REQUIRE("combo/dialogs");
this.prompt=new $DialogsSaveConfirm(function(){
_100a.cbSaveDraft(null,function(){
_100a.close();
});
},function(){
_100a.close();
});
this.prompt.show();
}else{
_100a.close();
}
},cbOnBeforeSend:null,_cbOnBeforeSend:function(_100b){
$Widgets.Dialog.findWidget($C(_100b)).hide();
Webmail.enableCloseWarning(L("Compose.C.Sending"));
},cbOnChange:null,_cbOnChange:function(){
},cbOnClose:null,_cbOnClose:function(_100c){
var _100d=$Widgets.Dialog.findWidget($C(_100c));
_100d.close();
},cbOnConnErr:null,_cbOnConnErr:function(_100e,_100f){
$Widgets.Dialog.findWidget($C(_100e)).show();
Webmail.disableCloseWarning();
_100e.disable();
if(!_100f){
$UI.error(L("E.Connection"),function(){
_100e.enable();
});
}
},cbOnDisable:null,_cbOnDisable:function(_1010){
var _1011=$Widgets.Dialog.findWidget($C(_1010));
_1011.disableContainer();
},cbOnEnable:null,_cbOnEnable:function(_1012){
var _1013=$Widgets.Dialog.findWidget($C(_1012));
if(_1013){
_1013.enableContainer();
}
},cbOnFolderChange:null,_cbOnFolderChange:function(_1014,_1015,delta){
var _1017=$Bootstrap.getAppWindow();
_1017.$Dispatcher.publish("Folders.status_change",_1015,delta);
_1017.setTimeout("$MessageList.checkFolder(\""+_1015+"\");",1);
},cbOnSave:null,_cbOnSave:function(_1018){
var _1019=$Widgets.Dialog.findWidget($C(_1018));
if(_1019){
_1019.publishEvent("settitle",_1018.getTitle());
}
},cbOnSpellcheckEnd:null,_cbOnSpellcheckEnd:function(_101a){
var _101b=$Widgets.Dialog.findWidget($C(_101a));
_101b.publishEvent("showpopout");
},cbOnSpellcheckStart:null,_cbOnSpellcheckStart:function(_101c){
var _101d=$Widgets.Dialog.findWidget($C(_101c));
_101d.publishEvent("hidepopout");
},cbOnSend:null,_cbOnSend:function(_101e,_101f){
var main=$Bootstrap.getAppWindow();
if(main){
if(_101e.exception&&_101f){
var _1021=$Widgets.Dialog.findWidget($C(_101f));
if(_1021){
_101f.disable();
_1021.show();
}
}
main.$Dispatcher.publish("Compose.sent",_101e);
}
Webmail.disableCloseWarning();
},cbPopout:null,_cbPopout:function(_1022){
$AN(11);
var _1023=$W(_1022);
var _1024=_1023.getContent();
var _1025=$W(_1024);
if(_1025.isBusy()){
return;
}
$UI.showStatus();
var json=_1025.serialize();
_1025.close();
$$Compose.load(null,wm_Settings_COMPOSE_POPUP,json);
$Settings.setComposeWindowType(wm_Settings_COMPOSE_POPUP);
$UI.clearStatus();
}};
Object.bindCallbacks($$Compose.Popin);
}
if($Bootstrap.notLoaded("42540d5066011bc5fd5e54dd159bd968")){
$$Compose.Popup={_compose_widget:null,_skeleton:null,load:function(_1027,_1028){
$Popup.create({height:CFG_COMPOSE_WINDOW_HEIGHT,width:CFG_COMPOSE_WINDOW_WIDTH,onload:function(win){
win.REQUIRE("combo/dialogs");
win.REQUIRE("combo/compose_popup");
if(_1028){
win.$$Compose.Popup.cbWindowLoad(_1028,true);
}else{
$Compose.getMessage(_1027.action,function(_102a){
var data=wack.extend(_1027,_102a);
win.$$Compose.Popup.cbWindowLoad(data,false);
}.bind(this),_1027.folder,_1027.uid,null,_1027.msg_arr);
}
},onresize:function(win){
if(win.$$Compose){
Function.release(win.$$Compose.Popup.resizeWidget.bind(win.$$Compose.Popup));
}
},show_loading:true});
},resizeWidget:function(){
try{
var _102d=$$Compose.Popup._compose_widget;
var _102e=$$Compose.Popup._skeleton;
var _102f=document.body.offsetHeight;
var _1030=_102e.container.dom("title_container");
_102f-=_1030.offsetHeight;
_102d.resize(_102f);
}
catch(e){
}
},toggleCloseWarning:function(_1031){
if(_1031){
if(this._show_close_warning){
return;
}
this._show_close_warning=true;
window.onbeforeunload=function(){
return L("Compose.CloseWarning");
};
}else{
this._show_close_warning=false;
window.onbeforeunload=Prototype.emptyFunction;
}
},cbOnBeforeSend:null,_cbOnBeforeSend:function(){
$UI.showStatus(L("Compose.L.Sending"));
},cbOnChange:null,_cbOnChange:function(){
this.toggleCloseWarning(true);
},cbOnClose:null,_cbOnClose:function(_1032){
this.toggleCloseWarning(false);
window.setTimeout("window.close()",0);
},cbOnConnErr:null,_cbOnConnErr:function(_1033,_1034){
if(!_1034){
$UI.error(L("E.Connection"),function(){
Webmail.enable();
});
}
},cbOnFolderChange:null,_cbOnFolderChange:function(_1035,_1036,delta){
var _1038=$Bootstrap.getAppWindow();
_1038.$Dispatcher.publish("Folders.status_change",_1036,delta);
_1038.setTimeout("$MessageList.checkFolder(\""+_1036+"\");",1);
},cbOnSave:null,_cbOnSave:function(_1039){
this.toggleCloseWarning(false);
this._skeleton.setTitle(this._compose_widget.getTitle());
},cbOnSend:null,_cbOnSend:function(_103a){
$UI.clearStatus();
var main=$Bootstrap.getAppWindow();
if(main){
main.$Dispatcher.publish("Compose.sent",_103a);
}
},cbOnSpellcheckStart:null,_cbOnSpellcheckStart:function(){
this._skeleton.disablePopin();
},cbOnSpellcheckEnd:null,_cbOnSpellcheckEnd:function(){
this._skeleton.enablePopin();
},cbWindowLoad:null,_cbWindowLoad:function(data,_103d){
document.body.style.overflow="hidden";
this._compose_widget=$Widgets.Compose.factory({onclose:this.cbOnClose,onchange:this.cbOnChange,onconnerr:this.cbOnConnErr,onsave:this.cbOnSave,onfolderchange:this.cbOnFolderChange,onbeforesend:this.cbOnBeforeSend,onsend:this.cbOnSend,onspellcheckstart:this.cbOnSpellcheckStart,onspellcheckend:this.cbOnSpellcheckEnd});
if(_103d){
this._compose_widget.unserialize(data);
}else{
this._compose_widget.populate(data);
}
this._skeleton=$Widgets.Compose.Popup.factory();
this._skeleton.setComposeWidget(this._compose_widget);
Element.append(document.body,$C(this._skeleton));
this.resizeWidget();
this._compose_widget.focus();
$Dispatcher.publish("Widget.load","Compose.Popup",this._skeleton);
}};
Object.bindCallbacks($$Compose.Popup);
}
if($Bootstrap.notLoaded("c90c4ae48cf94b07e95ff308a18760b0")){
Framework.register("Webmail.Compose.LinkDialog");
$$SmileyDialog=Webmail.Compose.SmileyDialog=Class.create();
$$SmileyDialog.prototype={initialize:function(_103e){
if(!window.editor){
return false;
}
this.evCancel=this.evCancel.bindAsEventListener(this);
this.evSmileyClick=this.evSmileyClick.bindAsEventListener(this);
this.editor=_103e;
this.editorUndo=_103e.EditorWindow.parent.FCKUndo;
this.editorConfig=_103e.EditorWindow.parent.FCKConfig;
this.basePath=this.editorConfig.SmileyPath;
this.images=this.editorConfig.SmileyImages;
this.cols=this.editorConfig.SmileyColumns;
},draw:function(){
this.container=Element.createHtml(["<div id=\"smiley_dialog_container\">","<div>","</div>","</div>"].join(""));
this._smileyDiv=this.container.firstChild;
for(i=0,ii=this.images.length;i<ii;i++){
var url=this.basePath+this.images[i];
var image=Element.createHtml("<img src='"+url+"' class='compose_smiley' />");
image.url=url;
Event.observe(image,"click",this.evSmileyClick);
Element.append(this._smileyDiv,image);
if(((i+1)%this.cols)==0){
Element.append(this._smileyDiv,Element.createHtml("<br>"));
}
}
return this.container;
},show:function(){
var _1041=this.draw();
if(!_1041||!window.editor){
return false;
}
var title=L("Compose.L.SmileyTitle");
REQUIRE("combo/dialogs");
var load=$Dialogs.loadDialog(_1041,{border:true,closehandler:this.evCancel,disablewin:true,movable:true,minimize:false,shadow:true,title:title,titlebar:true});
return true;
},unload:function(){
$Dialogs.unloadDialog(this.container);
},evCancel:function(e){
this.unload();
},evSmileyClick:function(e){
this.editorUndo.SaveUndoStep();
var _1046=Event.element(e);
var _1047=this.editor.CreateElement("IMG");
_1047.src=_1046.url;
this.unload();
}};
}
if($Bootstrap.notLoaded("656d7d2d0d564a3403ebbda1366a6f31")){
wack.Parser={parseEmail:function(s){
var _1049=[];
var _104a=s.split(/,/);
for(var i=0,ii=_104a.length;i<ii;i++){
var token=_104a[i].trim();
if(token.length>0){
var name="";
var email=token;
var pos1=token.indexOf("<");
if(pos1!=-1){
var pos2=token.indexOf(">",pos1);
if(pos2!=-1){
name=token.substring(0,pos1-1).trim();
if(name.indexOf("\"")==0){
name=name.substring(1).trim();
}
if(name.indexOf("\"")==name.length-1){
name=name.substring(0,name.length-1).trim();
}
email=token.substring(pos1+1,pos2).trim();
}else{
name=token.substring(0,pos1-1).trim();
if(name.indexOf("\"")==0){
name=name.substring(1).trim();
}
if(name.indexOf("\"")==name.length-1){
name=name.substring(0,name.length-1).trim();
}
email=token.substring(pos1+1).trim();
}
}else{
if(token.indexOf("@")==-1&&token.indexOf("\"")==0&&token.substring(token.length-1)!="\""&&i+1<ii){
_104a[i+1]=_104a[i].trim()+", "+_104a[i+1].trim();
continue;
}else{
if(token.indexOf("@")==-1){
name=token;
email="";
if(name.indexOf("\"")==0){
name=name.substring(1).trim();
}
if(name.indexOf("\"")==name.length-1){
name=name.substring(0,name.length-1).trim();
}
}
}
}
_1049.push({name:name,email:email});
}
}
return _1049;
}};
}
if($Bootstrap.notLoaded("d942fd5296033dd9742f4e5a1ddf3a1c")){
function $Ex(e){
if(e&&!e._extended){
for(method in $Exception.Methods){
e[method]=function(){
return $Exception.Methods[method].apply(null,[this].concat($A(arguments)));
};
$Ex(e.inner_exception);
}
e._extended=true;
}
return e;
}
Framework.register("Webmail");
Framework.register("Webmail.Exception");
Webmail.Exception.Methods={find:function(e,_1053){
do{
if(e.code==_1053){
return e;
}
e=e.inner_exception;
}while(e);
return false;
},root:function(e){
while(e.inner_exception){
e=e.inner_exception;
}
return e;
}};
Object.extend(Webmail.Exception,Webmail.Exception.Methods);
$Exception=Webmail.Exception;
}
if($Bootstrap.notLoaded("fda28a704ca29be2d445af779eb3cacc")){
Framework.register("Webmail");
$KeyEventManager=Webmail.KeyEventManager=new function(){
this._last_clicked=null;
this._key_elements=new Array();
this._toggleClear=false;
this.initialize=function(){
Event.observe(document,"click",this.evClearLastClicked);
Event.observe(document,"keyup",this.evFindKeypressCallback);
};
this.addKeyEvent=function(ele,_1056,_1057,shift){
if(typeof (_1057)=="undefined"){
_1057=0;
shift=0;
}
if(typeof (shift)=="undefined"){
shift=0;
}
if(this._findKeyEvent(ele,_1057,shift)!=-1){
return;
}
Event.stopObserving(document,"click",this.evClearLastClicked);
Event.observe(ele,"click",this.evSetLastClicked);
Event.observe(document,"click",this.evClearLastClicked);
if(ele.tagName.toLowerCase()=="input"){
Event.observe(ele,"focus",this.evSetLastClicked);
Event.observe(ele,"blur",this.evClearInputField);
}
var _1059=this._key_elements.length;
var _105a={"element":ele.id,"callback":_1056,"keycode":_1057.toString(),"shift":shift.toString()};
this._key_elements[_1059]=_105a;
};
this.removeKeyEvent=function(ele,_105c,shift){
var _105e=this._findKeyEvent(ele,_105c,shift);
if(_105e!=-1){
var _105f=this._key_elements.splice(_105e,1);
}
};
this.setLastClicked=function(ele){
if(ele&&ele.id){
this._last_clicked=ele.id;
this._toggleClear=true;
}
};
this._findKeyEvent=function(ele,_1062,shift){
for(var i=0;i<this._key_elements.length;i++){
cur_event=this._key_elements[i];
if(cur_event.element==ele.id&&cur_event.keycode==_1062&&cur_event.shift==shift){
return i;
}
}
return -1;
};
this._evSetLastClicked=function(e){
var elem=Event.element(e);
var _1067=this._key_elements.length;
var found=false;
this._last_clicked=null;
while(elem&&elem.tagName.toLowerCase()!="html"&&found==false){
for(var i=0;i<_1067;i++){
if(elem.id==this._key_elements[i].element){
this._last_clicked=elem.id;
this._toggleClear=true;
found=true;
break;
}
}
elem=elem.parentNode;
}
};
this.evSetLastClicked=this._evSetLastClicked.bindAsEventListener(this);
this._evClearLastClicked=function(e){
if(this._toggleClear==false){
this._last_clicked=null;
}
this._toggleClear=false;
};
this.evClearLastClicked=this._evClearLastClicked.bindAsEventListener(this);
this._evClearInputField=function(e){
this._last_clicked=null;
};
this.evClearInputField=this._evClearInputField.bindAsEventListener(this);
this._evFindKeypressCallback=function(e){
var elem=$(this._last_clicked);
var shift=0;
if(this._last_clicked){
for(var i=0;i<this._key_elements.length;i++){
cur_event=this._key_elements[i];
if(cur_event&&cur_event.element==this._last_clicked&&cur_event.keycode==e.keyCode&&shift==cur_event.shift){
Event.stop(e);
callback_func=cur_event.callback;
callback_func(e);
}
}
}
};
this.evFindKeypressCallback=this._evFindKeypressCallback.bindAsEventListener(this);
};
}
if($Bootstrap.notLoaded("60daa5b944389c84aa139c217acf66c1")){
Framework.register("Webmail");
$TPL=$Template=Webmail.Template={initialize:function(){
if(!defined(window._t_f)){
return;
}
for(var i=0,ii=_t_f.length;i<ii;i++){
var func="_t_f_"+_t_f[i];
if(window[func]){
window[func]();
}
}
},dom:function(id,ref){
return (window.APP||window).$TPL[id][ref];
},findRoot:function(elem){
while(elem&&!elem._tpl_root&&elem!=document.body){
elem=elem.parentNode;
}
if(!elem||elem==document.body){
return false;
}
return elem;
},getOptions:function(id){
return (window.APP||window).$Template[id]._options;
},getTemplate:function(id,vars){
vars=vars||{};
var _1078=(window.APP||window).$("Template_"+id);
if(!_1078){
return false;
}
var elem=$(_1078.firstChild.cloneNode(true));
this._assignProps(elem,id);
this._assignVariables(elem,vars);
return elem;
},getVars:function(id){
return (window.APP||window).$Template[id]._vars;
},_assignProps:function(elem,id){
var _107d=this.getOptions(id);
var vars=this.getVars(id);
elem._tpl_id=id;
elem._tpl_root=true;
elem._tpl_options=_107d;
elem._tpl_vars=vars;
elem.dom=function(ref){
var p="_tpl_dom_"+ref;
if(!elem[p]){
elem[p]=$TPL.dom(id,ref)(elem);
if(!elem[p].length){
elem[p]=$(elem[p]);
}
}
return elem[p];
};
elem.populate=function(data){
$TPL.populate(this,data);
};
elem.fill=function(_1082){
$Template._assignVariables(elem,_1082);
};
},_assignVariables:function(elem,_1084){
var _1085=elem._tpl_options;
var vars=elem._tpl_vars;
var _1087=_1085.find_vars;
if(!defined(_1087)){
_1087=true;
}
_1084=_1084||{};
if(_1087){
var _1088=elem.innerHTML;
}
var key;
for(key in _1084){
if(_1087){
var regex=new RegExp("((<var>)|(% ))"+key+"((</var>)|( %))","gi");
_1088=_1088.replace(regex,_1084[key]);
}else{
if(vars[key]){
var ptr=vars[key];
if(typeof ptr=="string"){
ptr=[ptr];
}
for(var i=0,ii=ptr.length;i<ii;i++){
elem.dom(ptr[i]).update(_1084[key]);
}
}
}
}
if(_1087){
var all=new RegExp("((<var>)|(% ))[a-zA-Z_]((</var>)|( %))","gi");
_1088=_1088.replace(all,"");
elem.innerHTML=_1088;
}
},populate:function(_108e,data){
var key;
for(key in data){
_108e.dom(key).update(data[key]);
}
}};
}
if($Bootstrap.notLoaded("45a3d9db3a0fe57c03ed54968d262938")){
Framework.register("Webmail.Modules");
$$MainMenu=Webmail.Modules.MainMenu={tabs:null,tabset:null,__preload:function(){
Object.bindCallbacks(this);
$Dispatcher.subscribe("Settings.change.external",this.cbChangeExtMail);
var _1091=Element.createHtml(["<div id=\"MainMenu\">","<div class=\"left\"></div>","<div class=\"right\"></div>","</div>"].join(""));
var left=$(_1091.firstChild);
var right=$(_1091.lastChild);
this.tabs={"email":{text:L("MainMenu.L.Email"),module:"MessageList",module_arg:CFG_FOLDER_INBOX,menu:[{text:L("Folders.Q.Check"),onclick:function(){
$AN(47);
$Dispatcher.checkMail();
}},{text:L("Folders.Q.Compose"),onclick:function(){
$AN(120);
$Dispatcher.compose();
}},{id:"external",text:L("LeftMenu.L.External"),onclick:function(){
$AN(49);
$Dispatcher.checkExtMail();
}},{text:L("Folders.Q.AddFolder"),onclick:function(){
$AN(27);
$$FolderManager.create.showForm(false);
}},{text:L("Folders.Q.FolderManager"),onclick:function(){
$AN(31);
$Controller.loadModule("FolderManager",false,true);
}}]},"contacts":{text:L("MainMenu.L.Contacts"),module:"Contacts",menu:[{text:L("Contacts.General.AddContact"),onclick:function(){
$AN(21);
REQUIRE("combo/contacts");
$$Contacts.openAddContactDialog();
}},{text:L("Contacts.General.AddGroup"),onclick:function(){
$AN(22);
REQUIRE("combo/contacts");
$$Contacts.openAddGroupDialog();
}},{text:L("Contacts.General.MyContacts"),onclick:function(){
$AN(18);
$Controller.loadModule("Contacts",wm_Contacts_MY_CONTACTS_MODE,true);
}},{id:"company_directory",text:L("Contacts.General.CompanyDirectory"),onclick:function(){
$AN(23);
$Controller.loadModule("Contacts",wm_Contacts_COMPANY_DIRECTORY_MODE,true);
}}]},"calendar":{text:L("MainMenu.L.Calendar"),module:"Calendar",menu:[{id:"add_event",text:L("Calendar.F.AddEvent"),onclick:function(){
$AN(1);
REQUIRE("combo/calendar_eventform");
$$EventForm.showNew($Calendar.getPersonalCalendars()[0]);
}},{id:"manager",text:L("Calendar.L.CalendarManager"),onclick:function(){
$AN(2);
REQUIRE("combo/calendar");
$$Calendar.showCalendarManager();
}}]},"tasks":{text:L("Tasks.L.Tasks"),combo:"tasks_combo",module:"Tasks",menu:[{text:L("Tasks.L.Add"),onclick:function(){
$AN(142);
REQUIRE("combo/tasks");
if($Tasks.task_lists){
$$Tasks.showAddTaskForm();
}else{
var _1094=$$Tasks.showAddTaskForm.bind($$Tasks);
$Tasks.getTaskLists(_1094);
}
}},{text:L("Tasks.Manager.AddTaskList"),onclick:function(){
$AN(143);
REQUIRE("combo/tasks");
$$Tasks.showTaskListForm();
}},{id:"test",text:L("Tasks.L.Manage"),onclick:function(){
$AN(144);
REQUIRE("combo/tasks");
if($Tasks.task_lists){
$$Tasks.showTaskListsManager();
}else{
var _1095=$$Tasks.showTaskListsManager.bind($$Tasks);
$Tasks.getTaskLists(_1095);
}
}}]},"notes":{text:L("Notes.L.Notes"),combo:"notes_combo",module:"Notes",force_load:false,menu:[{text:L("Notes.L.Add"),onclick:function(){
$AN(99);
$Widgets.load("Notes.Form");
var _1096=$Widgets.Notes.Form.factory();
_1096.populate({subject:"",content:""});
$Widgets.Notes.Form.createPopup(_1096);
}}]}};
if(!$Custom.isContactsEnabled()){
delete this.tabs["contacts"];
}
if(!$Custom.isCalendarEnabled()){
delete this.tabs["calendar"];
}
if(!$Custom.isTasksEnabled()){
delete this.tabs["tasks"];
}
if(!$Custom.isNotesEnabled()){
delete this.tabs["notes"];
}
this.tabset=$UI.Tabs.createTabset(this.tabs,{onclick:this.loadSection.bind(this),allow_reclick:true});
if(Webmail.isQuarantine()){
var _1097=Element.createHtml(["<span class=\"quarantine\">",L("Quarantine.L.Header"),"</span>"].join(""));
left.append(_1097);
this.disableTab("email");
}
left.append(this.tabset);
var _1098=L("Webmail.L.Help");
if(Webmail.isManagedDomain()){
_1098=L("Webmail.L.Support");
}
right.innerHTML=[username,"<span class=\"settings\">","<span class=\"sep\">|</span>","<a href=\"javascript:void(0);\" onclick=\"$$MainMenu.loadSectionSettings()\">",L("MainMenu.L.Settings"),"</a>","</span>","<span class=\"report_bug\">","<span class=\"sep\">|</span>","<a href=\"javascript:void(0);\" onclick=\"report_bug();\">",L("Webmail.L.Report"),"</a>","</span>","<span class=\"help\">","<span class=\"sep\">|</span>","<a id=\"Webmail_help_link\" href=\"javascript:void(0);\">",_1098,"</a>","</span>","<span class=\"sep\">|</span>","<a href=\"",Webmail._logout_url,"\">",L("logoff"),"</a>",].join("");
var _1099=right.getElementsByTagName("span");
var _109a=_1099[0];
var _109b=_1099[2];
var help=_1099[4];
if($Settings.isHelpEnabled()){
if(Webmail.isManagedDomain()){
var el=help.lastChild;
el.href=CFG_SUPPORT_URL;
el.target="_blank";
el.onclick=function(){
$AN(43);
};
}else{
Event.observe(help.lastChild,"click",$Help.show.bindAsEventListener($Help));
}
}else{
$(help).remove();
}
if(!Webmail.isBeta()||Webmail.isQuarantine()){
$(_109b).remove();
}
if(!$Settings.isSettingsEnabled()){
$(_109a).remove();
}
return _1091;
},__load:function(){
},disableMenuItem:function(_109e,id){
$UI.Tabs.disableMenuItem(this.tabset,_109e,id);
},disableTab:function(_10a0){
$UI.Tabs.disableTab(this.tabset,_10a0);
},enableMenuItem:function(_10a1,id){
$UI.Tabs.enableMenuItem(this.tabset,_10a1,id);
},enableTab:function(_10a3){
$UI.Tabs.enableTab(this.tabset,_10a3);
},hideMenuItem:function(_10a4,id){
$UI.Tabs.hideMenuItem(this.tabset,_10a4,id);
},loadSection:function(key){
$Analytics.add("tabs",key);
var force=this.tabs[key].force_load;
if(typeof (force)=="undefined"){
force=true;
}
var load=$Controller.loadModule(this.tabs[key].module,this.tabs[key].module_arg,force);
if(load){
this.setActiveTab(key);
}
},loadSectionSettings:function(){
$AN(132);
$Settings.load();
},setActiveTab:function(key){
$UI.Tabs.setActiveTab(this.tabset,key);
},showMenuItem:function(_10aa,id){
$UI.Tabs.showMenuItem(this.tabset,_10aa,id);
},cbChangeExtMail:null,_cbChangeExtMail:function(_10ac){
$$Email.setExternalButton(_10ac.length);
$Controller.resize();
}};
}
if($Bootstrap.notLoaded("43a750c8dad3426586352ec6085acf39")){
Framework.register("Webmail.Modules");
$$SubMenu=Webmail.Modules.SubMenu={image_root:"images/",stall_update:false,_active_section:null,_timer:null,_num_action_links:$Preload["Custom.num_action_links"],_num_ext_accounts:0,__preload:function(){
Object.bindCallbacks(this);
Object.bindObservers(this);
var _10ad=$Prefs.getUserPref("left_width",185);
Element.setStyle("core_left",{width:_10ad+"px"});
var _10ae=$("core_left_handle");
Element.setStyle(_10ae,{left:_10ad-1+"px"});
_10ae.orig_left=_10ad-1;
Element.append("quota_container",$$Quota.draw());
Element.append("SubMenu",this.draw());
this._makeResizable();
return;
this.checkHandle=$Dispatcher.checkMail.bind($Dispatcher);
this.checkExtHandle=$Dispatcher.checkExtMail.bind($Dispatcher);
this.composeHandle=$Dispatcher.compose.bind($Dispatcher);
Event.observe("check_link","click",this.checkHandle);
Event.observe("checkext_link","click",this.checkExtHandle);
var _10af={};
_10af["compose_link"]=this.composeHandle;
var list=$("left_actions").getElementsByTagName("ul")[0];
var links=$LeftMenu.getActionLinks();
for(var i=0,ii=links.length;i<ii;i++){
var icon=links[i].icon||"check-mail.gif";
var _10b4=links[i].display;
var id=links[i].id||"";
var link=Element.createHtml(["<li>","<a id=\"",id,"\" class=\"link\" href=\"javascript:void(0);\" ","style=\"background-image:url(images/",icon,");\">","<span>",_10b4,"</span></a>","</li>"].join(""));
var _10b7=link.firstChild;
if(_10af[id]){
Event.observe(_10b7,"click",_10af[id]);
}else{
Event.observe(_10b7,"click",this.evActionLink.bindAsEventListener(this));
_10b7._url=links[i].url;
_10b7._popup=links[i].popup;
_10b7._popup_height=links[i].popup_height;
_10b7._popup_width=links[i].popup_width;
}
Element.append(list,link);
}
},__load:function(){
},__resize:function(){
var _10b8=$("SubMenu");
var _10b9=Webmail.leftHeight();
if(wack.Browser.is_firefox){
_10b9--;
}
var width=Webmail.leftWidth();
if(width<=0){
width=1;
}
_10b8.style.height=_10b9+"px";
_10b8.style.width=width+"px";
var _10bb=$("SubMenu_content");
if(_10bb){
var _10bc=Position.cumulativeOffset(_10bb)[1]-Position.cumulativeOffset($("core_left"))[1];
var _10bd=_10b9-_10bc-1;
_10bd-=$("SubMenu_totals").offsetHeight;
Element.setDimensions(_10bb,{width:width,height:_10bd});
}
if(_10bd&&this._active_section){
(this._active_section.__resize||Prototype.emptyFunction)(this._active_section.__content,width,_10bd);
}
},draw:function(){
var _10be=Element.create("div");
var _10bf=Element.create("div",{id:"SubMenu_content"});
Element.append(_10be,_10bf,this._drawTotals());
return _10be;
},loadSection:function(_10c0){
if(!_10c0||this._active_section==_10c0){
return;
}
var _10c1=$("SubMenu_content");
if(this._active_section){
$(this._active_section.__content).hide();
}
this._active_section=_10c0;
if(!_10c0.__content){
var _10c2=_10c0.__content=_10c0.__preload();
_10c1.append(_10c2);
}
_10c1.scrollTop=0;
$(_10c0.__content).show();
if(_10c0.__load){
_10c0.__load();
}
},registerSection:function(_10c3,_10c4){
return;
this._sections[_10c3]=Object.extend(this._sections[_10c3]||{},{module:_10c4});
},setExternalAccounts:function(count){
return;
var _10c6=this._num_ext_accounts;
if(count<0){
count=0;
}
var _10c7=8+(this._num_action_links*2)+((this._num_action_links+1)*18);
if(count==0){
this._num_ext_accounts=count;
Element.hide($("checkext_link").parentNode);
Element.setStyle("left_actions",{height:_10c7+"px"});
}else{
if(_10c6==0&&count>0){
this._num_ext_accounts=count;
Element.show($("checkext_link").parentNode);
Element.setStyle("left_actions",{height:_10c7+18+"px"});
}
}
if($("core").offsetTop==0){
this.__resize();
}
},updateTotals:function(){
if(this.stall_update){
return;
}
var _10c8=$FolderList.getAllUnread(true);
var _10c9="";
var _10ca="Email.Unread";
if(_10c8==1){
_10c9=L(_10ca+".S");
}else{
_10c9=L(_10ca+".P",_10c8.format());
}
var _10cb=$("SubMenu_totals_email");
_10cb.update(_10c9);
},_drawTotals:function(){
var _10cc=Element.create("div",{id:"SubMenu_totals"});
var _10cd=Element.create("ul",{className:"SubMenu_tree"});
var _10ce=Element.createHtml(["<li class=\"email\">","<a href=\"javascript:void(0);\" class=\"email\">","<span id=\"SubMenu_totals_email\">",L("Email.Unread.P",0),"</span>","</a>","</li>"].join(""));
var email=_10ce.getElementsByTagName("a")[0];
email._type="email";
Event.observe(email,"click",this.evTotalClick);
_10cd.append(_10ce);
_10cc.append(_10cd);
return _10cc;
},_makeResizable:function(){
function snapHorizontal(x,y){
if(x<10){
x=10;
}
if(x>500){
x=500;
}
return [x,$("core_left_handle").orig_top];
}
function startResize(_10d2){
Element.addClassName(_10d2,"core_left_handle_active");
Webmail.enableWindow(false);
}
function endResize(_10d3){
Element.removeClassName(_10d3,"core_left_handle_active");
Webmail.enableWindow(true);
$Controller._setLeftWidth(_10d3.offsetLeft);
$Controller.resize();
}
new Draggable("core_left_handle",{altDelta:true,snap:snapHorizontal,starteffect:startResize,endeffect:endResize});
},_evTotalClick:function(e){
$AN(46);
var link=Event.findElement(e,"a");
var type=link._type;
if(!type){
return;
}
if(Keystroke.key("z")&&console.show){
console.show();
return;
}
$UI.load(function(){
$$MainMenu.loadSection(type);
},e);
},evTotalClick:null};
}
if($Bootstrap.notLoaded("0ec1109da1ee80185c1fb1963031dd15")){
Framework.register("Webmail");
$LeftMenu=Webmail.LeftMenu=new function(){
this.cache={};
this.links=$Preload["LeftMenu.action_links"];
this.findCollapsedParent=function(_10d7){
var fs=$FolderSettings;
if(fs.getSetting("folders_main","collapse")){
return "folders_main";
}
var _10d9=_10d7.split(".");
var _10da=false;
for(var i=_10d9.length,ii=1;i>ii;i--){
_10d9.pop();
var temp=_10d9.join(".");
if(temp==CFG_FOLDER_INBOX){
break;
}
if(fs.getSetting(temp,"collapse")){
_10da=temp;
}
}
return _10da;
};
this.getActionLinks=function(){
return this.links.slice(0);
};
this.getFoldersStatus=function(_10dd,_10de){
var _10de=_10de||Prototype.emptyFunction;
var _10df=[];
if(_10dd){
_10df=Array.merge(_10df,$FolderList.getFolders());
}
Webmail.Data.request("LeftMenu.getFoldersStatus",{callback:function(_10e0){
this.updateFoldersStatus(_10e0);
_10de();
}.bind(this),handle_conn_err:false},_10df);
};
this.setFolderCollapse=function(_10e1,_10e2){
$FolderSettings.changeSetting(_10e1,"collapse",_10e2);
if(_10e2){
this.checkTrackback(_10e1);
}else{
var fl=$FolderList;
if((fl.isDraft(_10e1)&&(fl.getTotalMessages(_10e1)>0))){
return;
}
if(!(fl.getNewMessages(_10e1)>0)){
}
}
Webmail.Data.request("LeftMenu.setFolderCollapse",{callback:function(_10e4){
}.bind(this)},_10e1,_10e2);
};
this.updateFoldersStatus=function(_10e5){
if(!_10e5){
return;
}
$$SubMenu.stall_update=true;
for(var i=0,ii=_10e5.length;i<ii;i++){
var data=_10e5[i];
if($FolderList.getUnreadMessages(data.folder)<data.unread){
$Dispatcher.publish("Folder.newUnreadMessages",data.folder);
}
$FolderList.setFolderStatus(data.folder,data.total,data.unread);
}
$$SubMenu.stall_update=false;
$$SubMenu.updateTotals();
};
};
}
if($Bootstrap.notLoaded("9833e97e423c9494f63a6635aa907e6c")){
Framework.register("Webmail");
$Quota=Webmail.Quota=new function(){
this.quota=$Preload["Quota.quota"];
this.usage=$Preload["Quota.usage"];
this.getQuota=function(){
return this.quota;
};
this.getUsage=function(){
return this.usage;
};
this.setUsage=function(usage){
this.usage=usage;
$$Quota.update();
};
};
}
if($Bootstrap.notLoaded("18cc0a416c73764b6528e234a36105c2")){
Framework.register("Webmail.Modules");
$$Quota=Webmail.Modules.Quota=new function(){
this.draw=function(){
var quota=$Quota.getQuota().toString();
var usage=$Quota.getUsage().toString();
if(quota>0){
var _10eb=parseInt((usage/quota)*100);
}else{
var _10eb=0;
}
usage=(usage<(1*1024*1024)/10?"0.0 MB":usage.toFilesize(1));
if(_10eb>100){
_10eb=100;
}
if(_10eb>=75){
var _10ec="alert";
}else{
var _10ec="normal";
}
var _10ed=Element.createHtml(["<table><tbody><tr>","<td>",usage.replace(" ","&nbsp;"),"</td>","<td class=\"bar\">","<div>","<img src=\"images/blank.gif\" class=\"",_10ec,"\" />","</div>","</td>","<td>",quota.toFilesize(1).replace(" ","&nbsp;"),"</td>","</tr></tbody></table>"].join(""));
var _10ee=_10ed.getElementsByTagName("img")[0];
Element.setStyle(_10ee,{width:_10eb+"%",height:"8px"});
return _10ed;
};
this.update=function(){
var cont=$("quota_container");
if(!cont){
return false;
}
var table=cont.firstChild;
var _10f1=table.rows[0].cells[0];
var _10f2=table.getElementsByTagName("img")[0];
var usage=$Quota.getUsage();
var quota=$Quota.getQuota();
if(quota==0){
var _10f5=0;
}else{
var _10f5=parseInt((usage/quota)*100);
}
usage=(usage<(1*1024*1024)/10?"0.0 MB":String(usage).toFilesize(1));
if(_10f5>100){
_10f5=100;
}
if(_10f5>=75){
var _10f6="alert";
}else{
var _10f6="normal";
}
Element.update(_10f1,usage.replace(" ","&nbsp;"));
_10f2.className=_10f6;
Element.setStyle(_10f2,{width:_10f5+"%",height:"8px"});
return true;
};
};
}
if($Bootstrap.notLoaded("a937fc140a47ef159f61ee45db0c6f67")){
Framework.register("Webmail");
$FolderSettings=Webmail.FolderSettings=new function(){
this._default_values={};
this._default_values["collapse"]=false;
this._default_values["sort"]=0;
this.getSetting=function(_10f7,_10f8){
var _10f9=$FolderList.getSetting(_10f7,_10f8,this._getDefault(_10f8));
return _10f9;
};
this.changeSetting=function(_10fa,_10fb,value){
return $FolderList.addSetting(_10fa,_10fb,value);
};
this.setFolderCollapse=function(_10fd,_10fe){
Webmail.Data.request("Settings.setFolderCollapse",{},_10fd,_10fe);
};
this._getDefault=function(_10ff){
return (this._default_values[_10ff]?this._default_values[_10ff]:false);
};
};
}
if($Bootstrap.notLoaded("9df176d914199df670c484c2b2d73f64")){
Framework.register("Webmail.Modules");
$$FolderManager=Webmail.Modules.FolderManager=new function(){
this.config={disable_scroll:true,use_navmenu:true,auto_submenu:true};
this.tpl={};
this.sizes={"email":-1};
this.first_load=true;
this.__preload=function(){
Object.bindCallbacks(this);
$Dispatcher.subscribe("Email.Folders.update",this.cbSubUpdateFolders);
var _1100=$FolderList.getDropdownOptions();
var _1101=Element.createHtml("<div id=\"folder_manager\"><div class=\"toolbar\"><div class=\"toolbar_left\"><input type=\"button\" class=\"btn2\" value=\""+L("Folders.L.AddFolder")+"\" _ref=\"create\" /><input type=\"button\" class=\"btn2\" value=\""+L("Folders.L.Sizes")+"\" _ref=\"sizes\" /></div></div><div class=\"grid_action_bar\"><div class=\"grid_action_bar_left\"><img src=\"images/blank.gif\" class=\"arrow_up_rt\" /><input type=\"button\" value=\""+L("L.Delete")+"\"class=\"delete btn\" id=\"fmanager_delete_btn\" _ref=\"delete\" />"+L("L.OR")+"<select class=\"folder_list\" id=\"fmanager_grid_dropdown\" _ref=\"dropdown\"></select></div></div><div id=\"fmanager_grid_container\" class=\"fmanager_grid_container\"><table id=\"fmanager_grid\" class=\"fmanager_grid\" cellspacing=\"0\" cellpadding=\"0\"><thead><tr class=\"column_header_row\"><td class=\"check\">&nbsp;</td><td>"+L("Folders.L.Names")+"</td><td id=\"fmanager_count_header\" class=\"count\">"+L("Folders.L.Messages")+"</td><td class=\"short\">"+L("Folders.L.Size")+"</td><td class=\"short\">"+L("Folders.L.Settings")+"</td><td class=\"short\">"+L("Folders.L.Purge")+"</td></tr></thead></table></div></div>");
$Templates.setDom(_1101);
var dom=_1101.dom;
var _1103=dom("create");
var _1104=dom("sizes");
var _1105=dom("delete");
var _1106=dom("dropdown");
this.createHandler=this.evCreate.bindAsEventListener(this);
this.deleteHandler=this.evDelete.bindAsEventListener(this);
this.moveHandler=this.evMove.bindAsEventListener(this);
this.sizeHandler=this.evUpdateSize.bindAsEventListener(this);
Event.observe(_1103,"click",this.createHandler);
Event.observe(_1105,"click",this.deleteHandler);
Event.observe(_1106,"change",this.moveHandler);
Event.observe(_1104,"click",this.sizeHandler);
var _1107=this._draw();
Element.append(_1101.lastChild,_1107);
Element.setStyle(_1101,{height:"500px"});
return _1101;
};
this.__load=function(){
$$FolderManager.SubMenu.clearActiveFolder();
$$SubMenu.loadSection(this.SubMenu);
this._clearCheckedFolders();
if(this.first_load){
this.updateDropdowns();
this.first_load=false;
}
$("fmanager_delete_btn").disabled=false;
Element.show($("fmanager_grid_folders"));
Element.show($("fmanager_grid_dropdown"));
Element.show("fmanager_total_size");
$Help.setPage(HELP_FOLDER_MANAGER);
Element.update($("fmanager_count_header"),L("Folders.L.Messages"));
var _1108=$FolderList.getFolders();
var _1109=_1108.length;
this._setTotalSize(this.sizes["email"]);
if($("fmanager_grid_list")){
$("fmanager_grid_list").scrollTop=0;
}
this.__resize();
};
this.__resize=function(){
var _110a=Webmail.rightHeight()+20;
var _110b=Webmail.rightWidth();
if(wack.Browser.is_firefox){
Element.setDimensions($("folder_manager"),{height:_110a-2});
Element.setDimensions($("fmanager_grid_list"),{height:_110a-90});
}else{
Element.setDimensions($("folder_manager"),{height:_110a});
Element.setDimensions($("fmanager_grid_list"),{height:_110a-88});
}
name_width=_110b-535;
if(name_width<50){
name_width=50;
}
var _110c=$("fmanager_grid_container").childNodes[0].childNodes[0].childNodes[0];
var _110d=$("fmanager_grid_list").childNodes[0].childNodes[0].childNodes[1];
_110c.childNodes[5].className="purge_non_rss";
name_width+=90;
if(_110d){
_110d.childNodes[1].style.width=name_width+"px";
}
_110c.childNodes[1].style.width=name_width+"px";
};
this.create={dom:{getFolderField:function(_110e){
return this._getCreateForm(_110e).getElementsByTagName("select")[0];
},getNameField:function(_110f){
return this._getCreateForm(_110f).getElementsByTagName("input")[0];
},_getCreateForm:function(_1110){
while(_1110.className!="fmanager_create"&&_1110!=document.body){
_1110=_1110.parentNode;
}
if(_1110==document.body){
return false;
}
return _1110;
}},evSubmit:function(e){
var _1112=Event.element(e);
var _1113=this.dom.getNameField(_1112);
var _1114=this.dom.getFolderField(_1112);
var _1115=_1113.value;
var _1116=_1114.value||CFG_FOLDER_INBOX;
var _1117=$FolderList.getFolders();
$KeyEventManager.removeKeyEvent($("fmanager_create"),13,0);
$KeyEventManager.removeKeyEvent($("fmanager_create"),27,0);
if(!$FolderList.validateFolderName(_1115)){
$UI.error(L("Folders.F.E.InvalidName"));
_1113.focus();
return;
}
$FolderList.createFolder(_1116,_1115,function(_1118){
if(_1118.exception){
$UI.error(_1118.message);
}else{
Webmail.Dialogs.unloadDialog(_1112);
}
});
},moveToForm:function(_1119){
REQUIRE("combo/dialogs");
var form=Element.createHtml("<div class=\"fmanager_move\"><label>"+L("Folders.D.Move")+"</label>:<div class=\"folder_list\" _ref=\"folder_list\"></div><div class=\"buttons\"><input type=\"button\" class=\"btn\" value=\""+L("L.Save")+"\" _ref=\"save_btn\" /><input type=\"button\" class=\"btn\" value=\""+L("L.Cancel")+"\" _ref=\"cancel_btn\" /></div></div>");
var _111b=form.getElementsByTagName("input");
Event.observe(_111b[0],"click",this.evMoveToFolder.bindAsEventListener(this));
Event.observe(_111b[1],"click",$Dialogs.evClose.bindAsEventListener($Dialogs));
var load=$Dialogs.loadDialog(form,{disablewin:false,minimize:true,movable:true,title:L("Folders.Title.Folders")});
},showForm:function(){
REQUIRE("combo/dialogs");
var form=Element.createHtml(["<div id=\"fmanager_create\" class=\"fmanager_create\">","<label>",L("Folders.F.FolderName"),":</label>","<input type=\"text\" class=\"name\" />","<label>",L("Folders.F.Parent"),":</label>","<select>","</select>","<div class=\"buttons\">","<input type=\"button\" class=\"btn\" value=\"",L("L.Save"),"\" />","<input type=\"button\" class=\"btn\" value=\"",L("L.Cancel"),"\" />","</div>","</div>"].join(""));
var _111e=form.getElementsByTagName("select")[0];
$$FolderManager._populateDropdown(_111e);
var _111f=form.getElementsByTagName("input");
var name=_111f[0];
var ok=_111f[1];
var _1122=_111f[2];
Event.observe(ok,"click",this.evSubmit.bindAsEventListener(this));
Event.observe(_1122,"click",$Dialogs.evClose.bindAsEventListener($Dialogs));
$KeyEventManager.addKeyEvent(form,this.evSubmit.bindAsEventListener(this),13,0);
$KeyEventManager.setLastClicked(form);
var load=$Dialogs.loadDialog(form,{disablewin:false,minimize:true,movable:true,title:L("Folders.L.AddFolder")});
if(load){
try{
name.focus();
}
catch(e){
}
}
return load;
}};
this.dom={getCheckbox:function(row){
return this.getCheckboxCell(row).firstChild;
},getCheckboxCell:function(row){
return row.childNodes[0];
},getCountCell:function(row){
return row.childNodes[2];
},getEditCell:function(row){
return row.childNodes[4];
},getEditLink:function(row){
return this.getEditCell(row).firstChild;
},getNameCell:function(row){
return row.childNodes[1];
},getNameLink:function(row){
return this.getNameCell(row).firstChild;
},getPurgeCell:function(row){
return row.childNodes[5];
},getPurgeLink:function(row){
return this.getPurgeCell(row).firstChild;
},getSizeCell:function(row){
return row.childNodes[3];
},getUpdatedCell:function(row){
if(!row.childNodes[6]){
return false;
}
return row.childNodes[6];
},findRow:function(_112f){
while(!_112f._folder&&_112f!=document.body){
_112f=_112f.parentNode;
}
if(_112f==document.body){
return false;
}
return _112f;
}};
this.edit={dom:{getFolderField:function(_1130){
return this._getForm(_1130).getElementsByTagName("select")[0];
},getNameField:function(_1131){
return this._getForm(_1131).getElementsByTagName("input")[0];
},_getForm:function(_1132){
while(_1132.className!="fmanager_edit"&&_1132!=document.body){
_1132=_1132.parentNode;
}
if(_1132==document.body){
return false;
}
return _1132;
}},evSubmit:function(e){
var _1134=Event.element(e);
var form=this.dom._getForm(_1134);
var _1136=form._folder.raw;
var _1137=this.dom.getNameField(_1134);
var _1138=_1137.value;
$KeyEventManager.removeKeyEvent($("fmanager_edit"),13,0);
$KeyEventManager.removeKeyEvent($("fmanager_edit"),27,0);
if(!$FolderList.validateFolderName(_1138)){
$UI.error(L("Folders.F.E.InvalidName"));
return;
}
$FolderList.renameFolder(_1136,_1138,function(_1139){
if(_1139.exception){
$UI.error(_1139.message);
}else{
$Dialogs.unloadDialog(_1134);
}
});
},showForm:function(_113a){
REQUIRE("combo/dialogs");
var form=Element.createHtml(["<div id=\"fmanager_edit\" class=\"fmanager_edit\">","<p>","<label>",L("Folders.F.FolderName"),":</label>","<input type=\"text\" class=\"name\" value=\"",_113a.name,"\" />","</p>","<p class=\"buttons\">","<input type=\"button\" class=\"btn\" value=\"",L("L.Save"),"\" />","<input type=\"button\" class=\"btn\" value=\"",L("L.Cancel"),"\" />","</p>","</div>"].join(""));
form._folder=_113a;
var _113c=form.getElementsByTagName("input");
var name=_113c[0];
var ok=_113c[1];
var _113f=_113c[2];
Event.observe(ok,"click",this.evSubmit,this);
Event.observe(_113f,"click",$Dialogs.evClose,$Dialogs);
$KeyEventManager.addKeyEvent(form,this.evSubmit.bindAsEventListener(this),13,0);
$KeyEventManager.setLastClicked(form);
var load=$Dialogs.loadDialog(form,{disablewin:false,movable:true,title:L("Folders.L.EditFolder")});
if(load){
try{
name.focus();
}
catch(e){
}
}
return load;
}};
this.getFolderClass=function(_1141){
var _1142="";
if(String.compare(_1141.raw,CFG_FOLDER_INBOX,false)){
_1142="inbox";
}else{
var _1143={};
_1143[CFG_FOLDER_DRAFTS]="drafts";
_1143[CFG_FOLDER_SENT]="sent";
_1143[CFG_FOLDER_SPAM]="spam";
_1143[CFG_FOLDER_TRASH]="trash";
for(var s in _1143){
if(_1141.raw==s||$FolderList.isWithin(_1141.raw,s)){
_1142=_1143[s];
break;
}
}
}
if(_1142!=""){
_1142="folder_"+_1142;
}
return _1142;
};
this.setFolderCounts=function(_1145,total,_1147,row){
row=row||$("fmanager_row_"+_1145);
if(!row){
return;
}
total=total||0;
_1147=_1147||0;
var _1149="L.Message"+(total==1?".S":".P");
var _114a=this.dom.getCountCell(row);
var _114b=total.format()+"&nbsp;"+L(_1149);
if(_1147>0){
_114b+=",&nbsp;<span class=\"new\">"+_1147.format()+"&nbsp;"+L("L.New")+"</span>";
}
Element.update(_114a,_114b);
};
this.update=function(){
var fl=$FolderList;
var _114d=fl.getFolders();
var start=0;
var grid=$("fmanager_grid");
var _1150=$("fmanager_grid_folders");
this.updateDropdowns();
if(!_1150){
return;
}
var rows=_1150.getElementsByTagName("tr");
var _1152=[];
for(var i=1,ii=rows.length;i<ii;i++){
if(Element.visible(rows[i])){
_1152.push(rows[i]._folder.raw);
}
}
var _1154=[];
for(var i=start,ii=_114d.length;i<ii;i++){
_1154.push(_114d[i].raw);
}
var _1155=Array.diff(_1152,_1154);
var _1156=Array.diff(_1154,_1152);
for(var i=0,ii=_1155.length;i<ii;i++){
var row=$("fmanager_row_"+_1155[i]);
if(row){
row.id="";
Element.remove(row);
Element.hide(row);
Element.append(_1150,row);
}
}
for(var i=0,ii=_1156.length;i<ii;i++){
for(var j=0,jj=_114d.length;j<jj;j++){
if(_114d[j].raw==_1156[i]){
var index=j;
index++;
var _115a=_114d[j];
break;
}
}
var _115b=_1150.lastChild;
if(Element.visible(_115b)||_115b==_1150.firstChild){
var row=this._drawRow(_1150,_115a);
}else{
var row=_115b;
this._populateRow(row,_115a);
}
Element.insert(_1150,index,row);
Element.show(row);
}
if(_1152.length==0){
this.__resize();
}
};
this.updateDropdowns=function(){
var _115c=$("fmanager_grid_dropdown");
if(_115c){
_115c.style.display="none";
this._populateDropdown(_115c);
Form.Select.insert(_115c,{value:"-",text:L("Folders.D.Move")},{position:0});
Form.Select.insert(_115c,{value:"-",text:"------------------"},{position:1});
_115c.selectedIndex=0;
_115c.style.display="";
}
};
this.updateSizes=function(){
var grid=$("fmanager_grid_folders");
var _115e=0;
var rows=grid.getElementsByTagName("tr");
for(var i=0,ii=rows.length;i<ii;i++){
if(!Element.visible(rows[i])){
continue;
}
var _1161=rows[i]._folder;
var size=$FolderList.getFolderSize(_1161.raw);
_115e+=size;
this._setFolderSize(rows[i],size);
}
this._setTotalSize(_115e);
this.showTotalFolderSize(true);
};
this._clearCheckedFolders=function(){
var grid=$("fmanager_grid_folders");
var rows=grid.getElementsByTagName("tr");
for(var i=0,ii=rows.length;i<ii;i++){
var _1166=rows[i]._folder;
if(!_1166){
continue;
}
var _1167=this.dom.getCheckbox(rows[i]);
$UI_Grid.checkSelectedRow(_1167,false,_1166.tagName);
if($FolderList.isPermanentFolder(_1166.raw)){
_1167.disabled=true;
}else{
_1167.disabled=false;
}
}
};
this._draw=function(){
var table=Element.createHtml("<div id=\"fmanager_grid_list\" style=\"width: 100%; overflow: scroll; overflow-x: hidden;margin: 0px; padding: 0px;\"><table id=\"fmanager_grid\" class=\"fmanager_grid\" cellspacing=\"0\" cellpadding=\"0\"><tbody id=\"fmanager_grid_folders\" _ref=\"body\"><tr style=\"display:none;\" id=\"fmanager_grid_folder_clone\"><td class=\"check\"><input type=\"checkbox\" /></td><td class=\"name\"><a href=\"javascript:void(0);\"></a></td><td class=\"count\">&nbsp;</td><td class=\"size short\">&nbsp;</td><td class=\"edit short\"><a href=\"javascript:void(0);\">"+L("Folders.L.Edit")+"</a></td><td class=\"purge purge_non_rss\"><a href=\"javascript:void(0);\">"+L("Folders.L.Purge")+"</a></td></tr></tbody><tbody class=\"fmanager_grid_size\" id=\"fmanager_grid_size\" style=\"display:none\"><tr><td class=\"check\"></td><td class=\"name\"></td><td class=\"count\" align=\"right\" style=\"border:0;\"><strong>"+L("Folders.TotalSize")+":</strong></td><td class=\"size short\" style=\"border:0\"><span id=\"fmanager_total_size\"></span></td></tr></tbody></table></div>");
$Templates.setDom(table);
var _1169=table.dom("body");
var _116a=$FolderList.getFolders();
for(var i=0,ii=_116a.length;i<ii;i++){
var row=this._drawRow(_1169,_116a[i]);
Element.append(_1169,row);
}
return table;
};
this._drawRow=function(tbody,_116e){
var _116f=tbody.firstChild;
var row=_116f.cloneNode(true);
var _1171=this.dom.getCheckbox(row);
var _1172=this.dom.getNameLink(row);
var _1173=this.dom.getEditLink(row);
var _1174=this.dom.getPurgeLink(row);
this.checkHandler=this.evCheck.bindAsEventListener(this);
this.loadHandler=this.evFolderGo.bindAsEventListener(this);
this.editHandler=this.evEdit.bindAsEventListener(this);
this.purgeHandler=this.evPurge.bindAsEventListener(this);
Webmail.UI.Grid.addHoverColor(row);
Event.observe(_1171,"click",this.checkHandler);
Event.observe(_1172,"click",this.loadHandler);
Event.observe(_1174,"click",this.purgeHandler);
Event.observe(_1173,"click",this.editHandler);
this._populateRow(row,_116e);
Element.show(row);
return row;
};
this._getCheckedFolders=function(){
var grid=$("fmanager_grid_folders");
var rows=grid.getElementsByTagName("tr");
var _1177=[];
for(var i=0,ii=rows.length;i<ii;i++){
if(!Element.visible(rows[i])){
continue;
}
var _1179=this.dom.getCheckbox(rows[i]);
if(_1179.checked&&rows[i]&&rows[i]._folder){
_1177.push(rows[i]._folder.raw);
}
}
return _1177;
};
this._getNewFolderNames=function(_117a,dest){
var _117c=new Array;
dest=(dest?dest:CFG_FOLDER_INBOX);
for(var i=0;i<_117a.length;i++){
var temp=_117a[i].split(".");
var total=$FolderList.getTotalMessages(_117a[i]);
var _1180=$FolderList.getUnreadMessages(_117a[i]);
var name=temp.pop();
var _1182=temp.join(".");
var _1183="";
for(var j=0;j<_117a.length;j++){
if(_117a[j]==_1182){
_1183=_117c[j].name;
}
}
name=(_1183||dest)+"."+name;
_117c[i]={"name":name,"total":total,"unread":_1180};
}
return _117c;
};
this._populateDropdown=function(_1185,_1186,_1187){
_1187=_1187||false;
var _1188=$FolderList.getFolders();
var start=0;
var _118a={value:"",text:L("Folders.N.Email")};
Form.Select.clear(_1185);
if(!_1186){
Form.Select.insert(_1185,_118a);
var _118b=1;
}else{
var _118b=0;
}
for(var i=start,ii=_1188.length;i<ii;i++){
if(!_1187&&_1188[i].raw=="INBOX"){
continue;
}
var raw=_1188[i].raw;
var _118e=$FolderList.getIndentLevel(raw);
var _118f=String.repeat(" ",(_118e+_118b)*2)+_1188[i].name;
if(_118f.length>25){
_118f=_118f.substring(0,22)+"...";
}
_118f=_118f.replace(/>/g,"&gt;");
_118f=_118f.replace(/</g,"&lt;");
Form.Select.insert(_1185,{value:raw,text:_118f});
}
};
this._populateRow=function(row,_1191){
row.id="fmanager_row_"+_1191.raw;
row._folder=_1191;
var _1192=this.dom.getCheckbox(row);
_1192.disabled=false;
$UI_Grid.checkSelectedRow(_1192,false,row.tagName);
row.removeAttribute("alt");
row.removeAttribute("title");
if(update_cell=this.dom.getUpdatedCell(row)){
Element.update(update_cell,"- - -");
}
if($FolderList.isPermanentFolder(_1191.raw)){
_1192.disabled=true;
}
var _1193=this.dom.getNameLink(row);
_1193.className="folder";
var _1194=this.getFolderClass(_1191);
var _1195=$FolderList.getIndentLevel(_1191.raw)*18;
Element.addClassName(_1193,_1194);
Element.setStyle(_1193,{marginLeft:_1195+"px"});
Element.updateText(_1193,_1191.name,{escape_spaces:true});
var _1196=this.dom.getEditCell(row);
var _1197=this.dom.getEditLink(row);
this.editHandler=this.evEdit.bindAsEventListener(this);
if($FolderList.isPermanentFolder(_1191.raw)){
Element.update(_1196,"- - -");
if(Element.nodeName(_1197)=="a"){
Event.stopObserving(_1197,"click",this.editHandler);
}
}else{
if(Element.nodeName(_1197)!="a"){
Element.update(_1196,"<a href=\"javascript:void(0);\">Edit</a>");
Event.observe(_1196.firstChild,"click",this.editHandler);
}
}
var _1198=this.dom.getCountCell(row);
var total=$FolderList.getTotalMessages(_1191);
var _119a=$FolderList.getUnreadMessages(_1191);
if(defined(total)&&defined(_119a)&&total!=null&&_119a!=null){
this.setFolderCounts(_1191.raw,total,_119a,row);
}else{
Element.update(_1198,"&nbsp;");
}
};
this._setFolderSize=function(row,size){
var _119d=this.dom.getSizeCell(row);
size=size||0;
Element.update(_119d,size.toString().toFilesize(1)+String.repeat("&nbsp;",5));
};
this._setTotalSize=function(size){
size=size||0;
if(size<0){
this.showTotalFolderSize(false);
}else{
var _119f="fmanager_total_size";
Element.update(_119f,size.toString().toFilesize(1)+String.repeat("&nbsp;",5));
this.showTotalFolderSize(true);
}
this.sizes["email"]=size;
};
this.cbSubUpdateFolders=null;
this._cbSubUpdateFolders=function(){
this.update();
};
this.evCheck=function(e){
var _11a1=Event.element(e);
var row=this.dom.findRow(_11a1);
var _11a3=row._folder;
var _11a4=_11a1.checked;
$UI_Grid.checkSelectedRow(_11a1,_11a4,row.tagName);
var _11a5=row.nextSibling;
while(_11a5&&$FolderList.isWithin(_11a5._folder.raw,_11a3.raw)){
if(!Element.visible(_11a5)){
continue;
}
var _11a6=this.dom.getCheckbox(_11a5);
$UI_Grid.checkSelectedRow(_11a6,_11a4,row.tagName);
_11a6.disabled=_11a4;
_11a5=_11a5.nextSibling;
}
};
this.evCreate=function(e){
$AN(25);
this.create.showForm();
};
this.evDelete=function(e){
$AN(28);
var _11a9=this._getCheckedFolders();
if(_11a9.length>0){
if(confirm(L("Folders.Confirm.Delete"))){
$FolderList.deleteFolders(_11a9,function(_11aa){
this._clearCheckedFolders();
if(_11aa.exception){
$UI.error(_11aa.message);
}
}.bind(this));
}
}
};
this.evEdit=function(e){
$AN(38);
var _11ac=Event.element(e);
var row=this.dom.findRow(_11ac);
var _11ae=row._folder;
this.edit.showForm(_11ae);
};
this.evFolderGo=function(e){
var _11b0=Event.findElement(e,"tr");
var _11b1=_11b0._folder;
Webmail.Dispatcher.loadFolder(_11b1.raw);
};
this.evMove=function(e){
$AN(33);
var _11b3=Event.element(e);
var dest=_11b3.value;
var _11b5=this._getCheckedFolders();
if(dest=="-"||_11b5.length==0){
_11b3.selectedIndex=0;
return;
}
if(_11b5.length>0){
this._clearCheckedFolders();
_11b3.selectedIndex=0;
$FolderList.moveFolders(_11b5,dest,function(_11b6){
this._clearCheckedFolders();
if(_11b6.exception){
$UI.error(_11b6.message);
}
}.bind(this));
}
};
this.evMoveToFolder=function(e){
},this.evPurge=function(e){
$AN(36);
var link=Event.element(e);
var row=this.dom.findRow(link);
var _11bb=row._folder.raw;
if($Settings.isPurgePermanent()||_11bb==CFG_FOLDER_TRASH||_11bb==CFG_FOLDER_SPAM){
var _11bc=L("Folders.Confirm.PurgeFolderPerm");
}else{
var _11bc=L("Folders.Confirm.PurgeFolder");
}
if(confirm(_11bc)){
$FolderList.purgeFolder(_11bb,function(_11bd){
if(_11bd.exception){
$UI.error(_11bd.message);
}
});
}
};
this.evUpdateSize=function(e){
$AN(40);
$FolderList.updateSizes();
};
this.showTotalFolderSize=function(bool){
if(bool){
Element.show($("fmanager_grid_size"));
}else{
Element.hide($("fmanager_grid_size"));
}
};
};
}
if($Bootstrap.notLoaded("b9be3199c4d8b7138729c71214064dcb")){
Droppables._activate=Droppables.activate;
Droppables.activate=function(drop){
Droppables._activate(drop);
drop.onmouseover(drop);
};
Framework.register("Webmail.Modules.FolderManager");
Webmail.Modules.FolderManager.SubMenu={active_link:null,__preload:function(){
Object.bindCallbacks(this);
Object.bindObservers(this);
var _11c1=Element.create("div");
_11c1.append(this.draw());
$Dispatcher.subscribe("Email.Folders.update",this.cbSubUpdateFolders);
return _11c1;
},__load:function(){
$$MainMenu.setActiveTab("email");
},__resize:function(elem,width,_11c4){
},clearActiveFolder:function(){
if(this.active_link){
this.active_link.removeClassName("active");
}
},createFolderTree:function(_11c5){
var lists=[Element.create("ul",{className:"SubMenu_tree SubMenu_tree_toggle"})];
var _11c7=0;
var _11c8=null;
for(var i=0,ii=_11c5.length;i<ii;i++){
var _11ca=_11c5[i];
var _11cb=$FolderList.getIndentLevel(_11ca.raw);
if(_11cb>_11c7){
_11c8.append(lists[_11cb]=Element.create("ul"));
_11c8.addClassName("parent");
_11c8.removeClassName("leaf");
if($FolderSettings.getSetting(_11c8._folder.raw,"collapse")){
_11c8._collapsed=true;
_11c8.addClassName("collapsed");
}
}
_11c7=_11cb;
_11c8=null;
_11c8=this._drawFolderLink(_11ca);
if(!lists[_11cb]){
_11cb=0;
}
lists[_11cb].append(_11c8);
}
return lists[0];
},dom:{findUnreadContainer:function(cont){
var spans=cont.getElementsByTagName("span");
for(var i=0,ii=spans.length;i<ii;i++){
if(spans[i].className=="new"){
return $(spans[i]);
}
}
},findLink:function(cont){
return cont.getElementsByTagName("a")[0];
},findPurgeLink:function(cont){
var link=cont.getElementsByTagName("a")[1];
if(link){
link=$(link);
}
return link;
}},draw:function(){
var _11d2=Element.create("div",{className:"Email_SubMenu"});
var _11d3=$Custom.getExtraLinks();
if(_11d3.length>0){
_11d2.append($Custom.createLinksSection(_11d3));
}
var _11d4=$TPL.getTemplate("submenu_section",{title:L("Folders.Title.Folders"),add:L("Folders.L.AddFolder"),manage:L("Folders.Q.FolderManager")});
Event.observe(_11d4.dom("title"),"click",this.evHeaderTextClick);
Event.observe(_11d4.dom("manage"),"click",this.evClickManageIcon);
Event.observe(_11d4.dom("add"),"click",this.evPlusClick);
_11d2.append(_11d4);
var tree=this.createFolderTree($FolderList.getFolders());
tree.id="Email_folder_tree";
_11d4.append(tree);
$Widgets.ContextMenu.Folders.factory(tree);
return _11d2;
},purgeFolder:function(_11d6){
var _11d7;
if($Settings.isPurgePermanent()||$FolderList.isTrash(_11d6)||$FolderList.isSpam(_11d6)){
_11d7=L("Folders.Confirm.PurgeFolderPerm");
}else{
_11d7=L("Folders.Confirm.PurgeFolder");
}
if(confirm(_11d7)){
$FolderList.purgeFolder(_11d6);
}
},setActiveFolder:function(_11d8){
var _11d9=$("Email_flink_"+_11d8);
if(_11d9){
this._setActiveFolder(_11d9);
}
},setFolderCounts:function(_11da,total,_11dc){
if(typeof (_11da)=="string"){
var _11dd=$("Email_flink_"+_11da);
}else{
var _11dd=$(_11da);
_11da=_11dd._folder.raw;
}
if(!_11dd){
return;
}
total=total||0;
_11dc=_11dc||0;
this._updateTrackback(_11da,total,_11dc);
$$SubMenu.updateTotals();
if($FolderList.isDraft(_11da)){
_11dc=total;
}
if($FolderList.isTrash(_11da)){
_11dc=0;
}
var _11de=this.dom.findUnreadContainer(_11dd);
if(_11de){
_11de.innerHTML=(_11dc==0?"":"("+_11dc+")");
}
if($FolderList.isTrash(_11da)||$FolderList.isSpam(_11da)){
var _11df=this.dom.findPurgeLink(_11dd);
if(_11df){
if(total>0){
_11df.show();
}else{
_11df.hide();
}
}
}
if(_11dc>0){
_11dd.addClassName("has_unread");
}else{
_11dd.removeClassName("has_unread");
}
},update:function(){
var _11e0=$FolderList.getFolders();
var tree=$("Email_folder_tree");
if(!tree){
return;
}
var _11e2=$(tree).getElementsByTagName("li");
var _11e3=[];
for(var i=0,ii=_11e2.length;i<ii;i++){
_11e3.push(_11e2[i]._folder.raw);
}
var _11e5=[];
for(var i=0,ii=_11e0.length;i<ii;i++){
_11e5.push(_11e0[i].raw);
}
var _11e6=Array.diff(_11e3,_11e5);
var _11e7=Array.diff(_11e5,_11e3);
for(var i=0,ii=_11e6.length;i<ii;i++){
var link=$("Email_flink_"+_11e6[i]);
if(link){
var group=$(link.parentNode);
var _11ea=$(group.parentNode);
var _11eb=this.dom.findLink(link);
Droppables.remove(_11eb);
link.innerHTML="";
Element.remove(link);
if(group.childNodes.length==0){
Element.remove(group);
_11ea.removeClassName("parent");
_11ea.addClassName("leaf");
}
}
}
for(var i=0,ii=_11e7.length;i<ii;i++){
var _11ec=$FolderList.getIndentLevel(_11e7[i]);
var _11ed=null;
var _11ee=null;
for(var j=0,jj=_11e0.length;j<jj;j++){
if(_11e0[j].raw==_11e7[i]){
_11ed=_11e0[j-1];
_11ee=_11e0[j];
break;
}
}
var _11ea=$FolderList.getParent(_11ee.raw);
var _11f0=$("Email_flink_"+_11ea);
if(_11ea==CFG_FOLDER_INBOX){
_11ea=tree;
_11f0=$(_11ea);
}
var _11f1=this._drawFolderLink(_11ee);
if(_11ea==tree){
var group=tree;
}else{
var group=_11f0.getElementsByTagName("ul")[0];
}
if(!group){
group=Element.create("ul");
Element.append(_11f0,group);
Element.append(group,_11f1);
_11f0.addClassName("parent");
_11f0.removeClassName("leaf");
}else{
var _11f2=$("Email_flink_"+_11ed.raw);
if(_11ed.raw!=_11ea){
if(_11f2){
while(!Element.isMember(group,_11f2)){
_11f2=_11f2.parentNode.parentNode;
}
}
}
if(_11ed.raw==_11ea){
group.insertBefore(_11f1,group.firstChild);
}else{
if(!_11f2||_11f2==group.lastChild){
Element.append(group,_11f1);
}else{
group.insertBefore(_11f1,_11f2.nextSibling);
}
}
}
}
},_drawFolderLink:function(_11f3){
var _11f4=Element.create("li",{id:"Email_flink_"+_11f3.raw});
_11f4.className="folder leaf";
var _11f5="";
if($FolderList.isTrash(_11f3.raw)||$FolderList.isSpam(_11f3.raw)){
_11f5="<a href=\"javascript: void(0);\" class=\"purge_link\">"+"<img src=\"images/blank.gif\" align=\"top\" "+"title=\""+L("Folders.L.Purge")+"\" "+"alt=\""+L("Folders.L.Purge")+"\" /></a>";
}
var _11f6=_11f3.name;
_11f6=_11f6.replace(/</g,"&lt;");
_11f6=_11f6.replace(/>/g,"&gt;");
_11f4.innerHTML=["<span class=\"toggle\"><img src=\"images/blank.gif\" /></span>","<a href=\"javascript:void(0);\" isfolder=\"true\"><span>",_11f6,"</span></a>","<span class=\"new\"></span>",_11f5].join("");
var _11f7=$$FolderManager.getFolderClass(_11f3);
if(_11f7!=""){
_11f4.className+=" "+_11f7;
}
var _11f8=_11f4.getElementsByTagName("img")[0];
Event.observe(_11f8,"click",this.evToggleCollapse);
var link=this.dom.findLink(_11f4);
Event.observe(link,"click",this.evFolderClick);
Event.observe(link,"mouseout",this.evFolderMouseOut);
this._makeFolderLinkDroppable(link,_11f3.raw);
if(_11f5!=""){
var _11fa=this.dom.findPurgeLink(_11f4);
Event.observe(_11fa,"click",this.evPurgeIcon);
_11fa.hide();
}
_11f4._folder=_11f3;
if(_11f3.total!=undefined||_11f3.unread!=undefined){
this.setFolderCounts(_11f4,_11f3.total,_11f3.unread);
}
return _11f4;
},_loadManager:function(){
$Controller.loadModule("FolderManager");
},_makeFolderLinkDroppable:function(elem,_11fc){
Droppables.add(elem,{accept:"Email_draggable",hoverclass:"hovered",onDrop:function(_11fd){
$AN(63);
$$MessageRow.dropMessageInFolder(_11fc,_11fd);
},onmouseover:function(drop){
var link=drop.element;
var _1200=link.parentNode;
var _1201=_1200._folder.raw;
if(Draggables.activeDraggable&&!_1200._timer){
_1200._timer=setTimeout(function(){
_1200._collapsed=false;
_1200.removeClassName("collapsed");
this._toggleCollapsed(_1201,false);
}.bind(this),1250);
}
}.bind($$FolderManager.SubMenu)});
},_runTrackback:function(_1202){
var _1203=$("Email_flink_"+_1202);
if(!_1203){
return;
}
var total=_1203._children_total||0;
var _1205=_1203._children_unread||0;
if($FolderList.isDraft(_1202)){
_1205=total;
}
if(_1203._collapsed&&_1205>0){
_1203.addClassName("trackback");
}else{
_1203.removeClassName("trackback");
}
},_setActiveFolder:function(_1206){
_1206=$(_1206);
var _1207=_1206._folder.raw;
var key="active_link";
if(this[key]){
this[key].removeClassName("active");
}
_1206.addClassName("active");
this[key]=_1206;
$Dispatcher.publish("Folders.setActive",{folder:_1207});
var _1209=$("SubMenu_content");
var _120a=_1206.offsetTop;
if(_120a>_1209.offsetHeight){
_1209.scrollTop=_120a;
}else{
_1209.scrollTop=0;
}
},_toggleCollapsed:function(_120b,_120c){
this._runTrackback(_120b);
$FolderSettings.setFolderCollapse(_120b,_120c);
},_updateTrackback:function(_120d,total,_120f){
var _1210=$("Email_flink_"+_120d);
if(!_1210){
return;
}
var _1211=_1210._total||0;
var _1212=_1210._unread||0;
_1210._total=total=total||0;
_1210._unread=_120f=_120f||0;
var _1213=total-_1211;
var _1214=_120f-_1212;
var _1215=$(_1210.parentNode.parentNode);
while(_1215.nodeName=="li"||_1215.nodeName=="LI"){
_1215._children_total=(_1215._children_total||0)+_1213;
_1215._children_unread=(_1215._children_unread||0)+_1214;
this._runTrackback(_1215._folder.raw);
_1215=$(_1215.parentNode.parentNode);
}
},cbSubUpdateFolders:null,_cbSubUpdateFolders:function(){
this.update();
},_evFolderClick:function(e){
var _1217=Event.findElement(e,"li");
var _1218=_1217._folder.raw;
if(Keystroke&&Keystroke.key("z")){
this.purgeFolder(_1218);
}else{
$Dispatcher.loadFolder(_1218);
this._setActiveFolder(_1217);
}
},evFolderClick:null,_evFolderMouseOut:function(e){
var _121a=Event.findElement(e,"li");
clearTimeout(_121a._timer);
_121a._timer=null;
},evFolderMouseOut:null,evHeaderTextClick:null,_evHeaderTextClick:function(e){
$AN(32);
this._loadManager();
},evClickManageIcon:null,_evClickManageIcon:function(e){
$AN(30);
this._loadManager();
},_evPlusClick:function(e){
$AN(24);
$$FolderManager.create.showForm(false);
},evPlusClick:null,_evPurgeIcon:function(e){
$AN(35);
var _121f=Event.findElement(e,"li");
var _1220=_121f._folder.raw;
this.purgeFolder(_1220);
},evPurgeIcon:null,_evToggleCollapse:function(e){
var _1222=Event.findElement(e,"li");
var _1223=_1222._folder.raw;
var _1224=(_1222._collapsed?false:true);
if(_1222._collapsed){
$AN(42);
_1222._collapsed=false;
_1222.removeClassName("collapsed");
}else{
$AN(41);
_1222._collapsed=true;
_1222.addClassName("collapsed");
}
this._toggleCollapsed(_1223,_1224);
},evToggleCollapse:null};
}
if($Bootstrap.notLoaded("64e9019a15d280ad5859b7a9ab14cd4a")){
Framework.register("Webmail");
$Mail=Webmail.Mail={check_timer:null,num_external_accounts:$Preload["Mail.num_external_accounts"],_inited:false,initialize:function(){
Object.bindCallbacks(this);
var _1225=$Prefs.getUserPref("mail_auto_check",5*60);
this.setCheckTimer(_1225);
this.check(function(){
if(CFG_FOLDER_PREFETCH_ENABLE&&$Custom.isFoldersEnabled()){
var _1226=$FolderList.getPrefetchFolderArray();
var _1227=new wack.List();
for(var x=0;x<_1226.length;x++){
_1227.add(_1226[x]);
}
var _1229=new Webmail.Modules.MessageList.Prefetcher.FolderExclusionList();
_1229.add("INBOX.RSS*");
_1229.add("INBOX.Trash*");
_1229.add("INBOX.spam*");
var _122a=new Webmail.Modules.MessageList.Prefetcher(_1227,_1229,{interval_sleep_time:CFG_FOLDER_PREFETCH_INTERVAL},$Dispatcher);
_122a.start();
}
},true);
$Dispatcher.setExternalAccounts(this.num_external_accounts);
},check:function(_122b,_122c){
_122c=_122c||false;
if(this._inited&&$MessageList.active()){
var _122d=$MessageList.folder();
var _122e=$MessageList.start();
var _122f=$$MessageList.getCurrentUids();
}else{
var _122d=_122e=_122f=false;
}
var _1230=_122c;
$Dispatcher.publish("Folders.pending_call");
$Data.request("Mail.check",{callback:function(_1231){
if(_1231.exception){
}else{
var _1232=_1231.messages;
var _1233=_1231.folders;
var usage=_1231.usage;
if(!this._inited){
for(var i=0,ii=_1233.length;i<ii;i++){
if(_1233[i].folder==CFG_FOLDER_INBOX){
_1233.remove(i);
break;
}
}
this._inited=true;
}
var _1236=$FolderList.getUnreadMessages(CFG_FOLDER_INBOX);
var _1237=false;
var _1238=0;
if($MessageList.active()){
_1237=$MessageList.folder();
_1238=$FolderList.getUnreadMessages(_1237);
}
if($Custom.isFoldersEnabled()){
$LeftMenu.updateFoldersStatus(_1233);
}
if(_1232!=null){
if($MessageList.folder()==_1232["folder"]){
$MessageList.total(_1232["total"]);
$MessageList.unseen(_1232["unseen"]);
var _1239=($MessageList.sort()==8||$MessageList.sort()==9);
var _123a=1000*60*5;
var diff=((new Date)-$$MessageList.current_message_loaded);
if(!_1239||!_1230||!$$MessageList.current_message||diff>=_123a){
$MessageList.cbGetMessages(_1232["msgs"]);
}
}
}
if(usage!==null){
$Quota.setUsage(usage);
}
if($Settings.isSoundEnabled()){
if($FolderList.getUnreadMessages(CFG_FOLDER_INBOX)>_1236||(_1237&&$FolderList.getUnreadMessages(_1237)>_1238)){
Webmail.UI.Sounds.play(CFG_SOUND_ID);
}
}
}
if(_122b){
_122b(_1231);
}
}.bind(this),handle_conn_err:!_122c,background:_1230,request_type:CFG_AJAX_READ},_122d,_122e,_122f);
},checkBackground:function(){
$Mail.check(null,true);
},setReadStatus:function(_123c,_123d,_123e){
$Data.request("Mail.setReadStatus",{callback:_123e,handle_conn_err:false,request_retries:1},_123c,_123d);
},setCheckTimer:function(_123f){
if(_123f=="none"){
_123f=0;
}
window.clearTimeout(this.check_timer);
if(_123f>0){
this.check_timer=window.setInterval($Mail.checkBackground,_123f*1000);
}
},setFlag:function(_1240,flag,_1242,color){
if(typeof color=="undefined"){
var color=false;
}
$Data.request("Mail.setFlag",{callback:_1242},_1240,flag,color);
},cbSubSettingsChange:function(_1244){
$Mail.setCheckTimer(_1244);
}};
$Dispatcher.subscribe("Settings.change.mail_check",$Mail.cbSubSettingsChange);
}
if($Bootstrap.notLoaded("be95adc06eb27b13d9a799393d81f457")){
Framework.register("Webmail.Modules.Email");
$$Email=Webmail.Modules.Email={_util_bar:null,getUtilityBar:function(){
if(!this._util_bar){
this._util_bar=this._drawUtilityBar();
}
this.setExternalButton($Mail.num_external_accounts);
return this._util_bar;
},_drawUtilityBar:function(){
var _1245=Element.createHtml("<span><input type=\"button\" value=\""+L("Folders.Q.Check")+"\" _ref=\"check\" /><input type=\"button\" value=\""+L("Folders.Q.Compose")+"\" _ref=\"compose\" /><input type=\"button\" value=\""+L("LeftMenu.L.External")+"\" id=\"Mail_external_btn\" _ref=\"external\"/></span>");
$Templates.setDom(_1245);
this._ext_btn=_1245.dom("external");
Object.bindObservers(this);
Event.observe(_1245.dom("check"),"click",this.evCheckMail);
if($Custom.isComposeEnabled()){
Event.observe(_1245.dom("compose"),"click",this.evCompose);
}else{
_1245.dom("compose").style.display="none";
}
Event.observe(this._ext_btn,"click",this.evCheckExternal);
return _1245;
},setExternalButton:function(count){
$Mail.num_external_accounts=count;
if($Custom.isComposeEnabled()){
if(count>0){
$$MainMenu.showMenuItem("email","external");
if(this._ext_btn){
this._ext_btn.show();
}
}else{
$$MainMenu.hideMenuItem("email","external");
if(this._ext_btn){
this._ext_btn.hide();
}
}
}else{
if(this._ext_btn){
this._ext_btn.hide();
}
}
},_evCheckMail:function(e){
$AN(44);
$Dispatcher.checkMail();
},_evCheckExternal:function(e){
$AN(48);
$Dispatcher.checkExtMail();
},_evCompose:function(e){
$AN(101);
var _124a=wack.Event.element(e);
if(_124a._loading){
return;
}
_124a._loading=true;
$Dispatcher.compose();
setTimeout(function(){
_124a._loading=false;
},500);
}};
}
if($Bootstrap.notLoaded("0272389c252cbb3fe5cbd6461d0b2026")){
Framework.register("Webmail");
$Search=Webmail.Search=new function(){
this.active=function(){
return ($Controller.getCurrentModule()=="Search"?true:false);
};
this.blacklistMessages=function(_124b,_124c){
$Data.request("Mail.blacklistMessages",{callback:_124c},_124b);
};
this.disable=function(){
$$Search.toggleWidget(false);
};
this.enable=function(_124d){
$$Search.toggleWidget(true,_124d);
};
this.moveToTrash=function(m){
var mln=$MessageList;
if(typeof m=="undefined"){
return ($Prefs.getUserPref("mail_delete_to_trash",1)==1?true:false);
}else{
mln._move_to_trash=$Prefs.setUserPref("mail_delete_to_trash",(m?1:0),false);
}
};
this.previewPane=function(p){
var mln=$MessageList;
if(typeof p=="undefined"){
return $Settings.usePreviewPane();
}else{
$Prefs.setUserPref("disp_use_previewpane",(p?1:0),false);
$$Search.draw.previewPane(p);
}
};
this.searchAdvanced=function(_1252,start,limit,_1255){
start=start||0;
limit=limit||0;
$Data.request("Search.searchAdvanced",{callback:function(_1256){
if(!_1256.exception){
_1255(_1256);
}
}.bind(this)},_1252,start,limit);
};
this.searchBasic=function(_1257,start,limit,_125a){
start=start||0;
limit=limit||0;
_125a=_125a||Prototype.emptyFunction;
Webmail.Data.request("Search.searchBasic",{callback:function(_125b){
if(!_125b.exception&&_125b.results){
_125a(_125b);
}
}},_1257,start,limit);
};
this.safelistMessages=function(_125c,_125d){
$Data.request("Mail.safelistMessages",{callback:_125d},_125c);
};
};
}
if($Bootstrap.notLoaded("ff51f27af71c695b80f63fb95bc1f9e6")){
Framework.register("Webmail.Modules");
$$Search=Webmail.Modules.Search=new function(){
this.config={disable_scroll:true,enable_search:true};
this.module_key="Search";
this.check_drag=new CheckDrag;
this.current_message=false;
this.basic_type="curr";
this.curr_type="";
this.criteria={};
this.matches=0;
this.start=1;
this.limit=Number(CFG_SEARCH_LIMIT);
this.shown=0;
this.basic_input=null;
this.external_search=$Preload["Search.external_search"];
this.__preload=function(){
Object.bindObservers(this);
Object.bindCallbacks(this);
$Dispatcher.subscribe("Email.Folders.update",this.cbSubUpdateFolders);
$Dispatcher.subscribe("Settings.change.preview_pane",this.cbSubSettingsPreviewPane);
var _125e=this.create.searchWidget();
Element.append("core_right",_125e);
this._page=Element.create("div",{id:"Search_page"});
this._list=Element.create("div",{id:"Search_list_container",className:"media_screen"});
$Widgets.ContextMenu.Messages.factory(this._list,{search:true});
this._ppane=Element.create("div",{id:"Search_ppane"});
this._ppane_handle=Element.create("div",{id:"Search_ppane_handle",className:"media_screen"});
Element.append(this._page,this._list,this._ppane,this._ppane_handle);
this._p_pane_proportion=0.5;
this._ppane_blank=this.create.previewPane();
Element.append(this._ppane,this._ppane_blank);
if(!$Search.previewPane()){
this._ppane_handle.style.display="none";
this._ppane.style.display="none";
}
var _125f=Element.create("div",{className:"Search_hover",id:"Search_test"});
Element.hide(_125f);
Element.append(this._page,_125f);
var _1260=this.create.header();
this._search_body=this.create.body();
Element.append(this._list,_1260,this._search_body);
return this._page;
};
this.__load=function(){
if($Search.previewPane()){
this.setPreviewPaneClear(true);
this._ppane_handle.style.display="";
}
$Dispatcher.clearActiveFolder();
this.draw.titlebar();
};
this.__resize=function(){
this._resizeHeight();
this._resizeWidth();
};
this._boundPreviewPane=function(h){
return ((h>50)&&(h<Webmail.rightHeight()-50));
};
this._bumpResults=function(bump){
if(bump){
Element.show("Search_adv_placeholder");
}else{
Element.hide("Search_adv_placeholder");
}
this._resizeHeight();
};
this._resizeHeight=function(){
var _1263=$("Search_container");
var _1264=Webmail.rightHeight()+18;
var _1265=($("Search_adv_placeholder").offsetHeight||0);
_1264-=_1265;
if($Search.previewPane()){
var _1266=Number(Math.round(_1264*(1-this._p_pane_proportion)))+_1265;
var _1267=_1266-_1263.offsetTop;
if(_1266>0){
$("Search_list_container").setStyle({height:_1266+"px"});
}
var _1268=_1264-_1266+_1265;
var _1269=$$Search._ppane;
var _126a=$$Search._ppane_handle;
if(_1268>0){
_1269.style.height=_1268+"px";
_126a.style.top=_1266+"px";
}
}else{
var _1267=_1264-_1263.offsetTop;
}
if(_1267>0){
_1263.setStyle({height:_1267+"px"});
}
if($$MessageList._email_widget){
$$MessageList._email_widget.resize();
}
};
this._resizeHeightBar=function(){
var _126b=Webmail.rightHeight();
var _126c=$("Search_adv_placeholder").offsetHeight;
_126b-=_126c;
if($Search.previewPane()){
this._p_pane_proportion=this._ppane.offsetHeight/_126b;
}
this._resizeHeight();
};
this._resizeWidth=function(){
var _126d=Webmail.rightWidth();
var _126e=_126d-402;
var tb=$$Search.dom.getBody();
if(!tb.childNodes){
return;
}
if(tb.childNodes[0]){
var _1270=tb.childNodes[0].obj._sub.offsetWidth;
if(_1270==50&&_126e<=50){
return;
}
}
if(!Element.hasClassName($("Search_folder_div"),"MessageRow_folder_hidden")){
_126e=_126e-$("Search_folder_div").offsetWidth;
}
if(_126e<50){
_126e=50;
}
for(var i=0,ii=tb.childNodes.length;i<ii;i++){
var tr=tb.childNodes[i];
tr.obj._sub.style.width=_126e+"px";
}
$("Search_subject_header").firstChild.style.width=_126e+"px";
var _1273=wack.Browser.getDimensions()[1];
var _1274=$("Search_widget");
var _1275=$("Search_toolbar_left");
if(_1274&&_1275){
Element.setDimensions(_1274,{width:_1273-Position.cumulativeOffset(_1275)[0]-_1275.offsetWidth-40});
}
};
this._setColumnHeaders=function(_1276){
var _1277=L("Mlist.L.Sent");
var _1278=L("Mlist.L.From");
if($FolderList.isWithin(_1276,CFG_FOLDER_DRAFTS)){
_1277=L("Mlist.L.Saved");
}
if($FolderList.isWithin(_1276,CFG_FOLDER_DRAFTS)||$FolderList.isWithin(_1276,CFG_FOLDER_SENT)){
_1278=L("Mlist.L.To");
}
var _1279=" <img src=\"images/blank.gif\" class=\"Mlist_header_down_arrow\" />";
_1277+=_1279;
Element.update("Search_date_header",_1277);
Element.update($("Search_from_header").firstChild,_1278);
};
this._setFolder=function(_127a){
var _127b=$("Search_from_header").firstChild;
if($FolderList.isWithin(_127a,CFG_FOLDER_SENT)||$FolderList.isWithin(_127a,CFG_FOLDER_DRAFTS)){
_127b.innerHTML=L("Search.L.To");
}else{
_127b.innerHTML=L("Search.L.From");
}
Form.Select.setSelected("Search_results_folders",_127a);
};
this._showIndexWarning=function(){
REQUIRE("combo/dialogs");
var msg=new $DialogsWarning({message:L("Search.IndexWarning1")+"<br><br>"+L("Search.IndexWarning2"),title:L("Search.T.IndexWarning"),width:500});
msg.show();
$UI.clearStatus();
};
this.blacklist={call:function(){
var _127d=$$Search.blacklist.handler.bind($$Search);
var _127e=$$Search.getCheckedRows();
if(_127e.length==0){
return;
}
$UI.showStatus(L("Mlist.St.Blacklist"));
$Search.blacklistMessages(_127e,_127d);
},external:function(_127f){
$UI.clearStatus();
var sb=$$Search._body;
for(var i=0,ii=sb.childNodes.length;i<ii;i++){
var ro=sb.childNodes[i];
if(ro.obj.id()==_127f["id"]&&ro.obj.folder()==_127f["folder"]){
if(this.current_message==ro){
$Dispatcher.setPreviewPaneClear(true);
$$Search.current_message=false;
}
if(ro.obj.folder()!=CFG_FOLDER_SPAM){
$$Search.changeUnseen(0,-1,ro.obj.folder(),CFG_FOLDER_SPAM);
}else{
$$Search.changeUnseen(0,-1,ro.obj.folder());
}
ro.obj.remNode();
return;
}
}
},handler:function(_1283){
$UI.clearStatus();
var sb=$$Search._body;
var _1285=[];
for(var i=0,ii=sb.childNodes.length;i<ii;i++){
var ro=sb.childNodes[i];
if(!ro.obj.visible()){
break;
}
if(ro.obj.checked()){
if(ro.obj.folder()!=CFG_FOLDER_SPAM){
_1285.push({"folder":ro.obj.folder(),"id":ro.obj.id(),"unseen":!ro.obj.read()});
if($$Search.current_message==ro){
$Dispatcher.setPreviewPaneClear(true);
}
ro.obj.remNode();
}else{
ro.obj.checked(false);
}
}
}
if(_1285.length>0){
var _1288={};
for(var i=0,ii=_1285.length;i<ii;i++){
if(!_1288[_1285[i]["folder"]]){
_1288[_1285[i]["folder"]]={"unseen":(_1285[i]["unseen"]?1:0),"total":1};
}else{
if(_1285[i]["unseen"]){
_1288[_1285[i]["folder"]]["unseen"]+=1;
}
_1288[_1285[i]["folder"]]["total"]+=1;
}
}
for(folder in _1288){
$$Search.changeUnseen(0,-_1288[folder]["total"],folder,CFG_FOLDER_SPAM);
}
}
}};
this.create={body:function(){
var _1289=Element.create("div",{id:"Search_container"});
_1289.innerHTML=["<table id=\"Search_table\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">","<tbody id=\"Search_body\"></tbody>","<tbody id=\"Search_empty\">","<tr>","<td id=\"Search_empty_content\"></td>","</tr>","</tbody>","</table>"].join("");
$$Search._body=_1289.getElementsByTagName("tbody")[0];
Element.append(_1289.firstChild,$$Search._body);
return _1289;
},header:function(){
var _128a=Element.create("div",{id:"Search_header"});
var _128b=" <img src=\"images/blank.gif\" class=\"Mlist_header_down_arrow\" />";
var _128c=["<div class=\"toolbar\">","<div class=\"toolbar_left\" id=\"Search_toolbar_left\">","<span class=\"folders\">","<span>",L("Search.L.SearchFolder"),":&nbsp;</span>","<select id=\"Search_results_folders\">",$$Search.getFolderOptions(),"</select>","</span>","<span class=\"check\">","<input type=\"checkbox\" id=\"Search_results_attachments\" />","<span>",L("Search.L.ShowAttach"),"</span>","</span>","</div>","<div class=\"toolbar_right\">","</div>","</div>","<div id=\"Search_adv_placeholder\" style=\"display:none;\">&nbsp;</div>","<div id=\"Search_actions\">","<div class=\"left\">","<img src=\"images/blank.gif\" class=\"arrow_up_rt\" />","<input type=\"button\" class=\"btn\" value=\""+L("Mlist.L.Delete")+"\" id=\"delete_button\">","&nbsp;&nbsp;"+L("Mlist.Action.Or")+"&nbsp;&nbsp;",$$Search.create.optionsDropdown(),"&nbsp;&nbsp;"+L("Mlist.Action.Or")+"&nbsp;&nbsp;","<select id=\"Search_move_dd\">","<option value=\"null\">"+L("Mlist.Action.Move")+"</option>","<option value=\"null\">--------------------</option>",$FolderList.getDropdownOptions({include_special:true}),"</select>","</div>","<div class=\"left\">","<span id=\"Search_pager\"></span>","</div>","<div class=\"right\" id=\"Search_page_range\"></div>","<div class=\"clear\"></div>","</div>","<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"small\" width=\"100%\" style=\"margin-top:-1px\">","<tr height=\"15px\" id=\"Search_header\" class=\"column_header_row\">","<td class=\"MessageRow_check_cell\">","<input type=\"checkbox\" id=\"Search_header_checkbox\">","</td>","<td class=\"MessageRow_priority_cell\">","<img src=\"images/blank.gif\" class=\"Mlist_header_prio\" />","</td>","<td class=\"MessageRow_icon_cell\">","<img src=\"images/blank.gif\" class=\"Mlist_header_envelope\" />","</td>","<td class=\"MessageRow_flag_cell\">","<img src=\"images/blank.gif\" class=\"Mlist_header_flag\" />","</td>","<td class=\"MessageRow_attach_cell\">","<img src=\"images/blank.gif\" class=\"Mlist_header_attach\" />","</td>","<td id=\"Search_from_header\">","<div class=\"MessageRow_from_div\">",L("Search.L.From"),"</div>","</td>","<td id=\"Search_subject_header\">","<div class=\"MessageRow_subject_div\">",L("Search.L.Subject"),"</div>","</td>","<td>","<div id=\"Search_folder_div\" class=\"MessageRow_folder MessageRow_folder_hidden\">",L("Mlist.L.Folder"),"</div>","</td>","<td id=\"Search_date_header\" class=\"MessageRow_date_cell\">",L("Mlist.L.Sent")+_128b,"</td>","<td id=\"Search_size_header\" class=\"MList_header_size_cell\">",L("Search.L.Size"),"</td>","</tr>","</table>"].join("");
_128a.innerHTML=_128c;
var _128d=_128a.firstChild;
var _128e=_128d.nextSibling.nextSibling;
var _128f=_128a.lastChild;
var _1290=_128e.getElementsByTagName("input")[0];
var _1291=_128e.getElementsByTagName("select");
var _1292=_1291[0];
var _1293=_1291[1];
var _1294=_128f.getElementsByTagName("input")[0];
var _1295=_128f.rows[0];
var _1296=_1295.cells[5];
var _1297=_1296.nextSibling;
var _1298=_1297.nextSibling;
var _1299=_1298.nextSibling;
Event.observe(_1292,"change",$$Search.evChangeDropdown.bind($$Search));
Event.observe(_1293,"change",$$Search.evMoveMessages.bind($$Search));
Event.observe(_1290,"click",$$Search.evClickDelete.bind($$Search));
Event.observe(_1294,"click",$$Search.evCheckAll.bind($$Search));
var _129a=_128a.firstChild.firstChild.getElementsByTagName("input")[0];
var _129b=_128a.firstChild.firstChild.getElementsByTagName("select")[0];
this.attachHandle=$$Search.evToggleAttachments.bindAsEventListener($$Search);
this.folderHandle=$$Search.evSwitchFolder.bindAsEventListener($$Search);
Event.observe(_129a,"click",this.attachHandle);
Event.observe(_129b,"change",this.folderHandle);
return _128a;
},optionsDropdown:function(){
return $$MessageList.getOptionsDropdown("Search_action_dd");
},previewPane:function(){
var pane=Element.createHtml(["<div class=\"Search_ppane_blank\" id=\"Search_ppane_blank\">","<div>",L("Mlist.PreviewPane"),"</div>","</div>",].join(""));
return pane;
},searchWidget:function(){
var _129d=Element.createHtml(["<div id=\"Search_widget\">","<input value=\""+L("Search.L.Search")+"\" class=\"btn\" type=\"button\" />","<a href=\"javascript: void(0);\">",L("Search.L.Advanced"),"</a>","<form method=\"get\" action=\"http://www.google.com/custom\" target=\"_blank\" id=\"Search_google\"> ","<input type=\"hidden\" name=\"q\" value=\"\"></input>","<input type=\"hidden\" name=\"client\" value=\"pub-5258819546022198\"></input>","<input type=\"hidden\" name=\"forid\" value=\"1\"></input>","<input type=\"hidden\" name=\"ie\" value=\"UTF-8\"></input>","<input type=\"hidden\" name=\"oe\" value=\"UTF-8\"></input>","<input type=\"hidden\" name=\"hl\" value=\"en\"></input>","<input type=\"hidden\" name=\"sa\" value=\"Search\"></input>","<input type=\"hidden\" name=\"cof\" value=\"GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:125;S:http://www.google.com;FORID:1\"></input>","</form>","</div>",].join(""));
Element.hide(_129d.getElementsByTagName("form")[0]);
var _129e=_129d.getElementsByTagName("input");
var _129f=_129d.getElementsByTagName("a")[0];
this.basicHandler=$$Search.evQuickSearch.bindAsEventListener($$Search);
this.advancedHandler=$$Search.evShowAdvanced.bindAsEventListener($$Search);
Event.observe(_129e[0],"click",this.basicHandler);
Event.observe(_129f,"click",this.advancedHandler);
var input=$$Search.basic_input=new MoUI.Input({blank_image:"images/blank.gif",border_color:"red",icon_width:20,icon_height:15,input_id:"Search_widget_text",type:"menu",width:132,menu_callback:function(v){
$Analytics.add("search","switch_"+v);
$$Search.basic_type=v;
$("Search_widget_text").select();
}});
input.addMenuItem("curr",L("Search.L.ThisFolder"),"images/search/this_folder.2.gif","images/search/this_folder_active.2.gif");
if($Custom.isFoldersEnabled()){
input.addMenuItem("all",L("Search.L.AllFolders"),"images/search/all_folders.2.gif","images/search/all_folders_active.2.gif");
}
if($$Search.external_search==true){
input.addMenuItem("","sep","");
input.addMenuItem("google",L("Search.L.Google"),"images/search/google.2.gif","images/search/google_active.2.gif");
}
Element.insert(_129d,0,input.create());
Event.observe(input.input_elem,"keypress",this.basicHandler);
return _129d;
}};
this.draw={checkDrag:function(cb,chkd){
},previewPane:function(v){
$$Search._list.style.height="0px";
$$Search._ppane_handle.style.display=(v?"":"none");
$$Search._ppane.style.display=(v?"":"none");
$$Search.__resize();
},results:function(_12a5,_12a6){
_12a6=_12a6||{};
$$Search.current_message=false;
if($Controller.getCurrentModule()!=$$Search.module_key){
$Controller.loadModule($$Search.module_key);
}
$UI.clearStatus();
$$Search.setPreviewPaneClear(true);
var tb=$($$Search.dom.getBody());
var _12a8=[];
var i=0;
var _12aa=_12a5.results;
var _12ab=(_12a6.folder&&($FolderList.isWithin(_12a6.folder,CFG_FOLDER_SENT)||$FolderList.isWithin(_12a6.folder,CFG_FOLDER_DRAFTS)));
var _12ac=(_12a6.folder==""||_12a6.folder=="all"?true:false);
var _12ad=$("Search_folder_div");
if(_12ac){
Element.removeClassName(_12ad,"MessageRow_folder_hidden");
}else{
Element.addClassName(_12ad,"MessageRow_folder_hidden");
}
$$Search._resizeWidth();
if(_12aa.length>0){
$("Search_empty").hide();
tb.show();
while(_12aa[i]){
if(tb.childNodes[i]){
var tr=tb.childNodes[i];
tr.obj.fillRow(_12aa[i],{use_to_field:_12ab,show_folder:_12ac});
}else{
var _12af=$$MessageList.evClickMessage.bindAsEventListener($$MessageList);
var ro=new $$MessageRow({click_handler:_12af});
_12a8.push(ro.getCheckbox());
ro.fillRow(_12aa[i],{use_to_field:_12ab,show_folder:_12ac});
tb.appendChild(ro.getContainer());
}
i++;
}
if(i<tb.childNodes.length){
for(var ii=tb.childNodes.length;i<ii;i++){
tb.childNodes[i].obj.visible(false);
}
}
}else{
$("Search_empty").show();
$("Search_empty_content").update(L("Search.NoResults"));
tb.hide();
}
if(_12a8.length>0){
$UI.Grid.addCheckDrag(tb,_12a8,tb.childNodes[0].tagName,$$MessageRow.checkDragCallback);
$$Search._resizeWidth();
}
$$Search.shown=_12aa.length;
$$Search.draw.titlebar(_12a5.matches);
var _12b2=_12a6.folder;
if(!_12b2){
_12b2="all";
}
$$Search._setFolder(_12b2);
$$Search._setColumnHeaders(_12b2);
$("Search_container").scrollTop=0;
$("Search_results_attachments").checked=(_12a6.attachments?true:false);
},titlebar:function(_12b3){
if(typeof _12b3=="undefined"){
_12b3=$$Search.matches;
}
var end=$$Search.start+Number($$Search.limit)-1;
if(end>_12b3){
end=_12b3;
}
var range="";
if(_12b3>0){
range=L("Pager.Range",$$Search.start,end,_12b3);
}else{
range="0";
}
var pager=$UI.Pager.createPager($$Search.start,Number($$Search.limit),_12b3,{callback:$$Search.page.bind($$Search),reduced_range:$$Search.shown,show_range:false});
var _12b7=$("Search_pager");
if(_12b7.childNodes.length>0){
_12b7.removeChild(_12b7.firstChild);
}
_12b7.append(pager);
var _12b8=$("Search_page_range");
if(_12b3>0){
_12b8.update(L("Search.Results")+": "+range);
}else{
_12b8.update("");
}
}};
this.dom={getBody:function(){
return $$Search._body;
},pluginText:function(cont){
return cont.firstChild.value;
},pluginContainer:function(elem){
while(elem!=document.body&&Element.nodeName(elem)!="div"){
elem=elem.parentNode;
}
if(elem==document.body){
return null;
}
return elem;
}};
this.focus=function(){
var input=$("Search_widget_text");
if(input&&input.focus){
input.focus();
}
};
this.getFolderOptions=function(){
var _12bc="";
if($Custom.isFoldersEnabled()){
var _12bd=$FolderList.getDropdownOptions({include_special:true,ret_array:true});
}else{
var _12bd=[{"path":"INBOX","text":"Inbox"}];
}
for(var i=0,ii=_12bd.length;i<ii;i++){
_12bc+="<option value=\""+_12bd[i].path+"\">"+"&nbsp;&nbsp;"+_12bd[i].text+"</option>";
}
if($Custom.isFoldersEnabled()){
var sep="<option value=\"\" class=\"sep\">"+String.repeat("&#8212;",10)+"</option>";
var _12c0="<option value=\"all\">"+L("Search.L.AllFolders")+"</option>"+sep+"<option value=\"\">"+L("Folders.N.Email")+"</option>"+_12bc;
}else{
_12c0=_12bc;
}
return _12c0;
};
this.init={makePaneResizeable:function(_12c1){
function snapVertical(x,y){
if(y<100){
y=100;
}
return [0,y];
}
function startResize(_12c4){
Element.addClassName(_12c4,"Search_handle_active");
Webmail.enableWindow(false);
}
function endResize(_12c5){
Element.removeClassName(_12c5,"Search_handle_active");
Webmail.enableWindow(true);
Element.setStyle("Search_ppane",{height:Webmail.rightHeight()-_12c5.offsetTop+"px"});
this._resizeHeightBar();
}
_12c1.style.position="absolute";
new Draggable(_12c1,{altDelta:true,snap:snapVertical,starteffect:startResize,endeffect:endResize.bind($$Search)});
}};
this.page=function(start,limit){
this.start=start;
this.refresh();
};
this.refresh=function(){
if(this.curr_type=="simple"){
var _12c8=this.criteria.folder;
var terms=this.criteria.terms;
this.searchBasic(_12c8,terms,null,true);
}else{
if(this.curr_type=="advanced"){
$$AdvSearch.search(true,this.criteria);
}
}
};
this.reset=function(){
$("Search_widget_text").value="";
};
this.resetRange=function(){
this.start=1;
this.criteria={};
};
this.safelist={call:function(){
var _12ca=$$Search.safelist.handler.bind($$Search);
var _12cb=$$Search.getCheckedRows();
if(_12cb.length==0){
return;
}
$UI.showStatus(L("Mlist.St.Safelist"));
$Search.safelistMessages(_12cb,_12ca);
},external:function(_12cc){
$UI.clearStatus();
if(_12cc["folder"]!=CFG_FOLDER_SPAM){
return;
}
var sb=$$Search._body;
for(var i=0,ii=sb.childNodes.length;i<ii;i++){
var ro=sb.childNodes[i];
if(ro.obj.folder()==_12cc["folder"]&&ro.obj.id()==_12cc["id"]){
if($$Search.current_message==ro){
$Dispatcher.setPreviewPaneClear(true);
$$Search.current_message=false;
}
$$Search.changeUnseen((ro.obj.read()?0:-1),-1,CFG_FOLDER_SPAM,CFG_FOLDER_INBOX);
ro.obj.remNode();
}
}
},handler:function(_12d0){
$UI.clearStatus();
var sb=$$Search._body;
var total=0;
var _12d3=0;
for(var i=0,ii=sb.childNodes.length;i<ii;i++){
var ro=sb.childNodes[i];
if(!ro.obj.visible()){
break;
}
if(ro.obj.checked()){
if(ro.obj.folder()==CFG_FOLDER_SPAM){
total++;
if(!ro.obj.read()){
_12d3++;
}
if($$Search.current_message==ro){
$Dispatcher.setPreviewPaneClear(true);
}
ro.obj.remNode();
}
ro.obj.checked(false);
}
}
if(total>0){
$$Search.changeUnseen(-_12d3,-total,CFG_FOLDER_SPAM,CFG_FOLDER_INBOX);
}
}};
this.search=function(type,_12d7,_12d8){
if(type=="simple"){
if(!_12d8){
if(this.basic_type=="all"){
_12d8="all";
}else{
_12d8=$MessageList.folder();
}
}
$("Search_results_attachments").checked=false;
this.searchBasic(_12d8,_12d7);
}
};
this.searchBasic=function(_12d9,_12da,_12db,_12dc){
var _12dd=$("Search_header_checkbox");
_12dd.checked=false;
$UI.showStatus(L("Search.St.Search"));
this._bumpResults(false);
if(!_12dc){
this.resetRange();
}
if(this.basic_type=="google"){
var _12de=$("Search_google");
_12de.q.value=_12da;
_12de.submit();
$UI.clearStatus();
return;
}
if(_12d9=="all"){
_12d9="";
}
var _12da={folder:_12d9||"",terms:_12da,attachments:($("Search_results_attachments").checked?true:false)};
this.criteria=_12da;
this.curr_type="simple";
$Search.searchBasic(_12da,this.start-1,this.limit,function(_12df){
if(_12df.exception){
$UI.clearStatus();
$UI.error(_12df.message);
}else{
this.matches=Number(_12df.matches);
if(this.matches==Search_FIRST_SEARCH){
this._showIndexWarning();
}else{
$$MessageList.current_message=false;
this.draw.results(_12df,this.criteria);
$("Search_widget_text").value=this.criteria.terms;
var _12e0=$("Search_results_attachments");
if(Element.reallyVisible(_12e0)){
this.toggleAttachments(!_12e0.checked);
}
}
}
if(_12db){
_12db(_12df);
}
}.bind(this));
};
this.toggleAttachments=function(_12e1){
var sb=this._body;
var i=0;
if(sb.childNodes.length==0){
return;
}
while(sb.childNodes[i]){
if(!sb.childNodes[i].obj.visible()){
break;
}
if(!sb.childNodes[i].obj.hasAttachment()){
sb.childNodes[i].obj.hasAttachment(_12e1);
}
i++;
}
return;
};
this.toggleWidget=function(_12e4,_12e5){
if(_12e4){
Element.show("Search_widget");
if(_12e5){
$("Search_widget_text").value="";
}
}else{
Element.hide("Search_widget");
}
};
this.updateDropdowns=function(){
var _12e6=$("Search_results_folders");
Form.Select.setInnerHTML(_12e6,this.getFolderOptions());
if(window.$$AdvSearch){
$$AdvSearch._updateDropdowns();
}
};
this.cbSubUpdateFolders=null;
this._cbSubUpdateFolders=function(){
this.updateDropdowns();
};
this.cbSubSettingsPreviewPane=null;
this._cbSubSettingsPreviewPane=function(is_on){
$Search.previewPane(is_on);
};
this.evChangeDropdown=function(e){
elem=Event.element(e);
var _12e9;
if(elem.value=="reportspam"){
_12e9=this.refresh.bind(this);
}
$$MessageList.handleAction(elem.value,$$Search._body,_12e9);
elem.selectedIndex=0;
$("Search_header_checkbox").checked=false;
};
this.evCheckAll=function(e){
var cs=Event.element(e).checked;
var sb=$$Search._body;
for(var i=0,ii=sb.childNodes.length;i<ii;i++){
var tr=sb.childNodes[i];
if(!tr.obj.visible()){
break;
}
$UI_Grid.checkSelectedRow(tr.obj._cbx,cs);
}
};
this.evClickDelete=function(e){
var _12f0=function(_12f1){
for(folder in _12f1){
$$Search.matches-=_12f1[folder]["total"];
$$Search.shown-=_12f1[folder]["total"];
}
$$Search.draw.titlebar();
$("Search_header_checkbox").checked=false;
$UI.showStatus();
$$Search.refresh();
};
var _12f2=this._body;
if(Keystroke.shift()){
Keystroke.shift(false);
if(confirm(L("Search.C.DeletePerm"))){
$$MessageList.deleteMessages(_12f2,_12f0,true);
}else{
return;
}
}else{
$$MessageList.deleteMessages(_12f2,_12f0,false);
}
};
this.evQuickSearch=function(e){
var elem=Event.element(e);
var _12f5=(elem.type=="button");
if(Event.key(e)==Event.KEY_RETURN||_12f5){
if(_12f5){
$AN(123);
}else{
$AN(124);
}
var cont=this.dom.pluginContainer(elem);
var text=$F("Search_widget_text");
if(text){
if(Element.reallyVisible("Search_results_folders")){
var _12f8=$F("Search_results_folders");
}else{
var _12f8=$MessageList.folder();
}
if(this.basic_type=="all"&&_12f8!="all"){
_12f8="all";
}
this.search("simple",text,_12f8);
}
}
};
this.evMoveMessages=function(e){
var elem=Event.findElement(e,"select");
var _12fb=elem.value;
if(_12fb=="null"){
elem.selectedIndex=0;
return;
}
var _12fc=$$Search._body;
var _12fd=function(_12fe){
for(folder in _12fe){
$$Search.matches-=_12fe[folder]["total"];
$$Search.shown-=_12fe[folder]["total"];
}
$$Search.draw.titlebar();
elem.selectedIndex=0;
$("Search_header_checkbox").checked=false;
$UI.showStatus();
$$Search.refresh();
};
$$MessageList.moveMessages(_12fb,_12fc,elem,_12fd);
};
this.evShowAdvanced=function(e){
var _1300=$$AdvSearch._drawDialog();
Element.show(_1300);
if(!_1300._cleared){
this._bumpResults(true);
}
var right=$("core_right");
Element.append(right,_1300);
$$AdvSearch._initDropdown();
};
this.evSwitchFolder=function(e){
$AN(130);
var _1303=Event.element(e);
var _1304=_1303.value;
this.criteria.folder=_1304;
this.basic_input.setActive((_1304=="all"?"all":"curr"));
this.page(1,this.limit);
};
this.evToggleAttachments=function(e){
$AN(131);
var _1306=Event.element(e);
var _1307=(_1306.checked?true:false);
if(this.criteria.attachments||this.matches>this.limit){
this.criteria.attachments=_1307;
this.page(1,this.limit);
}else{
this.toggleAttachments(!_1307);
}
};
this.getCheckedRows=function(){
var _1308=[];
var sb=$$Search._body;
for(var i=0,ii=sb.childNodes.length;i<ii;i++){
var ro=sb.childNodes[i];
if(!ro.obj.visible()){
break;
}
if(ro.obj.checked()){
_1308.push({"folder":ro.obj.folder(),"id":ro.obj.id(),"obj":ro.obj});
}
}
return _1308;
};
this.changeUnseen=function(_130c,total,start,_130f,_1310){
if(typeof _130f!="undefined"){
var _1311=(_1310?0:_130c);
$Dispatcher.publish("Folders.status_change",_130f,-total,-_1311);
}
$Dispatcher.publish("Folders.status_change",start,total,_130c);
};
this.setPreviewPaneClear=function(clear){
var _1313=this._ppane_blank;
if(clear){
var ppane=this._ppane;
if(ppane.firstChild==_1313){
return;
}
if(ppane.firstChild){
Element.remove(ppane.firstChild);
}
Element.append(ppane,_1313);
}else{
if(_1313&&_1313.parentNode==this._ppane){
Element.remove(_1313);
}
}
};
};
}
if($Bootstrap.notLoaded("134ad93b2b8af18fc29ddb948ace7775")){
Framework.register("Webmail.Modules.Search");
$$AdvSearch=Webmail.Modules.Search.Advanced=new function(){
_date_picker_widget:
null,this.clear=function(){
var _1315=$("Search_adv_dialog");
var _1316=this.dom.getFolderField(_1315);
var from=this.dom.getFromField(_1315);
var to=this.dom.getToField(_1315);
var _1319=this.dom.getSubjectField(_1315);
var body=this.dom.getBodyField(_1315);
var omit=this.dom.getOmitField(_1315);
var _131c=this.dom.getDateDropdown(_1315);
var _131d=this.dom.getAttachCheckbox(_1315);
this._date_picker_widget.set("");
from.value=to.value=_1319.value=body.value=omit.value="";
_1316.selectedIndex=_131c.selectedIndex=0;
_131d.checked=false;
};
this.close=function(_131e){
var _131f=$("Search_adv_dialog");
if(_131f){
$$Search._bumpResults(false);
Element.hide(_131f);
_131f._cleared=_131e;
if(_131e){
this.clear();
}
}
};
this.dom={getSection:function(_1320,index){
return this._getContent(_1320).childNodes[index-1];
},getAttachCheckbox:function(_1322){
var _1323=this.getSection(_1322,4);
return _1323.getElementsByTagName("input")[1];
},getBodyField:function(_1324){
var _1325=this.getSection(_1324,2);
return _1325.getElementsByTagName("input")[1];
},getCloseIcon:function(_1326){
return _1326.lastChild;
},getDateDropdown:function(_1327){
var _1328=this.getSection(_1327,4);
return _1328.getElementsByTagName("select")[0];
},getFolderField:function(_1329){
var _132a=this.getSection(_1329,1);
return _132a.getElementsByTagName("select")[0];
},getFromField:function(_132b){
var _132c=this.getSection(_132b,2);
return _132c.getElementsByTagName("input")[0];
},getHideIcon:function(_132d){
return this.getCloseIcon(_132d).previousSibling;
},getOmitField:function(_132e){
var _132f=this.getSection(_132e,3);
return _132f.getElementsByTagName("input")[1];
},getSubjectField:function(_1330){
var _1331=this.getSection(_1330,1);
return _1331.getElementsByTagName("input")[0];
},getToField:function(_1332){
var _1333=this.getSection(_1332,3);
return _1333.getElementsByTagName("input")[0];
},_getContainer:function(){
},_getContent:function(_1334){
return _1334.childNodes[1];
}};
this.search=function(_1335,_1336){
var _1337=$("Search_header_checkbox");
_1337.checked=false;
$UI.showStatus(L("Search.St.Search"));
var _1338=$("Search_adv_dialog");
if(!_1335){
$$Search.resetRange();
}
if(!_1336){
var _1336=this._buildCriteriaObject(_1338);
$$Search.criteria=_1336;
$$Search.curr_type="advanced";
}
if(!_1336.from&&!_1336.to&&!_1336.subject&&!_1336.body&&!_1336.omit&&!_1336.attachments){
$UI.clearStatus();
$UI.error(L("Search.E.Empty"));
return false;
}
var _1339=null;
if(_1336.folder!="all"){
_1339=_1336.folder;
}
$$Search.criteria=_1336;
$$Search.curr_type="advanced";
$Search.searchAdvanced(_1336,$$Search.start-1,$$Search.limit,function(_133a){
if(_133a.exception){
$UI.error(_133a.message);
}else{
if(_133a.matches==Search_FIRST_SEARCH){
$$Search._showIndexWarning();
}else{
$$MessageList.current_message=false;
if(Element.reallyVisible(_1338)){
$$Search._bumpResults(true);
}
$$Search.matches=_133a.matches;
$$Search.draw.results(_133a,_1336);
}
}
$UI.clearStatus();
}.bind(this));
};
this._buildCriteriaObject=function(_133b){
var _133c=this.dom.getFolderField(_133b);
var from=this.dom.getFromField(_133b);
var to=this.dom.getToField(_133b);
var _133f=this.dom.getSubjectField(_133b);
var body=this.dom.getBodyField(_133b);
var omit=this.dom.getOmitField(_133b);
var _1342=this.dom.getDateDropdown(_133b);
var date=$C(this._date_picker_widget).firstChild;
var _1344=this.dom.getAttachCheckbox(_133b);
var _1345={folder:$F(_133c),from:$F(from),to:$F(to),subject:$F(_133f),body:$F(body),omit:$F(omit),date_type:$F(_1342),date:$F(date),attachments:(_1344.checked?true:false)};
return _1345;
};
this._drawDialog=function(){
var _1346=$("Search_adv_dialog");
if(_1346){
return _1346;
}
var _this=$$Search;
var _1348=$$Search.getFolderOptions();
var _1349=Element.createHtml(["<div id=\"Search_adv_dialog\">","<iframe frameborder=\"0\" src=\"",Webmail.getBlankUrl(),"\"></iframe>","<div class=\"content\">","<div class=\"section\">","<label>",L("Search.L.SearchFolder"),"</label>","<select id=\"Search_adv_single_folder\" tabindex=\"1\">",_1348,"</select>","<label>",L("Search.F.Subject"),"</label>","<input type=\"text\" class=\"txt long bottom\" tabindex=\"4\"/>","</div>","<div class=\"section\">","<label>",L("Search.F.From"),"</label>","<input type=\"text\" class=\"txt long\" tabindex=\"2\"/>","<label>",L("Search.F.Body"),"</label>","<input type=\"text\" class=\"txt long bottom\" tabindex=\"5\"/>","</div>","<div class=\"section\">","<label>",L("Search.F.To"),"</label>","<input type=\"text\" class=\"txt long\" tabindex=\"3\"/>","<label>",L("Search.F.Omit"),"</label>","<input type=\"text\" class=\"txt long bottom\" tabindex=\"6\"/>","</div>","<div class=\"bottomrow\">","<span class=\"date\">","<span>",L("Search.F.DateWithin"),"&nbsp;&nbsp;</span>","<select id=\"Search_adv_date_type\">","<option value=\"range:day\">",L("Search.F.RangeDay"),"</option>","<option value=\"range:week\">",L("Search.F.RangeWeek"),"</option>","<option value=\"range:month\">",L("Search.F.RangeMonth"),"</option>","<option value=\"curr:week\">",L("Search.F.CurrWeek"),"</option>","<option value=\"curr:month\">",L("Search.F.CurrMonth"),"</option>","<option value=\"curr:year\">",L("Search.F.CurrYear"),"</option>","</select>","&nbsp; ",L("Search.F.Of")," &nbsp;","</span>","<span class=\"attachment check\">","<input id=\"Search_adv_has_attach\" type=\"checkbox\" />","<label for=\"Search_adv_has_attach\">",L("Search.L.ShowAttach"),"</label>","</span>","<input _ref=\"search_btn\" type=\"submit\" class=\"btn search\" value=\"",L("Search.L.Search"),"\" />","</div>","</div>","<div class=\"hide\"></div>","<div class=\"close\"></div>","</div>"].join(""));
_1349._cleared=true;
$Templates.setDom(_1349);
$Widgets.load("DatePicker");
this._date_picker_widget=$Widgets.DatePicker.factory();
this._date_picker_widget.populate({form_name:"search_adv_date"});
Element.append(_1349.getByTag("span")[0],$C(this._date_picker_widget));
var _134a=this.dom.getCloseIcon(_1349);
var _134b=this.dom.getHideIcon(_1349);
var _134c=_1349.dom("search_btn");
var _134d=this.dom.getBodyField(_1349);
var _134e=this.dom.getFromField(_1349);
var _134f=this.dom.getFolderField(_1349);
var _1350=this.dom.getOmitField(_1349);
var _1351=this.dom.getToField(_1349);
var _1352=this.dom.getSubjectField(_1349);
this.closeHandler=this.evClose.bindAsEventListener(this);
this.hideHandler=this.evHide.bindAsEventListener(this);
this.searchHandler=this.evSearch.bindAsEventListener(this);
this.keyHandler=this.evKey.bindAsEventListener(this);
Event.observe(_134a,"click",this.closeHandler);
Event.observe(_134b,"click",this.hideHandler);
Event.observe(_134c,"click",this.searchHandler);
Event.observe(_134d,"keypress",this.keyHandler);
Event.observe(_134e,"keypress",this.keyHandler);
Event.observe(_134f,"keypress",this.keyHandler);
Event.observe(_1350,"keypress",this.keyHandler);
Event.observe(_1351,"keypress",this.keyHandler);
Event.observe(_1352,"keypress",this.keyHandler);
close_link=_134c=null;
return _1349;
};
this._initDropdown=function(){
var _1353=$("Search_adv_single_folder");
if(_1353){
if($$Search.basic_type!="all"){
var _1354=$MessageList.folder();
Form.Select.setSelected(_1353,_1354);
}else{
_1353.selectedIndex=0;
}
}
};
this._updateDropdowns=function(){
var _1355=$("Search_adv_single_folder");
if(_1355){
Form.Select.setInnerHTML(_1355,$$Search.getFolderOptions());
}
};
this.evClose=function(e){
this.close(true);
};
this.evHide=function(e){
this.close(false);
};
this.evKey=function(e){
if(e.keyCode==13){
$AN(122);
this.search();
}
};
this.evSearch=function(e){
$AN(121);
this.search();
};
};
}
if($Bootstrap.notLoaded("dfdb5c29c8e2e2cc21609c3f85359694")){
$FeatureBubble=Webmail.FeatureBubble={_flags:$Preload["UserFlags.bubbles"],disableBubble:function(_135a){
if(!$Bootstrap.isAppWindow()){
return $Bootstrap.getAppWindow().$FeatureBubble.disableBubble(_135a);
}
this._flags=this._flags&~_135a;
$Data.request("UserFlags.disableFeatureBubble",{handle_conn_err:false,errcapture:0},_135a);
},isBubbleEnabled:function(_135b){
if(!$Bootstrap.isAppWindow()){
return $Bootstrap.getAppWindow().$FeatureBubble.isBubbleEnabled(_135b);
}
if((this._flags&_135b)==0){
return false;
}else{
return true;
}
},cbSubWidgetLoad:null,_cbSubWidgetLoad:function(name,_135d){
var _135e=this.Config.getConfig();
var info=_135e[name];
if(info){
if(info.callback){
info.callback(_135d);
}else{
if(this.isBubbleEnabled(info.bubble)){
var _1360=$Widgets.UI.FeatureBubble.factory();
_1360.populate(info);
var _1361=$C(_135d).dom(info.elem_ref);
if(_1361){
_1361.appendChild($C(_1360));
}
}
}
}
}};
$FeatureBubble.Config={};
Object.bindCallbacks($FeatureBubble);
$Dispatcher.subscribe("Widget.load",$FeatureBubble.cbSubWidgetLoad);
}
if($Bootstrap.notLoaded("e27bb75dde8ada9068832bca523b151f")){
Webmail.FeatureBubble.Config={getConfig:function(){
return {"Compose.Popup":{bubble:wm_UserFlags_FeatureBubble_COMPOSE_POPIN,elem_ref:"popin_bubble",title:L("Compose.PopinBubble.Title"),desc:L("Compose.PopinBubble.Desc")},"Compose.Popin":{callback:function(_1362){
var _1363=wm_UserFlags_FeatureBubble_COMPOSE_POPIN;
if($FeatureBubble.isBubbleEnabled(_1363)){
$FeatureBubble.disableBubble(_1363);
}
}}};
}};
}
$Bootstrap.reportLoaded("js","webmail");
if ($Bootstrap.notLoaded('266cf3e7e0b628b078eb4b8883490fbb')) {
/* vim: set tabstop=4 textwidth=120: */
/**
 * @fileoverview
 * js/Webmail/Widgets/Picker.js
 *
 * This widget is a base picker object.  A picker is basically an input element with an image that
 * will trigger some sort of picker object to help the user enter a value into the input element.
 *
 * CHANGELOG
 *
 * @requires	Prototype
 * @requires	Framework
 * @requires	Global
 * @requires	Webmail.Widgets
 *
 * @author		Brian Hartsock
 *
 */


Framework.create('Webmail.Widgets.Picker', $Widgets.create({

	id:			null,
	options:	null,
	_picker:	null,
	prev_val:	null,
	prevent_close_click: false,
	prevent_close_blur:	false,

	//Quick DOM accessors
	dom_input:		null,
	dom_image:		null,

	// Public functions
	// {{{ clearPicker()
	/*
	 * Close the picker.
	 *
	 */
	clearPicker: function(){

		if(this._picker){
			Element.remove(this._picker);
			this._picker = null;
		}

		//Stop observing document clicks
		Event.stopObserving(document.body, 'click', this.evDocumentClick);
	
		this.prevent_close_click = false;
		this.prevent_close_blur = false;
	},

	// }}}
	// {{{ disable()
	/*
	 * Disables the widget form elements other than the checkbox.
	 *
	 */
	disable: function(){
		this.dom_input.disabled = true;
	},
	
	// }}}
	// {{{ enable()
	/*
	 * Enables the widget form elements other than the checkbox.
	 *
	 */
	enable: function(){
		this.dom_input.disabled = false;
	},

	// }}}
	// {{{ reset()
	/*
	 * Reset the reminder widget.
	 *
	 */
	reset: function(){
		this.dom_input.name = '';
	},

	// }}}
	// {{{ set()
	/*
	 * Set the input value.  Option to format.  Always use this so we can fire the onchange event.
	 *
	 */
	set: function(value, do_not_format){
		var value = (do_not_format ? value : this._getFormattedValue(value));

		//IF new value is different
		if(this.dom_input.value != value){
			this.dom_input.value = value;
		}

		this.options.onchange(value);
	},

	// }}}

	// Private functions
	// {{{ _getFormattedValue()
	/*
	 * Formats the input value.  To be overridden if the input values need formatted, this does 
	 * nothing currently
	 *
	 * @param	{string}	value	Value to be formatted
	 * @return	{string}	Formatted value
	 */
	_getFormattedValue: function(value){
		return value;
	},

	// }}}

	// Event handlers
	// {{{ evBlurInput()
	/*
	 * Event handler for blurring from input. Used to format the value when entered by hand.
	 *
	 * @param	{event}	e	Event fired
	 */
	evBlurInput: null,
	_evBlurInput: function(e){
		this.set(this.dom_input.value);
		if (!this.prevent_close_blur) {
			this.clearPicker();
		} else {
			// blur should not close the picker (clicking on the image or picker dropdown)
			this.prevent_close_blur = false;
		}
	},

	// }}}
	// {{{ evDocumentClick()
	/*
	 * Handles the document click event.
	 *
	 */
	evDocumentClick: null,
	_evDocumentClick: function(){
		if (!this.prevent_close_click) {
			this.clearPicker();
		} else {
			// click should not close the picker (clicking on the image, input field, or picker
			// dropdown)
			this.prevent_close_click = false;
		}
	},

	// }}}
	// {{{ evMousedownImage()
	/**
	 * Called when clicking on the image associated with the picker.
	 * @param	{event}		e
	 */
	evMousedownImage: null,
	_evMousedownImage: function(e) {
		// prevent the evBlurInput function from closing the picker automatically
		this.prevent_close_blur = true;
	},
	// }}}
	// {{{ evMousedownInput()
	/**
	 * Called when clicking on the input box associated with the picker.
	 * @param	{event}		e
	 */
	evMousedownInput: null,
	_evMousedownInput: function(e) {
		// prevent the evDocumentClick function from closing the picker automatically
		this.prevent_close_click = true;
	},
	// }}}
	// {{{ evPreventClose()
	/**
	 * Event handler to prevent an automatic close when clicking on a picker.
	 * @param	{event}		e
	 */
	evPreventClose: null,
	_evPreventClose: function(e) {
	/* When clicking on a picker, three things happen in order - mousedown on the picker, blur on
	 * the input, and click on the document.  The last two automatically try to close the picker,
	 * which we want -only- if they are not clicking on the picker.  If they are, this function is
	 * called, where we set flags to prevent both from closing the picker.
	 */
		// prevent evDocumentClick from closing the picker
		this.prevent_close_click = true;
		// prevent evBlurInput from closing the picker
		this.prevent_close_blur = true;
	},
	// }}}
	// {{{ evShowPicker()
	/*
	 * Event handler called whenever the picker is requested to be shown.
	 *
	 * @param   event   e   Event that was fired (browser specific)
	 */
	evShowPicker: null,
	_evShowPicker : function(e)
	{
		Event.stop(e);

		// If there is a current picker, clear it
		if ($Widgets.Picker._current_picker) {
			$Widgets.Picker._current_picker.clearPicker();
		}

		//IF the picker is already shown, clear it
		if(this._picker){
			this.clearPicker();

		//ELSE the picker isn't being shown, hide it
		}else{
			$Widgets.Picker._current_picker = this;
			this._showPicker();
		}
	}

	// }}}
}));

$Widgets.Picker._current_picker = null;
};
$Bootstrap.applyCss("");
$Bootstrap.reportLoaded("widgets", "Picker");if ($Bootstrap.notLoaded('457c0df541703ac7a71dbe089b484925')) {
/* vim: set tabstop=4 textwidth=120: */
/**
 * @fileoverview
 * js/Webmail/Widgets/DatePicker.js
 *
 * This is a widget for the date picker object which consists of an input and image.  If the image
 * is clicked at minical will show up
 *
 * CHANGELOG
 *
 * @requires	Prototype
 * @requires	Framework
 * @requires	Global
 * @requires	Webmail.Widgets
 *
 * @author		Brian Hartsock
 *
 */


Framework.create('Webmail.Widgets.DatePicker', $Widgets.create({

	// {{{ initialize()
	/*
	 * Constructor.
	 */
	initialize: function(tabIndex) {
		Object.bindObservers(this);

		this.id = $Widgets.DatePicker._id++;
		this.draw(tabIndex);
	},
	// }}}

	// Public functions
	// {{{ draw()
	/*
	 * Draw the widget.
	 *
	 */
	draw: function(tabIndex) {

		var container = Element.createHtml([
			'<span>',
				'<input class="text date" type="text" ',
					'tabindex="'+tabIndex+'" ',
					'id="datepicker_'+this.id+'"/>',
				'<img class="datepicker" field="datepicker_'+this.id+'" ',
					'src="images/blank.gif" />',
			'</span>'].join(''));

		this.dom_input = $(container.firstChild);
		this.dom_image = $(container.lastChild);

		//Event handling
		this.dom_image.observe('click', this.evShowPicker);
		this.dom_image.observe('mousedown', this.evMousedownImage);
		this.dom_input.observe('mousedown', this.evMousedownInput);
		this.dom_input.observe('focus', this.evShowPicker);
		this.dom_input.observe('blur', 	this.evBlurInput);

		this.container = container;
	},
	// }}}
	// {{{ getValue()
	/**
	 * Returns the value in the datepicker input field
	 * @return	{String}
	 */
	getValue: function() {
		var value = this.dom_input.value;
		return value;
	},

	// }}}
	// {{{ populate()
	/*
	 * Populate the reminder widget.
	 *
	 * @param	{object}	options		Optional options object
	 */
	populate: function(options){

		//Set options
		this.options = Object.extend(
			{
				date:		null,
				form_name: 	null,
				onchange:	Prototype.emptyFunction
			}, options || {});

		//IF date is passed in, set it
		if(this.options.date){
			this.dom_input.value = $Locale.DateTime.basicDate(newDate(this.options.date));
		}

		if(this.options.form_name){
			this.dom_input.name = this.options.form_name;
		}
	},
	// }}}
	// {{{ setValue()
	/**
	 * Sets the raw value of the input field
	 * @param	{String}	date	Date to fill in
	 */
	setValue: function(date) {
		this.dom_input.value = date;
	},
	
	// }}}

	//Private functions
	// {{{ _drawPicker()
	/*
	 * Draws the minical for the input field.
	 *
	 */
	_drawPicker : function()
	{
		//Conviennce variable
		var field	= this.dom_input;
		var value	= $Locale.DateTime.americanDateFromInput(field.value);

		//Get date from field (don't allow invalid dates)
		var date	= wack.DateTime.isDate(value) ? 
							new Date(value) :
							new Date();

		// Create datepicker
		var datepicker			= new DatePicker();
		datepicker.empty_url	= 'misc/blank.html';
		datepicker.date			= date;
		datepicker.image_dir	= 'images/';
		datepicker.day_callback	= this.evSetDatePicker;
		datepicker.mousedown_callback = this.evPreventClose;

		// Draw datepicker
		var container		= datepicker.create();
		container.field		= field.id;

		//Find and set position of datepicker
		var dim = Element.getDimensions(field);
		var pos = Position.cumulativeOffset(field);

		Element.setStyle(container,
						{
						position:	'absolute',
						left:		(pos[0] + 1) + 'px',
						top:		((pos[1] + 1) + dim.height) + 'px',

						//Zindex must be greater than Dialog's zindex
						zIndex:		'5000'
						});

		return container;
	},
	// }}}
	// {{{ _showPicker()
	/*
	 * Displays the minical for the input field.
	 *
	 */
	_showPicker : function()
	{
		//Do nothing if the picker already exists
		if(this._picker){
			return;
		}

		// Create datepicker (if not already created)
		this._picker = this._drawPicker();
		Element.append(document.body, this._picker);

		//Conviennce variable
		var field = this.dom_input;
		
		var value	= $Locale.DateTime.americanDateFromInput(field.value);

		//Get date to highlight
		var date = wack.DateTime.isDate(value) ?
						new Date(value) :
						new Date();

		// Grey out date in field in datepicker (must be done after appended to DOM tree)
		// TODO - This is stupid.  Don't do this using an ID and do it when creating the
		//  minical
		$("mcday"+date.format("%Y-%m-%d")).parentNode.style.background = "#F0F0F0";

		//Setup body event handling
		Element.observe(document.body, 'click', this.evDocumentClick);
	},
	// }}}

	//Event handlers
	// {{{ evSetDatePicker()
	/*
	 * Event handler called whenever a date is picked from the date picker. This is form independent and requires a unique ID field.
	 *
	 * @param   event   e   Event that was fired (browser specific)
	 *
	 */
	evSetDatePicker: null,
	_evSetDatePicker: function(e)
	{
		Event.stop(e);
		
		//Grab link
		var link	= Event.findElement(e, 'a');

		//Set value of input to datepicker
		this.set($Locale.DateTime.basicDate(newDate(link.date)), true);
	
		//remove date picker
		this.clearPicker();
	}
	// }}}

}, $Widgets.Picker));

Webmail.Widgets.DatePicker._id = 0;
};
$Bootstrap.applyCss("");
$Bootstrap.reportLoaded("widgets", "DatePicker");if ($Bootstrap.notLoaded('73018e2cacd55d79ef7bd3642d0a7e19')) {
// vim:ts=4:sw=4:et:tw=100:fdm=marker:
/**
 * Widget for displaying a single email
 *
 * TODO PERFORMANCE
 * 			- separate body to end of message so we dont have to eval it
 * 			- profile EVERYTHING

 * TODO grab structure and headers all in one call
 * TODO get prev/next from message list cache if possible
 */

Framework.register('Webmail.Widgets');

$Widgets.Email = $Widgets.create({

	/**
	 * Just something so we know its an email widget
	 */
	_is_email_widget: true,

	/**
	 * Root container element.
	 * @var	{Element}
	 */
	container: null,

	/**
	 * Options passed into the constructor (cannot change once instantiated)
	 * @var	{Object}
	 */
	config: {},

	/**
	 * Options passed into populate.. changes with each email loaded
	 * @var	{object}
	 */
	options: null,

	/**
	 * Last response to come back from the server.
	 * @var	{object}
	 */
	response: {},

	/**
	 * Container for expanding fields.  We store this so we can reuse it.
	 * @var	{Element}
	 */
	_expand_elem: null,
	_expand_active: false,

	/**
	 * Keeps track of whether or not we've resized before, so we can do certain things just the
	 * first time.
	 * @var	{bool}
	 */
	_resize_init: false,

	/**
	 * Whether or not we know if the message is read/unread (null if we don't know)
	 * @var	{bool}
	 */
	_unread: null,

	/**
	 * Whether or not email preview pane has focus (has been clicked on).
	 * @var {bool}
	 */
	_has_focus: false,
	
	// {{{ initialize()
	/**
	 * Constructor.
	 */
	initialize: function(config) {
		Object.bindObservers(this);
		Object.bindCallbacks(this);

		this.config = Object.extend({
			onchange: Prototype.emptyFunction,
			view: $Widgets.Email.VIEW_PREVIEW
		}, config || {});

		this.draw();
		this.container.__widget__ = this;
		$Dispatcher.subscribe('Calendar.Events.inviteRespond', this.cbInviteResponse);
	},

	// }}}
	
	// public:
	// {{{ blur()
	/**
	 * Resets focus state on message body
	 */
	blur: function() {
		this._has_focus = false;
	},

	// }}}
	// {{{ downloadAttachments()
	/**
	 * Downloads a zip file of all attachments for the current email
	 */
	downloadAttachments: function() {
		$Widgets.Email.zipAttachments(this.options.folder, this.options.uid, this.options.pid);
	},

	// }}}
	// {{{ draw()
	/**
	 * Standard draw function.
	 */
	draw: function() {
		var template = '';

		if (this.config.view == $Widgets.Email.VIEW_PREVIEW) {
			this.container = Element.createHtml('<div class="ReadMail"><div _ref="root" class="wm_root"><div class="header" _ref="header"><table cellspacing="2" _ref="hdr_tbl"><tr class="from"><td class="lbl"><div _ref="from_lbl">'+L('Message.L.From')+':</div></td><td class="val from"><div class="wrapper"><div class="content" _ref="from"></div><img src="images/blank.gif" _ref="from_save" class="save plus-green" /></div></td><td class="lbl" _ref="to_lbl">'+L('Message.L.To')+':</td><td class="val"><div class="wrapper" _ref="to_wrap"><div class="content" _ref="to"></div></div></td><td class="arrow"><img src="images/blank.gif" _ref="to_arrow" /></td></tr><tr><td class="lbl" _ref="subj_lbl">'+L('Message.L.Subject')+':</td><td class="val"><div class="wrapper"><div class="content" _ref="subject"></div></div></td><td class="lbl cc" _ref="cc_lbl">'+L('Message.L.Cc')+':</td><td class="val cc"><div class="wrapper" _ref="cc_wrap"><div class="content" _ref="cc"></div></div></td><td class="arrow"><img src="images/blank.gif" _ref="cc_arrow" /></td></tr><tr class="date"><td class="lbl">'+L('Message.L.Date')+':</td><td colspan="4" _ref="date"></td></tr></table><table cellspacing="2" _ref="attach_tbl"><tr class="attach" style="display:none;" _ref="attach_row"><td class="lbl" valign="top"><div _ref="attach_lbl">'+L('Message.L.Attach')+':</td></td><td class="attach"><div class="list_wrap"><div class="list" _ref="attach"></div></div><img src="images/blank.gif" class="save" _ref="attach_save" title="'+L('Email.Attach.SaveAll')+'" alt="'+L('Email.Attach.SaveAll')+'" /><div style="clear:both;"></div></td><td class="arrow"><img src="images/blank.gif" _ref="attach_arrow" title="'+L('Email.ViewAll')+'"alt="'+L('Email.ViewAll')+'" /></td></tr></table></div><div class="mtoolbar" _ref="toolbar"><div class="mtoolbar_left" _ref="toolbar_left">'+this._getToolbarHtml()+'</div></div><div class="body" _ref="body"><div class="contents" _ref="content"></div></div></div></div>');
			
		} else {
			this.container = Element.createHtml('<div class="ReadMail"><div _ref="root" class="wm_root"><div class="header" _ref="header"><table cellspacing="0"><tr><td width="60%" rowspan="2"><table cellspacing="2" _ref="hdr_tbl"><tr class="from"><td class="lbl" _ref="from_lbl">'+L('Message.L.From')+':</td><td class="val from"><div class="wrapper"><div class="content" _ref="from"></div><img src="images/blank.gif" class="save plus-green" _ref="from_save" /></div></td><td></td></tr><tr><td class="lbl" _ref="to_lbl">'+L('Message.L.To')+':</td><td class="val"><div class="wrapper" _ref="to_wrap"><div class="content" _ref="to"></div></div></td><td class="arrow"><img src="images/blank.gif" _ref="to_arrow" /></td></tr><tr style="display:none;" _ref="cc_row"><td class="lbl" _ref="cc_lbl">'+L('Message.L.Cc')+':</td><td class="val"><div class="wrapper" _ref="cc_wrap"><div class="content" _ref="cc"></div></div></td><td class="arrow"><img src="images/blank.gif" _ref="cc_arrow" /></td></tr><tr><td class="lbl">'+L('Message.L.Date')+':</td><td class="val"><div class="wrapper"><div class="content" _ref="date"></div></div></td><td></td></tr><tr class="subject"><td class="lbl" _ref="subj_lbl">'+L('Message.L.Subject')+':</td><td class="val"><div class="wrapper"><div class="content" _ref="subject"></div></div></td><td></td></tr><tr class="attach" style="display:none;" _ref="attach_row"><td class="lbl" _ref="attach_lbl" valign="top">'+L('Message.L.Attach')+':</td><td class="val attach"><div class="list_wrap"><div class="list" _ref="attach"></div></div><img src="images/blank.gif" class="save" _ref="attach_save" title="'+L('Email.Attach.SaveAll')+'" alt="'+L('Email.Attach.SaveAll')+'" /><div style="clear:both;"></div></td><td class="arrow"><img src="images/blank.gif" _ref="attach_arrow" title="'+L('Email.ViewAll')+'"alt="'+L('Email.ViewAll')+'" /></td></tr></table><a href="javascript:void(0);" class="back" _ref="back_link"></a></td><td height="100%" valign="top" class="right move_dropdown"><div _ref="move_dropdown"></div></td></tr><tr><td valign="bottom" class="right"><div class="nav_links"><a href="javascript:void(0);" _ref="prev_del_link">'+L('Mlist.Header.PrevAndDelete')+'</a><span class="sep">|</span><a href="javascript:void(0);" _ref="next_del_link">'+L('Mlist.Header.NextAndDelete')+'</a></div></td></tr></table></div><div class="header full_header" style="display:none;" _ref="full_header"></div><div class="mtoolbar" _ref="toolbar"><div class="mtoolbar_left" _ref="toolbar_left">'+this._getToolbarHtml()+'</div><div class="mtoolbar_right" _ref="toolbar_right"><a href="javascript:void(0);" _ref="prev_link">'+L('Read.L.Previous')+'</a><span class="sep">|</span><a href="javascript:void(0);" _ref="next_link">'+L('Read.L.Next')+'</a></div></div><div class="body" _ref="body"><div class="contents" _ref="content"></div></div></div></div>');
		}
		
		$Templates.setDom(this.container);

		// hide the View Images button if we aren't blocking images
		if (this.config.view == $Widgets.Email.VIEW_PREVIEW && $Settings.isBlockImagesEnabled() == false) {
			this._hideToolbarLink("view_images");
		}

		//this used to be in css, but because IE6 doesnt properly
		//evaluate child selectors we set it here programatically
		//so we dont mess up html styles with Cascading
		if(wack.Browser.is_ie6) {
			this.container.dom('body').height = '100px';
		}

		// Set observes for user interaction
		this._setObservers();

		// Set classname
		this._setClassname();

		// Set up right clicks
		var dom = this.container.dom;
		$Widgets.ContextMenu.EmailContact.factory(dom('from'));
		$Widgets.ContextMenu.EmailContact.factory(dom('to'));
		$Widgets.ContextMenu.EmailContact.factory(dom('cc'));
	},
	
	// }}}
	// {{{ hasFocus()
	/**
	 * Returns true if this widget has the focus.
	 * @return	{bool}
	 */
	hasFocus: function() {
		return this._has_focus;
	},
	// }}} 
	// {{{ move()
	/**
	 * Moves the email of this widget to a different folder.
	 * @param	{string}	folder	Folder to move message to (UTF-7)
	 */
	move: function(folder) {
		$UI.showStatus();

		$MessageList.moveMessages(
			{folder:this.options.folder, id:this.options.uid},
			folder,
			this.cbMove
		);
	},
	
	// }}}
	// {{{ populate()
	/**
	 * Populates the widget with data
	 * @param	{Object}	options		(See default options in function)
	 */
	populate: function(options) {
		this.options = this.options || {};

		// Show possible options
		this.options = wack.extend({
			folder: null,
			uid: null,
			pid: null,
			callback: this.options.callback || null,
			force_plain: false,
			resize: true,
			unread: null
		}, options || {});

		// Setup other options
		var fetch_options = {};
		if (this.config.view != $Widgets.Email.VIEW_PREVIEW) {
			fetch_options['get_siblings'] = true;
		}
		if (this.options.force_plain) {
			fetch_options['force_plain'] = true;
		}

		var folder	= this.options.folder;
		var uid		= this.options.uid;
		var pid		= this.options.pid || 0;

		// Try to grab read status so we can change visually before the return
		if (this.options.unread != null) {
			this._unread = this.options.unread;
		} else {
			this._unread = $Bootstrap.getAppWindow().$MessageList.isUnread({
				folder: folder,
				id: uid
			});
		}
		if (this._unread) {
			$Bootstrap.getAppWindow().$Dispatcher.publish('Folders.status_change', folder, 0, -1);
		}

		// Let everyone know we're reading it
		$Bootstrap.getAppWindow().$Dispatcher.publish(
			'Message.change',
			folder,
			uid,
			'read',
			true
		);

		// Grab the message data
		$Message.get(folder, uid, pid, wack.extend(fetch_options, {
			callback: this.cbOpen,
			call_group: 'Message.read_'+this.config.view
		}));
	},
	
	// }}}
	// {{{ print
	/**
	 * Print the email
	 *
	 * @return void
	 */
	print: function() {
		window.print();
	},

	// }}}
	// {{{ reset()
	/**
	 * Clears out all message specific data so populate can start fresh.
	 */
	reset: function() {
		var to_clear = [
			'from',
			'to',
			'subject',
			'cc',
			'body'
		];

		for (var i=0,ii=to_clear.length; i<ii; i++) {
			this.container.dom(to_clear[i]).innerHTML = '';
		}
	},

	// }}}
	// {{{ resize()
	/**
	 * Typical resize function.
	 */
	resize: function() {
		var dom = this.container.dom;

		// Shrink the body so we know its not stretching the container height
		// We hide the content so it doesn't cause scroll/stretch problems
		if (wack.Browser.is_ie) {
			Element.hide(dom('content'));
		}
		
		dom('body').style.height = '50px';
		dom('body').style.width = '50px';

		var container_height = this.container.offsetHeight;
		var container_width	 = this.container.offsetWidth;
		var header_height	 = dom('header').offsetHeight;
		var toolbar_height	 = dom('toolbar').offsetHeight || 0;

		// Don't resize if its hidden
		if (container_height <= 0) {
			return;
		}

		// Add full header height if applicable
		if (this.config.view != $Widgets.Email.VIEW_PREVIEW) {
			var full_header_height = dom('full_header').offsetHeight;
			if (full_header_height) {
				header_height += full_header_height;
			}
		}

		// Have to resize body to proper height so it can overflow
		var body_height = (container_height-header_height-toolbar_height);
		Element.setDimensions(dom('body'), { height: body_height });
		
		// IE7 doesn't like us resizing the width for some reason
		if (!wack.Browser.is_ie7) {
			Element.setDimensions(dom('body'), { width: this.container.offsetWidth });
		} else {
			dom('body').style.width = '';
		}

		// Reshow the content since everything is resized
		if (wack.Browser.is_ie) {
			Element.show(dom('content'));
		}

		// Init resize if we need to
		if (!this._resize_init) {
			this._resize_init = true;
			this._resizeInit();
		}

		// Safari and FF3 have issues with overflow on div's in table cells
		if (wack.Browser.is_safari || wack.Browser.is_ff3) {
			var left_lbl	= Math.max(dom('from_lbl').offsetWidth, dom('subj_lbl').offsetWidth);
			var right_lbl	= Math.max(dom('to_lbl').offsetWidth, dom('cc_lbl').offsetWidth);

			// Get total space for the values (with some room to spare)
			var value_width = parseInt((container_width - left_lbl - right_lbl - 100)/2);
			
			// We use parentNode because we need the content to be bigger so we know its overflowing
			Element.setDimensions(dom('from').parentNode, { width: value_width });
			Element.setDimensions(dom('subject').parentNode, { width: value_width });
			Element.setDimensions(dom('to').parentNode, { width: value_width });
			Element.setDimensions(dom('cc').parentNode, { width: value_width });
		}

		// Resize attachments (subtract 14 for padding and margin on the save icon)
		if (this.response.attach) {
			dom('attach').style.width = '10px';
			var attach_width	= dom('attach').parentNode.parentNode.offsetWidth - 18; //padding/margin
			var save_icon_width	= dom('attach_save').offsetWidth;
			if ((attach_width - save_icon_width) > 0) {
				// Only resize if it is a positive number
				dom('attach').style.width = attach_width - save_icon_width + 'px';
			}
		}

		// Check to see if we need to show expand arrows
		var to_check = {to_wrap:'to_arrow', cc_wrap:'cc_arrow', attach:'attach_arrow'};
		for (var field in to_check) {
			if (dom(field).scrollWidth > dom(field).offsetWidth) {
				dom(to_check[field]).style.visibility = 'visible';
			} else {
				dom(to_check[field]).style.visibility = '';
			}
		}
	},

	// }}}
	// {{{ sendInviteResponse()
	/**
	 * Sends an ical response to an invite (for ical emails only)
	 * @param	{string}	action	The action to send back
	 */
	sendInviteResponse: function(action) {
		if (!this.response.is_ical) {
			return;
		}
		
		// Update personal calendars if they aren't loaded
		$Data.doBatch(function() {
			REQUIRE('combo/calendar');
			// Make sure the calendar is loaded in root window.
			var root = $Bootstrap.getAppWindow();
			root.REQUIRE('js/calendar_data');
			
			// Check for personal calendars
			var personal = $Calendar.getPersonalCalendars();
		}.bind(this),
		{
			callback: function() {
				// Load the form
				var form = new $$Calendar.Forms.InviteAction();
				form.__load(
					this.options.folder,
					this.options.uid,
					this.options.pid,
					action,
					this.response.event_exists,
					this.response.calendar_id
				);
			}.bind(this)
		});
	},

	// }}}
	// {{{ toggleFullHeader()
	/**
	 * Hides/Shows the full header.
	 * @param	{bool}	show	Whether or not to show the full header
	 */
	toggleFullHeader: function(show) {
		var dom			= this.container.dom;
		var full_header	= dom('full_header');
		var header		= dom('header');
		
		// Hiding
		if (!show) {
			Element.hide(full_header);
			Element.show(header);
			this.resize();
			return;
		}

		// If it hasn't been fetched yet, do so and draw
		if (full_header.innerHTML == '') {
			$UI.showStatus();
			$Data.request(
				'MessageView.getFullHeader',
				{callback: function(response) {
					$UI.clearStatus();

					if (response.exception) {
						$UI.error(L('Message.E.Header'));
						return;
					}

					var html = '<table cellspacing="0">';
					for (var i=0,ii=response.length; i<ii; i++) {
						var value = String(response[i].value);
						value = value.replace(/</g, '&lt;').replace(/>/g, '&gt;');

						html +=
							'<tr>' +
								'<td class="lbl" valign="top">' +
									response[i].label.escapeHTML() + ':</td>' +
								'<td class="val" valign="top">' +
									value + '</td>' +
							'</tr>';
					}

					html += '</table>';
					full_header.innerHTML = html;
					this.toggleFullHeader(true);

				}.bind(this)},
				this.options.folder,
				this.options.uid,
				this.options.pid
			);

			return;
		}

		Element.hide(header);
		Element.show(full_header);
		this.resize();
	},

	// }}}

	// accessors:
	// {{{ getFolder()
	/**
	 * Returns the folder of the message currently loaded.
	 * @return	{string}	Folder (UTF-7)
	 */
	getFolder: function() {
		return this.options.folder;
	},
	
	// }}}
	// {{{ getSubject()
	/**
	 * Returns the subject of the message currently loaded.
	 * @return	{string}	The subject, FALSE if no message is loaded
	 */
	getSubject: function() {
		if (this.response) {
			return this.response.subject;
		} else {
			return false;
		}
	},

	// }}}
	// {{{ getUid()
	/**
	 * Returns the uid of the message currently loaded.
	 * @return	{int}	UID
	 */
	getUid: function() {
		return this.options.uid;
	},
	
	// }}}

	// private:
	// {{{ _areImagesBlocked()
	/**
	 * Determines whether or not a message body has blocked images in it
	 */
	areImagesBlocked: null,
	_areImagesBlocked: function(body) {
		var img_tags = body.getElementsByTagName('img');
		var img;
		for (var i=0,ii=img_tags.length; i<ii; i++) {
			img = img_tags[i];
			// IE 7 doesn't support hasAttribute
			if (img.getAttribute('_src') != null) {
				return true;
			}
		}
		return false;
	},
	// }}}
	// {{{ _checkIcal()
	/**
	 * Checks to see if we need to send a request to update ical event
	 */
	_checkIcal: function() {
		if (!this.response.is_ical 
			|| (this.response.ical_type != 'reply'
					&& this.response.ical_type != 'cancel')) {
			return;
		}

		if (!this.response.event_exists) {
			return;
		}

		$Data.request(
			'MessageView.handleInviteResponse',
			{
				background: true,
				callback: function(response) {
					// If the guest was not on the original list
					if (response.unknown_guest == true) {
						REQUIRE('combo/dialogs');
						var prompt = new $DialogsPrompt(
							'', L('Calendar.F.GuestNotFoundAdd'),
							null, {cancel:false}
						);
						prompt.addButton(L('L.Yes'),
							function() {
								$Calendar.Events.syncGuestList(response.ical_str);
							}
						);
						prompt.addButton(L('L.No'), Prototype.emptyFunction);
						prompt.show();
					} else {
						if (this.response.ical_type == 'cancel') {
							$Dispatcher.publish('Calendar.Events.clearCache');
						}
					}
				}.bind(this)
			},
			this.options.folder,
			this.options.uid,
			this.response.ical_type
		);

	},

	// }}}
	// {{{ _checkReadReceipt()
	/**
	 * Checks a message to see if the sender requested a read receipt.
	 */
	_checkReadReceipt: function() {
		// Only show the read receipt if its not send/draft/spam
		var folder = this.options.folder;
		if ($FolderList.isDraft(folder) || $FolderList.isSent(folder) || $FolderList.isSpam(folder)) {
			return;
		}
		
		if (this.response.read_receipt) {
			var send_response = false;
			if (confirm(L('Read.C.ReadReceipt'))) {
				send_response = true;
			}

			$Data.request(
				'MessageView.markReadReceipt',
				{background:true},
				this.options.folder,
				this.options.uid,
				send_response
			);

			this.response.read_receipt = false;
		}
	},

	// }}}
	// {{{ _containsImages()
	/**
	 * Determines whether or not a message body has any images in it at all
	 */
	containsImages: null,
	_containsImages: function(body) {
		var img_tags = body.getElementsByTagName('img');
		if (img_tags.length>0) {
			return true;
		} else {
			return false;
		}
	},
	// }}}
	// {{{ _getToolbarHtml()
	/**
	 * Helper function to generate html for the reply/forward toolbar
	 * @return	{string}
	 */
	_getToolbarHtml: function() {
		// Toolbar items
		this._toolbar_items = {
			reply: L('Message.Link.Reply'),
			reply_all: L('Message.Link.ReplyAll'),
			forward: L('Message.Link.Forward'),
			del: L('Message.Link.Delete'),
			notspam: L('Message.Link.NotSpam'),
			spam: L('Message.Link.Spam'),
			resume: L('Message.Link.Resume'),
			resend: L('Message.Link.ReSend'),
			print: L('Webmail.L.Print'),
			view_images: L('Message.L.ViewImages')
		};

		var toolbar_html = '';
		for (var item in this._toolbar_items) {
			toolbar_html +=
				'<a href="javascript:void(0);" class="'+item+'" _ref="'+item+'_link">'+this._toolbar_items[item]+'</a>';
		}

		return toolbar_html;
	},
	
	// }}}
	// {{{ _hideToolbarLink()
	/**
	 * Will cause a toolbar link to become hidden
	 */
	_hideToolbarLink: function(link_name) {
		var dom = this.container.dom;
		dom(link_name+'_link').style.display = 'none';
	},
	
	// }}}
	// {{{ _makeAddressList()
	/**
	 * Generates a list of address for display.
	 * @param	{Array}		addresses	Array of addresses
	 * @return	{string}	HTML to show
	 */
	_makeAddressList: function(addresses) {
		var links = [];
		for (var i=0,ii=addresses.length; i<ii; i++) {
			var addr	= addresses[i];
			var name	= (addr.name || '').replace(/ /g, '&nbsp;');
			var email	= (addr.email || '');

			var display	= name || email;
			email = email.addSlashes();
			email = escape(email);

			if (name || email) {
				if (email && $Custom.isComposeEnabled()) {
					links.push(
						'<a href="javascript:void(0);" ' +
							'class="Read_address_link" alt="'+email+'" title="'+email+'" ' +
							'_email_contact="true" _name="'+name+'" _email="'+email+'" ' +
							'onclick=\'$Widgets.Email.evAddressClick("'+email+'");\'>'+display+'</a>'
					);
				} else {
					links.push(display);
				}
			}
		}

		var html = links.join(', ');
		return html;
	},

	// }}}
	// {{{ _openSibling()
	/**
	 * Loads a sibling of the current message.
	 * @param	{string}	sibling		"prev" or "next"
	 */
	_openSibling: function(sibling) {
		$UI.showStatus();
		$Data.request(
			'MessageView.getSibling',
			{
				callback: function(response) {
					$UI.clearStatus();

					// Means there is no sibling
					if (response == -100) {
						this.container.dom(sibling+'_del_link').className =
						this.container.dom(sibling+'_link').className = 'disabled';
					} else {
						this.options.uid = response.uid;
						this.cbOpen(response);
					}
				}.bind(this),
				call_group: 'Message.read_'+this.config.view
			},
			this.options.folder,
			this.options.uid,
			sibling
		);
	},
	
	// }}}
	// {{{ _populateAttachments()
	/**
	 * Helper function for populating attachment data.
	 */
	_populateAttachments: function() {
		var dom = this.container.dom;

		if (this.response.attach) {
			var attach_html = '';

			// Get any existing links that were drawn
			var spans		= dom('attach').getElementsByTagName('span');
			var num_spans	= spans.length;

			for (var i=0,ii=this.response.attach.length; i<ii; i++) {
				var att		= this.response.attach[i];
				var link	= '';

				if (typeof(att.tid) == 'undefined') {
					att.tid = -1;
				}

				// Figure out link properties
				var url, onclick;
				if (att.is_email) {
					var params = {
						folder: this.options.folder,
						uid: this.options.uid,
						pid: att.pid
					};
					url		= "javascript:void(0);";
					onclick	= "$$Message.popup("+JSON.stringify(params)+");";
				} else {
					onclick	= "";
					url = 'p/message/download.php?mailbox='+this.options.folder.urlEncode()+
							'&uid='+this.options.uid+'&pid='+att.pid+'&tnefid='+att.tid+ 
							'&'+CFG_SESSION_NAME+'='+Webmail.getSessionId();
				}

				// So it doesn't wrap
				att.name = att.name.replace(' ', '&nbsp;');
				var display = att.name + '&nbsp;(' + att.size + ')';

				var link_html = '<a href="'+url+'" onclick=\''+onclick+'\'>'+display+'</a>';

				// In IE the first attachment link goes over the background image and i
				// (mike) could not find any CSS workarounds.
				var image_hack = '';
				if (i == 0 && wack.Browser.is_ie) {
					image_hack = '<img src="images/blank.gif" width="0" />';
				}

				// Reuse or make a new one
				if (spans[i]) {
					var span = spans[i];
					span.innerHTML = image_hack + link_html;

					Element.show(spans[i]);
				} else {
					dom('attach').innerHTML +=
						'<span class="ReadMail_attach_item">' + image_hack + link_html + '</span>  ';
				}
			}

			// Hide any extra links
			if (num_spans > this.response.attach.length) {
				for (var i=this.response.attach.length; i<num_spans; i++) {
					Element.hide(spans[i]);
				}
			}

			Element.show(dom('attach_row'));
		} else {
			Element.hide(dom('attach_row'));
		}
			

	},

	// }}}
	// {{{ _resizeInit()
	/**
	 * Resize helper function that is called only on the first resize.
	 * This is used for some layout tricks we have to do to get around browser compat issues.
	 */
	_resizeInit: function() {
		// This only needs to be called for preview pane
		if (this.config.view != $Widgets.Email.VIEW_PREVIEW) {
			return;
		}
		
		var dom = this.container.dom;

		// We need to figure out how big to make the left label columns since they're in different
		// tables
		var from_width		= dom('from_lbl').offsetWidth;
		var attach_width	= dom('attach_lbl').offsetWidth;

		// Expand from (subject will follow) if its smaller
		if (from_width < attach_width) {
			dom('from_lbl').style.width = attach_width + 'px';
		} else {
			dom('attach_lbl').style.width = from_width + 'px';
		}
	},

	// }}}
	// {{{ _setClassname()
	/**
	 * Generates the proper classname for the container so we can control appearance via CSS easily.
	 */
	_setClassname: function() {
		var class_name = 'wm_root ';

		// Set based on view type
		if (this.config.view == $Widgets.Email.VIEW_POPUP) {
			class_name += 'view_popup';
		} else if (this.config.view == $Widgets.Email.VIEW_FULL) {
			class_name += 'view_full';
		} else {
			class_name += 'view_preview';
		}

		// Only do the rest if we have options
		if (this.options) {
			// If popup attachment
			if (this.options.pid) {
				class_name += ' attachment';
			}
			
			// Set anything folder/message specific
			if ($FolderList.isSent(this.options.folder)) {
				class_name += ' sent';
			} else if ($FolderList.isDraft(this.options.folder)) {
				class_name += ' draft';
			} else if ($FolderList.isSpam(this.options.folder)) {
				class_name += ' spam';
			}

			// Check for ical
			if (this.response.is_ical) {
				class_name += ' invite';
			}
		}

		this.container.dom('root').className = class_name;
	},

	// }}}
	// {{{ _setFolderDropdown()
	/**
	 * Fills in the options for the folder dropdown.
	 */
	_setFolderDropdown: function() {
		// Figure out options to pass when we get folders
		var folder_opts = {
			include_special: true
		};

		// We have to fill in a div like this because IE is awful
		// (http://support.microsoft.com/kb/276228)
		this.container.dom('move_dropdown').innerHTML =
			'<select class="move_dd" onchange="$Widgets.Email.evMoveChange(this);">' +
				'<option value="">'+L('Mlist.Action.Move')+'</option>' +
				'<option value="">--------------------</option>' +
				$FolderList.getDropdownOptions(folder_opts) +
			'</select>';
	},
	
	// }}}
	// {{{ _setObservers() 
	/**
	 * Helper function that sets observers for all the elements in the widget.
	 */
	_setObservers: function() {
		var dom = this.container.dom;

		// Setup clicking arrows to expand stuff
		dom('to_arrow')._field = dom('to');
		dom('cc_arrow')._field = dom('cc');
		dom('attach_arrow')._field = dom('attach');
		dom('attach_arrow')._wrapper = dom('attach');
		Event.observe(dom('to_arrow'), 'click', this.evExpandField);
		Event.observe(dom('cc_arrow'), 'click', this.evExpandField);
		Event.observe(dom('attach_arrow'), 'click', this.evExpandField);

		// View Images button
		if (dom('view_images')) {
			Event.observe(dom('view_images'), 'click', this.evViewImages);
		}

		// Save icon
		Event.observe(dom('from_save'), 'click', this.evSaveContact);

		// Download attachments
		Event.observe(dom('attach_save'), 'click', this.evSaveAttachments);

		// Clicking for the toolbar links
		var toolbar_funcs = {
			reply: this.evComposeLink,
			reply_all: this.evComposeLink,
			forward: this.evComposeLink,
			del: this.evDeleteClick,
			notspam: this.evReportNotSpam,
			spam: this.evReportSpam,
			resume: this.evComposeLink,
			resend: this.evComposeLink,
			print: this.evPrint,
			view_images: this.evViewImages
		};
		var links = dom('toolbar_left').getElementsByTagName('a');
		for (var i=0,ii=links.length; i<ii; i++) {
			Event.observe(links[i], 'click', toolbar_funcs[links[i].className]);
		}

		// Nav links
		if (this.config.view != $Widgets.Email.VIEW_PREVIEW) {
			// Prev/Next links
			Event.observe(dom('prev_link'), 'click', this.evPrevClick);
			Event.observe(dom('next_link'), 'click', this.evNextClick);
			Event.observe(dom('prev_del_link'), 'click', this.evPrevDeleteClick);
			Event.observe(dom('next_del_link'), 'click', this.evNextDeleteClick);

			// Back link
			Event.observe(dom('back_link'), 'click', this.evBack);
		}

		Event.observe(document.body, 'click', this.evBodyClick);
	},

	// }}}
	// {{{ _showLoadOption()
	/**
	 * Shows the option to load plain text if the html message could not be loaded
	 */
	_showLoadOption: function(response) {
		REQUIRE('combo/dialogs');

		this._load_option_prompt = new $DialogsPrompt(
			L('Message.Option.Title'),
			L('Message.Option.Description'),
			null,
			{cancel: false}
		);

		this._load_option_prompt.addButton(L('L.Yes'), function() {
			this.options.force_plain = true;
			this.populate(this.options);
		}.bind(this));

		this._load_option_prompt.addButton(L('L.No'), function() {
			this.options.callback(response);
		}.bind(this));

		this._load_option_prompt.show();
	},

	// }}}
	// {{{ _showToolbarLink()
	/**
	 * Will cause a toolbar link to become visible
	 */
	_showToolbarLink: function(link_name) {
		var dom = this.container.dom;
		dom(link_name+'_link').style.display = 'inline';
	},
	
	// }}}

	// callbacks:
	// {{{ cbDelete()
	/**
	 * Called when delete is finished
	 */
	cbDelete: null,
	_cbDelete: function(response) {
		$Bootstrap.getAppWindow().$UI.clearStatus();
	},
	// }}}
	// {{{ cbInviteResponse()
    _cbInviteResponse: null,
    cbInviteResponse: function(trash, folder, id) {
		if (!folder || !id) {
			return;
		}
		
		//only delete if they have the setting and
		//its not in the trash folder
        if($Settings.deleteInviteAfterAction() && !$FolderList.isTrash(folder)) {
            $MessageList.deleteMessages(
                {
                    folder: folder,
                    id:     id,
                    unread: false
                },
                this.cbDelete,
                false
            );
        }
    },
	// }}}
	// {{{ cbMove()
	/**
	 * Called when move is finished
	 */
	cbMove: null,
	_cbMove: function(response) {
		$UI.clearStatus();
	},

	// }}}
	// {{{ cbOpen()
	/**
	 * Callback for reading a message
	 */
	cbOpen: null,
	_cbOpen: function(response) {
		if (response.exception) {
			// HTML message was too big, offer plain text version
			if (response.code == Message_TOO_LARGE_HTML) {
				this._showLoadOption(response);
				return;
			}

			$UI.error(L('Message.NotAvailable'));
		} else {
			$UI.clearStatus();
			if (response.uid != this.options.uid || response.folder != this.options.folder) {
				// this isn't the message we want.
				return;
			}

			if (!this.options.force_plain && !this.options.pid && !response._from_cache) {
				$MessageCache.addToCache(this.options.folder, this.options.uid, response);
			}
			this.response = response;
			var dom = this.container.dom;

			// Apply proper classname
			this._setClassname();

			// Easy fill in
			dom('from').innerHTML		= this._makeAddressList([response.from]);
			dom('to').innerHTML			= this._makeAddressList(response.to);
			dom('cc').innerHTML			= this._makeAddressList(response.cc);
			dom('subject').innerHTML	= response.subject;
			dom('date').innerHTML		= response.date;
			dom('content').style.display = 'none';
			dom('content').innerHTML	= response.body;
			Function.release(function() {
				dom('content').style.display = '';
			});
			
			// only mess with the View Images button if the feature is being used
			if ($Settings.isBlockImagesEnabled()) {

				//determine if any images were blocked
				var contains_images = this._containsImages(dom('content'));
				var images_blocked = this._areImagesBlocked(dom('content'));
				
				// allow the link to be used only if images are blocked
				if (contains_images && images_blocked) {
					this._showToolbarLink('view_images');
				} else {
					this._hideToolbarLink('view_images');
				}
				
			} else {
				this._hideToolbarLink('view_images');
			}
			
			dom('full_header').innerHTML = '';

			// Do the back link
			if (this.config.view == $Widgets.Email.VIEW_FULL) {
				if ($Controller._last_module_key == 'Search') {
					dom('back_link').innerHTML = '< ' + L('Message.Link.Back', L('Search.L.Search'));
				} else {
					dom('back_link').innerHTML = '< ' + 
						L('Message.Link.Back', $FolderList.getName(this.options.folder));
				}
			}

			// Attachments
			this._populateAttachments();

			// Setup prev/next links display
			if (this.config.view != $Widgets.Email.VIEW_PREVIEW) {
				dom('prev_del_link').className =
				dom('next_del_link').className =
				dom('prev_link').className =
				dom('next_link').className = '';

				// Find the message to try and get its siblings
				this._guess_siblings = false;
				if (typeof this.response.prev_uid == 'undefined') {
					var msg_row = $Bootstrap.getAppWindow().$$MessageList.findMessage(this.options.folder, this.options.uid);
					if (msg_row && msg_row.obj) {
						var prev_row = msg_row.obj.previous();
						if (prev_row) {
							var prev_msg = prev_row.obj;
							this.response.prev_uid = prev_msg.id();
						}
						
						var next_row = msg_row.obj.next();
						if (next_row) {
							var next_msg = next_row.obj;
							this.response.next_uid = next_msg.id();
						}
					} else {
						this._guess_siblings = true;
					}
				}

				// If no previous message, disable
				if (!this.response.prev_uid && !this._guess_siblings) {
					dom('prev_del_link').className =
					dom('prev_link').className = 'disabled';
				}

				// If no next message, disable
				if (!this.response.next_uid && !this._guess_siblings) {
					dom('next_del_link').className =
					dom('next_link').className = 'disabled';
				}
			}
		
			// Check for read receipt
			this._checkReadReceipt();

			// Check for ical action required
			if ($Custom.isCalendarEnabled()) {
				this._checkIcal();
			}

			// If full view, and no cc, hide the row
			if (this.config.view != $Widgets.Email.VIEW_PREVIEW) {
				if (response.cc) {
					Element.show(dom('cc_row'));
				} else {
					Element.hide(dom('cc_row'));
				}
			}

			// Set folder dropdown
			if (this.config.view != $Widgets.Email.VIEW_PREVIEW) {
				this._setFolderDropdown();
			}

			// Mark as unread
			this.options.unread = false;
			this.config.onchange();

			if (dom('full_header') && dom('full_header').style.display == '') {
				// full header is already open, it should be populated
				$UI.showStatus();
				this.toggleFullHeader(true);
			}
		}

		if (this.options.callback) {
			this.options.callback(response);
		}
	},

	// }}}
	// {{{ cbReportNotSpam()
	/**
	 * Called when reporting false positives completes.
	 */
	cbReportNotSpam: null,
	_cbReportNotSpam: function(response) {
		$UI.clearStatus();
	},
	
	// }}}
	// {{{ cbReportSpam()
	/**
	 * Called when report spam is finished
	 */
	cbReportSpam: null,
	_cbReportSpam: function(response) {
		$UI.clearStatus();
	},
	
	// }}}

	// events:
	// {{{ evBack()
	/**
	 * Used only in full view for the back link
	 */
	evBack: null,
	_evBack: function(e) {
		$Controller.backModule();
	},
	
	// }}}
	// {{{ evBodyClick()
	/**
	 * Called when the body is clicked to determine if preview pane has focus.
	 * @param	{event}	e	Click event
	 */
	evBodyClick: null,
	_evBodyClick: function(e) {
		var target = Event.element(e);
		this._has_focus = wack.Element.isAncestor($('p_pane'), target);
	},
	// }}}
	// {{{ evComposeLink()
	/**
	 * Handler called when a "compose" type link from the toolbar is clicked
	 */
	evComposeLink: null,
	_evComposeLink: function(e) {
		var link 	  = Event.findElement(e, 'a');
		var classname = link.className;

		$Analytics.add('open_compose', classname + '_link');

		var action_map = {
			reply: wm_Compose_REPLY,
			reply_all: wm_Compose_REPLY_ALL,
			forward: wm_Compose_FORWARD,
			resume: wm_Compose_RESUME_DRAFT,
			resend: wm_Compose_RESEND
		};

		$Dispatcher.compose(
			null,
			action_map[classname],
			this.options.uid,
			this.options.folder,
			null, null, null, null,	null, null,
			(this.config.view == $Widgets.Email.VIEW_POPUP ? wm_Settings_COMPOSE_POPUP : null)
		);

		if (this.config.view == $Widgets.Email.VIEW_POPUP) {
			self.close();
		}
	},

	// }}}
	// {{{ evDeleteClick()
	/**
	 * Called when the delete link in the toolbar is clicked
	 */
	evDeleteClick: null,
	_evDeleteClick: function(e) {
		$AN(51);

		$UI.showStatus();
		
		$MessageList.deleteMessages(
			{
				folder:	this.options.folder,
				id:		this.options.uid,
				unread:	this.options.unread || $Bootstrap.getAppWindow().$MessageList.isUnread({
					folder:	this.options.folder,
					id:		this.options.uid
				})
			},
			this.cbDelete,
			false
		);
	},

	// }}}
	// {{{ evExpandField()
	evExpandField: null,
	_evExpandField: function(e) {
		// Create expand container if it doesn't exist
		if (this._expand_elem == null) {
			this._expand_elem = Element.create('div');
			this._expand_elem.className = 'ReadMail_field_expand';
			this._expand_elem.style.display = 'none';
			this.container.append(this._expand_elem);

			$Widgets.ContextMenu.EmailContact.factory(this._expand_elem);
		} else if (this._expand_active) {
			this.evHideExpandedField();
		}

		var arrow	= Event.element(e);
		var field	= arrow._field;
		var wrapper	= arrow._wrapper || field;

		// Fill in contents
		this._expand_elem._arrow = arrow;
		this._expand_elem.innerHTML = field.innerHTML;

		// Figure out where it should float
		var top_offset = (arrow._wrapper ? 0 : 4);
		var cont_offset	= Position.positionedOffset(this.container);
		var offset		= Position.positionedOffset(wrapper);
		this._expand_elem.style.left	= offset[0] - 1 + 'px';
		this._expand_elem.style.top		= offset[1] - top_offset + cont_offset[1] + 'px';

		// We want it to stretch over the field
		if (arrow._wrapper) {
			Element.setDimensions(this._expand_elem, { width: wrapper.offsetWidth - 9});
			arrow.style.visibility = '';
		} else {
			var arrow_offset = Position.positionedOffset(arrow);
			Element.setDimensions(this._expand_elem, { width: (arrow_offset[0] + arrow.offsetWidth) - 
												offset[0] });
		}
		
		// Show the hover
		this._expand_elem.style.display = '';
		
		this._expand_active = true;
		Event.observe(document, 'click', this.evHideExpandedField);

		Event.stop(e);
	},
	
	// }}}
	// {{{ evHideExpandedField()
	/**
	 * Hides any expanded fields when the document is clicked
	 */
	evHideExpandedField: null,
	_evHideExpandedField: function(e) {
		if (!this._expand_active) {
			return;
		}
		
		this._expand_elem._arrow.style.visibility = 'visible';

		this._expand_active = false;
		this._expand_elem.style.display = 'none';
		Event.stopObserving(document, 'click', this.evHideExpandedField);
	},

	// }}}
	// {{{ evNextClick()
	/**
	 * When the "Next" link is clicked in the header
	 */
	evNextClick: null,
	_evNextClick: function(e) {
		$AN(68);

		// See if we need to guess
		if (this._guess_siblings) {
			this._openSibling('next');
			return;
		}

		// Stop if there is no next message
		if (!this.response.next_uid) {
			return;
		}
		
		// Populate
		$UI.showStatus();
		this.populate({
			folder: this.options.folder,
			uid: this.response.next_uid
		});
	},

	// }}}
	// {{{ evNextDeleteClick()
	/**
	 * Click when "next & delete" is clicked.
	 */
	evNextDeleteClick: null,
	_evNextDeleteClick: function(e) {
		$AN(69);

		// If no previous email, stop
		if (!this.response.next_uid) {
			return;
		}

		var message = {folder:this.options.folder, id:this.options.uid};

		$UI.showStatus();
		$MessageList.deleteMessages(
			message,
			function(response) {
				if (this.response.next_uid) {
					// Populate
					this.populate({
						folder: this.options.folder,
						uid: this.response.next_uid
					});
				}
				
				var destination = ($Settings.isDeletePermanent() ? null : CFG_FOLDER_TRASH);
				$Bootstrap.getAppWindow().$Dispatcher.publish('Message.move', [message], destination);
			}.bind(this),
			false,
			true
		);
	},

	// }}}
	// {{{ evPrevClick()
	/**
	 * When the "Prev" link is clicked in the header
	 */
	evPrevClick: null,
	_evPrevClick: function(e) {
		$AN(70);

		// See if we need to guess
		if (this._guess_siblings) {
			this._openSibling('prev');
			return;
		}

		// Stop if there is no previous message
		if (!this.response.prev_uid) {
			return;
		}
		
		// Populate
		$UI.showStatus();
		this.populate({
			folder: this.options.folder,
			uid: this.response.prev_uid
		});
	},

	// }}}
	// {{{ evPrevDeleteClick()
	/**
	 * Click when "previous & delete" is clicked.
	 */
	evPrevDeleteClick: null,
	_evPrevDeleteClick: function(e) {
		$AN(71);

		// If no previous email, stop
		if (!this.response.prev_uid && !this._guess_siblings) {
			return;
		}

		var message = {folder:this.options.folder, id:this.options.uid};

		$UI.showStatus();
		$MessageList.deleteMessages(
			message,
			function(response) {
				if (this.response.prev_uid) {
					// Populate
					this.populate({
						folder: this.options.folder,
						uid: this.response.prev_uid
					});
				}

				var destination = ($Settings.isDeletePermanent() ? null : CFG_FOLDER_TRASH);
				$Bootstrap.getAppWindow().$Dispatcher.publish('Message.move', [message], destination);
			}.bind(this),
			false,
			true
		);
	},

	// }}}
	// {{{ evPrint()
	/**
	 * Called when print link in the toolbar is clicked
	 */
	evPrint: null,
	_evPrint: function(e) {
		$AN(82);

		this.print();
	},

	// }}}
	// {{{ evReportNotSpam() 
	/**
	 * Called when the "Not Spam" link in the toolbar is clicked.
	 */
	evReportNotSpam: null,
	_evReportNotSpam: function(e) {
		$AN(89);
		
		$UI.showStatus();
		$MessageList.reportNotSpam(
			{folder: this.options.folder, id:this.options.uid},
			this.cbReportNotSpam
		);
	},

	// }}}
	// {{{ evReportSpam()
	/**
	 * Called when blacklist link from the toolbar is clicked
	 */
	evReportSpam: null,
	_evReportSpam: function(e) {
		$AN(86);
	
		// Show confirm prompt
		if (!confirm(L('Mlist.C.ReportSpam'))) {
			return;
		}
		
		$UI.showStatus();
		$MessageList.reportSpam(
			{folder: this.options.folder, id: this.options.uid},
			this.cbReportSpam
		);
	},
	
	// }}}
	// {{{ evSaveAttachments()
	/**
	 * Handler for the save icon for saving all attachments
	 */
	evSaveAttachments: null,
	_evSaveAttachments: function(e) {
		this.downloadAttachments();
	},

	// }}}
	// {{{ evSaveContact()
	/**
	 * Saves the from address as a contact
	 */
	evSaveContact: null,
	_evSaveContact: function(e) {
		REQUIRE('combo/contacts');

		var value	= this.response.from;
		var name	= new $Contacts.Name();
		var email	= value.email;

		name.parse(value.name);

		var add_form = new $$Contacts.AddContactDialog({
			standard: {
				email:			email,
				name_title:		name.getTitle(),
				firstname:		name.getFirstName(),
				middlename:		name.getMiddleName(),
				lastname:		name.getLastName(),
				name_suffix:	name.getSuffix()
			},
			custom: false
		});

		// Error Listener
		add_form.addErrorListener(function(msg) {
			$$Contacts._onError(msg, function() {
				add_form.enableDialog(true);
			});
			add_form.enableDialog(false);
		}.bind(this));
		
		add_form.show();
	},
	
	// }}}
	// {{{ evViewImages()
	/**
	 * Handler for the view images button
	 */
	evViewImages: null,
	_evViewImages: function(e) {
		
		// disable the View Images button -- we won't need it for this message again 
		this._hideToolbarLink('view_images');

		// find all the img tags in the body of the email
		var dom = this.container.dom;
		var img_tags = dom('content').getElementsByTagName('img');	
		var img;
		var _src;
		
		// copy _src to src in each img element
		for (var i=0,ii=img_tags.length; i<ii; i++) {
			img = img_tags[i];
			_src = img.getAttribute('_src')
			if (_src != null) {
				img.setAttribute('src',_src);
				img.removeAttribute('_src');
			}
		}

		//save new body in the MessageCache
		if ($MessageCache.isCached(this.options.folder,this.options.uid)) {
			var cached_msg = $MessageCache.getCachedMsg(this.options.folder,this.options.uid);
			cached_msg.body = dom('content').innerHTML;
		}
	}
	// }}}

});

// View constants
$Widgets.Email.VIEW_PREVIEW	= 1;
$Widgets.Email.VIEW_FULL	= 2;
$Widgets.Email.VIEW_POPUP	= 4;

// Static functions
// {{{ evAddressClick()
/**
 * Handler for when an address is clicked in the message header
 * @param	{string}	email	Email that was clicked
 */
$Widgets.Email.evAddressClick = function(email) {
	if ($Custom.isComposeEnabled()) {
        $AN(102);

        /*we recieve an ecnoded email, we decode it here so 
        * it shows up correctly in the compose Display 
        */
        email = unescape(email);
        $Dispatcher.compose(null, null, null, null, email);
    }
}

// }}}
// {{{ evDateLink()
/**
 * Handler for clicking dates automatically parsed when reading a message.
 */
$Widgets.Email.evDateLink = function(date, time) {
	$AN(0);

	$UI.load(function() {
		//Load the event form dependencies		
		REQUIRE('combo/calendar_eventform');
		
		//Show a new event form for the date clicked
		$$EventForm.showNew($Calendar.getPersonalCalendars()[0], date, time);
	});
};

// }}}
// {{{ evInviteResponse()
/**
 * Handler for links on an ical email
 * @param	{Element}	link	Link that was clicked
 */
$Widgets.Email.evInviteResponse = function(link) {
	var action = link.className;

	// Loop up until we find the email widget
	var elem = link;
	while (elem != document.body && elem.className != 'ReadMail') {
		elem = elem.parentNode;
	}

	if (elem == document.body) {
		return;
	}
	$W(elem).sendInviteResponse(action);
}

// }}}
// {{{ evMoveChange()
/**
 * Moves the given message.
 * @param	{Element}	select	Dropdown that was changed
 */
$Widgets.Email.evMoveChange = function(select) {
	$AN(66);

	// Find the parent container so we can get the widget
	var elem = select;
	while (elem != document.body && !elem.__widget__) {
		elem = elem.parentNode;
	}

	if (elem != document.body) {
		$W(elem).move(select.value);
	}

	select.selectedIndex = 0;
}

// }}}
// {{{ evMoveToAnchor()
/**
 * This will scroll the body to an anchor found within the email
 * @param	{Element}	link	The link that was clicked
 */
$Widgets.Email.evMoveToAnchor = function(link) {
	// Find the root container so we can get the widget
	var container;
	var elem = link;
	while (elem && elem != document.body) {
		elem = elem.parentNode;
		if (elem.__widget__ && elem.__widget__._is_email_widget) {
			container = elem;
			break;
		}
	}

	if (!container) {
		return;
	}

	var widget	= $W(container);
	var anchor	= link.getAttribute('_anchor').substr(1);
	var body	= container.dom('body');

	var links = body.getElementsByTagName('a');
	for (var i=0,ii=links.length; i<ii; i++) {
		if (links[i].name == anchor && !links[i].href) {
			var link_top	= Position.cumulativeOffset(links[i])[1];
			var body_top	= Position.cumulativeOffset(body)[1];

			body.scrollTop = (link_top - body_top);
			break;
		}
	}
}

// }}}
// {{{ zipAttachments()
/**
 * Downloads a zip file of all attachments for a message
 * @param	{string}	folder	Folder message is in (UTF-7)
 * @param	{int}		uid		UID of the message
 * @param	{int}		pid		PID of the message (for zipping attachments from email attachments)
 */
$Widgets.Email.zipAttachments = function(folder, uid, pid) {
	var hidden_style = 'height:0;width:0;margin:0;border:0;';

	// If there is no iframe, make one to post to
	if (!$Widgets.Email._zip_iframe) {
		$Widgets.Email._zip_iframe = Element.createHtml(
			'<iframe style="'+hidden_style+'" name="ReadMail_zip"></iframe>'
		);

		Element.append(document.body, $Widgets.Email._zip_iframe);
	}

	// If there is no form, make one to do the post
	if (!$Widgets.Email._zip_form) {
		var sid = Webmail.getSessionId();

		$Widgets.Email._zip_form = Element.createHtml([
			'<form style="'+hidden_style+'" action="p/message/zip_attachments.php" ',
				'method="post" target="ReadMail_zip">',
				'<input type="hidden" name="',CFG_SESSION_NAME,'" value="',sid,'" />',
				'<input type="hidden" name="folder" />',
				'<input type="hidden" name="uid" />',
				'<input type="hidden" name="pid" />',
			'</form>'
		].join(''));
		
		Element.append(document.body, $Widgets.Email._zip_form);
	}

	var form = $Widgets.Email._zip_form;
	form.folder.value	= folder;
	form.uid.value		= uid;
	form.pid.value		= pid;
	form.submit();
}

// }}}
};
$Bootstrap.applyCss("div.ReadMail{height:100%;}div.ReadMail div.header{background:"+wcv__shading_light+";border-bottom:1px solid "+wcv__shading_medium+";padding:6px 10px 6px 10px;position:relative;\n\tbackground-image: url('"+wcv__image_url+"gradient_bg.png') !important;\n\tbackground-position: left top !important;\n\tbackground-repeat: repeat-x !important;\n}div.ReadMail div.header td.val a{color:"+wcv__right_fgColor+"!important;text-decoration:none!important;}div.ReadMail div.header td.val a:hover{color:"+wcv__right_linkHoverColor+"!important;text-decoration:underline!important;}body.quarantine div.ReadMail div.header td.val a:hover{color:"+wcv__right_fgColor+"!important;text-decoration:none!important;}div.ReadMail div.view_preview div.header{padding-right:20px;}div.ReadMail div.header table{width:100%;}div.ReadMail div.header td.lbl{font-weight:bold;text-align:right;white-space:nowrap;}div.ReadMail div.view_preview div.header td.val{width:50%;}div.ReadMail div.view_full div.header td.val,div.ReadMail div.view_popup div.header td.val{width:100%;}div.ReadMail div.header td.val div.wrapper{margin:0;overflow:hidden;white-space:nowrap;width:100%;}div.ReadMail div.header td.val div.wrapper div.content{float:left;}div.ReadMail div.header td.arrow img{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1225px;cursor:pointer;visibility:hidden;height:9px;width:9px;}div.ReadMail div.header tr.from td.from img{cursor:pointer;margin:0 0 0 6px;}div.ReadMail div.feed div.header tr.from td.val img,div.ReadMail div.sent div.header tr.from td.val img{display:none;}div.ReadMail div.header td.right{padding:0;text-align:right;}body.quarantine div.ReadMail td.right .move_dd{display:none;}body.quarantine div.ReadMail td.cc{display:none;}@media screen{div.ReadMail div.view_preview div.header tr.date{display:none;}div.ReadMail div.view_full div.header tr.subject{display:none;}}div.ReadMail div.attachment div.nav_links,div.ReadMail div.attachment td.move_dropdown select{display:none;}div.ReadMail div.header tr.attach td{padding:2px 0 0 0;}@media screen{div.ReadMail div.header tr.attach td.lbl{padding:7px 0 0 0;}}@media screen{div.ReadMail div.header td.attach{width:100%;}}div.ReadMail div.header td.attach img.save{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1125px;cursor:pointer;height:11px;margin:6px 4px 0 4px;width:11px;}@media screen{div.ReadMail div.header td.attach div.list{background:#FFF;border:1px solid "+wcv__shading_medium+";float:left;height:16px;overflow:hidden;padding:4px 2px 2px 6px;white-space:nowrap;width:10px;}}span.ReadMail_attach_item{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1025px;margin:0 12px 0 0;white-space:nowrap;}span.ReadMail_attach_item a{margin:0 0 0 13px;}div.ReadMail div.view_popup div.header a.back{display:none;}div.ReadMail_field_expand{background-color:#FFF;border:1px solid "+wcv__shading_medium+";left:0;line-height:1.7;max-height:100px;overflow:auto;padding:4px;position:absolute;top:0;white-space:normal;}div.ReadMail_field_expand a{color:"+wcv__right_fgColor+"!important;text-decoration:none!important;}div.ReadMail_field_expand a:hover{color:"+wcv__right_linkHoverColor+"!important;text-decoration:underline!important;}div.ReadMail div.full_header{max-height:300px;overflow:auto;}div.ReadMail div.full_header table{width:auto!important;}div.ReadMail div.mtoolbar{background:#FFF;border-bottom:1px solid "+wcv__shading_medium+";float:left;height:1.0em;overflow:hidden;padding:4px 0 7px 0;white-space:nowrap;width:100%;}div.ReadMail div.mtoolbar_left{float:left;padding:0 0 0 12px;}div.ReadMail div.mtoolbar_right{float:right;}div.ReadMail div.mtoolbar a{background-repeat:no-repeat;border-right:1px solid "+wcv__shading_light+";margin:0 4px;padding:0 6px 0 13px;}div.ReadMail div.mtoolbar_right a{border:0;margin:0;padding:0;}div.ReadMail div.mtoolbar a.reply{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -823px;}div.ReadMail div.mtoolbar a.reply_all{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -849px;}div.ReadMail div.mtoolbar a.forward{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -873px;}div.ReadMail div.mtoolbar a.del{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -899px;}div.ReadMail div.mtoolbar a.spam{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -948px;}div.ReadMail div.mtoolbar a.notspam{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -924px;display:none;}div.ReadMail div.mtoolbar a.resume{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1248px;display:none;}div.ReadMail div.mtoolbar a.resend{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -973px;display:none;}div.ReadMail div.mtoolbar a.print{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1000px;border:0!important;padding-left:21px;}body.quarantine div.ReadMail div.mtoolbar a.reply{display:none;}body.quarantine div.ReadMail div.mtoolbar a.reply_all{display:none;}body.quarantine div.ReadMail div.mtoolbar a.forward{display:none;}body.quarantine div.ReadMail div.mtoolbar a.spam{display:none;}body.quarantine div.ReadMail div.mtoolbar a.notspam{display:inline;}div.ReadMail div.mtoolbar a.view_images{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1274px;border:0!important;padding-left:21px;}div.ReadMail div.draft div.mtoolbar a.resume{display:inline!important;;}div.ReadMail div.sent div.mtoolbar a.resend{display:inline!important;}div.ReadMail div.feed div.mtoolbar a.reply,div.ReadMail div.feed div.mtoolbar a.reply_all,div.ReadMail div.feed div.mtoolbar a.notspam,div.ReadMail div.feed div.mtoolbar a.spam{display:none!important;}div.ReadMail div.invite div.mtoolbar a.notspam,div.ReadMail div.invite div.mtoolbar a.spam{display:none!important;}div.ReadMail div.spam div.mtoolbar a.spam{display:none!important;}div.ReadMail div.spam div.mtoolbar a.notspam{display:inline!important;}div.ReadMail div.view_popup div.mtoolbar a.print{display:none;}div.ReadMail div.view_popup div.mtoolbar a.spam{border:0;}div.ReadMail div.attachment div.mtoolbar{display:none;}div.ReadMail div.view_popup div.mtoolbar div.mtoolbar_right,div.ReadMail div.view_full div.mtoolbar div.mtoolbar_right{padding:0 10px 0 0;}div.ReadMail a.disabled,div.ReadMail a.disabled:hover{color:"+wcv__left_fgColor+"!important;cursor:text;text-decoration:none!important;}@media screen{div.ReadMail div.wm_root div.body{float:left;}div.ReadMail div.wm_root>div.body{height:100px;overflow:auto;}}div.ReadMail div.body div.contents{font-size:9pt;padding:10px 0 14px 20px;}div.ReadMail div.body div.contents span{}@media screen{div.ReadMail div.body{position:relative;}div.ReadMail div.body div.contents{margin-right:30px;}}div.ReadMail_invite a.accept{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1150px;border-right:1px solid "+wcv__shading_light+";font-size:8pt;padding:0 10px 0 17px;}div.ReadMail_invite a.decline{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1175px;border-right:1px solid "+wcv__shading_light+";font-size:8pt;margin:0 0 0 10px;padding:0 10px 0 16px;}div.ReadMail_invite a.tentative{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 0px -1200px;font-size:8pt;margin:0 0 0 10px;padding:0 0 0 17px;}@media print{div.ReadMail div.header tr.from td.from img,div.ReadMail div.header td.arrow img,div.ReadMail div.mtoolbar,div.ReadMail div.header a.back,div.ReadMail div.header div.nav_links{display:none;}div.ReadMail div.header td.lbl{text-align:left;}div.ReadMail div.header tr.attach td.lbl{}div.ReadMail div.header tr.attach img.save{display:none;}div.ReadMail div.header tr.attach div.list_wrap{overflow:hidden;}span.ReadMail_attach_item{background:none;display:block;}span.ReadMail_attach_item a{color:black!important;margin:0 0 0 2px;}div.ReadMail,div.ReadMail div.header,div.ReadMail div.body{background-color:transparent;border:none;height:auto!important;overflow:visible!important;width:100%!important;}div.ReadMail div.body div.contents{margin:10px 0 0 0;padding:0;}div.ReadMail div.header{border-bottom:2px solid black;}*{overflow:visible!important;}}");
$Bootstrap.reportLoaded("widgets", "Email");if ($Bootstrap.notLoaded('934dc29536f0a8469423a48cb57c0259')) {
// vim:ts=4:sw=4:et:tw=100:fdm=marker:
/**
 * Widget for popup/dropdown menus
 */

Framework.register('Webmail.Widgets');

$Widgets.Menu = $Widgets.create({

	/**
	 * List of menu items
	 * @var	{Array}
	 */
	_items: [],

	/**
	 * List of submenus
	 * @var (Array)
	 */
	_submenus: [],

	/**
	 * The active submenu
	 * @var (Array)
	 */
	_active_submenu_index: null,

	/**
	 * Whether shadow has been set
	 * @var {Boolean}
	 */
	_shadow_set: false,

	// public:
	// {{{ hide()
	/**
	 * Hides the menu
	 */
	hide: function() {
		this.container.style.display = 'none';

		//hide the sub menu if were showing one
		if(this._submenus[this._active_submenu_index]) {
			
			// Reset sub_menu classes to not be hovered
			$Templates.setDom(this.container);
			var child_nodes = this.container.dom('content').childNodes;
			for(var item_count = 0; item_count < child_nodes.length; item_count ++) {
				if(child_nodes[item_count].className == 'sub_menu_hover') {
					child_nodes[item_count].className = 'sub_menu';
				}
			}
			
			this._submenus[this._active_submenu_index].hide();
		}
	},

	// }}}
	// {{{ initialize()
	/**
	 * Constructor
	 */
	initialize: function(items, options) {
		Object.bindObservers(this);

		this._submenus = [];
		this._active_submenu_index = [];

		this._items = items;
		this._options = wack.extend({
			onclick: null,
			shadow: true,
			submenu: false
		}, options||{});

		this.container = this._draw();
	},

	// }}}
	// {{{ showSubMenu()
	/**
	 * Shows a menu and move it based on the parent position
	 */
	showSubMenu: function(items, parent) {
		var parent_menu = parent.parentNode.parentNode.parentNode;
		var top = parent_menu.offsetTop + parent.offsetTop;
		var left = parent_menu.offsetLeft + parent.offsetWidth;
	
		this.container.style.display = '';
		this.container.visibility = 'hidden';

		// Get proper position based on screen constraints
		var browser_dimensions = wack.Browser.getDimensions();
		var menu_dimensions	= Element.getDimensions(this.container.dom('content'));

		var parent_dimensions;
		// Make sure its not going off the right
		if ((left + menu_dimensions.width + 10) >= browser_dimensions[1]) {
			var parent_dimensions = Element.getDimensions(parent_menu);
			left = parent_menu.offsetLeft - parent.offsetWidth;
		}

		// Make sure it does not go past bottom
		if ((top + menu_dimensions.height + 10) >= browser_dimensions[0]) {
			parent_dimensions = Element.getDimensions(parent);
			top = top - ((menu_dimensions.height - parent_dimensions.height) + 1);
		}

		// Set menu position
		this.container.style.position = 'absolute';
		this.container.style.top = top + 'px';
		this.container.style.left = left + 'px';
		this.container.style.zIndex = 100000;

		this.show(items);
	},
	// }}} 
	// {{{ show()
	/**
	 * Re-shows the menu
	 * @param	{Array}	[items]	Optionally pass items for dynamic menus
	 */
	show: function(items) {
		this.container.style.display = '';
		this.container.style.visibility = 'hidden';

		var wrapper = this.container.dom('content_wrapper');
		
		if (items) {
			var menu_frame = this.container.dom('content');
			var menu_items = menu_frame.childNodes;

			for (var i=0,ii=items.length; i<ii; i++) {

				// Check if the item needs to be hidden
				if (items[i].show) {
					if (!(items[i].show()) && !menu_items[i].__hidden) {
						menu_items[i].__hidden = true;
						Element.addClassName(menu_items[i], 'hidden');
					} else if (items[i].show() && menu_items[i].__hidden) {
						menu_items[i].__hidden = false;
						Element.removeClassName(menu_items[i], 'hidden');
					}
				}

				// Check whether to disable the item
				if (items[i].disabled && items[i].disabled()) {
					if (!menu_items[i].__disabled) {
						menu_items[i].__disabled = true;
						Element.addClassName(menu_items[i], 'disabled');
					}
				} else {
					if (menu_items[i].__disabled) {
						Element.removeClassName(menu_items[i], 'disabled');
					}
					menu_items[i].__disabled = false;
				}

				// See if label is dynamic
				if (typeof(items[i].label) == 'function') {
					menu_items[i].innerHTML = items[i].label();
				}
			}

			// Setup shadow dimensions
			var shadow = this.container.dom('shadow').childNodes[0];
			var dimensions = Element.getDimensions(wrapper);

			// Flags are messing up in IE7. Need some padding in the dialog...
			if (wack.Browser.is_ie7) {
				this.container.style.width = (dimensions.width+5) + 'px';
				dimensions = Element.getDimensions(wrapper);
			}
			if (shadow) {
				shadow.style.height	= dimensions.height + 'px';
				shadow.style.width	= dimensions.width + 'px';
			}
			this._shadow_set = true;
		}

		//need to size our iframe blocker if we're using IE6
		if(wack.Browser.is_ie6) {
			dimensions = Element.getDimensions(wrapper);
			Element.setStyle(this.container.lastChild, {
				width: dimensions.width+'px',
				height: dimensions.height+'px'});
		}
		
		
		this.container.style.visibility = '';

		// Force focus on the menu
		this.container.focus();
	},

	// }}}

	// private:
	// {{{ _draw()
	/**
	 * Draws the menu based on the items stored
	 * @return	{Element}
	 */
	_draw: function() {
		var container = Element.createHtml('<span class="Widgets_Menu"><div class="shadow" _ref="shadow"></div><div class="content" _ref="content_wrapper"><div class="minwidth"></div><div _ref="content"></div></div></span>');
		$Templates.setDom(container);
		var dom = container.dom;
		
		// Build Menu Elements
		var menu = dom('content');
		for (var i=0,ii=this._items.length; i<ii; i++) {
			if (this._items[i].new_section) {
				// New Section: Draw a horizontal line
				menu.appendChild(Element.createHtml('<div class="break"><img src="images/blank.gif" /></div>'));
			} else if (this._items[i].custom) {
				// Custom HTML instead of label
				menu.appendChild(this._items[i].custom);
			} else if (this._items[i].label) {
				// Allow dynamic labels
				if (typeof(this._items[i].label) == 'function') {
					var label = '';
				} else {
					var label = this._items[i].label;
				}

				var newItem = Element.createHtml(
					'<a href="javascript:void(0);" _index="'+i+'">' + label + '</a>'
				);

				// If there is a submenu, add a right arrow
				if(this._items[i].submenu) {
					newItem.addClassName('sub_menu');
				} 
				
				// Bold Default Items
				if (this._items[i].isdefault) {
					Element.addClassName(newItem, 'default');
				}

				// Hides menu item
				if (this._items[i].show === false) {
					Element.addClassName(newItem, 'hidden');
				}

				//observer mouse over for submenus
				Event.observe(newItem, 'mouseover', this.evMouseOver);

				menu.appendChild(newItem);
			}
		}

		// Setup menu content
		Event.observe(dom('content'), 'click', this.evClick);
		
		
		// Add shadow if necessary
		if (this._options.shadow) {
			var filter = $UI.Alpha.newLayer('#000', 40);
			container.dom('shadow').appendChild(filter);
		}
	
		//if its ie 6 we need a fake iframe to cover over window controls(dropdowns etc.)
		if (wack.Browser.is_ie6) {
			var iframe_src = Webmail.getBlankUrl();
			var iframe = Element.createHtml(
				'<iframe src="'+iframe_src+'" frameborder="0"></iframe>');
			Element.append(container, iframe);
		}
		
		return container;
	},

	// }}}
	// {{{ _drawSubMenu()
    _drawSubMenu: function(item) {
		//need the parent container to calculate positioning;
		var submenu = $Widgets.Menu.factory(item.submenu);
		var menu_container = $C(submenu);
		menu_container.style.position = 'absolute';
		document.body.appendChild(menu_container);

		return submenu;
	},
	// }}}
	// {{{ evMouseOver()
	/**
	 * Fired when a menu is hovered over
	 */
	evMouseOver: null,
	_evMouseOver: function(e) {
	
		if(this._submenus[this._active_submenu_index])
		{
			this._submenus[this._active_submenu_index].hide();
			
			//unset the elem.classname = '' for this index;
			var this_menu = this.container;
			$Templates.setDom(this_menu);
			var child_nodes = this_menu.dom('content').childNodes;
			for(var item_count = 0; item_count < child_nodes.length; item_count ++) {
				if(child_nodes[item_count].className == 'sub_menu_hover') {
					child_nodes[item_count].className = 'sub_menu';
				}
			}
		}

		// Make sure the element mouseover was the anchor element (menu item)
		var elem = Event.element(e);
		if (Element.nodeName(elem) != 'a') {
			return;
		}

		// Find the index and show the submenu
		var index 	= elem.getAttribute('_index');
		var item	= this._items[index];
		
		// If it's a disabled element don't go to display
		if  (elem.__disabled) {
			Event.stop(e);
			return;
		}
		
		if(item.submenu) {
		
			/*change the class of our hovered element to its hover css because we want 
			 * to keep it while on the submenu
			*/
			elem.className = 'sub_menu_hover';
			if(!this._submenus[index]) {
				this._submenus[index] = this._drawSubMenu(item);
			}

			this._active_submenu_index = index;
			
			this._submenus[index].showSubMenu(item, elem);

		}
	},
	// }}}
	// {{{ evClick()
	/**
	 * Fired when the menu is clicked
	 */
	evClick: null,
	_evClick: function(e) {
		// Make sure the element clicked was the anchor element (menu item)
		var elem = Event.element(e);
		if (Element.nodeName(elem) != 'a') {
			return;
		}

		// If it's a disabled element, don't do anything
		if (elem.__disabled) {
			Event.stop(e);
			return;
		}

		// Find the index and run the item's callback
		var index	= elem.getAttribute('_index');
		var item	= this._items[index];

		// See if theres a global callback
		if ((!item || !item.submenu) && this._options.onclick) {
			this._options.onclick();
		}

		if (item && item.callback != null) {
			item.callback();
		}
	}

	// }}}
});
};
$Bootstrap.applyCss("span.Widgets_Menu div.content{background:#FFF;border:1px solid "+wcv__shading_medium+";padding:0;position:absolute;z-index:10000;}span.Widgets_Menu div.content div.minwidth{height:1px;overflow:hidden;width:150px;}span.Widgets_Menu div.content a{color:#000!important;cursor:default;display:block;padding:3px 10px;text-decoration:none;white-space:nowrap;}span.Widgets_Menu div.content a.default{font-weight:bold;}span.Widgets_Menu div.content a.hidden{display:none;}span.Widgets_Menu div.content a:hover{background:"+wcv__shading_dark+";color:#FFF!important;cursor:pointer;text-decoration:none;}span.Widgets_Menu div.content a.sub_menu{background-image:url('"+wcv__image_url+"arrows\/right-arrow-grey.gif')!important;background-position:97% 50%!important;background-repeat:no-repeat!important;}span.Widgets_Menu div.content a.sub_menu_hover{background:"+wcv__shading_dark+";background-image:url('"+wcv__image_url+"arrows\/right-arrow-reverse.gif')!important;background-position:97% 50%!important;background-repeat:no-repeat!important;color:#FFF!important;cursor:pointer;text-decoration:none;}span.Widgets_Menu div.content a.disabled{color:#CCC!important;}span.Widgets_Menu div.content div.break{background-color:#CCC;height:1px;padding:0;margin:3px 2px;}span.Widgets_Menu div.content div.break img{height:1px;}span.Widgets_Menu div.content div.flags{margin:1px;padding:3px 10px;}span.Widgets_Menu div.content div.flags span.label{margin:0 2px 0 0;}span.Widgets_Menu div.content div.flags a{display:inline;height:5px;padding:3px 8px;width:5px;}span.Widgets_Menu div.content div.flags a:hover{background-color:"+wcv__shading_light+";}span.Widgets_Menu div.content a.flag_red,span.Widgets_Menu div.content a.flag_red:hover{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 3px -495px;}span.Widgets_Menu div.content a.flag_green,span.Widgets_Menu div.content a.flag_green:hover{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 3px -520px;}span.Widgets_Menu div.content a.flag_purple,span.Widgets_Menu div.content a.flag_purple:hover{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 3px -545px;}span.Widgets_Menu div.content a.flag_blue,span.Widgets_Menu div.content a.flag_blue:hover{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 3px -570px;}span.Widgets_Menu div.content a.flag_yellow,span.Widgets_Menu div.content a.flag_yellow:hover{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 3px -595px;}span.Widgets_Menu div.content a.flag_grey,span.Widgets_Menu div.content a.flag_grey:hover{background-image: url('"+wcv__image_url+"sprites\/email.2.png');background-repeat: no-repeat;background-position: 3px -445px;}span.Widgets_Menu div.shadow{left:2px;position:absolute;top:2px;z-index:9999;}");
$Bootstrap.reportLoaded("widgets", "Menu");if ($Bootstrap.notLoaded('c743898a07caefca59f872413a8093b5')) {
/**
 * @fileoverview
 * Webmail/Widgets/QuickSummary.js
 * 
 * Widget for showing a quick summary of whatever was hovered.
 *
 * CHANGELOG
 * 4/3/07		created
 * 
 * @author		Steve
 */

Framework.register('Webmail.Widgets');

Webmail.Widgets.QuickSummary = Webmail.Widgets.create({

	_hovered: false,
	_options: {},
	container: null,

	// {{{ initialize()
	/**
	 * Constructor to create a new widget.
	 *
	 * @return	{null}
	 */
	initialize: function(options) {
		Object.bindObservers(this);
		Element.append(window.document.body, this._construct());
	},
	// }}}
	
// --private--
	// {{{ _construct()
	/**
	 * Creates the widget object and adds the event listener(s).
	 *
	 * @return	{element}
	 */
	_construct: function() {

		this.container = Element.createHtml(
		['<div class="widgets_quick_summary">',
			'<div class="shadow"></div>',
			'<div class="content"></div>',
		'</div>'].join(''));

		Event.observe(this.container,	'mouseout',		this.evMouseOut);
		
		Element.hide(this.container);
		
		return this.container;
	},
	// }}}
	// {{{ _dom()
	/**
	 * Subobject to return specific parts of the container.
	 */
	_dom: {
		findContent: function(cont) {
			return cont.childNodes[1];
		},
		findShadow: function(cont) {
			return cont.firstChild;
		}
	},
	// }}}
	// {{{ _getDimensions()
	/**
	 * Gets the dimensions of the container.  Should always be called after _populate().
	 *
	 * @return	{object}
	 */
	_getDimensions: function() {
		
		// make the element take up space, to get the dimensions
		Element.setStyle(this.container, {visibility: 'hidden', display: 'block'});
		var dim = Element.getDimensions(this._dom.findContent(this.container));
		
		// now that we have the dimensions, make it disappear
		Element.setStyle(this.container, {visibility: 'visible', display: 'none'});
		
		return dim;
	},
	// }}}
	// {{{ _getPosition()
	/**
	 * Gets the position based on set mouse position, container size, and browser dimensions.
	 *
	 * @return	{object}
	 */
	_getPosition: function() {
		var pos = this._options.position;

		var hov_dim 	= this._getDimensions();
		var brows_dim 	= Browser.getDimensions();

		if (pos.top - hov_dim.height > 0) { pos.top -= hov_dim.height; }
		
		if (pos.left + hov_dim.width >= brows_dim[1]) {
			pos.left -= hov_dim.width;
		}

		return pos;
	},
	// }}}
	// {{{ _hide()
	/**
	 * Hides the container.
	 *
	 * @return	{null}
	 */
	_hide: function() {
		Element.hide(this.container);		
	},
	// }}}
	// {{{ _populate()
	/**
	 * Replaces the text in the hover box.
	 *
	 * @param	{string}	message
	 * @return	{null}
	 */
	_populate: function(message) {
		this._dom.findContent(this.container).innerHTML = message.replace(/\n/g, '<br />');;
	},
	// }}}
	
// --public--	
	// {{{ close()
	/**
	 * Closes the widget and destroys it, so it can be recycled.
	 *
	 * @return	{null}
	 */
	close: function() {
		if (this._transition) {
			this._transition.cancel();
			this._transition = null;
		}
		this._options.onclose();
		this._hide();
		$Widgets.QuickSummary.destroy(this);
	},
	// }}}
	// {{{ init()
	/**
	 * Tells the widget the location of the mouse and what else to do when closing.
	 *
	 * @param	{mixed}		options		if no options are specified, will revert to defaults.
	 * @return	{null}
	 */
	init: function(options) {
		this._options = Object.extend({
			onclose: 			Prototype.emptyFunction,
			position:			{left: 0, top: 0},
			transition_time:	.4
		}, options || {});
	},
	// }}}
	// {{{ isHovered()
	/**
	 * Returns whether the container is hovered.
	 *
	 * @param	{int}	mouse_x		the x position of the mouse
	 * @param	{int}	mouse_y		the y position of the mouse
	 * @return	{bool}
	 */
	isHovered: function(mouse_x, mouse_y) {
		Position.prepare();
		return Position.withinIncludingScrolloffsets(this.container, mouse_x, mouse_y);	
	},
	// }}}
	// {{{ reset()
	/**
	 * Clears the options for the current widget.
	 *
	 * @return	{null}
	 */
	reset: function() {
		this.init();
	},
	// }}}
	// {{{ show()
	/**
	 * Determines where the box should go, and then makes it appear.
	 *
	 * @param	{string}	message			the message to show.
	 * @return	{null}
	 */
	show: function(message) {
		this._populate(message);

		// set shadow size
		var dim = this._getDimensions();
		Element.setStyle(this._dom.findShadow(this.container),
				{
					width:	dim.width + 'px',
					height:	dim.height + 'px'
				});

		// set the position of the box
		var pos = this._getPosition();
		Element.setStyle(this.container,
				{
					left:	pos.left + 'px',
					top:	pos.top + 'px'
				});

		// save the transition object if it should be cancelled mid-effect
		this._transition = Effect.Appear(this.container,
				{
					duration:		this._options.transition_time,
					afterFinish:	function() { this._transition = null; }.bind(this)
				});

	},
	// }}}

// --event listeners--
	// {{{ evMouseOut()
	/**
	 * Closes the widget if the mouse leaves the container.
	 *
	 * @return	{null}
	 */
	evMouseOut: null,
	_evMouseOut: function(e) {
		this.close();
	}
	// }}}

});

/* vim: set tabstop=4 textwidth=100: */
};
$Bootstrap.applyCss("");
$Bootstrap.reportLoaded("widgets", "QuickSummary");if ($Bootstrap.notLoaded('266cf3e7e0b628b078eb4b8883490fbb')) {
/* vim: set tabstop=4 textwidth=120: */
/**
 * @fileoverview
 * js/Webmail/Widgets/Picker.js
 *
 * This widget is a base picker object.  A picker is basically an input element with an image that
 * will trigger some sort of picker object to help the user enter a value into the input element.
 *
 * CHANGELOG
 *
 * @requires	Prototype
 * @requires	Framework
 * @requires	Global
 * @requires	Webmail.Widgets
 *
 * @author		Brian Hartsock
 *
 */


Framework.create('Webmail.Widgets.Picker', $Widgets.create({

	id:			null,
	options:	null,
	_picker:	null,
	prev_val:	null,
	prevent_close_click: false,
	prevent_close_blur:	false,

	//Quick DOM accessors
	dom_input:		null,
	dom_image:		null,

	// Public functions
	// {{{ clearPicker()
	/*
	 * Close the picker.
	 *
	 */
	clearPicker: function(){

		if(this._picker){
			Element.remove(this._picker);
			this._picker = null;
		}

		//Stop observing document clicks
		Event.stopObserving(document.body, 'click', this.evDocumentClick);
	
		this.prevent_close_click = false;
		this.prevent_close_blur = false;
	},

	// }}}
	// {{{ disable()
	/*
	 * Disables the widget form elements other than the checkbox.
	 *
	 */
	disable: function(){
		this.dom_input.disabled = true;
	},
	
	// }}}
	// {{{ enable()
	/*
	 * Enables the widget form elements other than the checkbox.
	 *
	 */
	enable: function(){
		this.dom_input.disabled = false;
	},

	// }}}
	// {{{ reset()
	/*
	 * Reset the reminder widget.
	 *
	 */
	reset: function(){
		this.dom_input.name = '';
	},

	// }}}
	// {{{ set()
	/*
	 * Set the input value.  Option to format.  Always use this so we can fire the onchange event.
	 *
	 */
	set: function(value, do_not_format){
		var value = (do_not_format ? value : this._getFormattedValue(value));

		//IF new value is different
		if(this.dom_input.value != value){
			this.dom_input.value = value;
		}

		this.options.onchange(value);
	},

	// }}}

	// Private functions
	// {{{ _getFormattedValue()
	/*
	 * Formats the input value.  To be overridden if the input values need formatted, this does 
	 * nothing currently
	 *
	 * @param	{string}	value	Value to be formatted
	 * @return	{string}	Formatted value
	 */
	_getFormattedValue: function(value){
		return value;
	},

	// }}}

	// Event handlers
	// {{{ evBlurInput()
	/*
	 * Event handler for blurring from input. Used to format the value when entered by hand.
	 *
	 * @param	{event}	e	Event fired
	 */
	evBlurInput: null,
	_evBlurInput: function(e){
		this.set(this.dom_input.value);
		if (!this.prevent_close_blur) {
			this.clearPicker();
		} else {
			// blur should not close the picker (clicking on the image or picker dropdown)
			this.prevent_close_blur = false;
		}
	},

	// }}}
	// {{{ evDocumentClick()
	/*
	 * Handles the document click event.
	 *
	 */
	evDocumentClick: null,
	_evDocumentClick: function(){
		if (!this.prevent_close_click) {
			this.clearPicker();
		} else {
			// click should not close the picker (clicking on the image, input field, or picker
			// dropdown)
			this.prevent_close_click = false;
		}
	},

	// }}}
	// {{{ evMousedownImage()
	/**
	 * Called when clicking on the image associated with the picker.
	 * @param	{event}		e
	 */
	evMousedownImage: null,
	_evMousedownImage: function(e) {
		// prevent the evBlurInput function from closing the picker automatically
		this.prevent_close_blur = true;
	},
	// }}}
	// {{{ evMousedownInput()
	/**
	 * Called when clicking on the input box associated with the picker.
	 * @param	{event}		e
	 */
	evMousedownInput: null,
	_evMousedownInput: function(e) {
		// prevent the evDocumentClick function from closing the picker automatically
		this.prevent_close_click = true;
	},
	// }}}
	// {{{ evPreventClose()
	/**
	 * Event handler to prevent an automatic close when clicking on a picker.
	 * @param	{event}		e
	 */
	evPreventClose: null,
	_evPreventClose: function(e) {
	/* When clicking on a picker, three things happen in order - mousedown on the picker, blur on
	 * the input, and click on the document.  The last two automatically try to close the picker,
	 * which we want -only- if they are not clicking on the picker.  If they are, this function is
	 * called, where we set flags to prevent both from closing the picker.
	 */
		// prevent evDocumentClick from closing the picker
		this.prevent_close_click = true;
		// prevent evBlurInput from closing the picker
		this.prevent_close_blur = true;
	},
	// }}}
	// {{{ evShowPicker()
	/*
	 * Event handler called whenever the picker is requested to be shown.
	 *
	 * @param   event   e   Event that was fired (browser specific)
	 */
	evShowPicker: null,
	_evShowPicker : function(e)
	{
		Event.stop(e);

		// If there is a current picker, clear it
		if ($Widgets.Picker._current_picker) {
			$Widgets.Picker._current_picker.clearPicker();
		}

		//IF the picker is already shown, clear it
		if(this._picker){
			this.clearPicker();

		//ELSE the picker isn't being shown, hide it
		}else{
			$Widgets.Picker._current_picker = this;
			this._showPicker();
		}
	}

	// }}}
}));

$Widgets.Picker._current_picker = null;
};
$Bootstrap.applyCss("");
$Bootstrap.reportLoaded("widgets", "Picker");if ($Bootstrap.notLoaded('bd9200894b5f7cc653fa4621bbe6af79')) {
/* vim: set tabstop=4 textwidth=120: */
/**
 * @fileoverview
 * js/Webmail/Widgets/TimePicker.js
 *
 * This is a widget for the time picker object which consists of an input and image.  If the image
 * is clicked a select will show up
 *
 * CHANGELOG
 *
 * @requires	Prototype
 * @requires	Framework
 * @requires	Global
 * @requires	Webmail.Widgets
 *
 * @author		Brian Hartsock
 *
 */


Framework.create('Webmail.Widgets.TimePicker', $Widgets.create({

	// {{{ initialize()
	/*
	 * Constructor.
	 */
	initialize: function(tabIndex) {
		Object.bindObservers(this);

		this.id = $Widgets.TimePicker._id++;
		this.draw(tabIndex);
	},
	// }}}

	// Public functions
	// {{{ draw()
	/*
	 * Draw the widget.
	 *
	 */
	draw: function(tabIndex) {

		var container = Element.createHtml([
			'<span>',
				'<input class="text time" type="text" ',
					'tabindex="'+tabIndex+'" ',
					'id="timepicker_'+this.id+'"/>',
				'<img class="timepicker" field="timepicker_'+this.id+'" ',
					'src="images/blank.gif" />',
			'</span>'].join(''));

		this.dom_input = $(container.firstChild);
		this.dom_image = $(container.lastChild);

		//Event handling
		this.dom_image.observe('click', this.evShowPicker);
		this.dom_image.observe('mousedown', this.evMousedownImage);
		this.dom_input.observe('mousedown', this.evMousedownInput);
		this.dom_input.observe('focus', this.evShowPicker);
		this.dom_input.observe('blur', 	this.evBlurInput);
		Element.observe(document.body, 'click', this.evDocumentClick);

		this.container = container;
	},
	// }}}
	// {{{ format()
	/*
	 * Forces formatting on the time picker widget
	 */
	format: function() {
		this.dom_input.value = this._getFormattedValue(this.dom_input.value);
	},
	// }}}
	// {{{ getValue()
	/**
	 * Returns the raw value from the text input
	 * @return	{String}
	 */
	getValue: function() {
		var value = this.dom_input.value;
		return value;
	},
	
	// }}}
	// {{{ populate()
	/*
	 * Populate the reminder widget.
	 *
	 * @param	{object}	options		Optional options object
	 */
	populate: function( options){

		//Set options
		this.options = Object.extend(
			{
				time:		null,
				form_name: 	null,
				onchange:	Prototype.emptyFunction
			}, options || {});

		if(this.options.time){
			this.dom_input.value = this.options.time;
		}

		if(this.options.form_name){
			this.dom_input.name = this.options.form_name;
		}
	},
	// }}}
	// {{{ setValue()
	/**
	 * Sets the raw value of the input field
	 * @param	{String}	time	Time to fill in
	 */
	setValue: function(time) {
		this.dom_input.value = time;
	},
	
	// }}}
	
	//Private functions
	// {{{ _drawPicker()
	/*
	 * Draws the time picker for the input field.
	 *
	 */
	_drawPicker : function()
	{
		var field = this.dom_input;

		// Create timepicker
		var time_picker				= new TimePicker;
		time_picker.time			= field.value;
		time_picker.callback		= this.evSetTimePicker;
		time_picker.mousedown_callback = this.evPreventClose;

		if ($Settings.getHourFormat() == wm_Settings_HOUR_24) {
			time_picker.use_24_hour = true;
		}
		
		// Render timepicker and settings
		var container 		= time_picker.render();
		container.field		= field.id;
		container.size		= '7';

		//Find and set position of datepicker
		var dim = Element.getDimensions(field);
		var pos = Position.positionedOffset(field);

		Element.setStyle(container,
						{
						position:	"absolute",

						left:		pos[0] + 'px',
						top:		(pos[1] + dim.height) + 'px',
						width:		(dim.width + 20) + 'px',

						zIndex:		'5000'
						});

		return container;
	},
	// }}}
	// {{{ _getFormattedValue()
	/**
	 * Attempt to format the time value.
	 * @param	{string}	time	Time to format
	 * @return	{string}	Formatted time string
	 */
	_getFormattedValue: function(time){
		var time_obj	= null;
		// Check AM/PM from previous input. If user does not
		// specify AM/PM (typed in), then use the previous AM/PM
		// value. This is only done with 12-hour format.
		if ($Settings.getHourFormat() == wm_Settings_HOUR_12 &&
			this.prev_val && !time.match(/(am|AM|pm|PM)/) &&
			newTime(this.prev_val).getHours() > 12) {
				time_obj = $DateTime.create(null, time + ' pm');
		} else {
			time_obj = $DateTime.create(null, time);
		}

		if (time_obj.isValid()) {
			var display	= time_obj.basicTime();
		} else {
			var display = '';
		}
		return display;
	},

	// }}}
	// {{{ _showPicker()
	/*
	 * Displays the time picker for the input field.
	 *
	 */
	_showPicker : function()
	{
		// Create picker (if not already created)
		this._picker = this._drawPicker();
		this.container.append(this._picker);

		// This is needed to make Safari scroll down to the selected index.
		// There was a problem with selecting before it was added to the DOM.
		if (wack.Browser.is_safari) {
			this._picker.selectedIndex = this._picker.selectedIndex;
		}

		//Setup body event handling
		Element.observe(document.body, 'click', this.evDocumentClick);
	},
	// }}}

	//Event handlers
	// {{{ evSetTimePicker()
	/*
	 * Event handler called whenever a date is picked from the date picker. This is form independent and requires a unique ID field.
	 *
	 * @param   event   e   Event that was fired (browser specific)
	 *
	 */
	evSetTimePicker: null,
	_evSetTimePicker: function(e)
	{
		Event.stop(e);
		
		//Grab link
		var select	= Event.findElement(e, 'select');
		var time 	= $F(select)

		//Set value of input to datepicker
		this.set(time, true);
	
		//remove date picker
		this.clearPicker();
	}
	// }}}

}, $Widgets.Picker));

Webmail.Widgets.TimePicker._id = 0;
};
$Bootstrap.applyCss("");
$Bootstrap.reportLoaded("widgets", "TimePicker");if ($Bootstrap.notLoaded('1a7c856f4481e3ca88888cb631399b23')) {
// vim:ts=4:tw=100:fdm=marker:
/**
 * Widget for displaying a feature bubble
 */

wack.depends('Webmail.Widgets.UI');

$Widgets.UI.FeatureBubble = $Widgets.create({
	/**
	 * Value representing which bubble this is
	 */
	_bubble_value: null,

	// {{{ initialize()
	/**
	 * Standard constructor
	 */
	initialize: function() {
		Object.bindCallbacks(this);
		Object.bindObservers(this);

		this.container = this._draw();
	},

	// }}}
	// {{{ close()
	/**
	 * Closes the bubble
	 */
	close: function() {
		wack.Element.remove(this.container);

		if (this._bubble_value) {
			$FeatureBubble.disableBubble(this._bubble_value);
		}
	},

	// }}}
	// {{{ populate()
	/**
	 * Populates data for the bubble
	 * @param	{Object}	data
	 */
	populate: function(data) {
		var dom = this.container.dom;

		dom('title').innerHTML = data.title || '';
		dom('desc').innerHTML = data.desc || '';

		this._bubble_value = data.bubble;
	},

	// }}}

	// {{{ _draw()
	/**
	 * Creates the bubble container
	 * @return	{Element}
	 */
	_draw: function() {
		var container = Element.createHtml('<div class="Widgets_UI_FeatureBubble"><div class="root"><div class="shadow" _ref="shadow"></div><div class="content"><div class="text" _ref="text"><div class="header" _ref="title"></div><div class="desc" _ref="desc"></div></div><div _ref="close_icon" class="close_icon"></div></div><div class="pointer"></div></div></div>');
		$Templates.setDom(container);

		// Add shadow
		var shadow = $UI.Alpha.newLayer('#000', 40);
		container.dom('shadow').appendChild(shadow);
		shadow.style.width = '100%';
		shadow.style.height = '100%';

		Event.observe(container.dom('close_icon'), 'click', this.evClickClose);

		return container;
	},

	// }}}
	
	// {{{ evClickClose()
	evClickClose: null,
	_evClickClose: function(e) {
		this.close();
	}

	// }}}
});
};
$Bootstrap.applyCss("div.Widgets_UI_FeatureBubble{width:215px;}div.Widgets_UI_FeatureBubble .root{position:relative;}div.Widgets_UI_FeatureBubble .shadow{position:absolute;top:5px;width:100%;height:100%;margin:2px 0 0 2px;}div.Widgets_UI_FeatureBubble .content{border:1px solid #F6BE69;background:#FFF url("+wcv__image_url+"feat_bubble\/bg-gradient.png) repeat-x;padding:7px 22px 7px 10px;position:relative;top:5px;}div.Widgets_UI_FeatureBubble .content .text .header{color:#C60;font-size:12px;font-weight:bold;}div.Widgets_UI_FeatureBubble .content .text .desc{color:#000;font-size:11px;padding:2px 0 0 0;}div.Widgets_UI_FeatureBubble .content .close_icon{position:absolute;background:url("+wcv__image_url+"feat_bubble\/close.gif) no-repeat;cursor:pointer;height:11px;right:5px;top:5px;width:12px;}div.Widgets_UI_FeatureBubble .pointer{position:absolute;background:url("+wcv__image_url+"feat_bubble\/pointer.gif) no-repeat;height:7px;width:11px;right:30px;top:0;}");
$Bootstrap.reportLoaded("widgets", "UI_FeatureBubble");
$Bootstrap.reportLoaded("combo", "webmail");