/***

    (c) 1999 - 2009 StatCounter.  All rights Reserved.

    THIS FILE IS AUTOMATICALLY GENERATED.

    Contains MochiKit:

    (c) 2005 Bob Ippolito.  All rights Reserved.

***/

if(typeof (MochiKit)=="undefined"){
MochiKit={};
}
if(typeof (MochiKit.__export__)=="undefined"){
MochiKit.__export__=true;
}
if(typeof (MochiKit.Base)=="undefined"){
MochiKit.Base={};
}
MochiKit.Base._module=function(_1,_2,_3){
if(!(_1 in MochiKit)){
MochiKit[_1]={};
}
var _4=MochiKit[_1];
_4.NAME="MochiKit."+_1;
_4.VERSION=_2;
_4.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
_4.toString=function(){
return this.__repr__();
};
for(var i=0;i<_3.length;i++){
if(!(_3[i] in MochiKit)){
throw "MochiKit."+_1+" depends on MochiKit."+_3[i]+"!";
}
}
};
MochiKit.Base._module("Base","1.5",[]);
MochiKit.Base.update=function(_6,_7){
if(_6===null||_6===undefined){
_6={};
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
if(typeof (o)!="undefined"&&o!==null){
for(var k in o){
_6[k]=o[k];
}
}
}
return _6;
};
MochiKit.Base.update(MochiKit.Base,{camelize:function(_b){
var _c=_b.split("-");
var cc=_c[0];
for(var i=1;i<_c.length;i++){
cc+=_c[i].charAt(0).toUpperCase()+_c[i].substring(1);
}
return cc;
},counter:function(n){
if(arguments.length===0){
n=1;
}
return function(){
return n++;
};
},clone:function(obj){
var me=arguments.callee;
if(arguments.length==1){
me.prototype=obj;
return new me();
}
},_flattenArray:function(res,lst){
for(var i=0;i<lst.length;i++){
var o=lst[i];
if(o instanceof Array){
arguments.callee(res,o);
}else{
res.push(o);
}
}
return res;
},flattenArray:function(lst){
return MochiKit.Base._flattenArray([],lst);
},flattenArguments:function(lst){
var res=[];
var m=MochiKit.Base;
var _1a=m.extend(null,arguments);
while(_1a.length){
var o=_1a.shift();
if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
for(var i=o.length-1;i>=0;i--){
_1a.unshift(o[i]);
}
}else{
res.push(o);
}
}
return res;
},extend:function(_1d,obj,_1f){
if(!_1f){
_1f=0;
}
if(obj){
var l=obj.length;
if(typeof (l)!="number"){
if(typeof (MochiKit.Iter)!="undefined"){
obj=MochiKit.Iter.list(obj);
l=obj.length;
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(!_1d){
_1d=[];
}
for(var i=_1f;i<l;i++){
_1d.push(obj[i]);
}
}
return _1d;
},updatetree:function(_22,obj){
if(_22===null||_22===undefined){
_22={};
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
if(typeof (o)!="undefined"&&o!==null){
for(var k in o){
var v=o[k];
if(typeof (_22[k])=="object"&&typeof (v)=="object"){
arguments.callee(_22[k],v);
}else{
_22[k]=v;
}
}
}
}
return _22;
},setdefault:function(_28,obj){
if(_28===null||_28===undefined){
_28={};
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
for(var k in o){
if(!(k in _28)){
_28[k]=o[k];
}
}
}
return _28;
},keys:function(obj){
var _2e=[];
for(var _2f in obj){
_2e.push(_2f);
}
return _2e;
},values:function(obj){
var _31=[];
for(var _32 in obj){
_31.push(obj[_32]);
}
return _31;
},items:function(obj){
var _34=[];
var e;
for(var _36 in obj){
var v;
try{
v=obj[_36];
}
catch(e){
continue;
}
_34.push([_36,v]);
}
return _34;
},_newNamedError:function(_38,_39,_3a){
_3a.prototype=new MochiKit.Base.NamedError(_38.NAME+"."+_39);
_38[_39]=_3a;
},operator:{truth:function(a){
return !!a;
},lognot:function(a){
return !a;
},identity:function(a){
return a;
},not:function(a){
return ~a;
},neg:function(a){
return -a;
},add:function(a,b){
return a+b;
},sub:function(a,b){
return a-b;
},div:function(a,b){
return a/b;
},mod:function(a,b){
return a%b;
},mul:function(a,b){
return a*b;
},and:function(a,b){
return a&b;
},or:function(a,b){
return a|b;
},xor:function(a,b){
return a^b;
},lshift:function(a,b){
return a<<b;
},rshift:function(a,b){
return a>>b;
},zrshift:function(a,b){
return a>>>b;
},eq:function(a,b){
return a==b;
},ne:function(a,b){
return a!=b;
},gt:function(a,b){
return a>b;
},ge:function(a,b){
return a>=b;
},lt:function(a,b){
return a<b;
},le:function(a,b){
return a<=b;
},seq:function(a,b){
return a===b;
},sne:function(a,b){
return a!==b;
},ceq:function(a,b){
return MochiKit.Base.compare(a,b)===0;
},cne:function(a,b){
return MochiKit.Base.compare(a,b)!==0;
},cgt:function(a,b){
return MochiKit.Base.compare(a,b)==1;
},cge:function(a,b){
return MochiKit.Base.compare(a,b)!=-1;
},clt:function(a,b){
return MochiKit.Base.compare(a,b)==-1;
},cle:function(a,b){
return MochiKit.Base.compare(a,b)!=1;
},logand:function(a,b){
return a&&b;
},logor:function(a,b){
return a||b;
},contains:function(a,b){
return b in a;
}},forwardCall:function(_78){
return function(){
return this[_78].apply(this,arguments);
};
},itemgetter:function(_79){
return function(arg){
return arg[_79];
};
},bool:function(_7b){
if(typeof (_7b)==="boolean"||_7b instanceof Boolean){
return _7b.valueOf();
}else{
if(typeof (_7b)==="string"||_7b instanceof String){
return _7b.length>0&&_7b!="false"&&_7b!="null"&&_7b!="undefined"&&_7b!="0";
}else{
if(typeof (_7b)==="number"||_7b instanceof Number){
return !isNaN(_7b)&&_7b!=0;
}else{
if(_7b!=null&&typeof (_7b.length)==="number"){
return _7b.length!==0;
}else{
return _7b!=null;
}
}
}
}
},typeMatcher:function(){
var _7c={};
for(var i=0;i<arguments.length;i++){
var typ=arguments[i];
_7c[typ]=typ;
}
return function(){
for(var i=0;i<arguments.length;i++){
if(!(typeof (arguments[i]) in _7c)){
return false;
}
}
return true;
};
},isNull:function(){
for(var i=0;i<arguments.length;i++){
if(arguments[i]!==null){
return false;
}
}
return true;
},isUndefinedOrNull:function(){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
if(!(typeof (o)=="undefined"||o===null)){
return false;
}
}
return true;
},isEmpty:function(obj){
return !MochiKit.Base.isNotEmpty.apply(this,arguments);
},isNotEmpty:function(obj){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
if(!(o&&o.length)){
return false;
}
}
return true;
},isArrayLike:function(){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
var typ=typeof (o);
if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"||o.nodeType===3||o.nodeType===4){
return false;
}
}
return true;
},isDateLike:function(){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
if(typeof (o)!="object"||o===null||typeof (o.getTime)!="function"){
return false;
}
}
return true;
},xmap:function(fn){
if(fn===null){
return MochiKit.Base.extend(null,arguments,1);
}
var _8d=[];
for(var i=1;i<arguments.length;i++){
_8d.push(fn(arguments[i]));
}
return _8d;
},map:function(fn,lst){
var m=MochiKit.Base;
var itr=MochiKit.Iter;
var _93=m.isArrayLike;
if(arguments.length<=2){
if(!_93(lst)){
if(itr){
lst=itr.list(lst);
if(fn===null){
return lst;
}
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(fn===null){
return m.extend(null,lst);
}
var _94=[];
for(var i=0;i<lst.length;i++){
_94.push(fn(lst[i]));
}
return _94;
}else{
if(fn===null){
fn=Array;
}
var _96=null;
for(var i=1;i<arguments.length;i++){
if(!_93(arguments[i])){
if(itr){
return itr.list(itr.imap.apply(null,arguments));
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
var l=arguments[i].length;
if(_96===null||_96>l){
_96=l;
}
}
_94=[];
for(var i=0;i<_96;i++){
var _98=[];
for(var j=1;j<arguments.length;j++){
_98.push(arguments[j][i]);
}
_94.push(fn.apply(this,_98));
}
return _94;
}
},xfilter:function(fn){
var _9b=[];
if(fn===null){
fn=MochiKit.Base.operator.truth;
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
if(fn(o)){
_9b.push(o);
}
}
return _9b;
},filter:function(fn,lst,_a0){
var _a1=[];
var m=MochiKit.Base;
if(!m.isArrayLike(lst)){
if(MochiKit.Iter){
lst=MochiKit.Iter.list(lst);
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(fn===null){
fn=m.operator.truth;
}
if(typeof (Array.prototype.filter)=="function"){
return Array.prototype.filter.call(lst,fn,_a0);
}else{
if(typeof (_a0)=="undefined"||_a0===null){
for(var i=0;i<lst.length;i++){
var o=lst[i];
if(fn(o)){
_a1.push(o);
}
}
}else{
for(var i=0;i<lst.length;i++){
o=lst[i];
if(fn.call(_a0,o)){
_a1.push(o);
}
}
}
}
return _a1;
},_wrapDumbFunction:function(_a5){
return function(){
switch(arguments.length){
case 0:
return _a5();
case 1:
return _a5(arguments[0]);
case 2:
return _a5(arguments[0],arguments[1]);
case 3:
return _a5(arguments[0],arguments[1],arguments[2]);
}
var _a6=[];
for(var i=0;i<arguments.length;i++){
_a6.push("arguments["+i+"]");
}
return eval("(func("+_a6.join(",")+"))");
};
},methodcaller:function(_a8){
var _a9=MochiKit.Base.extend(null,arguments,1);
if(typeof (_a8)=="function"){
return function(obj){
return _a8.apply(obj,_a9);
};
}else{
return function(obj){
return obj[_a8].apply(obj,_a9);
};
}
},method:function(_ac,_ad){
var m=MochiKit.Base;
return m.bind.apply(this,m.extend([_ad,_ac],arguments,2));
},compose:function(f1,f2){
var _b1=[];
var m=MochiKit.Base;
if(arguments.length===0){
throw new TypeError("compose() requires at least one argument");
}
for(var i=0;i<arguments.length;i++){
var fn=arguments[i];
if(typeof (fn)!="function"){
throw new TypeError(m.repr(fn)+" is not a function");
}
_b1.push(fn);
}
return function(){
var _b5=arguments;
for(var i=_b1.length-1;i>=0;i--){
_b5=[_b1[i].apply(this,_b5)];
}
return _b5[0];
};
},bind:function(_b7,_b8){
if(typeof (_b7)=="string"){
_b7=_b8[_b7];
}
var _b9=_b7.im_func;
var _ba=_b7.im_preargs;
var _bb=_b7.im_self;
var m=MochiKit.Base;
if(typeof (_b7)=="function"&&typeof (_b7.apply)=="undefined"){
_b7=m._wrapDumbFunction(_b7);
}
if(typeof (_b9)!="function"){
_b9=_b7;
}
if(typeof (_b8)!="undefined"){
_bb=_b8;
}
if(typeof (_ba)=="undefined"){
_ba=[];
}else{
_ba=_ba.slice();
}
m.extend(_ba,arguments,2);
var _bd=function(){
var _be=arguments;
var me=arguments.callee;
if(me.im_preargs.length>0){
_be=m.concat(me.im_preargs,_be);
}
var _c0=me.im_self;
if(!_c0){
_c0=this;
}
return me.im_func.apply(_c0,_be);
};
_bd.im_self=_bb;
_bd.im_func=_b9;
_bd.im_preargs=_ba;
return _bd;
},bindLate:function(_c1,_c2){
var m=MochiKit.Base;
var _c4=arguments;
if(typeof (_c1)==="string"){
_c4=m.extend([m.forwardCall(_c1)],arguments,1);
return m.bind.apply(this,_c4);
}
return m.bind.apply(this,_c4);
},bindMethods:function(_c5){
var _c6=MochiKit.Base.bind;
for(var k in _c5){
var _c8=_c5[k];
if(typeof (_c8)=="function"){
_c5[k]=_c6(_c8,_c5);
}
}
},registerComparator:function(_c9,_ca,_cb,_cc){
MochiKit.Base.comparatorRegistry.register(_c9,_ca,_cb,_cc);
},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){
if(a==b){
return 0;
}
var _cf=(typeof (a)=="undefined"||a===null);
var _d0=(typeof (b)=="undefined"||b===null);
if(_cf&&_d0){
return 0;
}else{
if(_cf){
return -1;
}else{
if(_d0){
return 1;
}
}
}
var m=MochiKit.Base;
var _d2=m._primitives;
if(!(typeof (a) in _d2&&typeof (b) in _d2)){
try{
return m.comparatorRegistry.match(a,b);
}
catch(e){
if(e!=m.NotFound){
throw e;
}
}
}
if(a<b){
return -1;
}else{
if(a>b){
return 1;
}
}
var _d3=m.repr;
throw new TypeError(_d3(a)+" and "+_d3(b)+" can not be compared");
},compareDateLike:function(a,b){
return MochiKit.Base.compare(a.getTime(),b.getTime());
},compareArrayLike:function(a,b){
var _d8=MochiKit.Base.compare;
var _d9=a.length;
var _da=0;
if(_d9>b.length){
_da=1;
_d9=b.length;
}else{
if(_d9<b.length){
_da=-1;
}
}
for(var i=0;i<_d9;i++){
var cmp=_d8(a[i],b[i]);
if(cmp){
return cmp;
}
}
return _da;
},registerRepr:function(_dd,_de,_df,_e0){
MochiKit.Base.reprRegistry.register(_dd,_de,_df,_e0);
},repr:function(o){
if(typeof (o)=="undefined"){
return "undefined";
}else{
if(o===null){
return "null";
}
}
try{
if(typeof (o.__repr__)=="function"){
return o.__repr__();
}else{
if(typeof (o.repr)=="function"&&o.repr!=arguments.callee){
return o.repr();
}
}
return MochiKit.Base.reprRegistry.match(o);
}
catch(e){
if(typeof (o.NAME)=="string"&&(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
return o.NAME;
}
}
try{
var _e2=(o+"");
}
catch(e){
return "["+typeof (o)+"]";
}
if(typeof (o)=="function"){
_e2=_e2.replace(/^\s+/,"").replace(/\s+/g," ");
_e2=_e2.replace(/,(\S)/,", $1");
var idx=_e2.indexOf("{");
if(idx!=-1){
_e2=_e2.substr(0,idx)+"{...}";
}
}
return _e2;
},reprArrayLike:function(o){
var m=MochiKit.Base;
return "["+m.map(m.repr,o).join(", ")+"]";
},reprString:function(o){
return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\v]/g,"\\v").replace(/[\r]/g,"\\r");
},reprNumber:function(o){
return o+"";
},registerJSON:function(_e8,_e9,_ea,_eb){
MochiKit.Base.jsonRegistry.register(_e8,_e9,_ea,_eb);
},evalJSON:function(){
return eval("("+MochiKit.Base._filterJSON(arguments[0])+")");
},_filterJSON:function(s){
var m=s.match(/^\s*\/\*(.*)\*\/\s*$/);
if(m){
return m[1];
}
return s;
},serializeJSON:function(o){
var _ef=typeof (o);
if(_ef=="number"||_ef=="boolean"){
return o+"";
}else{
if(o===null){
return "null";
}else{
if(_ef=="string"){
var res="";
for(var i=0;i<o.length;i++){
var c=o.charAt(i);
if(c=="\""){
res+="\\\"";
}else{
if(c=="\\"){
res+="\\\\";
}else{
if(c=="\b"){
res+="\\b";
}else{
if(c=="\f"){
res+="\\f";
}else{
if(c=="\n"){
res+="\\n";
}else{
if(c=="\r"){
res+="\\r";
}else{
if(c=="\t"){
res+="\\t";
}else{
if(o.charCodeAt(i)<=31){
var hex=o.charCodeAt(i).toString(16);
if(hex.length<2){
hex="0"+hex;
}
res+="\\u00"+hex.toUpperCase();
}else{
res+=c;
}
}
}
}
}
}
}
}
}
return "\""+res+"\"";
}
}
}
var me=arguments.callee;
var _f5;
if(typeof (o.__json__)=="function"){
_f5=o.__json__();
if(o!==_f5){
return me(_f5);
}
}
if(typeof (o.json)=="function"){
_f5=o.json();
if(o!==_f5){
return me(_f5);
}
}
if(_ef!="function"&&typeof (o.length)=="number"){
var res=[];
for(var i=0;i<o.length;i++){
var val=me(o[i]);
if(typeof (val)!="string"){
continue;
}
res.push(val);
}
return "["+res.join(", ")+"]";
}
var m=MochiKit.Base;
try{
_f5=m.jsonRegistry.match(o);
if(o!==_f5){
return me(_f5);
}
}
catch(e){
if(e!=m.NotFound){
throw e;
}
}
if(_ef=="undefined"){
throw new TypeError("undefined can not be serialized as JSON");
}
if(_ef=="function"){
return null;
}
res=[];
for(var k in o){
var _f9;
if(typeof (k)=="number"){
_f9="\""+k+"\"";
}else{
if(typeof (k)=="string"){
_f9=me(k);
}else{
continue;
}
}
val=me(o[k]);
if(typeof (val)!="string"){
continue;
}
res.push(_f9+":"+val);
}
return "{"+res.join(", ")+"}";
},objEqual:function(a,b){
return (MochiKit.Base.compare(a,b)===0);
},arrayEqual:function(_fc,arr){
if(_fc.length!=arr.length){
return false;
}
return (MochiKit.Base.compare(_fc,arr)===0);
},concat:function(){
var _fe=[];
var _ff=MochiKit.Base.extend;
for(var i=0;i<arguments.length;i++){
_ff(_fe,arguments[i]);
}
return _fe;
},keyComparator:function(key){
var m=MochiKit.Base;
var _103=m.compare;
if(arguments.length==1){
return function(a,b){
return _103(a[key],b[key]);
};
}
var _106=m.extend(null,arguments);
return function(a,b){
var rval=0;
for(var i=0;(rval===0)&&(i<_106.length);i++){
var key=_106[i];
rval=_103(a[key],b[key]);
}
return rval;
};
},reverseKeyComparator:function(key){
var _10d=MochiKit.Base.keyComparator.apply(this,arguments);
return function(a,b){
return _10d(b,a);
};
},partial:function(func){
var m=MochiKit.Base;
return m.bind.apply(this,m.extend([func,undefined],arguments,1));
},listMinMax:function(_112,lst){
if(lst.length===0){
return null;
}
var cur=lst[0];
var _115=MochiKit.Base.compare;
for(var i=1;i<lst.length;i++){
var o=lst[i];
if(_115(o,cur)==_112){
cur=o;
}
}
return cur;
},objMax:function(){
return MochiKit.Base.listMinMax(1,arguments);
},objMin:function(){
return MochiKit.Base.listMinMax(-1,arguments);
},findIdentical:function(lst,_119,_11a,end){
if(typeof (end)=="undefined"||end===null){
end=lst.length;
}
if(typeof (_11a)=="undefined"||_11a===null){
_11a=0;
}
for(var i=_11a;i<end;i++){
if(lst[i]===_119){
return i;
}
}
return -1;
},mean:function(){
var sum=0;
var m=MochiKit.Base;
var args=m.extend(null,arguments);
var _120=args.length;
while(args.length){
var o=args.shift();
if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
_120+=o.length-1;
for(var i=o.length-1;i>=0;i--){
sum+=o[i];
}
}else{
sum+=o;
}
}
if(_120<=0){
throw new TypeError("mean() requires at least one argument");
}
return sum/_120;
},median:function(){
var data=MochiKit.Base.flattenArguments(arguments);
if(data.length===0){
throw new TypeError("median() requires at least one argument");
}
data.sort(compare);
if(data.length%2==0){
var _124=data.length/2;
return (data[_124]+data[_124-1])/2;
}else{
return data[(data.length-1)/2];
}
},findValue:function(lst,_126,_127,end){
if(typeof (end)=="undefined"||end===null){
end=lst.length;
}
if(typeof (_127)=="undefined"||_127===null){
_127=0;
}
var cmp=MochiKit.Base.compare;
for(var i=_127;i<end;i++){
if(cmp(lst[i],_126)===0){
return i;
}
}
return -1;
},nodeWalk:function(node,_12c){
var _12d=[node];
var _12e=MochiKit.Base.extend;
while(_12d.length){
var res=_12c(_12d.shift());
if(res){
_12e(_12d,res);
}
}
},nameFunctions:function(_130){
var base=_130.NAME;
if(typeof (base)=="undefined"){
base="";
}else{
base=base+".";
}
for(var name in _130){
var o=_130[name];
if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
try{
o.NAME=base+name;
}
catch(e){
}
}
}
},queryString:function(_134,_135){
if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_134)=="string"||(typeof (_134.nodeType)!="undefined"&&_134.nodeType>0))){
var kv=MochiKit.DOM.formContents(_134);
_134=kv[0];
_135=kv[1];
}else{
if(arguments.length==1){
if(typeof (_134.length)=="number"&&_134.length==2){
return arguments.callee(_134[0],_134[1]);
}
var o=_134;
_134=[];
_135=[];
for(var k in o){
var v=o[k];
if(typeof (v)=="function"){
continue;
}else{
if(MochiKit.Base.isArrayLike(v)){
for(var i=0;i<v.length;i++){
_134.push(k);
_135.push(v[i]);
}
}else{
_134.push(k);
_135.push(v);
}
}
}
}
}
var rval=[];
var len=Math.min(_134.length,_135.length);
var _13d=MochiKit.Base.urlEncode;
for(var i=0;i<len;i++){
v=_135[i];
if(typeof (v)!="undefined"&&v!==null){
rval.push(_13d(_134[i])+"="+_13d(v));
}
}
return rval.join("&");
},parseQueryString:function(_13e,_13f){
var qstr=(_13e.charAt(0)=="?")?_13e.substring(1):_13e;
var _141=qstr.replace(/\+/g,"%20").split(/\&amp\;|\&\#38\;|\&#x26;|\&/);
var o={};
var _143;
if(typeof (decodeURIComponent)!="undefined"){
_143=decodeURIComponent;
}else{
_143=unescape;
}
if(_13f){
for(var i=0;i<_141.length;i++){
var pair=_141[i].split("=");
var name=_143(pair.shift());
if(!name){
continue;
}
var arr=o[name];
if(!(arr instanceof Array)){
arr=[];
o[name]=arr;
}
arr.push(_143(pair.join("=")));
}
}else{
for(var i=0;i<_141.length;i++){
pair=_141[i].split("=");
var name=pair.shift();
if(!name){
continue;
}
o[_143(name)]=_143(pair.join("="));
}
}
return o;
}});
MochiKit.Base.AdapterRegistry=function(){
this.pairs=[];
};
MochiKit.Base.AdapterRegistry.prototype={register:function(name,_149,wrap,_14b){
if(_14b){
this.pairs.unshift([name,_149,wrap]);
}else{
this.pairs.push([name,_149,wrap]);
}
},match:function(){
for(var i=0;i<this.pairs.length;i++){
var pair=this.pairs[i];
if(pair[1].apply(this,arguments)){
return pair[2].apply(this,arguments);
}
}
throw MochiKit.Base.NotFound;
},unregister:function(name){
for(var i=0;i<this.pairs.length;i++){
var pair=this.pairs[i];
if(pair[0]==name){
this.pairs.splice(i,1);
return true;
}
}
return false;
}};
MochiKit.Base._exportSymbols=function(_151,_152){
if(MochiKit.__export__===false||_152.__export__===false){
return;
}
for(var k in _152){
var v=_152[k];
if(v!=null){
var _155=(k[0]!=="_"&&k!=="toString");
if(v.__export__===true||(v.__export__!==false&&_155)){
_151[k]=_152[k];
}
}
}
};
MochiKit.Base._deprecated=function(_156,name,_158,_159,_15a){
if(typeof (_156)==="string"){
if(_156.indexOf("MochiKit.")===0){
_156=_156.substring(9);
}
_156=MochiKit[_156];
}
var _15b=_158.split(".")[1];
var _15c=_158.split(".")[2];
var func=function(){
var self=arguments.callee;
var msg=_156.NAME+"."+name+" is deprecated since version "+_159+". Use "+_158+" instead.";
if(self.logged!==true){
self.logged=true;
if(MochiKit.Logging){
MochiKit.Logging.logDebug(msg);
}else{
if(console&&console.log){
console.log(msg);
}
}
}
if(!MochiKit[_15b]){
throw new Error(msg);
}
return MochiKit[_15b][_15c].apply(this,arguments);
};
func.__export__=(_15a===true);
_156[name]=func;
};
MochiKit.Base.__new__=function(){
var m=this;
m.noop=m.operator.identity;
m._deprecated(m,"forward","MochiKit.Base.forwardCall","1.3");
m._deprecated(m,"find","MochiKit.Base.findValue","1.3");
if(typeof (encodeURIComponent)!="undefined"){
m.urlEncode=function(_161){
return encodeURIComponent(_161).replace(/\'/g,"%27");
};
}else{
m.urlEncode=function(_162){
return escape(_162).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27");
};
}
m.NamedError=function(name){
this.message=name;
this.name=name;
};
m.NamedError.prototype=new Error();
m.update(m.NamedError.prototype,{repr:function(){
if(this.message&&this.message!=this.name){
return this.name+"("+m.repr(this.message)+")";
}else{
return this.name+"()";
}
},toString:m.forwardCall("repr")});
m.NotFound=new m.NamedError("MochiKit.Base.NotFound");
m.listMax=m.partial(m.listMinMax,1);
m.listMin=m.partial(m.listMinMax,-1);
m.isCallable=m.typeMatcher("function");
m.isUndefined=m.typeMatcher("undefined");
m.merge=m.partial(m.update,null);
m.zip=m.partial(m.map,null);
m.average=m.mean;
m.comparatorRegistry=new m.AdapterRegistry();
m.registerComparator("dateLike",m.isDateLike,m.compareDateLike);
m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike);
m.reprRegistry=new m.AdapterRegistry();
m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
m.registerRepr("string",m.typeMatcher("string"),m.reprString);
m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber);
m.jsonRegistry=new m.AdapterRegistry();
m.nameFunctions(this);
};
MochiKit.Base.__new__();
if(MochiKit.__export__){
compare=MochiKit.Base.compare;
compose=MochiKit.Base.compose;
serializeJSON=MochiKit.Base.serializeJSON;
mean=MochiKit.Base.mean;
median=MochiKit.Base.median;
}
MochiKit.Base._exportSymbols(this,MochiKit.Base);
MochiKit.Base._module("Iter","1.5",["Base"]);
MochiKit.Base.update(MochiKit.Iter,{registerIteratorFactory:function(name,_165,_166,_167){
MochiKit.Iter.iteratorRegistry.register(name,_165,_166,_167);
},isIterable:function(o){
return o!=null&&(typeof (o.next)=="function"||typeof (o.iter)=="function");
},iter:function(_169,_16a){
var self=MochiKit.Iter;
if(arguments.length==2){
return self.takewhile(function(a){
return a!=_16a;
},_169);
}
if(typeof (_169.next)=="function"){
return _169;
}else{
if(typeof (_169.iter)=="function"){
return _169.iter();
}
}
try{
return self.iteratorRegistry.match(_169);
}
catch(e){
var m=MochiKit.Base;
if(e==m.NotFound){
e=new TypeError(typeof (_169)+": "+m.repr(_169)+" is not iterable");
}
throw e;
}
},count:function(n){
if(!n){
n=0;
}
var m=MochiKit.Base;
return {repr:function(){
return "count("+n+")";
},toString:m.forwardCall("repr"),next:m.counter(n)};
},cycle:function(p){
var self=MochiKit.Iter;
var m=MochiKit.Base;
var lst=[];
var _174=self.iter(p);
return {repr:function(){
return "cycle(...)";
},toString:m.forwardCall("repr"),next:function(){
try{
var rval=_174.next();
lst.push(rval);
return rval;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
if(lst.length===0){
this.next=function(){
throw self.StopIteration;
};
}else{
var i=-1;
this.next=function(){
i=(i+1)%lst.length;
return lst[i];
};
}
return this.next();
}
}};
},repeat:function(elem,n){
var m=MochiKit.Base;
if(typeof (n)=="undefined"){
return {repr:function(){
return "repeat("+m.repr(elem)+")";
},toString:m.forwardCall("repr"),next:function(){
return elem;
}};
}
return {repr:function(){
return "repeat("+m.repr(elem)+", "+n+")";
},toString:m.forwardCall("repr"),next:function(){
if(n<=0){
throw MochiKit.Iter.StopIteration;
}
n-=1;
return elem;
}};
},next:function(_17a){
return _17a.next();
},izip:function(p,q){
var m=MochiKit.Base;
var self=MochiKit.Iter;
var next=self.next;
var _180=m.map(self.iter,arguments);
return {repr:function(){
return "izip(...)";
},toString:m.forwardCall("repr"),next:function(){
return m.map(next,_180);
}};
},ifilter:function(pred,seq){
var m=MochiKit.Base;
seq=MochiKit.Iter.iter(seq);
if(pred===null){
pred=m.operator.truth;
}
return {repr:function(){
return "ifilter(...)";
},toString:m.forwardCall("repr"),next:function(){
while(true){
var rval=seq.next();
if(pred(rval)){
return rval;
}
}
return undefined;
}};
},ifilterfalse:function(pred,seq){
var m=MochiKit.Base;
seq=MochiKit.Iter.iter(seq);
if(pred===null){
pred=m.operator.truth;
}
return {repr:function(){
return "ifilterfalse(...)";
},toString:m.forwardCall("repr"),next:function(){
while(true){
var rval=seq.next();
if(!pred(rval)){
return rval;
}
}
return undefined;
}};
},islice:function(seq){
var self=MochiKit.Iter;
var m=MochiKit.Base;
seq=self.iter(seq);
var _18c=0;
var stop=0;
var step=1;
var i=-1;
if(arguments.length==2){
stop=arguments[1];
}else{
if(arguments.length==3){
_18c=arguments[1];
stop=arguments[2];
}else{
_18c=arguments[1];
stop=arguments[2];
step=arguments[3];
}
}
return {repr:function(){
return "islice("+["...",_18c,stop,step].join(", ")+")";
},toString:m.forwardCall("repr"),next:function(){
var rval;
while(i<_18c){
rval=seq.next();
i++;
}
if(_18c>=stop){
throw self.StopIteration;
}
_18c+=step;
return rval;
}};
},imap:function(fun,p,q){
var m=MochiKit.Base;
var self=MochiKit.Iter;
var _196=m.map(self.iter,m.extend(null,arguments,1));
var map=m.map;
var next=self.next;
return {repr:function(){
return "imap(...)";
},toString:m.forwardCall("repr"),next:function(){
return fun.apply(this,map(next,_196));
}};
},applymap:function(fun,seq,self){
seq=MochiKit.Iter.iter(seq);
var m=MochiKit.Base;
return {repr:function(){
return "applymap(...)";
},toString:m.forwardCall("repr"),next:function(){
return fun.apply(self,seq.next());
}};
},chain:function(p,q){
var self=MochiKit.Iter;
var m=MochiKit.Base;
if(arguments.length==1){
return self.iter(arguments[0]);
}
var _1a1=m.map(self.iter,arguments);
return {repr:function(){
return "chain(...)";
},toString:m.forwardCall("repr"),next:function(){
while(_1a1.length>1){
try{
var _1a2=_1a1[0].next();
return _1a2;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
_1a1.shift();
var _1a2=_1a1[0].next();
return _1a2;
}
}
if(_1a1.length==1){
var arg=_1a1.shift();
this.next=m.bind("next",arg);
return this.next();
}
throw self.StopIteration;
}};
},takewhile:function(pred,seq){
var self=MochiKit.Iter;
seq=self.iter(seq);
return {repr:function(){
return "takewhile(...)";
},toString:MochiKit.Base.forwardCall("repr"),next:function(){
var rval=seq.next();
if(!pred(rval)){
this.next=function(){
throw self.StopIteration;
};
this.next();
}
return rval;
}};
},dropwhile:function(pred,seq){
seq=MochiKit.Iter.iter(seq);
var m=MochiKit.Base;
var bind=m.bind;
return {"repr":function(){
return "dropwhile(...)";
},"toString":m.forwardCall("repr"),"next":function(){
while(true){
var rval=seq.next();
if(!pred(rval)){
break;
}
}
this.next=bind("next",seq);
return rval;
}};
},_tee:function(_1ad,sync,_1af){
sync.pos[_1ad]=-1;
var m=MochiKit.Base;
var _1b1=m.listMin;
return {repr:function(){
return "tee("+_1ad+", ...)";
},toString:m.forwardCall("repr"),next:function(){
var rval;
var i=sync.pos[_1ad];
if(i==sync.max){
rval=_1af.next();
sync.deque.push(rval);
sync.max+=1;
sync.pos[_1ad]+=1;
}else{
rval=sync.deque[i-sync.min];
sync.pos[_1ad]+=1;
if(i==sync.min&&_1b1(sync.pos)!=sync.min){
sync.min+=1;
sync.deque.shift();
}
}
return rval;
}};
},tee:function(_1b4,n){
var rval=[];
var sync={"pos":[],"deque":[],"max":-1,"min":-1};
if(arguments.length==1||typeof (n)=="undefined"||n===null){
n=2;
}
var self=MochiKit.Iter;
_1b4=self.iter(_1b4);
var _tee=self._tee;
for(var i=0;i<n;i++){
rval.push(_tee(i,sync,_1b4));
}
return rval;
},list:function(_1bb){
var rval;
if(_1bb instanceof Array){
return _1bb.slice();
}
if(typeof (_1bb)=="function"&&!(_1bb instanceof Function)&&typeof (_1bb.length)=="number"){
rval=[];
for(var i=0;i<_1bb.length;i++){
rval.push(_1bb[i]);
}
return rval;
}
var self=MochiKit.Iter;
_1bb=self.iter(_1bb);
var rval=[];
var _1bf;
try{
while(true){
_1bf=_1bb.next();
rval.push(_1bf);
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return rval;
}
return undefined;
},reduce:function(fn,_1c1,_1c2){
var i=0;
var x=_1c2;
var self=MochiKit.Iter;
_1c1=self.iter(_1c1);
if(arguments.length<3){
try{
x=_1c1.next();
}
catch(e){
if(e==self.StopIteration){
e=new TypeError("reduce() of empty sequence with no initial value");
}
throw e;
}
i++;
}
try{
while(true){
x=fn(x,_1c1.next());
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
return x;
},range:function(){
var _1c6=0;
var stop=0;
var step=1;
if(arguments.length==1){
stop=arguments[0];
}else{
if(arguments.length==2){
_1c6=arguments[0];
stop=arguments[1];
}else{
if(arguments.length==3){
_1c6=arguments[0];
stop=arguments[1];
step=arguments[2];
}else{
throw new TypeError("range() takes 1, 2, or 3 arguments!");
}
}
}
if(step===0){
throw new TypeError("range() step must not be 0");
}
return {next:function(){
if((step>0&&_1c6>=stop)||(step<0&&_1c6<=stop)){
throw MochiKit.Iter.StopIteration;
}
var rval=_1c6;
_1c6+=step;
return rval;
},repr:function(){
return "range("+[_1c6,stop,step].join(", ")+")";
},toString:MochiKit.Base.forwardCall("repr")};
},sum:function(_1ca,_1cb){
if(typeof (_1cb)=="undefined"||_1cb===null){
_1cb=0;
}
var x=_1cb;
var self=MochiKit.Iter;
_1ca=self.iter(_1ca);
try{
while(true){
x+=_1ca.next();
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
return x;
},exhaust:function(_1ce){
var self=MochiKit.Iter;
_1ce=self.iter(_1ce);
try{
while(true){
_1ce.next();
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
},forEach:function(_1d0,func,obj){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length>2){
func=m.bind(func,obj);
}
if(m.isArrayLike(_1d0)&&!self.isIterable(_1d0)){
try{
for(var i=0;i<_1d0.length;i++){
func(_1d0[i]);
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
}else{
self.exhaust(self.imap(func,_1d0));
}
},every:function(_1d6,func){
var self=MochiKit.Iter;
try{
self.ifilterfalse(func,_1d6).next();
return false;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return true;
}
},sorted:function(_1d9,cmp){
var rval=MochiKit.Iter.list(_1d9);
if(arguments.length==1){
cmp=MochiKit.Base.compare;
}
rval.sort(cmp);
return rval;
},reversed:function(_1dc){
var rval=MochiKit.Iter.list(_1dc);
rval.reverse();
return rval;
},some:function(_1de,func){
var self=MochiKit.Iter;
try{
self.ifilter(func,_1de).next();
return true;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return false;
}
},iextend:function(lst,_1e2){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(m.isArrayLike(_1e2)&&!self.isIterable(_1e2)){
for(var i=0;i<_1e2.length;i++){
lst.push(_1e2[i]);
}
}else{
_1e2=self.iter(_1e2);
try{
while(true){
lst.push(_1e2.next());
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
}
return lst;
},groupby:function(_1e6,_1e7){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length<2){
_1e7=m.operator.identity;
}
_1e6=self.iter(_1e6);
var pk=undefined;
var k=undefined;
var v;
function fetch(){
v=_1e6.next();
k=_1e7(v);
}
function eat(){
var ret=v;
v=undefined;
return ret;
}
var _1ee=true;
var _1ef=m.compare;
return {repr:function(){
return "groupby(...)";
},next:function(){
while(_1ef(k,pk)===0){
fetch();
if(_1ee){
_1ee=false;
break;
}
}
pk=k;
return [k,{next:function(){
if(v==undefined){
fetch();
}
if(_1ef(k,pk)!==0){
throw self.StopIteration;
}
return eat();
}}];
}};
},groupby_as_array:function(_1f0,_1f1){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length<2){
_1f1=m.operator.identity;
}
_1f0=self.iter(_1f0);
var _1f4=[];
var _1f5=true;
var _1f6;
var _1f7=m.compare;
while(true){
try{
var _1f8=_1f0.next();
var key=_1f1(_1f8);
}
catch(e){
if(e==self.StopIteration){
break;
}
throw e;
}
if(_1f5||_1f7(key,_1f6)!==0){
var _1fa=[];
_1f4.push([key,_1fa]);
}
_1fa.push(_1f8);
_1f5=false;
_1f6=key;
}
return _1f4;
},arrayLikeIter:function(_1fb){
var i=0;
return {repr:function(){
return "arrayLikeIter(...)";
},toString:MochiKit.Base.forwardCall("repr"),next:function(){
if(i>=_1fb.length){
throw MochiKit.Iter.StopIteration;
}
return _1fb[i++];
}};
},hasIterateNext:function(_1fd){
return (_1fd&&typeof (_1fd.iterateNext)=="function");
},iterateNextIter:function(_1fe){
return {repr:function(){
return "iterateNextIter(...)";
},toString:MochiKit.Base.forwardCall("repr"),next:function(){
var rval=_1fe.iterateNext();
if(rval===null||rval===undefined){
throw MochiKit.Iter.StopIteration;
}
return rval;
}};
}});
MochiKit.Iter.__new__=function(){
var m=MochiKit.Base;
if(typeof (StopIteration)!="undefined"){
this.StopIteration=StopIteration;
}else{
this.StopIteration=new m.NamedError("StopIteration");
}
this.iteratorRegistry=new m.AdapterRegistry();
this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter);
this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter);
m.nameFunctions(this);
};
MochiKit.Iter.__new__();
if(MochiKit.__export__){
reduce=MochiKit.Iter.reduce;
}
MochiKit.Base._exportSymbols(this,MochiKit.Iter);
MochiKit.Base._module("DateTime","1.5",["Base"]);
MochiKit.DateTime.isoDate=function(str){
str=str+"";
if(typeof (str)!="string"||str.length===0){
return null;
}
var iso=str.split("-");
if(iso.length===0){
return null;
}
var date=new Date(iso[0],iso[1]-1,iso[2]);
date.setFullYear(iso[0]);
date.setMonth(iso[1]-1);
date.setDate(iso[2]);
return date;
};
MochiKit.DateTime._isoRegexp=/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
MochiKit.DateTime.isoTimestamp=function(str){
str=str+"";
if(typeof (str)!="string"||str.length===0){
return null;
}
var res=str.match(MochiKit.DateTime._isoRegexp);
if(typeof (res)=="undefined"||res===null){
return null;
}
var year,_207,day,hour,min,sec,msec;
year=parseInt(res[1],10);
if(typeof (res[2])=="undefined"||res[2]===""){
return new Date(year);
}
_207=parseInt(res[2],10)-1;
day=parseInt(res[3],10);
if(typeof (res[4])=="undefined"||res[4]===""){
return new Date(year,_207,day);
}
hour=parseInt(res[4],10);
min=parseInt(res[5],10);
sec=(typeof (res[6])!="undefined"&&res[6]!=="")?parseInt(res[6],10):0;
if(typeof (res[7])!="undefined"&&res[7]!==""){
msec=Math.round(1000*parseFloat("0."+res[7]));
}else{
msec=0;
}
if((typeof (res[8])=="undefined"||res[8]==="")&&(typeof (res[9])=="undefined"||res[9]==="")){
return new Date(year,_207,day,hour,min,sec,msec);
}
var ofs;
if(typeof (res[9])!="undefined"&&res[9]!==""){
ofs=parseInt(res[10],10)*3600000;
if(typeof (res[11])!="undefined"&&res[11]!==""){
ofs+=parseInt(res[11],10)*60000;
}
if(res[9]=="-"){
ofs=-ofs;
}
}else{
ofs=0;
}
return new Date(Date.UTC(year,_207,day,hour,min,sec,msec)-ofs);
};
MochiKit.DateTime.toISOTime=function(date,_20f){
if(typeof (date)=="undefined"||date===null){
return null;
}
var hh=date.getHours();
var mm=date.getMinutes();
var ss=date.getSeconds();
var lst=[((_20f&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
return lst.join(":");
};
MochiKit.DateTime.toISOTimestamp=function(date,_215){
if(typeof (date)=="undefined"||date===null){
return null;
}
var sep=_215?"T":" ";
var foot=_215?"Z":"";
if(_215){
date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
}
return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_215)+foot;
};
MochiKit.DateTime.toISODate=function(date){
if(typeof (date)=="undefined"||date===null){
return null;
}
var _219=MochiKit.DateTime._padTwo;
var _21a=MochiKit.DateTime._padFour;
return [_21a(date.getFullYear()),_219(date.getMonth()+1),_219(date.getDate())].join("-");
};
MochiKit.DateTime.americanDate=function(d){
d=d+"";
if(typeof (d)!="string"||d.length===0){
return null;
}
var a=d.split("/");
return new Date(a[2],a[0]-1,a[1]);
};
MochiKit.DateTime._padTwo=function(n){
return (n>9)?n:"0"+n;
};
MochiKit.DateTime._padFour=function(n){
switch(n.toString().length){
case 1:
return "000"+n;
break;
case 2:
return "00"+n;
break;
case 3:
return "0"+n;
break;
case 4:
default:
return n;
}
};
MochiKit.DateTime.toPaddedAmericanDate=function(d){
if(typeof (d)=="undefined"||d===null){
return null;
}
var _220=MochiKit.DateTime._padTwo;
return [_220(d.getMonth()+1),_220(d.getDate()),d.getFullYear()].join("/");
};
MochiKit.DateTime.toAmericanDate=function(d){
if(typeof (d)=="undefined"||d===null){
return null;
}
return [d.getMonth()+1,d.getDate(),d.getFullYear()].join("/");
};
MochiKit.DateTime.__new__=function(){
MochiKit.Base.nameFunctions(this);
};
MochiKit.DateTime.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
MochiKit.Base._module("Async","1.5",["Base"]);
MochiKit.Async.Deferred=function(_222){
this.chain=[];
this.id=this._nextId();
this.fired=-1;
this.paused=0;
this.results=[null,null];
this.canceller=_222;
this.silentlyCancelled=false;
this.chained=false;
};
MochiKit.Async.Deferred.prototype={repr:function(){
var _223;
if(this.fired==-1){
_223="unfired";
}else{
if(this.fired===0){
_223="success";
}else{
_223="error";
}
}
return "Deferred("+this.id+", "+_223+")";
},toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){
var self=MochiKit.Async;
if(this.fired==-1){
if(this.canceller){
this.canceller(this);
}else{
this.silentlyCancelled=true;
}
if(this.fired==-1){
this.errback(new self.CancelledError(this));
}
}else{
if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){
this.results[0].cancel();
}
}
},_resback:function(res){
this.fired=((res instanceof Error)?1:0);
this.results[this.fired]=res;
this._fire();
},_check:function(){
if(this.fired!=-1){
if(!this.silentlyCancelled){
throw new MochiKit.Async.AlreadyCalledError(this);
}
this.silentlyCancelled=false;
return;
}
},callback:function(res){
this._check();
if(res instanceof MochiKit.Async.Deferred){
throw new Error("Deferred instances can only be chained if they are the result of a callback");
}
this._resback(res);
},errback:function(res){
this._check();
var self=MochiKit.Async;
if(res instanceof self.Deferred){
throw new Error("Deferred instances can only be chained if they are the result of a callback");
}
if(!(res instanceof Error)){
res=new self.GenericError(res);
}
this._resback(res);
},addBoth:function(fn){
if(arguments.length>1){
fn=MochiKit.Base.partial.apply(null,arguments);
}
return this.addCallbacks(fn,fn);
},addCallback:function(fn){
if(arguments.length>1){
fn=MochiKit.Base.partial.apply(null,arguments);
}
return this.addCallbacks(fn,null);
},addErrback:function(fn){
if(arguments.length>1){
fn=MochiKit.Base.partial.apply(null,arguments);
}
return this.addCallbacks(null,fn);
},addCallbacks:function(cb,eb){
if(this.chained){
throw new Error("Chained Deferreds can not be re-used");
}
this.chain.push([cb,eb]);
if(this.fired>=0){
this._fire();
}
return this;
},_fire:function(){
var _22e=this.chain;
var _22f=this.fired;
var res=this.results[_22f];
var self=this;
var cb=null;
while(_22e.length>0&&this.paused===0){
var pair=_22e.shift();
var f=pair[_22f];
if(f===null){
continue;
}
try{
res=f(res);
_22f=((res instanceof Error)?1:0);
if(res instanceof MochiKit.Async.Deferred){
cb=function(res){
self._resback(res);
self.paused--;
if((self.paused===0)&&(self.fired>=0)){
self._fire();
}
};
this.paused++;
}
}
catch(err){
_22f=1;
if(!(err instanceof Error)){
err=new MochiKit.Async.GenericError(err);
}
res=err;
}
}
this.fired=_22f;
this.results[_22f]=res;
if(cb&&this.paused){
res.addBoth(cb);
res.chained=true;
}
}};
MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(req){
return MochiKit.Base.evalJSON(req.responseText);
},succeed:function(_237){
var d=new MochiKit.Async.Deferred();
d.callback.apply(d,arguments);
return d;
},fail:function(_239){
var d=new MochiKit.Async.Deferred();
d.errback.apply(d,arguments);
return d;
},getXMLHttpRequest:function(){
var self=arguments.callee;
if(!self.XMLHttpRequest){
var _23c=[function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
},function(){
return new ActiveXObject("Msxml2.XMLHTTP.4.0");
},function(){
throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest");
}];
for(var i=0;i<_23c.length;i++){
var func=_23c[i];
try{
self.XMLHttpRequest=func;
return func();
}
catch(e){
}
}
}
return self.XMLHttpRequest();
},_xhr_onreadystatechange:function(d){
var m=MochiKit.Base;
if(this.readyState==4){
try{
this.onreadystatechange=null;
}
catch(e){
try{
this.onreadystatechange=m.noop;
}
catch(e){
}
}
var _241=null;
try{
_241=this.status;
if(!_241&&m.isNotEmpty(this.responseText)){
_241=304;
}
}
catch(e){
}
if(_241==200||_241==201||_241==204||_241==304||_241==1223){
d.callback(this);
}else{
var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed");
if(err.number){
d.errback(err);
}else{
d.errback(err);
}
}
}
},_xhr_canceller:function(req){
try{
req.onreadystatechange=null;
}
catch(e){
try{
req.onreadystatechange=MochiKit.Base.noop;
}
catch(e){
}
}
req.abort();
},sendXMLHttpRequest:function(req,_245){
if(typeof (_245)=="undefined"||_245===null){
_245="";
}
var m=MochiKit.Base;
var self=MochiKit.Async;
var d=new self.Deferred(m.partial(self._xhr_canceller,req));
try{
req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
req.send(_245);
}
catch(e){
try{
req.onreadystatechange=null;
}
catch(ignore){
}
d.errback(e);
}
return d;
},doXHR:function(url,opts){
var self=MochiKit.Async;
return self.callLater(0,self._doXHR,url,opts);
},_doXHR:function(url,opts){
var m=MochiKit.Base;
opts=m.update({method:"GET",sendContent:""},opts);
var self=MochiKit.Async;
var req=self.getXMLHttpRequest();
if(opts.queryString){
var qs=m.queryString(opts.queryString);
if(qs){
url+="?"+qs;
}
}
if("username" in opts){
req.open(opts.method,url,true,opts.username,opts.password);
}else{
req.open(opts.method,url,true);
}
if(req.overrideMimeType&&opts.mimeType){
req.overrideMimeType(opts.mimeType);
}
req.setRequestHeader("X-Requested-With","XMLHttpRequest");
if(opts.headers){
var _252=opts.headers;
if(!m.isArrayLike(_252)){
_252=m.items(_252);
}
for(var i=0;i<_252.length;i++){
var _254=_252[i];
var name=_254[0];
var _256=_254[1];
req.setRequestHeader(name,_256);
}
}
return self.sendXMLHttpRequest(req,opts.sendContent);
},_buildURL:function(url){
if(arguments.length>1){
var m=MochiKit.Base;
var qs=m.queryString.apply(null,m.extend(null,arguments,1));
if(qs){
return url+"?"+qs;
}
}
return url;
},doSimpleXMLHttpRequest:function(url){
var self=MochiKit.Async;
url=self._buildURL.apply(self,arguments);
return self.doXHR(url);
},loadJSONDoc:function(url){
var self=MochiKit.Async;
url=self._buildURL.apply(self,arguments);
var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]});
d=d.addCallback(self.evalJSONRequest);
return d;
},wait:function(_25f,_260){
var d=new MochiKit.Async.Deferred();
var m=MochiKit.Base;
if(typeof (_260)!="undefined"){
d.addCallback(function(){
return _260;
});
}
var _263=setTimeout(m.bind("callback",d),Math.floor(_25f*1000));
d.canceller=function(){
try{
clearTimeout(_263);
}
catch(e){
}
};
return d;
},callLater:function(_264,func){
var m=MochiKit.Base;
var _267=m.partial.apply(m,m.extend(null,arguments,1));
return MochiKit.Async.wait(_264).addCallback(function(res){
return _267();
});
}});
MochiKit.Async.DeferredLock=function(){
this.waiting=[];
this.locked=false;
this.id=this._nextId();
};
MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
var d=new MochiKit.Async.Deferred();
if(this.locked){
this.waiting.push(d);
}else{
this.locked=true;
d.callback(this);
}
return d;
},release:function(){
if(!this.locked){
throw TypeError("Tried to release an unlocked DeferredLock");
}
this.locked=false;
if(this.waiting.length>0){
this.locked=true;
this.waiting.shift().callback(this);
}
},_nextId:MochiKit.Base.counter(),repr:function(){
var _26a;
if(this.locked){
_26a="locked, "+this.waiting.length+" waiting";
}else{
_26a="unlocked";
}
return "DeferredLock("+this.id+", "+_26a+")";
},toString:MochiKit.Base.forwardCall("repr")};
MochiKit.Async.DeferredList=function(list,_26c,_26d,_26e,_26f){
MochiKit.Async.Deferred.apply(this,[_26f]);
this.list=list;
var _270=[];
this.resultList=_270;
this.finishedCount=0;
this.fireOnOneCallback=_26c;
this.fireOnOneErrback=_26d;
this.consumeErrors=_26e;
var cb=MochiKit.Base.bind(this._cbDeferred,this);
for(var i=0;i<list.length;i++){
var d=list[i];
_270.push(undefined);
d.addCallback(cb,i,true);
d.addErrback(cb,i,false);
}
if(list.length===0&&!_26c){
this.callback(this.resultList);
}
};
MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
MochiKit.Async.DeferredList.prototype._cbDeferred=function(_274,_275,_276){
this.resultList[_274]=[_275,_276];
this.finishedCount+=1;
if(this.fired==-1){
if(_275&&this.fireOnOneCallback){
this.callback([_274,_276]);
}else{
if(!_275&&this.fireOnOneErrback){
this.errback(_276);
}else{
if(this.finishedCount==this.list.length){
this.callback(this.resultList);
}
}
}
}
if(!_275&&this.consumeErrors){
_276=null;
}
return _276;
};
MochiKit.Async.gatherResults=function(_277){
var d=new MochiKit.Async.DeferredList(_277,false,true,false);
d.addCallback(function(_279){
var ret=[];
for(var i=0;i<_279.length;i++){
ret.push(_279[i][1]);
}
return ret;
});
return d;
};
MochiKit.Async.maybeDeferred=function(func){
var self=MochiKit.Async;
var _27e;
try{
var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
if(r instanceof self.Deferred){
_27e=r;
}else{
if(r instanceof Error){
_27e=self.fail(r);
}else{
_27e=self.succeed(r);
}
}
}
catch(e){
_27e=self.fail(e);
}
return _27e;
};
MochiKit.Async.__new__=function(){
var m=MochiKit.Base;
var ne=m.partial(m._newNamedError,this);
ne("AlreadyCalledError",function(_282){
this.deferred=_282;
});
ne("CancelledError",function(_283){
this.deferred=_283;
});
ne("BrowserComplianceError",function(msg){
this.message=msg;
});
ne("GenericError",function(msg){
this.message=msg;
});
ne("XMLHttpRequestError",function(req,msg){
this.req=req;
this.message=msg;
try{
this.number=req.status;
}
catch(e){
}
});
m.nameFunctions(this);
};
MochiKit.Async.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Async);
MochiKit.Base._module("DOM","1.5",["Base"]);
MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
return MochiKit.DOM._window;
},currentDocument:function(){
return MochiKit.DOM._document;
},withWindow:function(win,func){
var self=MochiKit.DOM;
var _28b=self._document;
var _28c=self._window;
var rval;
try{
self._window=win;
self._document=win.document;
rval=func();
}
catch(e){
self._window=_28c;
self._document=_28b;
throw e;
}
self._window=_28c;
self._document=_28b;
return rval;
},formContents:function(elem){
var _28f=[];
var _290=[];
var m=MochiKit.Base;
var self=MochiKit.DOM;
if(typeof (elem)=="undefined"||elem===null){
elem=self._document.body;
}else{
elem=self.getElement(elem);
}
m.nodeWalk(elem,function(elem){
var name=elem.name;
if(m.isNotEmpty(name)){
var _295=elem.tagName.toUpperCase();
if(_295==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
return null;
}
if(_295==="SELECT"){
if(elem.type=="select-one"){
if(elem.selectedIndex>=0){
var opt=elem.options[elem.selectedIndex];
var v=opt.value;
if(!v){
var h=opt.outerHTML;
if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
v=opt.text;
}
}
_28f.push(name);
_290.push(v);
return null;
}
_28f.push(name);
_290.push("");
return null;
}else{
var opts=elem.options;
if(!opts.length){
_28f.push(name);
_290.push("");
return null;
}
for(var i=0;i<opts.length;i++){
var opt=opts[i];
if(!opt.selected){
continue;
}
var v=opt.value;
if(!v){
var h=opt.outerHTML;
if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
v=opt.text;
}
}
_28f.push(name);
_290.push(v);
}
return null;
}
}
if(_295==="FORM"||_295==="P"||_295==="SPAN"||_295==="DIV"){
return elem.childNodes;
}
_28f.push(name);
_290.push(elem.value||"");
return null;
}
return elem.childNodes;
});
return [_28f,_290];
},withDocument:function(doc,func){
var self=MochiKit.DOM;
var _29e=self._document;
var rval;
try{
self._document=doc;
rval=func();
}
catch(e){
self._document=_29e;
throw e;
}
self._document=_29e;
return rval;
},registerDOMConverter:function(name,_2a1,wrap,_2a3){
MochiKit.DOM.domConverters.register(name,_2a1,wrap,_2a3);
},coerceToDOM:function(node,ctx){
var m=MochiKit.Base;
var im=MochiKit.Iter;
var self=MochiKit.DOM;
if(im){
var iter=im.iter;
var _2aa=im.repeat;
}
var map=m.map;
var _2ac=self.domConverters;
var _2ad=arguments.callee;
var _2ae=m.NotFound;
while(true){
if(typeof (node)=="undefined"||node===null){
return null;
}
if(typeof (node)=="function"&&typeof (node.length)=="number"&&!(node instanceof Function)){
node=im?im.list(node):m.extend(null,node);
}
if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){
return node;
}
if(typeof (node)=="number"||typeof (node)=="boolean"){
node=node.toString();
}
if(typeof (node)=="string"){
return self._document.createTextNode(node);
}
if(typeof (node.__dom__)=="function"){
node=node.__dom__(ctx);
continue;
}
if(typeof (node.dom)=="function"){
node=node.dom(ctx);
continue;
}
if(typeof (node)=="function"){
node=node.apply(ctx,[ctx]);
continue;
}
if(im){
var _2af=null;
try{
_2af=iter(node);
}
catch(e){
}
if(_2af){
return map(_2ad,_2af,_2aa(ctx));
}
}else{
if(m.isArrayLike(node)){
var func=function(n){
return _2ad(n,ctx);
};
return map(func,node);
}
}
try{
node=_2ac.match(node,ctx);
continue;
}
catch(e){
if(e!=_2ae){
throw e;
}
}
return self._document.createTextNode(node.toString());
}
return undefined;
},isChildNode:function(node,_2b3){
var self=MochiKit.DOM;
if(typeof (node)=="string"){
node=self.getElement(node);
}
if(typeof (_2b3)=="string"){
_2b3=self.getElement(_2b3);
}
if(typeof (node)=="undefined"||node===null){
return false;
}
while(node!=null&&node!==self._document){
if(node===_2b3){
return true;
}
node=node.parentNode;
}
return false;
},setNodeAttribute:function(node,attr,_2b7){
var o={};
o[attr]=_2b7;
try{
return MochiKit.DOM.updateNodeAttributes(node,o);
}
catch(e){
}
return null;
},getNodeAttribute:function(node,attr){
var self=MochiKit.DOM;
var _2bc=self.attributeArray.renames[attr];
var _2bd=self.attributeArray.ignoreAttr[attr];
node=self.getElement(node);
try{
if(_2bc){
return node[_2bc];
}
var _2be=node.getAttribute(attr);
if(_2be!=_2bd){
return _2be;
}
}
catch(e){
}
return null;
},removeNodeAttribute:function(node,attr){
var self=MochiKit.DOM;
var _2c2=self.attributeArray.renames[attr];
node=self.getElement(node);
try{
if(_2c2){
return node[_2c2];
}
return node.removeAttribute(attr);
}
catch(e){
}
return null;
},updateNodeAttributes:function(node,_2c4){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
if(_2c4){
var _2c7=MochiKit.Base.updatetree;
if(self.attributeArray.compliant){
for(var k in _2c4){
var v=_2c4[k];
if(typeof (v)=="object"&&typeof (elem[k])=="object"){
if(k=="style"&&MochiKit.Style){
MochiKit.Style.setStyle(elem,v);
}else{
_2c7(elem[k],v);
}
}else{
if(k.substring(0,2)=="on"){
if(typeof (v)=="string"){
v=new Function(v);
}
elem[k]=v;
}else{
elem.setAttribute(k,v);
}
}
if(typeof (elem[k])=="string"&&elem[k]!=v){
elem[k]=v;
}
}
}else{
var _2ca=self.attributeArray.renames;
for(var k in _2c4){
v=_2c4[k];
var _2cb=_2ca[k];
if(k=="style"&&typeof (v)=="string"){
elem.style.cssText=v;
}else{
if(typeof (_2cb)=="string"){
elem[_2cb]=v;
}else{
if(typeof (elem[k])=="object"&&typeof (v)=="object"){
if(k=="style"&&MochiKit.Style){
MochiKit.Style.setStyle(elem,v);
}else{
_2c7(elem[k],v);
}
}else{
if(k.substring(0,2)=="on"){
if(typeof (v)=="string"){
v=new Function(v);
}
elem[k]=v;
}else{
elem.setAttribute(k,v);
}
}
}
}
if(typeof (elem[k])=="string"&&elem[k]!=v){
elem[k]=v;
}
}
}
}
return elem;
},appendChildNodes:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
var _2cf=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
var _2d0=MochiKit.Base.concat;
while(_2cf.length){
var n=_2cf.shift();
if(typeof (n)=="undefined"||n===null){
}else{
if(typeof (n.nodeType)=="number"){
elem.appendChild(n);
}else{
_2cf=_2d0(n,_2cf);
}
}
}
return elem;
},insertSiblingNodesBefore:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
var _2d5=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
var _2d6=elem.parentNode;
var _2d7=MochiKit.Base.concat;
while(_2d5.length){
var n=_2d5.shift();
if(typeof (n)=="undefined"||n===null){
}else{
if(typeof (n.nodeType)=="number"){
_2d6.insertBefore(n,elem);
}else{
_2d5=_2d7(n,_2d5);
}
}
}
return _2d6;
},insertSiblingNodesAfter:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
var _2dc=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
if(elem.nextSibling){
return self.insertSiblingNodesBefore(elem.nextSibling,_2dc);
}else{
return self.appendChildNodes(elem.parentNode,_2dc);
}
},replaceChildNodes:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
arguments[0]=elem;
}
var _2e0;
while((_2e0=elem.firstChild)){
elem.removeChild(_2e0);
}
if(arguments.length<2){
return elem;
}else{
return self.appendChildNodes.apply(this,arguments);
}
},createDOM:function(name,_2e2){
var elem;
var self=MochiKit.DOM;
var m=MochiKit.Base;
if(typeof (_2e2)=="string"||typeof (_2e2)=="number"){
var args=m.extend([name,null],arguments,1);
return arguments.callee.apply(this,args);
}
if(typeof (name)=="string"){
var _2e7=self._xhtml;
if(_2e2&&!self.attributeArray.compliant){
var _2e8="";
if("name" in _2e2){
_2e8+=" name=\""+self.escapeHTML(_2e2.name)+"\"";
}
if(name=="input"&&"type" in _2e2){
_2e8+=" type=\""+self.escapeHTML(_2e2.type)+"\"";
}
if(_2e8){
name="<"+name+_2e8+">";
_2e7=false;
}
}
var d=self._document;
if(_2e7&&d===document){
elem=d.createElementNS("http://www.w3.org/1999/xhtml",name);
}else{
elem=d.createElement(name);
}
}else{
elem=name;
}
if(_2e2){
self.updateNodeAttributes(elem,_2e2);
}
if(arguments.length<=2){
return elem;
}else{
var args=m.extend([elem],arguments,2);
return self.appendChildNodes.apply(this,args);
}
},createDOMFunc:function(){
var m=MochiKit.Base;
return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
},removeElement:function(elem){
var self=MochiKit.DOM;
if(typeof (elem)=="string"){
elem=self.getElement(elem);
}
var e=self.coerceToDOM(elem);
e.parentNode.removeChild(e);
return e;
},swapDOM:function(dest,src){
var self=MochiKit.DOM;
dest=self.getElement(dest);
var _2f1=dest.parentNode;
if(src){
if(typeof (src)=="string"){
src=self.getElement(src);
}
src=self.coerceToDOM(src,_2f1);
_2f1.replaceChild(src,dest);
}else{
_2f1.removeChild(dest);
}
return src;
},getElement:function(id){
var self=MochiKit.DOM;
if(arguments.length==1){
return ((typeof (id)=="string")?self._document.getElementById(id):id);
}else{
return MochiKit.Base.map(self.getElement,arguments);
}
},getElementsByTagAndClassName:function(_2f4,_2f5,_2f6){
var self=MochiKit.DOM;
if(typeof (_2f4)=="undefined"||_2f4===null){
_2f4="*";
}
if(typeof (_2f6)=="undefined"||_2f6===null){
_2f6=self._document;
}
_2f6=self.getElement(_2f6);
if(_2f6==null){
return [];
}
var _2f8=(_2f6.getElementsByTagName(_2f4)||self._document.all);
if(typeof (_2f5)=="undefined"||_2f5===null){
return MochiKit.Base.extend(null,_2f8);
}
var _2f9=[];
for(var i=0;i<_2f8.length;i++){
var _2fb=_2f8[i];
var cls=_2fb.className;
if(typeof (cls)!="string"){
cls=_2fb.getAttribute("class");
}
if(typeof (cls)=="string"){
var _2fd=cls.split(" ");
for(var j=0;j<_2fd.length;j++){
if(_2fd[j]==_2f5){
_2f9.push(_2fb);
break;
}
}
}
}
return _2f9;
},_newCallStack:function(path,once){
var rval=function(){
var _302=arguments.callee.callStack;
for(var i=0;i<_302.length;i++){
if(_302[i].apply(this,arguments)===false){
break;
}
}
if(once){
try{
this[path]=null;
}
catch(e){
}
}
};
rval.callStack=[];
return rval;
},addToCallStack:function(_304,path,func,once){
var self=MochiKit.DOM;
var _309=_304[path];
var _30a=_309;
if(!(typeof (_309)=="function"&&typeof (_309.callStack)=="object"&&_309.callStack!==null)){
_30a=self._newCallStack(path,once);
if(typeof (_309)=="function"){
_30a.callStack.push(_309);
}
_304[path]=_30a;
}
_30a.callStack.push(func);
},addLoadEvent:function(func){
var self=MochiKit.DOM;
self.addToCallStack(self._window,"onload",func,true);
},focusOnLoad:function(_30d){
var self=MochiKit.DOM;
self.addLoadEvent(function(){
_30d=self.getElement(_30d);
if(_30d){
_30d.focus();
}
});
},setElementClass:function(_30f,_310){
var self=MochiKit.DOM;
var obj=self.getElement(_30f);
if(self.attributeArray.compliant){
obj.setAttribute("class",_310);
}else{
obj.setAttribute("className",_310);
}
},toggleElementClass:function(_313){
var self=MochiKit.DOM;
for(var i=1;i<arguments.length;i++){
var obj=self.getElement(arguments[i]);
if(!self.addElementClass(obj,_313)){
self.removeElementClass(obj,_313);
}
}
},addElementClass:function(_317,_318){
var self=MochiKit.DOM;
var obj=self.getElement(_317);
var cls=obj.className;
if(typeof (cls)!="string"){
cls=obj.getAttribute("class");
}
if(typeof (cls)!="string"||cls.length===0){
self.setElementClass(obj,_318);
return true;
}
if(cls==_318){
return false;
}
var _31c=cls.split(" ");
for(var i=0;i<_31c.length;i++){
if(_31c[i]==_318){
return false;
}
}
self.setElementClass(obj,cls+" "+_318);
return true;
},removeElementClass:function(_31e,_31f){
var self=MochiKit.DOM;
var obj=self.getElement(_31e);
var cls=obj.className;
if(typeof (cls)!="string"){
cls=obj.getAttribute("class");
}
if(typeof (cls)!="string"||cls.length===0){
return false;
}
if(cls==_31f){
self.setElementClass(obj,"");
return true;
}
var _323=cls.split(" ");
for(var i=0;i<_323.length;i++){
if(_323[i]==_31f){
_323.splice(i,1);
self.setElementClass(obj,_323.join(" "));
return true;
}
}
return false;
},swapElementClass:function(_325,_326,_327){
var obj=MochiKit.DOM.getElement(_325);
var res=MochiKit.DOM.removeElementClass(obj,_326);
if(res){
MochiKit.DOM.addElementClass(obj,_327);
}
return res;
},hasElementClass:function(_32a,_32b){
var obj=MochiKit.DOM.getElement(_32a);
if(obj==null){
return false;
}
var cls=obj.className;
if(typeof (cls)!="string"&&typeof (obj.getAttribute)=="function"){
cls=obj.getAttribute("class");
}
if(typeof (cls)!="string"){
return false;
}
var _32e=cls.split(" ");
for(var i=1;i<arguments.length;i++){
var good=false;
for(var j=0;j<_32e.length;j++){
if(_32e[j]==arguments[i]){
good=true;
break;
}
}
if(!good){
return false;
}
}
return true;
},escapeHTML:function(s){
return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
},toHTML:function(dom){
return MochiKit.DOM.emitHTML(dom).join("");
},emitHTML:function(dom,lst){
if(typeof (lst)=="undefined"||lst===null){
lst=[];
}
var _336=[dom];
var self=MochiKit.DOM;
var _338=self.escapeHTML;
var _339=self.attributeArray;
while(_336.length){
dom=_336.pop();
if(typeof (dom)=="string"){
lst.push(dom);
}else{
if(dom.nodeType==1){
lst.push("<"+dom.tagName.toLowerCase());
var _33a=[];
var _33b=_339(dom);
for(var i=0;i<_33b.length;i++){
var a=_33b[i];
_33a.push([" ",a.name,"=\"",_338(a.value),"\""]);
}
_33a.sort();
for(i=0;i<_33a.length;i++){
var _33e=_33a[i];
for(var j=0;j<_33e.length;j++){
lst.push(_33e[j]);
}
}
if(dom.hasChildNodes()){
lst.push(">");
_336.push("</"+dom.tagName.toLowerCase()+">");
var _340=dom.childNodes;
for(i=_340.length-1;i>=0;i--){
_336.push(_340[i]);
}
}else{
lst.push("/>");
}
}else{
if(dom.nodeType==3){
lst.push(_338(dom.nodeValue));
}
}
}
}
return lst;
},scrapeText:function(node,_342){
var rval=[];
(function(node){
var cn=node.childNodes;
if(cn){
for(var i=0;i<cn.length;i++){
arguments.callee.call(this,cn[i]);
}
}
var _347=node.nodeValue;
if(typeof (_347)=="string"){
rval.push(_347);
}
})(MochiKit.DOM.getElement(node));
if(_342){
return rval;
}else{
return rval.join("");
}
},removeEmptyTextNodes:function(_348){
_348=MochiKit.DOM.getElement(_348);
for(var i=0;i<_348.childNodes.length;i++){
var node=_348.childNodes[i];
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
node.parentNode.removeChild(node);
}
}
},getFirstElementByTagAndClassName:function(_34b,_34c,_34d){
var self=MochiKit.DOM;
if(typeof (_34b)=="undefined"||_34b===null){
_34b="*";
}
if(typeof (_34d)=="undefined"||_34d===null){
_34d=self._document;
}
_34d=self.getElement(_34d);
if(_34d==null){
return null;
}
var _34f=(_34d.getElementsByTagName(_34b)||self._document.all);
if(_34f.length<=0){
return null;
}else{
if(typeof (_34c)=="undefined"||_34c===null){
return _34f[0];
}
}
for(var i=0;i<_34f.length;i++){
var _351=_34f[i];
var cls=_351.className;
if(typeof (cls)!="string"){
cls=_351.getAttribute("class");
}
if(typeof (cls)=="string"){
var _353=cls.split(" ");
for(var j=0;j<_353.length;j++){
if(_353[j]==_34c){
return _351;
}
}
}
}
return null;
},getFirstParentByTagAndClassName:function(elem,_356,_357){
var self=MochiKit.DOM;
elem=self.getElement(elem);
if(typeof (_356)=="undefined"||_356===null){
_356="*";
}else{
_356=_356.toUpperCase();
}
if(typeof (_357)=="undefined"||_357===null){
_357=null;
}
if(elem){
elem=elem.parentNode;
}
while(elem&&elem.tagName){
var _359=elem.tagName.toUpperCase();
if((_356==="*"||_356==_359)&&(_357===null||self.hasElementClass(elem,_357))){
return elem;
}
elem=elem.parentNode;
}
return null;
},__new__:function(win){
var m=MochiKit.Base;
if(typeof (document)!="undefined"){
this._document=document;
var _35c="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
this._xhtml=(document.documentElement&&document.createElementNS&&document.documentElement.namespaceURI===_35c);
}else{
if(MochiKit.MockDOM){
this._document=MochiKit.MockDOM.document;
}
}
this._window=win;
this.domConverters=new m.AdapterRegistry();
var _35d=this._document.createElement("span");
var _35e;
if(_35d&&_35d.attributes&&_35d.attributes.length>0){
var _35f=m.filter;
_35e=function(node){
return _35f(_35e.ignoreAttrFilter,node.attributes);
};
_35e.ignoreAttr={};
var _361=_35d.attributes;
var _362=_35e.ignoreAttr;
for(var i=0;i<_361.length;i++){
var a=_361[i];
_362[a.name]=a.value;
}
_35e.ignoreAttrFilter=function(a){
return (_35e.ignoreAttr[a.name]!=a.value);
};
_35e.compliant=false;
_35e.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor","cellspacing":"cellSpacing","cellpadding":"cellPadding"};
}else{
_35e=function(node){
return node.attributes;
};
_35e.compliant=true;
_35e.ignoreAttr={};
_35e.renames={};
}
_35e.__export__=false;
this.attributeArray=_35e;
m._deprecated(this,"computedStyle","MochiKit.Style.getStyle","1.4",true);
m._deprecated(this,"elementDimensions","MochiKit.Style.getElementDimensions","1.4");
m._deprecated(this,"elementPosition","MochiKit.Style.getElementPosition","1.4");
m._deprecated(this,"getViewportDimensions","MochiKit.Style.getViewportDimensions","1.4");
m._deprecated(this,"hideElement","MochiKit.Style.hideElement","1.4");
m._deprecated(this,"makeClipping","MochiKit.Style.makeClipping","1.4.1");
m._deprecated(this,"makePositioned","MochiKit.Style.makePositioned","1.4.1");
m._deprecated(this,"setElementDimensions","MochiKit.Style.setElementDimensions","1.4");
m._deprecated(this,"setElementPosition","MochiKit.Style.setElementPosition","1.4");
m._deprecated(this,"setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4");
m._deprecated(this,"setOpacity","MochiKit.Style.setOpacity","1.4");
m._deprecated(this,"showElement","MochiKit.Style.showElement","1.4");
m._deprecated(this,"undoClipping","MochiKit.Style.undoClipping","1.4.1");
m._deprecated(this,"undoPositioned","MochiKit.Style.undoPositioned","1.4.1");
m._deprecated(this,"Coordinates","MochiKit.Style.Coordinates","1.4");
m._deprecated(this,"Dimensions","MochiKit.Style.Dimensions","1.4");
var _367=this.createDOMFunc;
this.UL=_367("ul");
this.OL=_367("ol");
this.LI=_367("li");
this.DL=_367("dl");
this.DT=_367("dt");
this.DD=_367("dd");
this.TD=_367("td");
this.TR=_367("tr");
this.TBODY=_367("tbody");
this.THEAD=_367("thead");
this.TFOOT=_367("tfoot");
this.TABLE=_367("table");
this.TH=_367("th");
this.INPUT=_367("input");
this.SPAN=_367("span");
this.A=_367("a");
this.DIV=_367("div");
this.IMG=_367("img");
this.BUTTON=_367("button");
this.TT=_367("tt");
this.PRE=_367("pre");
this.H1=_367("h1");
this.H2=_367("h2");
this.H3=_367("h3");
this.H4=_367("h4");
this.H5=_367("h5");
this.H6=_367("h6");
this.BR=_367("br");
this.HR=_367("hr");
this.LABEL=_367("label");
this.TEXTAREA=_367("textarea");
this.FORM=_367("form");
this.P=_367("p");
this.SELECT=_367("select");
this.OPTION=_367("option");
this.OPTGROUP=_367("optgroup");
this.LEGEND=_367("legend");
this.FIELDSET=_367("fieldset");
this.STRONG=_367("strong");
this.CANVAS=_367("canvas");
this.$=this.getElement;
m.nameFunctions(this);
}});
MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window));
if(MochiKit.__export__){
withWindow=MochiKit.DOM.withWindow;
withDocument=MochiKit.DOM.withDocument;
}
MochiKit.Base._exportSymbols(this,MochiKit.DOM);
MochiKit.Base._module("Selector","1.5",["Base","DOM","Iter"]);
MochiKit.Selector.Selector=function(_368){
this.params={classNames:[],pseudoClassNames:[]};
this.expression=_368.toString().replace(/(^\s+|\s+$)/g,"");
this.parseExpression();
this.compileMatcher();
};
MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){
function abort(_369){
throw "Parse error in selector: "+_369;
}
if(this.expression==""){
abort("empty expression");
}
var repr=MochiKit.Base.repr;
var _36b=this.params;
var expr=this.expression;
var _36d,_36e,_36f,rest;
while(_36d=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_36b.attributes=_36b.attributes||[];
_36b.attributes.push({name:_36d[2],operator:_36d[3],value:_36d[4]||_36d[5]||""});
expr=_36d[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(_36d=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){
_36e=_36d[1];
_36f=_36d[2];
rest=_36d[3];
switch(_36e){
case "#":
_36b.id=_36f;
break;
case ".":
_36b.classNames.push(_36f);
break;
case ":":
_36b.pseudoClassNames.push(_36f);
break;
case "":
case undefined:
_36b.tagName=_36f.toUpperCase();
break;
default:
abort(repr(expr));
}
expr=rest;
}
if(expr.length>0){
abort(repr(expr));
}
},buildMatchExpression:function(){
var repr=MochiKit.Base.repr;
var _372=this.params;
var _373=[];
var _374,i;
function childElements(_376){
return "MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, "+_376+".childNodes)";
}
if(_372.wildcard){
_373.push("true");
}
if(_374=_372.id){
_373.push("element.id == "+repr(_374));
}
if(_374=_372.tagName){
_373.push("element.tagName.toUpperCase() == "+repr(_374));
}
if((_374=_372.classNames).length>0){
for(i=0;i<_374.length;i++){
_373.push("MochiKit.DOM.hasElementClass(element, "+repr(_374[i])+")");
}
}
if((_374=_372.pseudoClassNames).length>0){
for(i=0;i<_374.length;i++){
var _377=_374[i].match(/^([^(]+)(?:\((.*)\))?$/);
var _378=_377[1];
var _379=_377[2];
switch(_378){
case "root":
_373.push("element.nodeType == 9 || element === element.ownerDocument.documentElement");
break;
case "nth-child":
case "nth-last-child":
case "nth-of-type":
case "nth-last-of-type":
_377=_379.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
if(!_377){
throw "Invalid argument to pseudo element nth-child: "+_379;
}
var a,b;
if(_377[0]=="odd"){
a=2;
b=1;
}else{
if(_377[0]=="even"){
a=2;
b=0;
}else{
a=_377[2]&&parseInt(_377)||null;
b=parseInt(_377[3]);
}
}
_373.push("this.nthChild(element,"+a+","+b+","+!!_378.match("^nth-last")+","+!!_378.match("of-type$")+")");
break;
case "first-child":
_373.push("this.nthChild(element, null, 1)");
break;
case "last-child":
_373.push("this.nthChild(element, null, 1, true)");
break;
case "first-of-type":
_373.push("this.nthChild(element, null, 1, false, true)");
break;
case "last-of-type":
_373.push("this.nthChild(element, null, 1, true, true)");
break;
case "only-child":
_373.push(childElements("element.parentNode")+".length == 1");
break;
case "only-of-type":
_373.push("MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, "+childElements("element.parentNode")+").length == 1");
break;
case "empty":
_373.push("element.childNodes.length == 0");
break;
case "enabled":
_373.push("(this.isUIElement(element) && element.disabled === false)");
break;
case "disabled":
_373.push("(this.isUIElement(element) && element.disabled === true)");
break;
case "checked":
_373.push("(this.isUIElement(element) && element.checked === true)");
break;
case "not":
var _37c=new MochiKit.Selector.Selector(_379);
_373.push("!( "+_37c.buildMatchExpression()+")");
break;
}
}
}
if(_374=_372.attributes){
MochiKit.Base.map(function(_37d){
var _37e="MochiKit.DOM.getNodeAttribute(element, "+repr(_37d.name)+")";
var _37f=function(_380){
return _37e+".split("+repr(_380)+")";
};
_373.push(_37e+" != null");
switch(_37d.operator){
case "=":
_373.push(_37e+" == "+repr(_37d.value));
break;
case "~=":
_373.push("MochiKit.Base.findValue("+_37f(" ")+", "+repr(_37d.value)+") > -1");
break;
case "^=":
_373.push(_37e+".substring(0, "+_37d.value.length+") == "+repr(_37d.value));
break;
case "$=":
_373.push(_37e+".substring("+_37e+".length - "+_37d.value.length+") == "+repr(_37d.value));
break;
case "*=":
_373.push(_37e+".match("+repr(_37d.value)+")");
break;
case "|=":
_373.push(_37f("-")+"[0].toUpperCase() == "+repr(_37d.value.toUpperCase()));
break;
case "!=":
_373.push(_37e+" != "+repr(_37d.value));
break;
case "":
case undefined:
break;
default:
throw "Unknown operator "+_37d.operator+" in selector";
}
},_374);
}
return _373.join(" && ");
},compileMatcher:function(){
var code="return (!element.tagName) ? false : "+this.buildMatchExpression()+";";
this.match=new Function("element",code);
},nthChild:function(_382,a,b,_385,_386){
var _387=MochiKit.Base.filter(function(node){
return node.nodeType==1;
},_382.parentNode.childNodes);
if(_386){
_387=MochiKit.Base.filter(function(node){
return node.tagName==_382.tagName;
},_387);
}
if(_385){
_387=MochiKit.Iter.reversed(_387);
}
if(a){
var _38a=MochiKit.Base.findIdentical(_387,_382);
return ((_38a+1-b)/a)%1==0;
}else{
return b==MochiKit.Base.findIdentical(_387,_382)+1;
}
},isUIElement:function(_38b){
return MochiKit.Base.findValue(["input","button","select","option","textarea","object"],_38b.tagName.toLowerCase())>-1;
},findElements:function(_38c,axis){
var _38e;
if(axis==undefined){
axis="";
}
function inScope(_38f,_390){
if(axis==""){
return MochiKit.DOM.isChildNode(_38f,_390);
}else{
if(axis==">"){
return _38f.parentNode===_390;
}else{
if(axis=="+"){
return _38f===nextSiblingElement(_390);
}else{
if(axis=="~"){
var _391=_390;
while(_391=nextSiblingElement(_391)){
if(_38f===_391){
return true;
}
}
return false;
}else{
throw "Invalid axis: "+axis;
}
}
}
}
}
if(_38e=MochiKit.DOM.getElement(this.params.id)){
if(this.match(_38e)){
if(!_38c||inScope(_38e,_38c)){
return [_38e];
}
}
}
function nextSiblingElement(node){
node=node.nextSibling;
while(node&&node.nodeType!=1){
node=node.nextSibling;
}
return node;
}
if(axis==""){
_38c=(_38c||MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName||"*");
}else{
if(axis==">"){
if(!_38c){
throw "> combinator not allowed without preceeding expression";
}
_38c=MochiKit.Base.filter(function(node){
return node.nodeType==1;
},_38c.childNodes);
}else{
if(axis=="+"){
if(!_38c){
throw "+ combinator not allowed without preceeding expression";
}
_38c=nextSiblingElement(_38c)&&[nextSiblingElement(_38c)];
}else{
if(axis=="~"){
if(!_38c){
throw "~ combinator not allowed without preceeding expression";
}
var _394=[];
while(nextSiblingElement(_38c)){
_38c=nextSiblingElement(_38c);
_394.push(_38c);
}
_38c=_394;
}
}
}
}
if(!_38c){
return [];
}
var _395=MochiKit.Base.filter(MochiKit.Base.bind(function(_396){
return this.match(_396);
},this),_38c);
return _395;
},repr:function(){
return "Selector("+this.expression+")";
},toString:MochiKit.Base.forwardCall("repr")};
MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_397,_398){
_397=MochiKit.DOM.getElement(_397);
var uniq=function(arr){
var res=[];
for(var i=0;i<arr.length;i++){
if(MochiKit.Base.findIdentical(res,arr[i])<0){
res.push(arr[i]);
}
}
return res;
};
return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_39d){
var _39e="";
var _39f=function(_3a0,expr){
var _3a2=expr.match(/^[>+~]$/);
if(_3a2){
_39e=_3a2[0];
return _3a0;
}else{
var _3a3=new MochiKit.Selector.Selector(expr);
var _3a4=MochiKit.Iter.reduce(function(_3a5,_3a6){
return MochiKit.Base.extend(_3a5,_3a3.findElements(_3a6||_397,_39e));
},_3a0,[]);
_39e="";
return _3a4;
}
};
var _3a7=_39d.replace(/(^\s+|\s+$)/g,"").split(/\s+/);
return uniq(MochiKit.Iter.reduce(_39f,_3a7,[null]));
},_398));
},findDocElements:function(){
return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(),arguments);
},__new__:function(){
this.$$=this.findDocElements;
MochiKit.Base.nameFunctions(this);
}});
MochiKit.Selector.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Selector);
MochiKit.Base._module("Style","1.5",["Base","DOM"]);
MochiKit.Style.Dimensions=function(w,h){
if(!(this instanceof MochiKit.Style.Dimensions)){
return new MochiKit.Style.Dimensions(w,h);
}
this.w=w;
this.h=h;
};
MochiKit.Style.Dimensions.prototype.__repr__=function(){
var repr=MochiKit.Base.repr;
return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}";
};
MochiKit.Style.Dimensions.prototype.toString=function(){
return this.__repr__();
};
MochiKit.Style.Coordinates=function(x,y){
if(!(this instanceof MochiKit.Style.Coordinates)){
return new MochiKit.Style.Coordinates(x,y);
}
this.x=x;
this.y=y;
};
MochiKit.Style.Coordinates.prototype.__repr__=function(){
var repr=MochiKit.Base.repr;
return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
};
MochiKit.Style.Coordinates.prototype.toString=function(){
return this.__repr__();
};
MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_3af){
var dom=MochiKit.DOM;
var d=dom._document;
elem=dom.getElement(elem);
_3af=MochiKit.Base.camelize(_3af);
if(!elem||elem==d){
return undefined;
}
if(_3af=="opacity"&&typeof (elem.filters)!="undefined"){
var _3b2=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/);
if(_3b2&&_3b2[1]){
return parseFloat(_3b2[1])/100;
}
return 1;
}
if(_3af=="float"||_3af=="cssFloat"||_3af=="styleFloat"){
if(elem.style["float"]){
return elem.style["float"];
}else{
if(elem.style.cssFloat){
return elem.style.cssFloat;
}else{
if(elem.style.styleFloat){
return elem.style.styleFloat;
}else{
return "none";
}
}
}
}
var _3b3=elem.style?elem.style[_3af]:null;
if(!_3b3){
if(d.defaultView&&d.defaultView.getComputedStyle){
var css=d.defaultView.getComputedStyle(elem,null);
_3af=_3af.replace(/([A-Z])/g,"-$1").toLowerCase();
_3b3=css?css.getPropertyValue(_3af):null;
}else{
if(elem.currentStyle){
_3b3=elem.currentStyle[_3af];
if(/^\d/.test(_3b3)&&!/px$/.test(_3b3)&&_3af!="fontWeight"){
var left=elem.style.left;
var _3b6=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
elem.style.left=_3b3||0;
_3b3=elem.style.pixelLeft+"px";
elem.style.left=left;
elem.runtimeStyle.left=_3b6;
}
}
}
}
if(_3af=="opacity"){
_3b3=parseFloat(_3b3);
}
if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.findValue(["left","top","right","bottom"],_3af)!=-1)){
if(MochiKit.Style.getStyle(elem,"position")=="static"){
_3b3="auto";
}
}
return _3b3=="auto"?null:_3b3;
},setStyle:function(elem,_3b8){
elem=MochiKit.DOM.getElement(elem);
for(var name in _3b8){
switch(name){
case "opacity":
MochiKit.Style.setOpacity(elem,_3b8[name]);
break;
case "float":
case "cssFloat":
case "styleFloat":
if(typeof (elem.style["float"])!="undefined"){
elem.style["float"]=_3b8[name];
}else{
if(typeof (elem.style.cssFloat)!="undefined"){
elem.style.cssFloat=_3b8[name];
}else{
elem.style.styleFloat=_3b8[name];
}
}
break;
default:
elem.style[MochiKit.Base.camelize(name)]=_3b8[name];
}
}
},setOpacity:function(elem,o){
elem=MochiKit.DOM.getElement(elem);
var self=MochiKit.Style;
if(o==1){
var _3bd=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent));
elem.style["opacity"]=_3bd?0.999999:1;
if(/MSIE/.test(navigator.userAgent)){
elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(o<0.00001){
o=0;
}
elem.style["opacity"]=o;
if(/MSIE/.test(navigator.userAgent)){
elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")";
}
}
},getElementPosition:function(elem,_3bf){
var self=MochiKit.Style;
var dom=MochiKit.DOM;
var _3c2=function(o){
return o!=null&&o.nodeType==null&&typeof (o.x)=="number"&&typeof (o.y)=="number";
};
if(typeof (elem)=="string"){
elem=dom.getElement(elem);
}
if(elem==null||(!_3c2(elem)&&self.getStyle(elem,"display")=="none")){
return undefined;
}
var c=new self.Coordinates(0,0);
var box=null;
var _3c6=null;
var d=MochiKit.DOM._document;
var de=d.documentElement;
var b=d.body;
if(!elem.parentNode&&elem.x&&elem.y){
c.x+=elem.x||0;
c.y+=elem.y||0;
}else{
if(elem.getBoundingClientRect){
box=elem.getBoundingClientRect();
c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
}else{
if(elem.offsetParent){
c.x+=elem.offsetLeft;
c.y+=elem.offsetTop;
_3c6=elem.offsetParent;
if(_3c6!=elem){
while(_3c6){
c.x+=parseInt(_3c6.style.borderLeftWidth)||0;
c.y+=parseInt(_3c6.style.borderTopWidth)||0;
c.x+=_3c6.offsetLeft;
c.y+=_3c6.offsetTop;
_3c6=_3c6.offsetParent;
}
}
var ua=navigator.userAgent.toLowerCase();
if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("AppleWebKit")!=-1&&self.getStyle(elem,"position")=="absolute")){
c.x-=b.offsetLeft;
c.y-=b.offsetTop;
}
if(elem.parentNode){
_3c6=elem.parentNode;
}else{
_3c6=null;
}
while(_3c6){
var _3cb=_3c6.tagName.toUpperCase();
if(_3cb==="BODY"||_3cb==="HTML"){
break;
}
var disp=self.getStyle(_3c6,"display");
if(disp.search(/^inline|table-row.*$/i)){
c.x-=_3c6.scrollLeft;
c.y-=_3c6.scrollTop;
}
if(_3c6.parentNode){
_3c6=_3c6.parentNode;
}else{
_3c6=null;
}
}
}
}
}
if(_3bf){
_3bf=arguments.callee(_3bf);
if(_3bf){
c.x-=(_3bf.x||0);
c.y-=(_3bf.y||0);
}
}
return c;
},setElementPosition:function(elem,_3ce,_3cf){
elem=MochiKit.DOM.getElement(elem);
if(typeof (_3cf)=="undefined"){
_3cf="px";
}
var _3d0={};
var _3d1=MochiKit.Base.isUndefinedOrNull;
if(!_3d1(_3ce.x)){
_3d0["left"]=_3ce.x+_3cf;
}
if(!_3d1(_3ce.y)){
_3d0["top"]=_3ce.y+_3cf;
}
MochiKit.DOM.updateNodeAttributes(elem,{"style":_3d0});
},makePositioned:function(_3d2){
_3d2=MochiKit.DOM.getElement(_3d2);
var pos=MochiKit.Style.getStyle(_3d2,"position");
if(pos=="static"||!pos){
_3d2.style.position="relative";
if(/Opera/.test(navigator.userAgent)){
_3d2.style.top=0;
_3d2.style.left=0;
}
}
},undoPositioned:function(_3d4){
_3d4=MochiKit.DOM.getElement(_3d4);
if(_3d4.style.position=="relative"){
_3d4.style.position=_3d4.style.top=_3d4.style.left=_3d4.style.bottom=_3d4.style.right="";
}
},makeClipping:function(_3d5){
_3d5=MochiKit.DOM.getElement(_3d5);
var s=_3d5.style;
var _3d7={"overflow":s.overflow,"overflow-x":s.overflowX,"overflow-y":s.overflowY};
if((MochiKit.Style.getStyle(_3d5,"overflow")||"visible")!="hidden"){
_3d5.style.overflow="hidden";
_3d5.style.overflowX="hidden";
_3d5.style.overflowY="hidden";
}
return _3d7;
},undoClipping:function(_3d8,_3d9){
_3d8=MochiKit.DOM.getElement(_3d8);
if(typeof (_3d9)=="string"){
_3d8.style.overflow=_3d9;
}else{
if(_3d9!=null){
_3d8.style.overflow=_3d9["overflow"];
_3d8.style.overflowX=_3d9["overflow-x"];
_3d8.style.overflowY=_3d9["overflow-y"];
}
}
},getElementDimensions:function(elem,_3db){
var self=MochiKit.Style;
var dom=MochiKit.DOM;
if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){
return new self.Dimensions(elem.w||0,elem.h||0);
}
elem=dom.getElement(elem);
if(!elem){
return undefined;
}
var disp=self.getStyle(elem,"display");
if(disp=="none"||disp==""||typeof (disp)=="undefined"){
var s=elem.style;
var _3e0=s.visibility;
var _3e1=s.position;
var _3e2=s.display;
s.visibility="hidden";
s.position="absolute";
s.display=self._getDefaultDisplay(elem);
var _3e3=elem.offsetWidth;
var _3e4=elem.offsetHeight;
s.display=_3e2;
s.position=_3e1;
s.visibility=_3e0;
}else{
_3e3=elem.offsetWidth||0;
_3e4=elem.offsetHeight||0;
}
if(_3db){
var _3e5="colSpan" in elem&&"rowSpan" in elem;
var _3e6=(_3e5&&elem.parentNode&&self.getStyle(elem.parentNode,"borderCollapse")=="collapse");
if(_3e6){
if(/MSIE/.test(navigator.userAgent)){
var _3e7=elem.previousSibling?0.5:1;
var _3e8=elem.nextSibling?0.5:1;
}else{
var _3e7=0.5;
var _3e8=0.5;
}
}else{
var _3e7=1;
var _3e8=1;
}
_3e3-=Math.round((parseFloat(self.getStyle(elem,"paddingLeft"))||0)+(parseFloat(self.getStyle(elem,"paddingRight"))||0)+_3e7*(parseFloat(self.getStyle(elem,"borderLeftWidth"))||0)+_3e8*(parseFloat(self.getStyle(elem,"borderRightWidth"))||0));
if(_3e5){
if(/Gecko|Opera/.test(navigator.userAgent)&&!/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent)){
var _3e9=0;
}else{
if(/MSIE/.test(navigator.userAgent)){
var _3e9=1;
}else{
var _3e9=_3e6?0.5:1;
}
}
}else{
var _3e9=1;
}
_3e4-=Math.round((parseFloat(self.getStyle(elem,"paddingTop"))||0)+(parseFloat(self.getStyle(elem,"paddingBottom"))||0)+_3e9*((parseFloat(self.getStyle(elem,"borderTopWidth"))||0)+(parseFloat(self.getStyle(elem,"borderBottomWidth"))||0)));
}
return new self.Dimensions(_3e3,_3e4);
},setElementDimensions:function(elem,_3eb,_3ec){
elem=MochiKit.DOM.getElement(elem);
if(typeof (_3ec)=="undefined"){
_3ec="px";
}
var _3ed={};
var _3ee=MochiKit.Base.isUndefinedOrNull;
if(!_3ee(_3eb.w)){
_3ed["width"]=_3eb.w+_3ec;
}
if(!_3ee(_3eb.h)){
_3ed["height"]=_3eb.h+_3ec;
}
MochiKit.DOM.updateNodeAttributes(elem,{"style":_3ed});
},_getDefaultDisplay:function(elem){
var self=MochiKit.Style;
var dom=MochiKit.DOM;
elem=dom.getElement(elem);
if(!elem){
return undefined;
}
var _3f2=elem.tagName.toUpperCase();
return self._defaultDisplay[_3f2]||"block";
},setDisplayForElement:function(_3f3,_3f4){
var _3f5=MochiKit.Base.extend(null,arguments,1);
var _3f6=MochiKit.DOM.getElement;
for(var i=0;i<_3f5.length;i++){
_3f4=_3f6(_3f5[i]);
if(_3f4){
_3f4.style.display=_3f3;
}
}
},getViewportDimensions:function(){
var d=new MochiKit.Style.Dimensions();
var w=MochiKit.DOM._window;
var b=MochiKit.DOM._document.body;
if(w.innerWidth){
d.w=w.innerWidth;
d.h=w.innerHeight;
}else{
if(b&&b.parentElement&&b.parentElement.clientWidth){
d.w=b.parentElement.clientWidth;
d.h=b.parentElement.clientHeight;
}else{
if(b&&b.clientWidth){
d.w=b.clientWidth;
d.h=b.clientHeight;
}
}
}
return d;
},getViewportPosition:function(){
var c=new MochiKit.Style.Coordinates(0,0);
var d=MochiKit.DOM._document;
var de=d.documentElement;
var db=d.body;
if(de&&(de.scrollTop||de.scrollLeft)){
c.x=de.scrollLeft;
c.y=de.scrollTop;
}else{
if(db){
c.x=db.scrollLeft;
c.y=db.scrollTop;
}
}
return c;
},__new__:function(){
var m=MochiKit.Base;
var _400=["A","ABBR","ACRONYM","B","BASEFONT","BDO","BIG","BR","CITE","CODE","DFN","EM","FONT","I","IMG","KBD","LABEL","Q","S","SAMP","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","TEXTAREA","TT","U","VAR"];
this._defaultDisplay={"TABLE":"table","THEAD":"table-header-group","TBODY":"table-row-group","TFOOT":"table-footer-group","COLGROUP":"table-column-group","COL":"table-column","TR":"table-row","TD":"table-cell","TH":"table-cell","CAPTION":"table-caption","LI":"list-item","INPUT":"inline-block","SELECT":"inline-block"};
if(/MSIE/.test(navigator.userAgent)){
for(var k in this._defaultDisplay){
var v=this._defaultDisplay[k];
if(v.indexOf("table")==0){
this._defaultDisplay[k]="block";
}
}
}
for(var i=0;i<_400.length;i++){
this._defaultDisplay[_400[i]]="inline";
}
m._deprecated(this,"elementPosition","MochiKit.Style.getElementPosition","1.3",true);
m._deprecated(this,"elementDimensions","MochiKit.Style.getElementDimensions","1.3",true);
this.hideElement=m.partial(this.setDisplayForElement,"none");
this.showElement=m.partial(this.setDisplayForElement,"block");
m.nameFunctions(this);
}});
MochiKit.Style.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Style);
MochiKit.Base._module("Signal","1.5",["Base","DOM","Style"]);
MochiKit.Signal._observers=[];
MochiKit.Signal.Event=function(src,e){
this._event=e||window.event;
this._src=src;
};
MochiKit.Signal.Event.__export__=false;
MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
var repr=MochiKit.Base.repr;
var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target());
if(this.type()&&this.type().indexOf("key")===0||this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu"){
str+=", modifier(): "+"{alt: "+repr(this.modifier().alt)+", ctrl: "+repr(this.modifier().ctrl)+", meta: "+repr(this.modifier().meta)+", shift: "+repr(this.modifier().shift)+", any: "+repr(this.modifier().any)+"}";
}
if(this.type()&&this.type().indexOf("key")===0){
str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}";
}
if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
str+=", mouse(): {page: "+repr(this.mouse().page)+", client: "+repr(this.mouse().client);
if(this.type()!="mousemove"&&this.type()!="mousewheel"){
str+=", button: {left: "+repr(this.mouse().button.left)+", middle: "+repr(this.mouse().button.middle)+", right: "+repr(this.mouse().button.right)+"}";
}
if(this.type()=="mousewheel"){
str+=", wheel: "+repr(this.mouse().wheel);
}
str+="}";
}
if(this.type()=="mouseover"||this.type()=="mouseout"||this.type()=="mouseenter"||this.type()=="mouseleave"){
str+=", relatedTarget(): "+repr(this.relatedTarget());
}
str+="}";
return str;
},toString:function(){
return this.__repr__();
},src:function(){
return this._src;
},event:function(){
return this._event;
},type:function(){
if(this._event.type==="DOMMouseScroll"){
return "mousewheel";
}else{
return this._event.type||undefined;
}
},target:function(){
return this._event.target||this._event.srcElement;
},_relatedTarget:null,relatedTarget:function(){
if(this._relatedTarget!==null){
return this._relatedTarget;
}
var elem=null;
if(this.type()=="mouseover"||this.type()=="mouseenter"){
elem=(this._event.relatedTarget||this._event.fromElement);
}else{
if(this.type()=="mouseout"||this.type()=="mouseleave"){
elem=(this._event.relatedTarget||this._event.toElement);
}
}
try{
if(elem!==null&&elem.nodeType!==null){
this._relatedTarget=elem;
return elem;
}
}
catch(ignore){
}
return undefined;
},_modifier:null,modifier:function(){
if(this._modifier!==null){
return this._modifier;
}
var m={};
m.alt=this._event.altKey;
m.ctrl=this._event.ctrlKey;
m.meta=this._event.metaKey||false;
m.shift=this._event.shiftKey;
m.any=m.alt||m.ctrl||m.shift||m.meta;
this._modifier=m;
return m;
},_key:null,key:function(){
if(this._key!==null){
return this._key;
}
var k={};
if(this.type()&&this.type().indexOf("key")===0){
if(this.type()=="keydown"||this.type()=="keyup"){
k.code=this._event.keyCode;
k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN");
this._key=k;
return k;
}else{
if(this.type()=="keypress"){
k.code=0;
k.string="";
if(typeof (this._event.charCode)!="undefined"&&this._event.charCode!==0&&!MochiKit.Signal._specialMacKeys[this._event.charCode]){
k.code=this._event.charCode;
k.string=String.fromCharCode(k.code);
}else{
if(this._event.keyCode&&typeof (this._event.charCode)=="undefined"){
k.code=this._event.keyCode;
k.string=String.fromCharCode(k.code);
}
}
this._key=k;
return k;
}
}
}
return undefined;
},_mouse:null,mouse:function(){
if(this._mouse!==null){
return this._mouse;
}
var m={};
var e=this._event;
if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
m.client=new MochiKit.Style.Coordinates(0,0);
if(e.clientX||e.clientY){
m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX;
m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY;
}
m.page=new MochiKit.Style.Coordinates(0,0);
if(e.pageX||e.pageY){
m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX;
m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY;
}else{
var de=MochiKit.DOM._document.documentElement;
var b=MochiKit.DOM._document.body;
m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
}
if(this.type()!="mousemove"&&this.type()!="mousewheel"){
m.button={};
m.button.left=false;
m.button.right=false;
m.button.middle=false;
if(e.which){
m.button.left=(e.which==1);
m.button.middle=(e.which==2);
m.button.right=(e.which==3);
}else{
m.button.left=!!(e.button&1);
m.button.right=!!(e.button&2);
m.button.middle=!!(e.button&4);
}
}
if(this.type()=="mousewheel"){
m.wheel=new MochiKit.Style.Coordinates(0,0);
if(e.wheelDeltaX||e.wheelDeltaY){
m.wheel.x=e.wheelDeltaX/-40||0;
m.wheel.y=e.wheelDeltaY/-40||0;
}else{
if(e.wheelDelta){
m.wheel.y=e.wheelDelta/-40;
}else{
m.wheel.y=e.detail||0;
}
}
}
this._mouse=m;
return m;
}
return undefined;
},stop:function(){
this.stopPropagation();
this.preventDefault();
},stopPropagation:function(){
if(this._event.stopPropagation){
this._event.stopPropagation();
}else{
this._event.cancelBubble=true;
}
},preventDefault:function(){
if(this._event.preventDefault){
this._event.preventDefault();
}else{
if(this._confirmUnload===null){
this._event.returnValue=false;
}
}
},_confirmUnload:null,confirmUnload:function(msg){
if(this.type()=="beforeunload"){
this._confirmUnload=msg;
this._event.returnValue=msg;
}
}});
MochiKit.Signal._specialMacKeys={3:"KEY_ENTER",63289:"KEY_NUM_PAD_CLEAR",63276:"KEY_PAGE_UP",63277:"KEY_PAGE_DOWN",63275:"KEY_END",63273:"KEY_HOME",63234:"KEY_ARROW_LEFT",63232:"KEY_ARROW_UP",63235:"KEY_ARROW_RIGHT",63233:"KEY_ARROW_DOWN",63302:"KEY_INSERT",63272:"KEY_DELETE"};
(function(){
var _410=MochiKit.Signal._specialMacKeys;
for(var i=63236;i<=63242;i++){
_410[i]="KEY_F"+(i-63236+1);
}
})();
MochiKit.Signal._specialKeys={8:"KEY_BACKSPACE",9:"KEY_TAB",12:"KEY_NUM_PAD_CLEAR",13:"KEY_ENTER",16:"KEY_SHIFT",17:"KEY_CTRL",18:"KEY_ALT",19:"KEY_PAUSE",20:"KEY_CAPS_LOCK",27:"KEY_ESCAPE",32:"KEY_SPACEBAR",33:"KEY_PAGE_UP",34:"KEY_PAGE_DOWN",35:"KEY_END",36:"KEY_HOME",37:"KEY_ARROW_LEFT",38:"KEY_ARROW_UP",39:"KEY_ARROW_RIGHT",40:"KEY_ARROW_DOWN",44:"KEY_PRINT_SCREEN",45:"KEY_INSERT",46:"KEY_DELETE",59:"KEY_SEMICOLON",91:"KEY_WINDOWS_LEFT",92:"KEY_WINDOWS_RIGHT",93:"KEY_SELECT",106:"KEY_NUM_PAD_ASTERISK",107:"KEY_NUM_PAD_PLUS_SIGN",109:"KEY_NUM_PAD_HYPHEN-MINUS",110:"KEY_NUM_PAD_FULL_STOP",111:"KEY_NUM_PAD_SOLIDUS",144:"KEY_NUM_LOCK",145:"KEY_SCROLL_LOCK",186:"KEY_SEMICOLON",187:"KEY_EQUALS_SIGN",188:"KEY_COMMA",189:"KEY_HYPHEN-MINUS",190:"KEY_FULL_STOP",191:"KEY_SOLIDUS",192:"KEY_GRAVE_ACCENT",219:"KEY_LEFT_SQUARE_BRACKET",220:"KEY_REVERSE_SOLIDUS",221:"KEY_RIGHT_SQUARE_BRACKET",222:"KEY_APOSTROPHE"};
(function(){
var _412=MochiKit.Signal._specialKeys;
for(var i=48;i<=57;i++){
_412[i]="KEY_"+(i-48);
}
for(i=65;i<=90;i++){
_412[i]="KEY_"+String.fromCharCode(i);
}
for(i=96;i<=105;i++){
_412[i]="KEY_NUM_PAD_"+(i-96);
}
for(i=112;i<=123;i++){
_412[i]="KEY_F"+(i-112+1);
}
})();
MochiKit.Signal.Ident=function(_414){
this.source=_414.source;
this.signal=_414.signal;
this.listener=_414.listener;
this.isDOM=_414.isDOM;
this.objOrFunc=_414.objOrFunc;
this.funcOrStr=_414.funcOrStr;
this.connected=_414.connected;
};
MochiKit.Signal.Ident.__export__=false;
MochiKit.Signal.Ident.prototype={};
MochiKit.Base.update(MochiKit.Signal,{_unloadCache:function(){
var self=MochiKit.Signal;
var _416=self._observers;
for(var i=0;i<_416.length;i++){
if(_416[i].signal!=="onload"&&_416[i].signal!=="onunload"){
self._disconnect(_416[i]);
}
}
},_listener:function(src,sig,func,obj,_41c){
var self=MochiKit.Signal;
var E=self.Event;
if(!_41c){
if(typeof (func.im_self)=="undefined"){
return MochiKit.Base.bindLate(func,obj);
}else{
return func;
}
}
obj=obj||src;
if(typeof (func)=="string"){
if(sig==="onload"||sig==="onunload"){
return function(_41f){
obj[func].apply(obj,[new E(src,_41f)]);
var _420=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:obj,funcOrStr:func});
MochiKit.Signal._disconnect(_420);
};
}else{
return function(_421){
obj[func].apply(obj,[new E(src,_421)]);
};
}
}else{
if(sig==="onload"||sig==="onunload"){
return function(_422){
func.apply(obj,[new E(src,_422)]);
var _423=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:func});
MochiKit.Signal._disconnect(_423);
};
}else{
return function(_424){
func.apply(obj,[new E(src,_424)]);
};
}
}
},_browserAlreadyHasMouseEnterAndLeave:function(){
return /MSIE/.test(navigator.userAgent);
},_browserLacksMouseWheelEvent:function(){
return /Gecko\//.test(navigator.userAgent);
},_mouseEnterListener:function(src,sig,func,obj){
var E=MochiKit.Signal.Event;
return function(_42a){
var e=new E(src,_42a);
try{
e.relatedTarget().nodeName;
}
catch(err){
return;
}
e.stop();
if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
return;
}
e.type=function(){
return sig;
};
if(typeof (func)=="string"){
return obj[func].apply(obj,[e]);
}else{
return func.apply(obj,[e]);
}
};
},_getDestPair:function(_42c,_42d){
var obj=null;
var func=null;
if(typeof (_42d)!="undefined"){
obj=_42c;
func=_42d;
if(typeof (_42d)=="string"){
if(typeof (_42c[_42d])!="function"){
throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
}
}else{
if(typeof (_42d)!="function"){
throw new Error("'funcOrStr' must be a function or string");
}
}
}else{
if(typeof (_42c)!="function"){
throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
}else{
func=_42c;
}
}
return [obj,func];
},connect:function(src,sig,_432,_433){
if(typeof (src)=="string"){
src=MochiKit.DOM.getElement(src);
}
var self=MochiKit.Signal;
if(typeof (sig)!="string"){
throw new Error("'sig' must be a string");
}
var _435=self._getDestPair(_432,_433);
var obj=_435[0];
var func=_435[1];
if(typeof (obj)=="undefined"||obj===null){
obj=src;
}
var _438=!!(src.addEventListener||src.attachEvent);
if(_438&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){
var _439=self._mouseEnterListener(src,sig.substr(2),func,obj);
if(sig==="onmouseenter"){
sig="onmouseover";
}else{
sig="onmouseout";
}
}else{
if(_438&&sig=="onmousewheel"&&self._browserLacksMouseWheelEvent()){
var _439=self._listener(src,sig,func,obj,_438);
sig="onDOMMouseScroll";
}else{
var _439=self._listener(src,sig,func,obj,_438);
}
}
if(src.addEventListener){
src.addEventListener(sig.substr(2),_439,false);
}else{
if(src.attachEvent){
src.attachEvent(sig,_439);
}
}
var _43a=new MochiKit.Signal.Ident({source:src,signal:sig,listener:_439,isDOM:_438,objOrFunc:_432,funcOrStr:_433,connected:true});
self._observers.push(_43a);
if(!_438&&typeof (src.__connect__)=="function"){
var args=MochiKit.Base.extend([_43a],arguments,1);
src.__connect__.apply(src,args);
}
return _43a;
},_disconnect:function(_43c){
if(!_43c.connected){
return;
}
_43c.connected=false;
var src=_43c.source;
var sig=_43c.signal;
var _43f=_43c.listener;
if(!_43c.isDOM){
if(typeof (src.__disconnect__)=="function"){
src.__disconnect__(_43c,sig,_43c.objOrFunc,_43c.funcOrStr);
}
return;
}
if(src.removeEventListener){
src.removeEventListener(sig.substr(2),_43f,false);
}else{
if(src.detachEvent){
src.detachEvent(sig,_43f);
}else{
throw new Error("'src' must be a DOM element");
}
}
},disconnect:function(_440){
var self=MochiKit.Signal;
var _442=self._observers;
var m=MochiKit.Base;
if(arguments.length>1){
var src=arguments[0];
if(typeof (src)=="string"){
src=MochiKit.DOM.getElement(src);
}
var sig=arguments[1];
var obj=arguments[2];
var func=arguments[3];
for(var i=_442.length-1;i>=0;i--){
var o=_442[i];
if(o.source===src&&o.signal===sig&&o.objOrFunc===obj&&o.funcOrStr===func){
self._disconnect(o);
if(!self._lock){
_442.splice(i,1);
}else{
self._dirty=true;
}
return true;
}
}
}else{
var idx=m.findIdentical(_442,_440);
if(idx>=0){
self._disconnect(_440);
if(!self._lock){
_442.splice(idx,1);
}else{
self._dirty=true;
}
return true;
}
}
return false;
},disconnectAllTo:function(_44b,_44c){
var self=MochiKit.Signal;
var _44e=self._observers;
var _44f=self._disconnect;
var _450=self._lock;
var _451=self._dirty;
if(typeof (_44c)==="undefined"){
_44c=null;
}
for(var i=_44e.length-1;i>=0;i--){
var _453=_44e[i];
if(_453.objOrFunc===_44b&&(_44c===null||_453.funcOrStr===_44c)){
_44f(_453);
if(_450){
_451=true;
}else{
_44e.splice(i,1);
}
}
}
self._dirty=_451;
},disconnectAll:function(src,sig){
if(typeof (src)=="string"){
src=MochiKit.DOM.getElement(src);
}
var m=MochiKit.Base;
var _457=m.flattenArguments(m.extend(null,arguments,1));
var self=MochiKit.Signal;
var _459=self._disconnect;
var _45a=self._observers;
var i,_45c;
var _45d=self._lock;
var _45e=self._dirty;
if(_457.length===0){
for(i=_45a.length-1;i>=0;i--){
_45c=_45a[i];
if(_45c.source===src){
_459(_45c);
if(!_45d){
_45a.splice(i,1);
}else{
_45e=true;
}
}
}
}else{
var sigs={};
for(i=0;i<_457.length;i++){
sigs[_457[i]]=true;
}
for(i=_45a.length-1;i>=0;i--){
_45c=_45a[i];
if(_45c.source===src&&_45c.signal in sigs){
_459(_45c);
if(!_45d){
_45a.splice(i,1);
}else{
_45e=true;
}
}
}
}
self._dirty=_45e;
},signal:function(src,sig){
var self=MochiKit.Signal;
var _463=self._observers;
if(typeof (src)=="string"){
src=MochiKit.DOM.getElement(src);
}
var args=MochiKit.Base.extend(null,arguments,2);
var _465=[];
self._lock=true;
for(var i=0;i<_463.length;i++){
var _467=_463[i];
if(_467.source===src&&_467.signal===sig&&_467.connected){
try{
if(_467.isDOM&&_467.funcOrStr!=null){
var obj=_467.objOrFunc;
obj[_467.funcOrStr].apply(obj,args);
}else{
if(_467.isDOM){
_467.objOrFunc.apply(src,args);
}else{
_467.listener.apply(src,args);
}
}
}
catch(e){
_465.push(e);
}
}
}
self._lock=false;
if(self._dirty){
self._dirty=false;
for(var i=_463.length-1;i>=0;i--){
if(!_463[i].connected){
_463.splice(i,1);
}
}
}
if(_465.length==1){
throw _465[0];
}else{
if(_465.length>1){
var e=new Error("Multiple errors thrown in handling 'sig', see errors property");
e.errors=_465;
throw e;
}
}
}});
MochiKit.Signal.__new__=function(win){
var m=MochiKit.Base;
this._document=document;
this._window=win;
this._lock=false;
this._dirty=false;
try{
this.connect(window,"onunload",this._unloadCache);
}
catch(e){
}
m.nameFunctions(this);
};
MochiKit.Signal.__new__(this);
if(MochiKit.__export__){
connect=MochiKit.Signal.connect;
disconnect=MochiKit.Signal.disconnect;
disconnectAll=MochiKit.Signal.disconnectAll;
signal=MochiKit.Signal.signal;
}
MochiKit.Base._exportSymbols(this,MochiKit.Signal);
MochiKit.Base._module("Position","1.5",["Base","DOM","Style"]);
MochiKit.Base.update(MochiKit.Position,{__export__:false,includeScrollOffsets:false,prepare:function(){
var _46c=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
var _46d=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
this.windowOffset=new MochiKit.Style.Coordinates(_46c,_46d);
},cumulativeOffset:function(_46e){
var _46f=0;
var _470=0;
do{
_46f+=_46e.offsetTop||0;
_470+=_46e.offsetLeft||0;
_46e=_46e.offsetParent;
}while(_46e);
return new MochiKit.Style.Coordinates(_470,_46f);
},realOffset:function(_471){
var _472=0;
var _473=0;
do{
_472+=_471.scrollTop||0;
_473+=_471.scrollLeft||0;
_471=_471.parentNode;
}while(_471);
return new MochiKit.Style.Coordinates(_473,_472);
},within:function(_474,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_474,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_474);
if(_474.style.position=="fixed"){
this.offset.x+=this.windowOffset.x;
this.offset.y+=this.windowOffset.y;
}
return (y>=this.offset.y&&y<this.offset.y+_474.offsetHeight&&x>=this.offset.x&&x<this.offset.x+_474.offsetWidth);
},withinIncludingScrolloffsets:function(_477,x,y){
var _47a=this.realOffset(_477);
this.xcomp=x+_47a.x-this.windowOffset.x;
this.ycomp=y+_47a.y-this.windowOffset.y;
this.offset=this.cumulativeOffset(_477);
return (this.ycomp>=this.offset.y&&this.ycomp<this.offset.y+_477.offsetHeight&&this.xcomp>=this.offset.x&&this.xcomp<this.offset.x+_477.offsetWidth);
},overlap:function(mode,_47c){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset.y+_47c.offsetHeight)-this.ycomp)/_47c.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset.x+_47c.offsetWidth)-this.xcomp)/_47c.offsetWidth;
}
},absolutize:function(_47d){
_47d=MochiKit.DOM.getElement(_47d);
if(_47d.style.position=="absolute"){
return;
}
MochiKit.Position.prepare();
var _47e=MochiKit.Position.positionedOffset(_47d);
var _47f=_47d.clientWidth;
var _480=_47d.clientHeight;
var _481={"position":_47d.style.position,"left":_47e.x-parseFloat(_47d.style.left||0),"top":_47e.y-parseFloat(_47d.style.top||0),"width":_47d.style.width,"height":_47d.style.height};
_47d.style.position="absolute";
_47d.style.top=_47e.y+"px";
_47d.style.left=_47e.x+"px";
_47d.style.width=_47f+"px";
_47d.style.height=_480+"px";
return _481;
},positionedOffset:function(_482){
var _483=0,_484=0;
do{
_483+=_482.offsetTop||0;
_484+=_482.offsetLeft||0;
_482=_482.offsetParent;
if(_482){
var p=MochiKit.Style.getStyle(_482,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_482);
return new MochiKit.Style.Coordinates(_484,_483);
},relativize:function(_486,_487){
_486=MochiKit.DOM.getElement(_486);
if(_486.style.position=="relative"){
return;
}
MochiKit.Position.prepare();
var top=parseFloat(_486.style.top||0)-(_487["top"]||0);
var left=parseFloat(_486.style.left||0)-(_487["left"]||0);
_486.style.position=_487["position"];
_486.style.top=top+"px";
_486.style.left=left+"px";
_486.style.width=_487["width"];
_486.style.height=_487["height"];
},clone:function(_48a,_48b){
_48a=MochiKit.DOM.getElement(_48a);
_48b=MochiKit.DOM.getElement(_48b);
_48b.style.position="absolute";
var _48c=this.cumulativeOffset(_48a);
_48b.style.top=_48c.y+"px";
_48b.style.left=_48c.x+"px";
_48b.style.width=_48a.offsetWidth+"px";
_48b.style.height=_48a.offsetHeight+"px";
},page:function(_48d){
var _48e=0;
var _48f=0;
var _490=_48d;
do{
_48e+=_490.offsetTop||0;
_48f+=_490.offsetLeft||0;
if(_490.offsetParent==document.body&&MochiKit.Style.getStyle(_490,"position")=="absolute"){
break;
}
}while(_490=_490.offsetParent);
_490=_48d;
do{
_48e-=_490.scrollTop||0;
_48f-=_490.scrollLeft||0;
}while(_490=_490.parentNode);
return new MochiKit.Style.Coordinates(_48f,_48e);
}});
MochiKit.Position.__new__=function(win){
MochiKit.Base.nameFunctions(this);
};
MochiKit.Position.__new__(this);
MochiKit.Base._exportSymbols(this,MochiKit.Position);
if(typeof (MochiKit)=="undefined"){
MochiKit={};
}
if(typeof (MochiKit.MochiKit)=="undefined"){
MochiKit.MochiKit={};
}
MochiKit.MochiKit.NAME="MochiKit.MochiKit";
MochiKit.MochiKit.VERSION="1.5";
MochiKit.MochiKit.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.MochiKit.toString=function(){
return this.__repr__();
};
MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Text","Async","DOM","Selector","Style","LoggingPane","Color","Signal","Position","Visual","DragAndDrop","Sortable"];
(function(){
if(typeof (document)=="undefined"){
return;
}
var _492=document.getElementsByTagName("script");
var _493="http://www.w3.org/1999/xhtml";
var _494="http://www.w3.org/2000/svg";
var _495="http://www.w3.org/1999/xlink";
var _496="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var base=null;
var _498=null;
var _499={};
var i;
var src;
for(i=0;i<_492.length;i++){
src=null;
switch(_492[i].namespaceURI){
case _494:
src=_492[i].getAttributeNS(_495,"href");
break;
default:
src=_492[i].getAttribute("src");
break;
}
if(!src){
continue;
}
_499[src]=true;
if(src.match(/MochiKit.js(\?.*)?$/)){
base=src.substring(0,src.lastIndexOf("MochiKit.js"));
_498=_492[i];
}
}
if(base===null){
return;
}
var _49c=MochiKit.MochiKit.SUBMODULES;
for(var i=0;i<_49c.length;i++){
if(MochiKit[_49c[i]]){
continue;
}
var uri=base+_49c[i]+".js";
if(uri in _499){
continue;
}
if(_498.namespaceURI==_494||_498.namespaceURI==_496){
var s=document.createElementNS(_498.namespaceURI,"script");
s.setAttribute("id","MochiKit_"+base+_49c[i]);
if(_498.namespaceURI==_494){
s.setAttributeNS(_495,"href",uri);
}else{
s.setAttribute("src",uri);
}
s.setAttribute("type","application/x-javascript");
_498.parentNode.appendChild(s);
}else{
document.write("<"+_498.nodeName+" src=\""+uri+"\" type=\"text/javascript\"></script>");
}
}
})();
var tooltip_style="            position:absolute;           background:#FFFFFF;          padding:0.3em;                 border: 1px solid grey;     font-size:8pt;           ";
var tooltip_css={"id":"tooltip","style":tooltip_style};
var Tooltip={};
Tooltip.create=function(e){
var area=e.src();
if(getNodeAttribute(area,"title")){
setNodeAttribute(area,"title_",getNodeAttribute(area,"title").slice(0));
removeNodeAttribute(area,"title");
}
var _4a1=$("tooltip");
var _4a2=Tooltip.build(area);
if(!_4a1){
appendChildNodes(document.body,_4a2);
}else{
swapDOM(_4a1,_4a2);
}
var _4a3=Tooltip.get_position(e,_4a2);
setElementPosition(_4a2,_4a3);
disconnectAll(area,"onmouseover");
connect(area,"onmousemove",Tooltip.move);
connect(area,"onmouseout",Tooltip.destroy);
return 1;
};
Tooltip.build=function(area){
var _4a5=getNodeAttribute(area,"title_");
var _4a6=_4a5;
var _4a7=DIV(tooltip_css);
var _4a8=DIV({},_4a6);
_4a7.appendChild(_4a8);
return _4a7;
};
Tooltip.move=function(_4a9){
var _4aa=getElement("tooltip");
if(_4aa!=undefined){
var _4ab=Tooltip.get_position(_4a9,_4aa);
setElementPosition(_4aa,_4ab);
return 1;
}
return 0;
};
Tooltip.get_position=function(_4ac,_4ad){
var ms=_4ac.mouse();
var _4af=getElementDimensions(_4ad);
var _4b0=getViewportDimensions();
var _4b1={"x":0,"y":0};
if(false&&_4b0.w<_4af.w+ms.page.x+10){
_4b1.x=ms.page.x-_4af.w-10;
}else{
_4b1.x=ms.page.x+10;
}
if(false&&_4b0.h<_4af.h+ms.page.y+10){
_4b1.y=ms.page.y-_4af.h-5;
}else{
_4b1.y=ms.page.y+5;
}
return _4b1;
};
Tooltip.destroy=function(_4b2){
var area=_4b2.src();
var _4b4=getElement("tooltip");
swapDOM(_4b4,null);
connect(area,"onmouseover",Tooltip.create);
disconnect(area,"onmousemove",Tooltip.move);
disconnect(area,"onmouseout",Tooltip.destroy);
};
function connectEach(_4b5,_4b6,dest,func){
return map(function(el){
return connect(el,_4b6,dest,func);
},_4b5);
}
function signal_el(el,type){
signal(el,type,{stop:noop,src:function(){
return getElement(el);
}});
}
function toggle_compare(){
var _4bc=getFirstElementByTagAndClassName("span",null,"more-info");
if($("info-block").style.display!="block"){
blindDown("info-block",{duration:0.3});
for(var i=0;i<5;i++){
callLater(0.0603*i,partial(function(_4be,i){
setStyle(_4be,{"background-position":((4-i)*-13)+"px 0"});
},_4bc,i));
}
}else{
blindUp("info-block",{duration:0.3});
for(var i=0;i<5;i++){
callLater(0.0612*i,partial(function(_4c0,i){
setStyle(_4c0,{"background-position":((i+1)*-13)+"px 0"});
},_4bc,i));
}
}
}
function showPopup(e){
showElement("dialog");
showElement("overlay");
setElementDimensions("overlay",getElementDimensions(document.body));
$("overlay").style["filter"]="alpha(opacity=50)";
e.stop();
}
connect(window,"onDOMload",function(e){
if($("more-info")){
connect("more-info","onclick",toggle_compare);
}
if($("modal-popup")){
connect("modal-popup","onclick",showPopup);
}
connectEach($$("a.modal-close"),"onclick",function(e){
e.stop();
hideElement("dialog");
hideElement("overlay");
});
});
function doSimplePostXMLHttpRequest(url){
var self=MochiKit.Async;
var req=self.getXMLHttpRequest();
if(arguments.length>1){
var m=MochiKit.Base;
var qs=m.queryString.apply(null,m.extend(null,arguments,1));
}
req.open("POST",url,true);
var _4ca=["X-Requested-With","XMLHttpRequest","X-MochiKit-Version",MochiKit.Async.VERSION,"Accept","text/javascript, text/html, application/xml, text/xml, */*","Content-type","application/x-www-form-urlencoded"];
if(req.overrideMimeType){
_4ca.push("Connection","close");
}
for(var i=0;i<_4ca.length;i+=2){
req.setRequestHeader(_4ca[i],_4ca[i+1]);
}
return self.sendXMLHttpRequest(req,qs);
}
var shortMonths=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"];
var longMonths=["January","February","March","April","May","June","July","August","September","October","November","December"];
var shortDays=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"];
var longDays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var american=false;
function ordered_day_month(d){
if(!american){
return d.getDate()+" "+shortMonths[d.getMonth()];
}else{
return shortMonths[d.getMonth()]+" "+d.getDate();
}
}
function formatDate(d,end){
var _4cf=isoTimestamp(getElement("now").innerHTML);
if(d.getFullYear()==_4cf.getFullYear()){
var _4d0=ordered_day_month(end);
}else{
var _4d0=ordered_day_month(end)+" "+(end.getFullYear()).toString().substring(2);
}
if(end!==null){
if(d.getFullYear()==end.getFullYear()){
if(d.getMonth()==end.getMonth()){
if(d.getDate()==end.getDate()){
if(d.getHours()==end.getHours()){
return _4d0;
}else{
return (d.getHours()+100).toString().substring(1)+":00 - "+(end.getHours()+100).toString().substring(1)+":59";
}
}else{
if(american&&d.getFullYear()==_4cf.getFullYear()){
return ordered_day_month(d)+" - "+end.getDate();
}else{
if(american){
return ordered_day_month(d)+" - "+end.getDate()+" "+(end.getFullYear()).toString().substring(2);
}else{
return d.getDate()+" - "+_4d0;
}
}
}
}else{
return ordered_day_month(d)+" - "+_4d0;
}
}else{
return ordered_day_month(d)+" "+(d.getFullYear()).toString().substring(2)+" - "+_4d0;
}
}else{
}
}
connect(window,"onDOMload",function(e){
connectEach($$("#date-tabs li"),"onclick",function(e){
forEach($$("#date-tabs li"),function(_4d3){
removeElementClass(_4d3,"selected");
});
addElementClass(e.src(),"selected");
var _4d4=getFirstElementByTagAndClassName("span",null,e.src());
var _4d5=_4d4.innerHTML;
forEach(concat(getElementsByTagAndClassName("select",null,"date-selectors"),getElementsByTagAndClassName("div",null,"shortcuts"),getElementsByTagAndClassName("div",null,"compare-shortcuts")),function(_4d6){
if(hasElementClass(_4d6,_4d5)){
_4d6.style.display="inline";
}else{
hideElement(_4d6);
}
});
$("granularity").value=_4d5.toLowerCase();
e.stop();
});
var ole=getElement("oldest-log");
if(!ole){
return;
}
var _4d8=isoTimestamp(ole.innerHTML);
var _4d9=new Date(_4d8.getFullYear(),_4d8.getMonth(),_4d8.getDate(),_4d8.getHours());
var _4da=new Date(_4d8.getFullYear(),_4d8.getMonth(),_4d8.getDate());
var _4db=new Date(_4d8.getFullYear(),_4d8.getMonth(),1);
var now=getElement("now");
var _4dd=isoTimestamp(now.innerHTML);
var _4de=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
var _4df=filter(function(_4e0){
return $("date-"+_4e0);
},["select","select-to","compare","compare-to"]);
function pad_digits(h,_4e2){
_4e2=(typeof _4e2=="undefined")?2:_4e2;
return (parseInt(h,10)+Math.pow(10,_4e2)).toString().substring(1);
}
function days_since(_4e3,date){
date=(typeof date=="undefined")?_4de:date;
return Math.ceil((date-_4e3)/86400000);
}
function createShortcuts(_4e5,_4e6,_4e7,_4e8){
var _4e9=new Array();
forEach(_4e5,function(no){
if($(_4e6).options.length>no){
var _4eb=A({href:"#"},"Last "+no+" "+_4e7);
connect(_4eb,"onclick",function(e){
e.stop();
$(_4e6).selectedIndex=$(_4e6).options.length-no-1;
filterDate("select");
$(_4e6+"-to").selectedIndex=$(_4e6+"-to").options.length-2;
filterDate("select-to");
});
_4e9.push(" | ");
_4e9.push(_4eb);
}
});
if(_4e9.length){
appendChildNodes("shortcuts",DIV({"class":_4e8},_4e9));
}
}
function filterDate(v){
var _4ee=$("month-year-"+v).value.split("-");
var _4ef=parseInt(_4ee[1],10)-1;
var _4f0=new Date(parseInt(_4ee[0],10),_4ef,1);
forEach($$("#date-"+v+" option"),function(_4f1){
_4f0.setDate(parseInt(_4f1.value,10));
_4f1.innerHTML=shortDays[_4f0.getDay()]+", "+_4f1.value;
if(_4f0.getMonth()!=_4ef||_4f0<_4da||_4f0>_4de){
if($("month-year-"+v).options.length==1){
removeElement(_4f1);
}else{
setNodeAttribute(_4f1,"style",{color:"#aaa"});
}
}else{
setNodeAttribute(_4f1,"style",{color:"Black"});
}
});
filterHour(v);
}
function filterHour(v){
var _4f3=$("month-year-"+v).value.split("-");
var _4f4=parseInt(_4f3[1],10)-1;
var _4f5=new Date(parseInt(_4f3[0],10),_4f4,parseInt($("date-"+v).value,10));
if(_4f5.getTime()==_4da.getTime()||_4f5.getTime()==_4de.getTime()){
forEach($$("#time-"+v+" option"),function(_4f6){
_4f5.setHours(parseInt(_4f6.value,10));
if(_4f5<_4d9||_4f5>_4dd){
if($("date-"+v).options.length==1){
removeElement(_4f6);
}else{
setNodeAttribute(_4f6,"style",{color:"#aaa"});
}
}else{
setNodeAttribute(_4f6,"style",{color:"Black"});
}
});
}else{
forEach($$("#time-"+v+" option"),function(_4f7){
setNodeAttribute(_4f7,"style",{color:"Black"});
});
}
}
var _4f8={};
forEach(_4df,function(v){
_4f8[v]=new Array();
});
for(var h=0;h<=23;h++){
forEach(_4df,function(v){
if(v.match("-to$")=="-to"){
_4f8[v].push(OPTION({value:pad_digits(h)},pad_digits(h)+":59"));
}else{
_4f8[v].push(OPTION({value:pad_digits(h)},pad_digits(h)+":00"));
}
});
}
forEach(_4df,function(v){
replaceChildNodes("time-"+v,_4f8[v]);
});
var _4fd={};
forEach(_4df,function(v){
_4fd[v]=new Array();
});
for(var d=1;d<=31;d++){
forEach(_4df,function(v){
_4fd[v].push(OPTION({value:pad_digits(d)},pad_digits(d)));
});
}
forEach(_4df,function(v){
replaceChildNodes("date-"+v,_4fd[v]);
connect("date-"+v,"onchange",partial(filterHour,v));
});
var _502=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
var _503={};
forEach(_4df,function(v){
_503[v]=new Array();
});
while(_4db<=_502){
var _505=shortMonths[_502.getMonth()]+" "+_502.getFullYear();
forEach(_4df,function(v){
_503[v]=concat([OPTION({value:_502.getFullYear()+"-"+pad_digits(_502.getMonth()+1)},_505)],_503[v]);
});
_502.setMonth(_502.getMonth()-1);
}
forEach(_4df,function(v){
replaceChildNodes("month-year-"+v,_503[v]);
connect("month-year-"+v,"onchange",partial(filterDate,v));
filterDate(v);
});
var _508={};
forEach(_4df,function(v){
_508[v]=new Array();
});
var _50a=new Date(_4dd.getFullYear(),_4dd.getMonth(),7+_4dd.getDate()-_4dd.getDay());
while(_4d8<_50a){
var _50b=new Date(_50a.getFullYear(),_50a.getMonth(),_50a.getDate()-6);
var _50c=_50a.getWeek();
forEach(_4df,function(v){
_508[v]=concat([OPTION({value:_50a.getFullYear()+"-"+pad_digits(_50c)},"W"+pad_digits(_50c)+" ("+formatDate(_50b,_50a)+")")],_508[v]);
});
_50a.setDate(_50a.getDate()-7);
}
forEach(_4df,function(v){
replaceChildNodes("week-"+v,_508[v]);
});
var _50f={};
forEach(_4df,function(v){
_50f[v]=new Array();
});
var _511=new Date(_4dd.getFullYear(),_4dd.getMonth()-(_4dd.getMonth()%3),1);
var _512=new Date(_4d8.getFullYear(),_4d8.getMonth()-(_4d8.getMonth()%3),1);
while(_512<=_511){
var q_no=((_511.getMonth()/3)+1);
var txt="Q"+q_no+"  ("+shortMonths[_511.getMonth()]+" - "+shortMonths[_511.getMonth()+2]+" "+_511.getFullYear()+")";
forEach(_4df,function(v){
_50f[v]=concat([OPTION({value:_511.getFullYear()+"-"+pad_digits(q_no)},txt)],_50f[v]);
});
_511.setMonth(_511.getMonth()-3);
}
forEach(_4df,function(v){
replaceChildNodes("quarter-"+v,_50f[v]);
});
var _517={};
forEach(_4df,function(v){
_517[v]=new Array();
});
var _519=new Date(_4dd.getFullYear(),0,1);
while(_4d8.getFullYear()<=_519.getFullYear()){
forEach(_4df,function(v){
_517[v]=concat([OPTION({value:_519.getFullYear()},_519.getFullYear())],_517[v]);
});
_519.setFullYear(_519.getFullYear()-1);
}
forEach(_4df,function(v){
replaceChildNodes("year-"+v,_517[v]);
});
connect("all-data","onclick",function(e){
var _51d=isoTimestamp(getElement("oldest-log").innerHTML);
e.stop();
$("time-select").value=pad_digits(_51d.getHours());
$("date-select").value=pad_digits(_51d.getDate());
$("week-select").selectedIndex=0;
$("quarter-select").selectedIndex=0;
$("month-year-select").selectedIndex=0;
$("year-select").selectedIndex=0;
filterDate("select");
$("time-select-to").value=pad_digits(_4dd.getHours());
$("date-select-to").value=pad_digits(_4dd.getDate());
$("week-select-to").selectedIndex=$("week-select-to").options.length-1;
$("quarter-select-to").selectedIndex=$("quarter-select-to").options.length-1;
$("month-year-select-to").selectedIndex=$("month-year-select-to").options.length-1;
$("year-select-to").selectedIndex=$("year-select-to").options.length-1;
filterDate("select-to");
});
var _51e=new Array();
forEach([10,3],function(no){
var _520=A({href:"#"},"Last "+no+" Hours");
var _521=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate(),_4dd.getHours());
_521.setHours(_521.getHours()-no);
if(_521<_4d9){
return;
}
connect(_520,"onclick",function(e){
e.stop();
var _523=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate(),_4dd.getHours());
_523.setHours(_523.getHours()-no);
$("time-select").value=pad_digits(_523.getHours());
$("date-select").value=pad_digits(_523.getDate());
$("month-year-select").value=_523.getFullYear()+"-"+pad_digits(_523.getMonth()+1);
filterDate("select");
var _524=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate(),_4dd.getHours());
$("time-select-to").value=pad_digits(_524.getHours()-1);
$("date-select-to").value=pad_digits(_524.getDate());
$("month-year-select-to").value=_524.getFullYear()+"-"+pad_digits(_524.getMonth()+1);
filterDate("select-to");
});
_51e.push(" | ");
_51e.push(_520);
});
var _525=["Last Hour","This Hour"];
for(var i=0;i<_525.length;i++){
var _527=A({href:"#"},_525[i]);
connect(_527,"onclick",partial(function(i,e){
e.stop();
var _52a=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate(),_4dd.getHours());
_52a.setHours(_52a.getHours()+(i-_525.length+1));
$("time-select").value=pad_digits(_52a.getHours());
$("date-select").value=pad_digits(_52a.getDate());
$("month-year-select").value=_52a.getFullYear()+"-"+pad_digits(_52a.getMonth()+1);
filterDate("select");
$("time-select-to").value=pad_digits(_52a.getHours());
$("date-select-to").value=pad_digits(_52a.getDate());
$("month-year-select-to").value=_52a.getFullYear()+"-"+pad_digits(_52a.getMonth()+1);
filterDate("select-to");
},i));
_51e.push(" | ");
_51e.push(_527);
}
appendChildNodes("shortcuts",DIV({"class":"Hourly"},_51e));
var _52b=new Array();
forEach([30,7,3],function(no){
var _52d=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
_52d.setDate(_52d.getDate()-no);
if(_52d<_4da){
return;
}
var _52e=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
_52e.setDate(_52e.getDate()-no);
var _52f={"date-select":pad_digits(_52e.getDate()),"month-year-select":_52e.getFullYear()+"-"+pad_digits(_52e.getMonth()+1),"date-select-to":pad_digits(_4dd.getDate()-1),"month-year-select-to":_4dd.getFullYear()+"-"+pad_digits(_4dd.getMonth()+1)};
var _530=A({href:"#"},"Last "+no+" Days");
connect(_530,"onclick",function(e){
e.stop();
forEach(keys(_52f),function(k2){
$(k2).value=_52f[k2];
});
filterDate("select");
filterDate("select-to");
});
_52b.push(" | ");
_52b.push(_530);
});
if(_4de>_4da){
var _533=A({href:"#"},"Yesterday");
connect(_533,"onclick",function(e){
var _535=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
_535.setDate(_535.getDate()-1);
$("date-select").value=pad_digits(_535.getDate());
$("month-year-select").value=_4dd.getFullYear()+"-"+pad_digits(_535.getMonth()+1);
filterDate("select");
$("date-select-to").value=pad_digits(_4dd.getDate()-1);
$("month-year-select-to").value=_4dd.getFullYear()+"-"+pad_digits(_4dd.getMonth()+1);
filterDate("select-to");
e.stop();
});
_52b.push(" | ");
_52b.push(_533);
}
var _536=A({href:"#"},"Today ("+_4dd.getHours()+" hours)");
connect(_536,"onclick",function(e){
$("date-select").value=pad_digits(_4dd.getDate());
$("month-year-select").value=_4dd.getFullYear()+"-"+pad_digits(_4dd.getMonth()+1);
filterDate("select");
$("date-select-to").value=pad_digits(_4dd.getDate());
$("month-year-select-to").value=_4dd.getFullYear()+"-"+pad_digits(_4dd.getMonth()+1);
filterDate("select-to");
e.stop();
});
_52b.push(" | ");
_52b.push(_536);
appendChildNodes("shortcuts",DIV({"class":"Daily"},_52b));
createShortcuts([10,6,2],"week-select","Weeks","Weekly");
createShortcuts([12,6,3],"month-year-select","Months","Monthly");
createShortcuts([4,3,2],"quarter-select","Quarters","Quarterly");
createShortcuts([4,3,2],"year-select","Years","Yearly");
function createSingle(text,_539,_53a){
var _53b=A({href:"#"},text);
connect(_53b,"onclick",function(e){
$(_539).selectedIndex=$(_539).options.length-1;
$(_539+"-to").selectedIndex=$(_539+"-to").options.length-1;
e.stop();
});
if(getElementsByTagAndClassName("div",_53a,"shortcuts").length>0){
appendChildNodes("shortcuts",DIV({"class":_53a},[" | ",_53b]));
}else{
appendChildNodes("shortcuts",DIV({"class":_53a},_53b));
}
}
function createSingleVsPrev(text,_53e,_53f,_540){
_540=(typeof _540=="undefined")?-2:_540;
if($(_53e).options.length+_540<0){
return;
}
var _541=A({href:"#"},text);
connect(_541,"onclick",function(e){
$(_53e).selectedIndex=$(_53e).options.length+_540;
$(_53e+"-to").selectedIndex=$(_53e+"-to").options.length+_540;
$(_53e.replace("select","compare")).selectedIndex=$(_53e.replace("select","compare")).options.length+_540+1;
$(_53e.replace("select","compare")+"-to").selectedIndex=$(_53e.replace("select","compare")+"-to").options.length+_540+1;
e.stop();
});
if(getElementsByTagAndClassName("div",_53f,"compare-shortcuts").length>0){
appendChildNodes("compare-shortcuts",DIV({"class":_53f},[" | ",_541]));
}else{
appendChildNodes("compare-shortcuts",DIV({"class":_53f},_541));
}
}
createSingle("This Month ("+days_since(new Date(_4dd.getFullYear(),_4dd.getMonth(),1))+" days)","month-year-select","Monthly");
createSingle("This Week ("+days_since(new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate()-_4dd.getDay()+1))+" days)","week-select","Weekly");
createSingle("This Quarter ("+days_since(new Date(_4dd.getFullYear(),_4dd.getMonth()-(_4dd.getMonth()%3),1))+" days)","quarter-select","Quarterly");
if($("year-select").options.length>1){
var _543=A({href:"#"},"Last Year");
connect(_543,"onclick",function(e){
$("year-select").selectedIndex=$("year-select").options.length-2;
filterDate("select");
$("year-select-to").selectedIndex=$("year-select").options.length-2;
filterDate("select-to");
e.stop();
});
appendChildNodes("shortcuts",DIV({"class":"Yearly"},_543));
}
createSingle("This Year ("+days_since(new Date(_4dd.getFullYear(),0,1))+" days)","year-select","Yearly");
if($("compare-shortcuts")){
var _545=new Array();
var _527=A({href:"#"},_4dd.getHours()+" Hours Yesterday vs. Today");
connect(_527,"onclick",function(e){
var _547=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate(),_4dd.getHours());
_547.setDate(_547.getDate()-1);
$("time-select").value="00";
$("date-select").value=pad_digits(_547.getDate());
$("month-year-select").value=_547.getFullYear()+"-"+pad_digits(_547.getMonth()+1);
filterDate("select");
$("time-select-to").value=pad_digits(_547.getHours()-1);
$("date-select-to").value=pad_digits(_547.getDate());
$("month-year-select-to").value=_547.getFullYear()+"-"+pad_digits(_547.getMonth()+1);
filterDate("select-to");
_547.setDate(_547.getDate()+1);
$("time-compare").value="00";
$("date-compare").value=pad_digits(_547.getDate());
$("month-year-compare").value=_547.getFullYear()+"-"+pad_digits(_547.getMonth()+1);
filterDate("compare");
$("time-compare-to").value=pad_digits(_547.getHours()-1);
$("date-compare-to").value=pad_digits(_547.getDate());
$("month-year-compare-to").value=_547.getFullYear()+"-"+pad_digits(_547.getMonth()+1);
filterDate("compare-to");
e.stop();
});
_545.push(_527);
_545.push(" | ");
var _527=A({href:"#"},"Prev vs. Last Hour");
connect(_527,"onclick",function(e){
var _549=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate(),_4dd.getHours());
_549.setHours(_549.getHours()-2);
$("time-select").value=pad_digits(_549.getHours());
$("date-select").value=pad_digits(_549.getDate());
$("month-year-select").value=_549.getFullYear()+"-"+pad_digits(_549.getMonth()+1);
filterDate("select");
$("time-select-to").value=pad_digits(_549.getHours());
$("date-select-to").value=pad_digits(_549.getDate());
$("month-year-select-to").value=_549.getFullYear()+"-"+pad_digits(_549.getMonth()+1);
filterDate("select-to");
_549.setHours(_549.getHours()+1);
$("time-compare").value=pad_digits(_549.getHours());
$("date-compare").value=pad_digits(_549.getDate());
$("month-year-compare").value=_549.getFullYear()+"-"+pad_digits(_549.getMonth()+1);
filterDate("compare");
$("time-compare-to").value=pad_digits(_549.getHours());
$("date-compare-to").value=pad_digits(_549.getDate());
$("month-year-compare-to").value=_549.getFullYear()+"-"+pad_digits(_549.getMonth()+1);
filterDate("compare-to");
e.stop();
});
_545.push(_527);
_545.push(" | ");
var _527=A({href:"#"},"Last vs. This Hour");
connect(_527,"onclick",function(e){
var _54b=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate(),_4dd.getHours());
_54b.setHours(_54b.getHours()-1);
$("time-select").value=pad_digits(_54b.getHours());
$("date-select").value=pad_digits(_54b.getDate());
$("month-year-select").value=_54b.getFullYear()+"-"+pad_digits(_54b.getMonth()+1);
filterDate("select");
$("time-select-to").value=pad_digits(_54b.getHours());
$("date-select-to").value=pad_digits(_54b.getDate());
$("month-year-select-to").value=_54b.getFullYear()+"-"+pad_digits(_54b.getMonth()+1);
filterDate("select-to");
_54b.setHours(_54b.getHours()+1);
$("time-compare").value=pad_digits(_54b.getHours());
$("date-compare").value=pad_digits(_54b.getDate());
$("month-year-compare").value=_54b.getFullYear()+"-"+pad_digits(_54b.getMonth()+1);
filterDate("compare");
$("time-compare-to").value=pad_digits(_54b.getHours());
$("date-compare-to").value=pad_digits(_54b.getDate());
$("month-year-compare-to").value=_54b.getFullYear()+"-"+pad_digits(_54b.getMonth()+1);
filterDate("compare-to");
e.stop();
});
_545.push(_527);
appendChildNodes("compare-shortcuts",DIV({"class":"Hourly"},_545));
var _54c=new Array();
var _527=A({href:"#"},"Prev vs. Last 7 Days");
connect(_527,"onclick",function(e){
var _54e=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
_54e.setDate(_54e.getDate()-14);
$("date-select").value=pad_digits(_54e.getDate());
$("month-year-select").value=_54e.getFullYear()+"-"+pad_digits(_54e.getMonth()+1);
filterDate("select");
_54e.setDate(_54e.getDate()+6);
$("date-select-to").value=pad_digits(_54e.getDate());
$("month-year-select-to").value=_54e.getFullYear()+"-"+pad_digits(_54e.getMonth()+1);
filterDate("select-to");
_54e.setDate(_54e.getDate()+1);
$("date-compare").value=pad_digits(_54e.getDate());
$("month-year-compare").value=_54e.getFullYear()+"-"+pad_digits(_54e.getMonth()+1);
_54e.setDate(_54e.getDate()+6);
filterDate("compare");
$("date-compare-to").value=pad_digits(_54e.getDate());
$("month-year-compare-to").value=_54e.getFullYear()+"-"+pad_digits(_54e.getMonth()+1);
filterDate("compare-to");
e.stop();
});
_54c.push(_527);
_54c.push(" | ");
var _527=A({href:"#"},longDays[(_4dd.getDay()+7-2)%7]+" vs. Yesterday");
connect(_527,"onclick",function(e){
var _550=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
_550.setDate(_550.getDate()-2);
$("date-select").value=pad_digits(_550.getDate());
$("month-year-select").value=_550.getFullYear()+"-"+pad_digits(_550.getMonth()+1);
filterDate("select");
$("date-select-to").value=pad_digits(_550.getDate());
$("month-year-select-to").value=_550.getFullYear()+"-"+pad_digits(_550.getMonth()+1);
filterDate("select-to");
_550.setDate(_550.getDate()+1);
$("date-compare").value=pad_digits(_550.getDate());
$("month-year-compare").value=_550.getFullYear()+"-"+pad_digits(_550.getMonth()+1);
filterDate("compare");
$("date-compare-to").value=pad_digits(_550.getDate());
$("month-year-compare-to").value=_550.getFullYear()+"-"+pad_digits(_550.getMonth()+1);
filterDate("compare-to");
e.stop();
});
_54c.push(_527);
_54c.push(" | ");
var _527=A({href:"#"},"Yesterday vs. Today");
connect(_527,"onclick",function(e){
var _552=new Date(_4dd.getFullYear(),_4dd.getMonth(),_4dd.getDate());
_552.setDate(_552.getDate()-1);
$("date-select").value=pad_digits(_552.getDate());
$("month-year-select").value=_552.getFullYear()+"-"+pad_digits(_552.getMonth()+1);
filterDate("select");
$("date-select-to").value=pad_digits(_552.getDate());
$("month-year-select-to").value=_552.getFullYear()+"-"+pad_digits(_552.getMonth()+1);
filterDate("select-to");
_552.setDate(_552.getDate()+1);
$("date-compare").value=pad_digits(_552.getDate());
$("month-year-compare").value=_552.getFullYear()+"-"+pad_digits(_552.getMonth()+1);
filterDate("compare");
$("date-compare-to").value=pad_digits(_552.getDate());
$("month-year-compare-to").value=_552.getFullYear()+"-"+pad_digits(_552.getMonth()+1);
filterDate("compare-to");
e.stop();
});
_54c.push(_527);
appendChildNodes("compare-shortcuts",DIV({"class":"Daily"},_54c));
createSingleVsPrev("Prev Week vs. Last Week","week-select","Weekly",-3);
createSingleVsPrev("Last Week vs. This Week","week-select","Weekly");
createSingleVsPrev("Prev Month vs. Last Month","month-year-select","Monthly",-3);
createSingleVsPrev("Last Month vs. This Month","month-year-select","Monthly");
createSingleVsPrev("Prev Quarter vs. Last Quarter","quarter-select","Quarterly",-3);
createSingleVsPrev("Last Quarter vs. This Quarter","quarter-select","Quarterly");
createSingleVsPrev("Prev Year vs. Last Year","year-select","Yearly",-3);
createSingleVsPrev("Last Year vs. This Year","year-select","Yearly");
}
if($("show-compare")){
setNodeAttribute("compare-block","style",{height:"28px"});
connect("show-compare","onclick",function(e){
$("period-a").innerHTML="Select Period A:";
blindDown("compare-block",{duration:0.3,afterFinish:function(){
$("isComparison").value="1";
$("hide-compare").style.display="inline";
hideElement("show-compare");
hideElement("shortcuts");
showElement("compare-shortcuts");
}});
e.stop();
});
connect("hide-compare","onclick",function(e){
$("isComparison").value="0";
blindUp("compare-block",{duration:0.3});
$("show-compare").style.display="inline";
$("period-a").innerHTML="Select Period:";
hideElement("hide-compare");
showElement("shortcuts");
hideElement("compare-shortcuts");
e.stop();
});
if($("isComparison").value=="1"){
signal("show-compare","onclick",{stop:noop});
}else{
signal("hide-compare","onclick",{stop:noop});
}
}
connectEach($$("#shortcuts a"),"onclick",function(e){
forEach($$("#shortcuts a"),function(el){
removeElementClass(el,"selected");
});
addElementClass(e.src(),"selected");
});
connectEach($$("#date_div select"),"onchange",function(e){
forEach($$("#shortcuts a"),function(el){
removeElementClass(el,"selected");
});
});
if($("granularity").value){
forEach($$("#date-tabs li"),function(li){
var _55a=getFirstElementByTagAndClassName("span",null,li);
if(_55a.innerHTML.toLowerCase()==$("granularity").value){
addElementClass(li,"selected");
return;
}
});
forEach($$("#date-selectors select"),function(_55b){
var _55c=getNodeAttribute(_55b,"saved_value");
var _55d=getElementsByTagAndClassName("option",null,_55b);
for(var i=0;i<_55d.length;i++){
if(_55c==_55d[i].value){
_55d[i].selected=true;
break;
}
}
if(_55b.id.substring(0,10)=="month-year"){
filterDate(_55b.id.substring(11));
}
});
}else{
var _55f=$$("#date-tabs li:first")[0];
addElementClass(_55f,"selected");
var _560=getFirstElementByTagAndClassName("span",null,_55f);
$("granularity").value=_560.innerHTML.toLowerCase();
signal_el("all-data","onclick");
}
signal_el($$("#date-tabs li.selected")[0],"onclick");
});
Date.prototype.getWeek=function(){
dowOffset=1;
var _561=new Date(this.getFullYear(),0,1);
var day=_561.getDay()-dowOffset;
day=(day>=0?day:day+7);
var _563=Math.floor((this.getTime()-_561.getTime()-(this.getTimezoneOffset()-_561.getTimezoneOffset())*60000)/86400000)+1;
var _564;
if(day<4){
_564=Math.floor((_563+day-1)/7)+1;
if(_564>52){
nYear=new Date(this.getFullYear()+1,0,1);
nday=nYear.getDay()-dowOffset;
nday=nday>=0?nday:nday+7;
_564=nday<4?1:53;
}
}else{
_564=Math.floor((_563+day-1)/7);
}
return _564;
};
if(typeof infosoftglobal=="undefined"){
var infosoftglobal=new Object();
}
if(typeof infosoftglobal.FusionChartsUtil=="undefined"){
infosoftglobal.FusionChartsUtil=new Object();
}
infosoftglobal.FusionCharts=function(swf,id,w,h,_569,_56a,c,_56c,lang,_56e,_56f){
if(!document.getElementById){
return;
}
this.initialDataSet=false;
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(swf){
this.setAttribute("swf",swf);
}
if(id){
this.setAttribute("id",id);
}
_569=_569?_569:0;
this.addVariable("debugMode",_569);
w=w.toString().replace(/\%$/,"%25");
if(w){
this.setAttribute("width",w);
}
h=h.toString().replace(/\%$/,"%25");
if(h){
this.setAttribute("height",h);
}
if(c){
this.addParam("bgcolor",c);
}
this.addParam("quality","high");
this.addParam("allowScriptAccess","always");
this.addVariable("chartWidth",w);
this.addVariable("chartHeight",h);
this.addVariable("DOMId",id);
_56a=_56a?_56a:0;
this.addVariable("registerWithJS",_56a);
_56c=_56c?_56c:"noScale";
this.addVariable("scaleMode",_56c);
lang=lang?lang:"EN";
this.addVariable("lang",lang);
this.detectFlashVersion=_56e?_56e:1;
this.autoInstallRedirect=_56f?_56f:1;
this.installedVer=infosoftglobal.FusionChartsUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){
infosoftglobal.FusionCharts.doPrepUnload=true;
}
};
infosoftglobal.FusionCharts.prototype={setAttribute:function(name,_571){
this.attributes[name]=_571;
},getAttribute:function(name){
return this.attributes[name];
},addParam:function(name,_574){
this.params[name]=_574;
},getParams:function(){
return this.params;
},addVariable:function(name,_576){
this.variables[name]=_576;
},getVariable:function(name){
return this.variables[name];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _578=new Array();
var key;
var _57a=this.getVariables();
for(key in _57a){
_578.push(key+"="+_57a[key]);
}
return _578;
},getSWFHTML:function(){
var _57b="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
_57b="<embed wmode=\"opaque\" type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"  ";
_57b+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _57c=this.getParams();
for(var key in _57c){
_57b+=[key]+"=\""+_57c[key]+"\" ";
}
var _57e=this.getVariablePairs().join("&");
if(_57e.length>0){
_57b+="flashvars=\""+_57e+"\"";
}
_57b+="/>";
}else{
_57b="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_57b+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
_57b+="<param name=\"wmode\" value=\"opaque\" />";
var _57c=this.getParams();
for(var key in _57c){
_57b+="<param name=\""+key+"\" value=\""+_57c[key]+"\" />";
}
var _57e=this.getVariablePairs().join("&");
if(_57e.length>0){
_57b+="<param name=\"flashvars\" value=\""+_57e+"\" />";
}
_57b+="</object>";
}
return _57b;
},setDataURL:function(_57f){
if(this.initialDataSet==false){
this.addVariable("dataURL",_57f);
this.initialDataSet=true;
}else{
var _580=infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute("id"));
if(!_580.setDataURL){
__flash__addCallback(_580,"setDataURL");
}
_580.setDataURL(_57f);
}
},encodeDataXML:function(_581){
var _582=["\\$","\\+"];
var _583=_581.match(/=\s*\".*?\"/g);
if(_583){
for(var i=0;i<_583.length;i++){
var _585=_583[i].replace(/^=\s*\"|\"$/g,"");
_585=_585.replace(/\'/g,"%26apos;");
var _586=_581.indexOf(_583[i]);
var _587="='"+_585+"'";
var _588=_581.substring(0,_586);
var _589=_581.substring(_586+_583[i].length);
var _581=_588+_587+_589;
}
}
_581=_581.replace(/\"/g,"%26quot;");
_581=_581.replace(/%(?![\da-f]{2}|[\da-f]{4})/ig,"%25");
_581=_581.replace(/\&/g,"%26");
return _581;
},setDataXML:function(_58a){
if(this.initialDataSet==false){
this.addVariable("dataXML",this.encodeDataXML(_58a));
this.initialDataSet=true;
}else{
var _58b=infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute("id"));
_58b.setDataXML(_58a);
}
},setTransparent:function(_58c){
if(typeof _58c=="undefined"){
_58c=true;
}
if(_58c){
this.addParam("WMode","transparent");
}else{
this.addParam("WMode","Opaque");
}
},render:function(_58d){
if((this.detectFlashVersion==1)&&(this.installedVer.major<8)){
if(this.autoInstallRedirect==1){
var _58e=window.confirm("You need Adobe Flash Player 8 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. Please click on Ok to install the same.");
if(_58e){
window.location="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
}else{
return false;
}
}else{
return false;
}
}else{
var n=(typeof _58d=="string")?document.getElementById(_58d):_58d;
n.innerHTML=this.getSWFHTML();
if(!document.embeds[this.getAttribute("id")]&&!window[this.getAttribute("id")]){
window[this.getAttribute("id")]=document.getElementById(this.getAttribute("id"));
}
return true;
}
}};
infosoftglobal.FusionChartsUtil.getPlayerVersion=function(){
var _590=new infosoftglobal.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
_590=new infosoftglobal.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else{
if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var _593=3;
while(axo){
try{
_593++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_593);
_590=new infosoftglobal.PlayerVersion([_593,0,0]);
}
catch(e){
axo=null;
}
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_590=new infosoftglobal.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch(e){
if(_590.major==6){
return _590;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(axo!=null){
_590=new infosoftglobal.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
}
return _590;
};
infosoftglobal.PlayerVersion=function(_594){
this.major=_594[0]!=null?parseInt(_594[0]):0;
this.minor=_594[1]!=null?parseInt(_594[1]):0;
this.rev=_594[2]!=null?parseInt(_594[2]):0;
};
infosoftglobal.FusionChartsUtil.cleanupSWFs=function(){
var _595=document.getElementsByTagName("OBJECT");
for(var i=_595.length-1;i>=0;i--){
_595[i].style.display="none";
for(var x in _595[i]){
if(typeof _595[i][x]=="function"){
_595[i][x]=function(){
};
}
}
}
};
if(infosoftglobal.FusionCharts.doPrepUnload){
if(!infosoftglobal.unloadSet){
infosoftglobal.FusionChartsUtil.prepUnload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
window.attachEvent("onunload",infosoftglobal.FusionChartsUtil.cleanupSWFs);
};
window.attachEvent("onbeforeunload",infosoftglobal.FusionChartsUtil.prepUnload);
infosoftglobal.unloadSet=true;
}
}
if(!document.getElementById&&document.all){
document.getElementById=function(id){
return document.all[id];
};
}
if(Array.prototype.push==null){
Array.prototype.push=function(item){
this[this.length]=item;
return this.length;
};
}
infosoftglobal.FusionChartsUtil.getChartObject=function(id){
var _59b=null;
if(navigator.appName.indexOf("Microsoft Internet")==-1){
if(document.embeds&&document.embeds[id]){
_59b=document.embeds[id];
}else{
_59b=window.document[id];
}
}else{
_59b=window[id];
}
if(!_59b){
_59b=document.getElementById(id);
}
return _59b;
};
var getChartFromId=infosoftglobal.FusionChartsUtil.getChartObject;
var FusionCharts=infosoftglobal.FusionCharts;
if(typeof infosoftglobal=="undefined"){
var infosoftglobal=new Object();
}
if(typeof infosoftglobal.FusionMapsUtil=="undefined"){
infosoftglobal.FusionMapsUtil=new Object();
}
infosoftglobal.FusionMaps=function(swf,id,w,h,_5a0,_5a1,c,_5a3,lang,_5a5,_5a6){
if(!document.getElementById){
return;
}
this.initialDataSet=false;
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(swf){
this.setAttribute("swf",swf);
}
if(id){
this.setAttribute("id",id);
}
w=w.toString().replace(/\%/,"%25");
if(w){
this.setAttribute("width",w);
}
h=h.toString().replace(/\%/,"%25");
if(h){
this.setAttribute("height",h);
}
if(c){
this.addParam("bgcolor",c);
}
this.addParam("quality","high");
this.addParam("allowScriptAccess","always");
this.addVariable("mapWidth",w);
this.addVariable("mapHeight",h);
_5a0=_5a0?_5a0:0;
this.addVariable("debugMode",_5a0);
this.addVariable("DOMId",id);
_5a1=_5a1?_5a1:0;
this.addVariable("registerWithJS",_5a1);
_5a3=_5a3?_5a3:"noScale";
this.addVariable("scaleMode",_5a3);
lang=lang?lang:"EN";
this.addVariable("lang",lang);
this.detectFlashVersion=_5a5?_5a5:1;
this.autoInstallRedirect=_5a6?_5a6:1;
this.installedVer=infosoftglobal.FusionMapsUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){
infosoftglobal.FusionMaps.doPrepUnload=true;
}
};
infosoftglobal.FusionMaps.prototype={setAttribute:function(name,_5a8){
this.attributes[name]=_5a8;
},getAttribute:function(name){
return this.attributes[name];
},addParam:function(name,_5ab){
this.params[name]=_5ab;
},getParams:function(){
return this.params;
},addVariable:function(name,_5ad){
this.variables[name]=_5ad;
},getVariable:function(name){
return this.variables[name];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _5af=new Array();
var key;
var _5b1=this.getVariables();
for(key in _5b1){
_5af.push(key+"="+_5b1[key]);
}
return _5af;
},getSWFHTML:function(){
var _5b2="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
_5b2="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"  ";
_5b2+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _5b3=this.getParams();
for(var key in _5b3){
_5b2+=[key]+"=\""+_5b3[key]+"\" ";
}
var _5b5=this.getVariablePairs().join("&");
if(_5b5.length>0){
_5b2+="flashvars=\""+_5b5+"\"";
}
_5b2+="/>";
}else{
_5b2="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_5b2+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _5b3=this.getParams();
for(var key in _5b3){
_5b2+="<param name=\""+key+"\" value=\""+_5b3[key]+"\" />";
}
var _5b5=this.getVariablePairs().join("&");
if(_5b5.length>0){
_5b2+="<param name=\"flashvars\" value=\""+_5b5+"\" />";
}
_5b2+="</object>";
}
return _5b2;
},setDataURL:function(_5b6){
if(this.initialDataSet==false){
this.addVariable("dataURL",_5b6);
this.initialDataSet=true;
}else{
var _5b7=infosoftglobal.FusionMapsUtil.getMapObject(this.getAttribute("id"));
if(!_5b7.setDataURL){
__flash__addCallback(_5b7,"setDataURL");
}
_5b7.setDataURL(_5b6);
}
},encodeDataXML:function(_5b8){
var _5b9=["\\$","\\+"];
var _5ba=_5b8.match(/=\s*\".*?\"/g);
if(_5ba){
for(var i=0;i<_5ba.length;i++){
var _5bc=_5ba[i].replace(/^=\s*\"|\"$/g,"");
_5bc=_5bc.replace(/\'/g,"%26apos;");
var _5bd=_5b8.indexOf(_5ba[i]);
var _5be="='"+_5bc+"'";
var _5bf=_5b8.substring(0,_5bd);
var _5c0=_5b8.substring(_5bd+_5ba[i].length);
var _5b8=_5bf+_5be+_5c0;
}
}
_5b8=_5b8.replace(/\"/g,"%26quot;");
_5b8=_5b8.replace(/%(?![\da-f]{2}|[\da-f]{4})/ig,"%25");
_5b8=_5b8.replace(/\&/g,"%26");
return _5b8;
},setDataXML:function(_5c1){
if(this.initialDataSet==false){
this.addVariable("dataXML",this.encodeDataXML(_5c1));
this.initialDataSet=true;
}else{
var _5c2=infosoftglobal.FusionMapsUtil.getMapObject(this.getAttribute("id"));
if(!_5c2.setDataXML){
__flash__addCallback(_5c2,"setDataXML");
}
_5c2.setDataXML(_5c1);
}
},setTransparent:function(_5c3){
if(typeof _5c3=="undefined"){
_5c3=true;
}
if(_5c3){
this.addParam("WMode","transparent");
}else{
this.addParam("WMode","Opaque");
}
},render:function(_5c4){
if((this.detectFlashVersion==1)&&(this.installedVer.major<8)){
if(this.autoInstallRedirect==1){
var _5c5=window.confirm("You need Adobe Flash Player 8 (or above) to view the maps. It is a free and lightweight installation from Adobe.com. Please click on Ok to install the same.");
if(_5c5){
window.location="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
}else{
return false;
}
}else{
return false;
}
}else{
var n=(typeof _5c4=="string")?document.getElementById(_5c4):_5c4;
if(this.getVariable("scaleMode").search(/noscale/i)>=0&&(this.getAttribute("width").search("%")>0||this.getAttribute("height").search("%")>0)){
var obj=this;
if(window.addEventListener){
window.addEventListener("load",function(){
n.innerHTML=obj.getSWFHTML();
},false);
}else{
if(window.attachEvent){
window.attachEvent("onload",function(){
n.innerHTML=obj.getSWFHTML();
});
}else{
n.innerHTML=this.getSWFHTML();
}
}
}else{
n.innerHTML=this.getSWFHTML();
}
if(!document.embeds[this.getAttribute("id")]&&!window[this.getAttribute("id")]){
window[this.getAttribute("id")]=document.getElementById(this.getAttribute("id"));
}
return true;
}
}};
infosoftglobal.FusionMapsUtil.getPlayerVersion=function(){
var _5c8=new infosoftglobal.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
_5c8=new infosoftglobal.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else{
if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var _5cb=3;
while(axo){
try{
_5cb++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_5cb);
_5c8=new infosoftglobal.PlayerVersion([_5cb,0,0]);
}
catch(e){
axo=null;
}
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_5c8=new infosoftglobal.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch(e){
if(_5c8.major==6){
return _5c8;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(axo!=null){
_5c8=new infosoftglobal.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
}
return _5c8;
};
infosoftglobal.PlayerVersion=function(_5cc){
this.major=_5cc[0]!=null?parseInt(_5cc[0]):0;
this.minor=_5cc[1]!=null?parseInt(_5cc[1]):0;
this.rev=_5cc[2]!=null?parseInt(_5cc[2]):0;
};
infosoftglobal.FusionMapsUtil.cleanupSWFs=function(){
var _5cd=document.getElementsByTagName("OBJECT");
for(var i=_5cd.length-1;i>=0;i--){
_5cd[i].style.display="none";
for(var x in _5cd[i]){
if(typeof _5cd[i][x]=="function"){
_5cd[i][x]=function(){
};
}
}
}
};
if(infosoftglobal.FusionMaps.doPrepUnload){
if(!infosoftglobal.unloadSet){
infosoftglobal.FusionMapsUtil.prepUnload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
window.attachEvent("onunload",infosoftglobal.FusionMapsUtil.cleanupSWFs);
};
window.attachEvent("onbeforeunload",infosoftglobal.FusionMapsUtil.prepUnload);
infosoftglobal.unloadSet=true;
}
}
if(!document.getElementById&&document.all){
document.getElementById=function(id){
return document.all[id];
};
}
if(Array.prototype.push==null){
Array.prototype.push=function(item){
this[this.length]=item;
return this.length;
};
}
infosoftglobal.FusionMapsUtil.getMapObject=function(id){
var _5d3=null;
if(navigator.appName.indexOf("Microsoft Internet")==-1){
if(document.embeds&&document.embeds[id]){
_5d3=document.embeds[id];
}else{
_5d3=window.document[id];
}
}else{
_5d3=window[id];
}
if(!_5d3){
_5d3=document.getElementById(id);
}
return _5d3;
};
var getMapFromId=infosoftglobal.FusionMapsUtil.getMapObject;
var FusionMaps=infosoftglobal.FusionMaps;
if(typeof (StatCounter)=="undefined"){
StatCounter={};
}
StatCounter.ComboBox=function(id,_5d5){
this.__init__(id,_5d5);
};
StatCounter.ComboBox.prototype={__class__:StatCounter.ComboBox,__init__:function(id,_5d7){
this.exposed_options=0;
this.total_options=0;
this.config=MochiKit.Base.update({maxListLength:16,options:[],optionStringGetter:function(item){
return item;
}},_5d7||{});
this.textedit=getElement(id);
setNodeAttribute(this.textedit,"autocomplete","off");
var _5d9=IMG({"class":"cbox-button","src":"http://www.statcounter.com/images/dropdown-arrow.png","width":"18","height":"18"});
this.optionslist=DIV({"class":"cbox-list hidden"});
this.hidden=getElement(id+"_hidden");
if(!this.hidden){
this.hidden=INPUT({"type":"hidden","id":id+"_hidden","name":id+"_hidden"});
insertSiblingNodesAfter(this.textedit,this.hidden);
}
insertSiblingNodesAfter(this.textedit,_5d9,DIV({"class":"cbox-container"},this.optionslist));
connect(_5d9,"onfocus",function(){
_5d9.blur();
});
connect(_5d9,"onclick",bind(this.toggle,this));
var IE6=false;
if(IE6){
connect(this.optionslist,"onmouseover",bind(this.highlightOption,this));
}
connect(this.optionslist,"onclick",bind(this.clickOption,this));
connect(this.textedit,"onkeydown",bind(this.keyDown,this));
connect(this.textedit,"onkeyup",bind(this.keyUp,this));
connect(document,"onmousedown",bind(this.documentMouseDown,this));
connect(this.optionslist,"onmousedown",this.preventBlur);
connect(_5d9,"onmousedown",this.preventBlur);
this.build(this.config.options);
},preventBlur:function(e){
e.stopPropagation();
},documentMouseDown:function(e){
if(!hasElementClass(this.optionslist,"hidden")&&!isChildNode(e.target(),this.textedit)){
addElementClass(this.optionslist,"hidden");
e.stop();
}
},_prevTexteditValue:"",keyDown:function(e){
this._prevTexteditValue=this.textedit.value;
switch(e.key().code){
case 38:
if(this._highlighted_node&&this._highlighted_node.previousSibling){
this.focusOptionNode(this._highlighted_node.previousSibling);
}
e.stopPropagation();
break;
case 40:
if(hasElementClass(this.optionslist,"hidden")){
this.toggle();
}else{
if((!this._highlighted_node)||!this._highlighted_node.parentNode){
this.focusOptionNode(this.optionslist.childNodes[0]);
}else{
if(this._highlighted_node.nextSibling){
this.focusOptionNode(this._highlighted_node.nextSibling);
}
}
e.stopPropagation();
}
break;
case 27:
addElementClass(this.optionslist,"hidden");
e.stopPropagation();
break;
case 39:
case 9:
case 13:
if(!hasElementClass(this.optionslist,"hidden")&&this._highlighted_node){
this.selectOption();
addElementClass(this.optionslist,"hidden");
this._prevTexteditValue=this.textedit.value;
}
signal(this,"selected");
break;
}
},keyUp:function(e){
if(e.key().code==13){
e.stop();
}
if(this._prevTexteditValue!=this.textedit.value){
this.filterList();
this.showDropdown();
}
},selectOption:function(){
var tgt=this._highlighted_node;
if(tgt){
this.textedit.value=scrapeText(tgt);
this.hidden.value=getNodeAttribute(tgt,"data");
}
},filterList:function(){
var val=this.textedit.value.toLowerCase();
var _5e1=0;
var _5e2=true;
var self=this;
forEach(getElementsByTagAndClassName("div",null,this.optionslist),function(_5e4){
var _5e5=scrapeText(_5e4).toLowerCase().substring(0,val.length);
if(val==_5e5){
showElement(_5e4);
_5e1++;
if(_5e2){
self.focusOptionNode(_5e4);
_5e2=false;
}
}else{
hideElement(_5e4);
}
});
this.exposed_options=_5e1;
},unfilterList:function(){
var _5e6=0;
forEach(getElementsByTagAndClassName("div",null,this.optionslist),function(_5e7){
showElement(_5e7);
_5e6++;
});
this.exposed_options=_5e6;
},_connect_ids:[],build:function(_5e8){
total_options=0;
var divs=[];
var self=this;
forEach(_5e8,function(_5eb){
if(_5eb.length!=2){
divs.push(DIV({"class":"break"}));
}else{
var div=DIV({"data":_5eb[0]},_5eb[1]);
divs.push(div);
}
total_options++;
});
replaceChildNodes(this.optionslist,divs);
this.total_options=total_options;
},showDropdown:function(){
removeElementClass(this.optionslist,"hidden");
var _5ed=Math.min(this.exposed_options,this.config.maxListLength);
if(!_5ed){
addElementClass(this.optionslist,"hidden");
this.blurHighlightedNode();
return;
}
var _5ee=getElementDimensions(this.optionslist.childNodes[0]);
var _5ef=getElementPosition(this.textedit);
var _5f0=getElementDimensions(this.textedit);
var top=_5ef.y+_5f0.h-1;
var h=getViewportDimensions().h-(top-getViewportPosition().y);
if(_5ed){
h=Math.min((_5ed*_5ee.h)+5,h);
}
setElementDimensions(this.optionslist,{w:_5f0.w-6,h:h});
setElementPosition(this.optionslist,{x:_5ef.x+1,y:top});
},highlightOption:function(e){
if(e.target()!=e.src()){
this.focusOptionNode(e.target());
}
},clickOption:function(e){
if(e.target()!=e.src()){
this.focusOptionNode(e.target());
this.selectOption();
addElementClass(this.optionslist,"hidden");
signal(this,"selected");
}
},toggle:function(){
if(this.exposed_options!=this.total_options||!this.optionslist||hasElementClass(this.optionslist,"hidden")){
this.unfilterList();
this.showDropdown();
this.textedit.focus();
}else{
addElementClass(this.optionslist,"hidden");
}
},focusOptionNode:function(node){
if(this._highlighted_node!=node){
if(this._highlighted_node){
removeElementClass(this._highlighted_node,"focused");
}
this.blurHighlightedNode();
this._highlighted_node=node;
}
addElementClass(node,"focused");
},blurHighlightedNode:function(){
if(this._highlighted_node){
removeElementClass(this._highlighted_node,"focused");
this._highlighted_node=null;
}
},setOptions:function(d){
this.config.options=d;
this.build(this.config.options);
},setText:function(d){
this.textedit.value=d;
}};
function FC_Rendered(_5f8){
disconnectAll("download-image","onclick");
connect("download-image","onclick",function(e){
e.stop();
if(rsplit(document.location.hash,"-",1)[1]=="map"){
var _5fa=getMapFromId(_5f8);
_5fa.exportMap();
}else{
var _5fb=getChartFromId(_5f8);
_5fb.saveAsImage();
}
});
}
function mapclick(_5fc){
var _5fd=_5fc.toLowerCase();
if(_5fd=="au"){
_5fd="oc";
}
var hs=document.location.hash.split("-");
if(hs.length<=1){
hs=StatCounter.GlobalStats.makeFullHash().split("-");
}
hs[1]=_5fd;
document.location.hash=hs.join("-");
}
connect(window,"onDOMload",function(e){
connect("signup","onsubmit",function(e){
var fc=formContents("signup");
e.stop();
var dp=doSimplePostXMLHttpRequest($("signup").action,fc);
dp.addCallbacks(function(r){
if(r.responseText=="true"){
hideElement("signup");
insertSiblingNodesAfter("signup",P({"id":"sign-up-success"},IMG({"class":"tick-icon",src:"http://www.statcounter.com/images/tick.png"})," Sign up successful."));
}else{
setStyle("email",{"color":"red"});
insertSiblingNodesAfter("email",P({"id":"sign-up-invalid"},"Invalid email address"));
var _604=getElement("email").value;
connect("email","onkeyup",function(e){
if(getElement("email").value!=_604){
setStyle("email",{"color":"black"});
removeElement("sign-up-invalid");
disconnectAll("email","onkeyup");
}
});
}
},function(r){
});
});
if(!getElement("csv-version")){
return;
}
connect("csv-version","onclick",function(e){
e.stop();
});
connect("embed-version","onclick",function(e){
e.stop();
$("embed").focus();
$("embed").select();
});
connect("download-image","onclick",function(e){
e.stop();
});
var d1="AS AF AFG 004 Afghanistan, Islamic Republic of$EU AX ALA 248 \xc5land Islands$EU AL ALB 008 Albania, Republic of$AF DZ DZA 012 Algeria, People's Democratic Republic of$OC AS ASM 016 American Samoa$EU AD AND 020 Andorra, Principality of$AF AO AGO 024 Angola, Republic of$NA AI AIA 660 Anguilla$//AN AQ ATA 010 Antarctica (the territory South of 60 deg S)$NA AG ATG 028 Antigua and Barbuda$SA AR ARG 032 Argentina, Argentine Republic$AS AM ARM 051 Armenia, Republic of$NA AW ABW 533 Aruba$OC AU AUS 036 Australia, Commonwealth of$EU AT AUT 040 Austria, Republic of$AS AZ AZE 031 Azerbaijan, Republic of$NA BS BHS 044 Bahamas, Commonwealth of the$AS BH BHR 048 Bahrain, Kingdom of$AS BD BGD 050 Bangladesh, People's Republic of$NA BB BRB 052 Barbados$EU BY BLR 112 Belarus, Republic of$EU BE BEL 056 Belgium, Kingdom of$NA BZ BLZ 084 Belize$AF BJ BEN 204 Benin, Republic of$NA BM BMU 060 Bermuda$AS BT BTN 064 Bhutan, Kingdom of$SA BO BOL 068 Bolivia, Republic of$EU BA BIH 070 Bosnia and Herzegovina$AF BW BWA 072 Botswana, Republic of$AN BV BVT 074 Bouvet Island (Bouvetoya)$SA BR BRA 076 Brazil, Federative Republic of$//AS IO IOT 086 British Indian Ocean Territory (Chagos Archipelago)$//NA VG VGB 092 British Virgin Islands$AS BN BRN 096 Brunei Darussalam$EU BG BGR 100 Bulgaria, Republic of$AF BF BFA 854 Burkina Faso$AF BI BDI 108 Burundi, Republic of$AS KH KHM 116 Cambodia, Kingdom of$AF CM CMR 120 Cameroon, Republic of$NA CA CAN 124 Canada$AF CV CPV 132 Cape Verde, Republic of$NA KY CYM 136 Cayman Islands$AF CF CAF 140 Central African Republic$AF TD TCD 148 Chad, Republic of$SA CL CHL 152 Chile, Republic of$AS CN CHN 156 China, People's Republic of$AS CX CXR 162 Christmas Island$//AS CC CCK 166 Cocos (Keeling) Islands$SA CO COL 170 Colombia, Republic of$AF KM COM 174 Comoros, Union of the$AF CD COD 180 Congo, Democratic Republic of the$AF CG COG 178 Congo, Republic of the$OC CK COK 184 Cook Islands$NA CR CRI 188 Costa Rica, Republic of$AF CI CIV 384 Cote d'Ivoire, Republic of$EU HR HRV 191 Croatia, Republic of$NA CU CUB 192 Cuba, Republic of$AS CY CYP 196 Cyprus, Republic of$EU CZ CZE 203 Czech Republic$EU DK DNK 208 Denmark, Kingdom of$AF DJ DJI 262 Djibouti, Republic of$NA DM DMA 212 Dominica, Commonwealth of$NA DO DOM 214 Dominican Republic$SA EC ECU 218 Ecuador, Republic of$AF EG EGY 818 Egypt, Arab Republic of$NA SV SLV 222 El Salvador, Republic of$AF GQ GNQ 226 Equatorial Guinea, Republic of$AF ER ERI 232 Eritrea, State of$EU EE EST 233 Estonia, Republic of$AF ET ETH 231 Ethiopia, Federal Democratic Republic of$EU FO FRO 234 Faroe Islands$SA FK FLK 238 Falkland Islands (Malvinas)$OC FJ FJI 242 Fiji, Republic of the Fiji Islands$EU FI FIN 246 Finland, Republic of$EU FR FRA 250 France, French Republic$SA GF GUF 254 French Guiana$OC PF PYF 258 French Polynesia$//AN TF ATF 260 French Southern Territories$AF GA GAB 266 Gabon, Gabonese Republic$AF GM GMB 270 Gambia, Republic of the$AS GE GEO 268 Georgia$EU DE DEU 276 Germany, Federal Republic of$AF GH GHA 288 Ghana, Republic of$EU GI GIB 292 Gibraltar$EU GR GRC 300 Greece, Hellenic Republic$NA GL GRL 304 Greenland$NA GD GRD 308 Grenada$NA GP GLP 312 Guadeloupe$OC GU GUM 316 Guam$NA GT GTM 320 Guatemala, Republic of$EU GG GGY 831 Guernsey, Bailiwick of$AF GN GIN 324 Guinea, Republic of$AF GW GNB 624 Guinea-Bissau, Republic of$SA GY GUY 328 Guyana, Co-operative Republic of$NA HT HTI 332 Haiti, Republic of$//AN HM HMD 334 Heard Island and McDonald Islands$EU VA VAT 336 Holy See (Vatican City State)$NA HN HND 340 Honduras, Republic of$AS HK HKG 344 Hong Kong, Special Administrative Region of China$EU HU HUN 348 Hungary, Republic of$EU IS ISL 352 Iceland, Republic of$AS IN IND 356 India, Republic of$AS ID IDN 360 Indonesia, Republic of$AS IR IRN 364 Iran, Islamic Republic of$AS IQ IRQ 368 Iraq, Republic of$EU IE IRL 372 Ireland$EU IM IMN 833 Isle of Man$AS IL ISR 376 Israel, State of$EU IT ITA 380 Italy, Italian Republic$NA JM JAM 388 Jamaica$AS JP JPN 392 Japan$EU JE JEY 832 Jersey, Bailiwick of$AS JO JOR 400 Jordan, Hashemite Kingdom of$AS KZ KAZ 398 Kazakhstan, Republic of$AF KE KEN 404 Kenya, Republic of$OC KI KIR 296 Kiribati, Republic of$AS KP PRK 408 North Korea, Democratic People's Republic of$AS KR KOR 410 South Korea, Republic of$AS KW KWT 414 Kuwait, State of$AS KG KGZ 417 Kyrgyz Republic$AS LA LAO 418 Lao People's Democratic Republic$EU LV LVA 428 Latvia, Republic of$AS LB LBN 422 Lebanon, Lebanese Republic$AF LS LSO 426 Lesotho, Kingdom of$AF LR LBR 430 Liberia, Republic of$AF LY LBY 434 Libyan Arab Jamahiriya$EU LI LIE 438 Liechtenstein, Principality of$EU LT LTU 440 Lithuania, Republic of$EU LU LUX 442 Luxembourg, Grand Duchy of$AS MO MAC 446 Macao, Special Administrative Region of China$EU MK MKD 807 Macedonia, the former Yugoslav Republic of$AF MG MDG 450 Madagascar, Republic of$AF MW MWI 454 Malawi, Republic of$AS MY MYS 458 Malaysia$AS MV MDV 462 Maldives, Republic of$AF ML MLI 466 Mali, Republic of$EU MT MLT 470 Malta, Republic of$OC MH MHL 584 Marshall Islands, Republic of the$NA MQ MTQ 474 Martinique$AF MR MRT 478 Mauritania, Islamic Republic of$AF MU MUS 480 Mauritius, Republic of$AF YT MYT 175 Mayotte$NA MX MEX 484 Mexico, United Mexican States$OC FM FSM 583 Micronesia, Federated States of$EU MD MDA 498 Moldova, Republic of$EU MC MCO 492 Monaco, Principality of$AS MN MNG 496 Mongolia$EU ME MNE 499 Montenegro, Republic of$NA MS MSR 500 Montserrat$AF MA MAR 504 Morocco, Kingdom of$AF MZ MOZ 508 Mozambique, Republic of$AS MM MMR 104 Myanmar, Union of$AF NA NAM 516 Namibia, Republic of$OC NR NRU 520 Nauru, Republic of$AS NP NPL 524 Nepal, State of$NA AN ANT 530 Netherlands Antilles$EU NL NLD 528 Netherlands, Kingdom of the$OC NC NCL 540 New Caledonia$OC NZ NZL 554 New Zealand$NA NI NIC 558 Nicaragua, Republic of$AF NE NER 562 Niger, Republic of$AF NG NGA 566 Nigeria, Federal Republic of$OC NU NIU 570 Niue$OC NF NFK 574 Norfolk Island$OC MP MNP 580 Northern Mariana Islands, Commonwealth of the$EU NO NOR 578 Norway, Kingdom of$AS OM OMN 512 Oman, Sultanate of$AS PK PAK 586 Pakistan, Islamic Republic of$OC PW PLW 585 Palau, Republic of$AS PS PSE 275 Palestinian Territory, Occupied$NA PA PAN 591 Panama, Republic of$OC PG PNG 598 Papua New Guinea, Independent State of$SA PY PRY 600 Paraguay, Republic of$SA PE PER 604 Peru, Republic of$AS PH PHL 608 Philippines, Republic of the$OC PN PCN 612 Pitcairn Islands$EU PL POL 616 Poland, Republic of$EU PT PRT 620 Portugal, Portuguese Republic$NA PR PRI 630 Puerto Rico, Commonwealth of$AS QA QAT 634 Qatar, State of$AF RE REU 638 Reunion$EU RO ROU 642 Romania$EU RU RUS 643 Russian Federation$AF RW RWA 646 Rwanda, Republic of$NA BL BLM 652 Saint Barthelemy$AF SH SHN 654 Saint Helena$NA KN KNA 659 Saint Kitts and Nevis, Federation of$NA LC LCA 662 Saint Lucia$NA MF MAF 663 Saint Martin$NA PM SPM 666 Saint Pierre and Miquelon$NA VC VCT 670 Saint Vincent and the Grenadines$OC WS WSM 882 Samoa, Independent State of$EU SM SMR 674 San Marino, Republic of$AF ST STP 678 Sao Tome and Principe, Democratic Republic of$AS SA SAU 682 Saudi Arabia, Kingdom of$AF SN SEN 686 Senegal, Republic of$EU RS SRB 688 Serbia, Republic of$AF SC SYC 690 Seychelles, Republic of$AF SL SLE 694 Sierra Leone, Republic of$AS SG SGP 702 Singapore, Republic of$EU SK SVK 703 Slovakia (Slovak Republic)$EU SI SVN 705 Slovenia, Republic of$OC SB SLB 090 Solomon Islands$AF SO SOM 706 Somalia, Somali Republic$AF ZA ZAF 710 South Africa, Republic of$AN GS SGS 239 South Georgia and the South Sandwich Islands$EU ES ESP 724 Spain, Kingdom of$AS LK LKA 144 Sri Lanka, Democratic Socialist Republic of$AF SD SDN 736 Sudan, Republic of$SA SR SUR 740 Suriname, Republic of$EU SJ SJM 744 Svalbard & Jan Mayen Islands$AF SZ SWZ 748 Swaziland, Kingdom of$EU SE SWE 752 Sweden, Kingdom of$EU CH CHE 756 Switzerland, Swiss Confederation$AS SY SYR 760 Syrian Arab Republic$AS TW TWN 158 Taiwan$AS TJ TJK 762 Tajikistan, Republic of$AF TZ TZA 834 Tanzania, United Republic of$AS TH THA 764 Thailand, Kingdom of$AS TL TLS 626 Timor-Leste, Democratic Republic of$AF TG TGO 768 Togo, Togolese Republic$OC TK TKL 772 Tokelau$OC TO TON 776 Tonga, Kingdom of$NA TT TTO 780 Trinidad and Tobago, Republic of$AF TN TUN 788 Tunisia, Tunisian Republic$AS TR TUR 792 Turkey, Republic of$AS TM TKM 795 Turkmenistan$NA TC TCA 796 Turks and Caicos Islands$OC TV TUV 798 Tuvalu$AF UG UGA 800 Uganda, Republic of$EU UA UKR 804 Ukraine$AS AE ARE 784 United Arab Emirates$EU GB GBR 826 United Kingdom$NA US USA 840 United States of America$//OC UM UMI 581 United States Minor Outlying Islands$//NA VI VIR 850 United States Virgin Islands$SA UY URY 858 Uruguay, Eastern Republic of$AS UZ UZB 860 Uzbekistan, Republic of$OC VU VUT 548 Vanuatu, Republic of$SA VE VEN 862 Venezuela, Bolivarian Republic of$AS VN VNM 704 Vietnam, Socialist Republic of$OC WF WLF 876 Wallis and Futuna$AF EH ESH 732 Western Sahara$AS YE YEM 887 Yemen$AF ZM ZMB 894 Zambia, Republic of$AF ZW ZWE 716 Zimbabwe, Republic of";
var _60b=[];
forEach(d1.split("$"),function(line){
if(!line.match(/^\/\//)){
line=line.split(",")[0];
var bits=line.split(/\s/);
_60b.push([bits[1],bits.slice(4).join(" ")]);
StatCounter.GlobalStats.region_codes[bits[1]]=bits.slice(4).join(" ");
}
});
var _60e=[];
_60e.push(["ww","Worldwide"],[[]]);
StatCounter.GlobalStats.region_codes["ww"]="Worldwide";
forEach(zip(["af","an","as","eu","na","oc","sa"],["Africa","Antarctica","Asia","Europe","North America","Oceania","South America"]),function(_60f){
var code=_60f[0];
var _611=_60f[1];
_60e.push([code,_611]);
StatCounter.GlobalStats.region_codes[code]=_611;
});
var _612=new StatCounter.ComboBox("region");
_612.setOptions(concat(_60e,[[]],_60b));
connect(_612,"selected",function(){
var hs=document.location.hash.split("-");
if(hs.length>1){
hs[1]=getElement("region_hidden").value;
document.location.hash=hs.join("-");
}else{
document.location.hash=StatCounter.GlobalStats.makeFullHash();
}
});
var _614=new StatCounter.ComboBox("statType");
_614.setOptions(zip(keys(StatCounter.GlobalStats.stat_types),values(StatCounter.GlobalStats.stat_types)));
connect(_614,"selected",function(){
var hs=document.location.hash.split("-");
if(hs.length>1){
hs[0]=getElement("statType_hidden").value;
document.location.hash=hs.join("-");
}else{
document.location.hash=StatCounter.GlobalStats.makeFullHash();
}
StatCounter.GlobalStats.disableMobileOptions();
});
connect("update-time","onclick",function(e){
document.location.hash=StatCounter.GlobalStats.makeFullHash();
e.stop();
hideElement("dialog");
hideElement("overlay");
});
function barToggle(e){
var h=document.location.hash;
if(h.split("-").length>1){
var _619=rsplit(h,"-",1);
if(_619[1]=="bar"||_619[1]=="map"){
h=_619[0];
}
if(getElement("chart-type-bar").checked){
h+="-bar";
}
document.location.hash=h;
}else{
document.location.hash=StatCounter.GlobalStats.makeFullHash();
}
}
connect("chart-type-bar","onclick",barToggle);
connect("chart-type-line","onclick",barToggle);
connect(getFirstParentByTagAndClassName("chart-type-bar","label"),"onclick",function(e){
getElement("chart-type-bar").click();
});
connect(getFirstParentByTagAndClassName("chart-type-line","label"),"onclick",function(e){
getElement("chart-type-line").click();
});
function changeChart(hash){
function genericError(){
var _61d=A({"href":"#"},"edit the time period");
connect(_61d,"onclick",showPopup);
replaceChildNodes("chartdiv_loading",DIV({},"Sorry, could not understand url: ",STRONG({},"#",hash),BR(),"You can ",_61d,", or choose a different ",STRONG({},"Statistic")," or ",STRONG({},"Country/Region")," to reselect your chart."));
addElementClass("chartdiv_loading","message");
window.location.hash=StatCounter.GlobalStats.makeFullHash();
window.location._oldhash=window.location.hash;
forEach($$(".chartdiv"),function(_61e){
addElementClass(_61e,"chartdiv-hidden");
});
removeElementClass("chartdiv_loading","chartdiv-hidden");
}
try{
var _61f=StatCounter.GlobalStats.dictFromHash(hash);
}
catch(err){
genericError();
return;
}
getElement("chartdiv_loading").innerHTML="<div>Loading...</div>";
removeElementClass("chartdiv_loading","message");
forEach($$(".chartdiv"),function(_620){
addElementClass(_620,"chartdiv-hidden");
});
removeElementClass("chartdiv_loading","chartdiv-hidden");
$("embed").value="";
disconnectAll("download-image","onclick");
connect("download-image","onclick",function(e){
e.stop();
});
disconnectAll("csv-version","onclick");
$("csv-version").href="chart.php?"+queryString(merge(_61f,{"csv":"1"}));
function updateChartXML(r){
if(r.map){
var _623={"ww":"FCMap_World","as":"FCMap_Asia2","na":"FCMap_NorthAmerica","sa":"FCMap_SouthAmerica","af":"FCMap_Africa","eu":"FCMap_Europe","oc":"FCMap_Oceania"};
var _624=_623[r.region_hidden];
var _625="744";
}else{
if(r.bar){
var _624="Bar2D";
var _625="774";
}else{
var _624="MSLine";
var _625="854";
}
}
forEach(concat(getElement("statistics").elements,$$("select")),function(el){
if(el.name in r){
el.value=r[el.name];
}
});
forEach($$("#date-tabs li"),function(li){
var _628=getFirstElementByTagAndClassName("span",null,li);
if(_628.innerHTML.toLowerCase()==r.granularity){
addElementClass(li,"selected");
}else{
removeElementClass(li,"selected");
}
});
signal_el($$("#date-tabs li.selected")[0],"onclick");
$("modal-popup").innerHTML=r.time_desc;
var _629=getChartFromId("rendered_chart_"+_624);
if(_629&&_629.setDataXML){
_629.setDataXML(r.xml);
}else{
if(r.map){
var _62a=new FusionMaps(_624+".swf","rendered_chart_"+_624,_625,"430","0","1");
_62a.setDataXML(r.xml);
_62a.setTransparent(true);
_62a.render("chartdiv_"+_624);
}else{
var _62a=new FusionCharts(_624+".swf","rendered_chart_"+_624,_625,"500","0","1");
_62a.setDataXML(r.xml);
_62a.render("chartdiv_"+_624);
}
}
if(window.location.host=="gs.statcounter.com"){
var _62b="gs.statcounter.com";
}else{
var _62b=window.location.host+"/global-stats";
}
$("embed").value="<div id=\""+hash+"\" width=\"600\" height=\"400\" style=\"width:600px; height: 400px;\"></div>"+"<!-- You may change the values of width and height above to resize the chart -->"+"<p>Source: <a href=\""+window.location+"\">StatCounter Global Stats - "+r.statType+" Market Share</a></p>"+"<script type=\"text/javascript\" src=\"http://www.statcounter.com/js/FusionCharts.js\"></script>"+"<script type=\"text/javascript\" src=\"http://"+_62b+"/chart.php?"+hash+"\"></script>";
if(r.map){
getElement("chart-type-map").checked=true;
forEach($$(".chartdiv"),function(_62c){
addElementClass(_62c,"chartdiv-hidden");
});
removeElementClass("chartdiv_"+_624,"chartdiv-hidden");
removeElementClass("map-heading","chartdiv-hidden");
$$("#map-heading div")[0].innerHTML=r.caption_part;
disconnectAll("download-image","onclick");
connect("download-image","onclick",function(e){
e.stop();
var _62e=getChartFromId("rendered_chart_Map");
_62e.saveAsImage();
});
}else{
if(r.bar){
getElement("chart-type-bar").checked=true;
forEach($$(".chartdiv"),function(_62f){
addElementClass(_62f,"chartdiv-hidden");
});
removeElementClass("chartdiv_Bar2D","chartdiv-hidden");
disconnectAll("download-image","onclick");
connect("download-image","onclick",function(e){
e.stop();
var _631=getChartFromId("rendered_chart_Bar2D");
_631.saveAsImage();
});
}else{
getElement("chart-type-line").checked=true;
forEach($$(".chartdiv"),function(_632){
addElementClass(_632,"chartdiv-hidden");
});
removeElementClass("chartdiv_MSLine","chartdiv-hidden");
disconnectAll("download-image","onclick");
connect("download-image","onclick",function(e){
e.stop();
var _634=getChartFromId("rendered_chart_MSLine");
_634.saveAsImage();
});
}
}
StatCounter.GlobalStats.xmlMemo[hash]=r;
if((rsplit(hash,"-",1)[1]=="bar")!=r.bar){
if(r.bar){
hash=hash+"-bar";
}else{
hash=rsplit(hash,"-",1)[0];
}
window.location.hash=hash;
window.location._oldhash=window.location.hash;
StatCounter.GlobalStats.xmlMemo[hash]=r;
}
document.title=r.caption_part+" | StatCounter Global Stats";
return r;
}
var s=hash.split("-")[0];
var g=hash.split("-")[2];
var end=parseInt(hash.split("-")[4],10);
var _638=parseInt(hash.split("-")[3],10);
if(isNaN(end)||isNaN(_638)||_638>end){
var _639=A({"href":"#"},"different time period");
connect(_639,"onclick",showPopup);
replaceChildNodes("chartdiv_loading",DIV({},"Time period is invalid. Please choose a ",_639,"."));
addElementClass("chartdiv_loading","message");
return;
}
if(s.match(/^mobile_/)){
var _63a=false;
switch(g){
case "daily":
_63a=end<20081216;
break;
case "weekly":
_63a=end<200851;
break;
case "monthly":
_63a=end<200812;
break;
case "quarterly":
_63a=end<200804;
break;
case "yearly":
_63a=end<2008;
break;
}
if(_63a){
var _639=A({"href":"#"},"more recent time period");
connect(_639,"onclick",showPopup);
replaceChildNodes("chartdiv_loading",DIV({},"Mobile data unavailable. Please choose a ",_639,"."));
addElementClass("chartdiv_loading","message");
return;
}
}else{
var _63a=false;
switch(g){
case "daily":
_63a=end<20080701;
break;
case "weekly":
_63a=end<200827;
break;
case "monthly":
_63a=end<200807;
break;
case "quarterly":
_63a=end<200803;
break;
case "yearly":
_63a=end<2008;
break;
}
if(_63a){
var _639=A({"href":"#"},"more recent time period");
connect(_639,"onclick",showPopup);
replaceChildNodes("chartdiv_loading",DIV({},"Data unavailable. Please choose a ",_639,"."));
addElementClass("chartdiv_loading","message");
return;
}
}
if(rsplit(hash,"-",1)[1]!="bar"&&rsplit(hash,"-",1)[1]==rsplit(hash,"-",2)[1]){
var _639=A({"href":"#"},"longer time period");
var _63b=A({"href":"#"},"bar graph");
connect(_639,"onclick",showPopup);
connect(_63b,"onclick",function(e){
e.stop();
window.location.hash+="-bar";
});
replaceChildNodes("chartdiv_loading",DIV({},"Please choose a ",_639," to view a line graph, or switch to a ",_63b,"."));
addElementClass("chartdiv_loading","message");
}else{
if(StatCounter.GlobalStats.xmlMemo[hash]!==undefined){
updateChartXML(StatCounter.GlobalStats.xmlMemo[hash]);
}else{
var d=loadJSONDoc("chart.php",_61f);
var _63e=callLater(10,function(){
replaceChildNodes("chartdiv_loading",DIV({},"The server took too long to respond, please ",A({"href":"javascript:window.location.reload()"},"reload the page")," and try again."));
addElementClass("chartdiv_loading","message");
});
d.addCallback(updateChartXML);
d.addErrback(function(r){
genericError();
return;
});
d.addBoth(function(){
_63e.cancel();
});
}
}
}
if(window.location.hash==""){
$("granularity").value="monthly";
$("month-year-select").selectedIndex=$("month-year-select").options.length-14;
$("month-year-select-to").selectedIndex=$("month-year-select-to").options.length-1;
if(document.referrer.match(/https?:\/\/(?:[-.\w\d]+\.)?(google|yahoo|altavista|ask|bing|lycos|msn|cuil)(?:\.[a-z]{2,3}){1,2}/i)){
StatCounter.GlobalStats.parseSearchReferral(document.referrer);
}
changeChart(StatCounter.GlobalStats.makeFullHash().substring(1));
}else{
changeChart(window.location.hash.substring(1));
}
$("modal-popup").innerHTML=formatDate(isoTimestamp(getElement("oldest-log").innerHTML),isoTimestamp(getElement("now").innerHTML));
StatCounter.GlobalStats.disableMobileOptions();
window.location._oldhash=window.location.hash;
setInterval(function(){
if(window.location._oldhash!=window.location.hash){
window.location._oldhash=window.location.hash;
changeChart(window.location.hash.substring(1));
}
},100);
});
rsplit=function(str,_641,hm){
if(str==null||str.length==0){
return str;
}
var bits=str.split(_641);
if((typeof (hm)=="undefined")||hm>=bits.length-1){
return bits;
}
bits.splice(0,bits.length-hm,bits.slice(0,bits.length-hm).join(_641));
return bits;
};
if(typeof (StatCounter)=="undefined"){
StatCounter={};
}
if(typeof (StatCounter.GlobalStats)=="undefined"){
StatCounter.GlobalStats={};
}
update(StatCounter.GlobalStats,{__new__:function(){
this.optionCache={};
this.savedOldestLog="";
this.region_codes={};
this.stat_types={"browser":"Browser","browser_version":"Browser Version","mobile_browser":"Mobile Browser","os":"Operating System","mobile_os":"Mobile OS","search_engine":"Search Engine","mobile_search_engine":"Mobile Search","mobile_vs_desktop":"Mobile vs. Desktop"};
this.xmlMemo={};
},all_data_selected:function(){
function pad_digits(h,_645){
_645=(typeof _645=="undefined")?2:_645;
return (parseInt(h,10)+Math.pow(10,_645)).toString().substring(1);
}
var now=getElement("now");
var _647=isoTimestamp(now.innerHTML);
var _648=isoTimestamp(getElement("oldest-log").innerHTML);
return ($("time-select").value==pad_digits(_648.getHours())&&$("date-select").value==pad_digits(_648.getDate())&&$("week-select").selectedIndex==0&&$("quarter-select").selectedIndex==0&&$("month-year-select").selectedIndex==0&&$("year-select").selectedIndex==0&&$("time-select-to").value==pad_digits(_647.getHours())&&$("date-select-to").value==pad_digits(_647.getDate())&&$("week-select-to").selectedIndex==$("week-select-to").options.length-1&&$("quarter-select-to").selectedIndex==$("quarter-select-to").options.length-1&&$("month-year-select-to").selectedIndex==$("month-year-select-to").options.length-1&&$("year-select-to").selectedIndex==$("year-select-to").options.length-1);
},disableMobileOptions:function(){
var self=this;
function disableOption(o){
if(!self.optionCache[o.parentNode.id]){
self.optionCache[o.parentNode.id]=new Array();
}
self.optionCache[o.parentNode.id].push(o);
o.parentNode.remove(o);
}
for(var _64b in self.optionCache){
while(self.optionCache[_64b].length>0){
var o=self.optionCache[_64b].pop(0);
try{
$(_64b).add(o,0);
}
catch(err){
$(_64b).add(o,$(_64b).options[0]);
}
}
}
switch(getElement("statType_hidden").value){
case "mobile_browser":
case "mobile_vs_desktop":
case "mobile_search_engine":
case "mobile_os":
self.savedOldestLog=getElement("oldest-log").innerHTML;
getElement("oldest-log").innerHTML="2008-12-16";
forEach(concat($$("#week-select option[value^=2008-]"),$$("#week-select-to option[value^=2008-]")),function(o){
if(!o.value.match(/51$/)&&!o.value.match(/52$/)){
disableOption(o);
}
});
forEach(concat($$("#month-year-select option"),$$("#month-year-select-to option")),function(o){
switch(o.value){
case "2008-07":
case "2008-08":
case "2008-09":
case "2008-10":
case "2008-11":
disableOption(o);
break;
}
});
forEach(concat($$("#quarter-select option[value=2008-03]"),$$("#quarter-select-to option[value=2008-03]")),function(o){
disableOption(o);
});
break;
case "social_media":
case "resolution":
case "mail":
self.savedOldestLog=getElement("oldest-log").innerHTML;
getElement("oldest-log").innerHTML="2009-03-29";
forEach(concat($$("#date_div option[value^=2008-]")),function(o){
disableOption(o);
});
forEach(concat($$("#week-select option[value^=2009-]"),$$("#week-select-to option[value^=2009-]")),function(o){
if(o.value.match(/(01|02|03|04|05|06|07|08|09|10|11|12)$/)){
disableOption(o);
}
});
forEach(concat($$("#month-year-select option[value^=2009-]"),$$("#month-year-select-to option[value^=2009-]")),function(o){
switch(o.value){
case "2009-01":
case "2009-02":
disableOption(o);
break;
}
});
break;
default:
if(self.savedOldestLog!=""){
getElement("oldest-log").innerHTML=self.savedOldestLog;
}
}
if(!self.all_data_selected()){
removeElementClass("all-data","selected");
}
},makeFullHash:function(){
var h="#"+getElement("statType_hidden").value+"-"+getElement("region_hidden").value+"-"+getElement("granularity").value+"-";
switch(getElement("granularity").value){
case "daily":
var my=getElement("month-year-select");
var myt=getElement("month-year-select-to");
var mdv=getElement("date-select").value;
var mdtv=getElement("date-select-to").value;
h+=my.value.replace("-","")+mdv.replace("-","");
h+="-";
h+=myt.value.replace("-","")+mdtv.replace("-","");
var my_h=my.options[my.selectedIndex].innerHTML;
var _659=myt.options[myt.selectedIndex].innerHTML;
var i=0;
var lhs="";
if(mdv!=mdtv||my_h!=_659){
if(my_h==_659){
my_h="";
}else{
if(rsplit(my_h," ",1)[1]==rsplit(_659," ",1)[1]){
my_h=rsplit(my_h," ",1)[0];
}
}
lhs=mdv.replace(/^0/,"")+" "+my_h.replace(/ 20/," ")+" to ";
}
$("modal-popup").innerHTML=lhs+mdtv.replace(/^0/,"")+" "+_659.replace(/ 20/," ");
break;
case "weekly":
h+=getElement("week-select").value.replace("-","")+"-"+getElement("week-select-to").value.replace("-","");
break;
case "monthly":
h+=getElement("month-year-select").value.replace("-","")+"-"+getElement("month-year-select-to").value.replace("-","");
break;
case "quarterly":
h+=getElement("quarter-select").value.replace("-","")+"-"+getElement("quarter-select-to").value.replace("-","");
break;
case "yearly":
h+=getElement("year-select").value.replace("-","")+"-"+getElement("year-select-to").value.replace("-","");
break;
}
if(getElement("chart-type-bar").checked){
h+="-bar";
}
return h;
},dictFromHash:function(hash){
var qs={};
var _65e=rsplit(hash,"-",1);
if(_65e[1]=="bar"){
var bits=hash.split("-");
bits=bits.slice(0,bits.length-1);
qs["bar"]=1;
}else{
if(_65e[1]=="map"){
var bits=hash.split("-");
bits=bits.slice(0,bits.length-1);
qs["map"]=1;
}else{
var bits=hash.split("-");
}
}
update(qs,{"statType_hidden":bits[0],"region_hidden":bits[1],"granularity":bits[2]});
qs["statType"]=StatCounter.GlobalStats.stat_types[bits[0]];
if(typeof (qs["statType"])=="undefined"){
for(var k in StatCounter.GlobalStats.stat_types){
getElement("statType").value=StatCounter.GlobalStats.stat_types[k];
break;
}
throw new Error();
}
qs["region"]=StatCounter.GlobalStats.region_codes[bits[1]];
if(typeof (qs["region"])=="undefined"){
getElement("region").value=StatCounter.GlobalStats.region_codes["ww"];
throw new Error();
}
switch(bits[2]){
case "daily":
qs["fromMonthYear"]=bits[3].slice(0,4)+"-"+bits[3].slice(4,6);
qs["fromDay"]=bits[3].slice(6,8);
qs["toMonthYear"]=bits[4].slice(0,4)+"-"+bits[4].slice(4,6);
qs["toDay"]=bits[4].slice(6,8);
break;
case "weekly":
qs["fromWeekYear"]=bits[3].slice(0,4)+"-"+bits[3].slice(4,6);
qs["toWeekYear"]=bits[4].slice(0,4)+"-"+bits[4].slice(4,6);
break;
case "monthly":
qs["fromMonthYear"]=bits[3].slice(0,4)+"-"+bits[3].slice(4,6);
qs["toMonthYear"]=bits[4].slice(0,4)+"-"+bits[4].slice(4,6);
break;
case "quarterly":
qs["fromQuarterYear"]=bits[3].slice(0,4)+"-"+bits[3].slice(4,6);
qs["toQuarterYear"]=bits[4].slice(0,4)+"-"+bits[4].slice(4,6);
break;
case "yearly":
qs["fromYear"]=bits[3];
qs["toYear"]=bits[4];
break;
}
forEach(getElement("statistics").elements,function(el){
if(el.name in qs){
el.value=qs[el.name];
}
});
return qs;
},parseSearchReferral:function(_662){
var self=this;
var qs=parseQueryString(_662.split("?",2)[1]);
if("q" in qs){
var _665=qs.q;
}else{
if("p" in qs){
var _665=qs.p;
}else{
var _665=qs.query;
}
}
var _666=true;
var _667=true;
var _668=_665.toLowerCase();
var _668=_668.replace(/\./gi,"");
var _668=_668.replace(/\?/gi," ");
var _668=_668.replace(/\+/gi," ");
var _669={};
forEach(_668.split(" "),function(_66a){
_669[_66a]=1;
});
function queryHasAny(_66b){
for(var i=0;i<_66b.length;i++){
if(_669[_66b[i]]==1){
return true;
}
}
return false;
}
if(queryHasAny(["usa","us","United States"])){
getElement("region").value="United States of America";
getElement("region_hidden").value="US";
}else{
if(queryHasAny(["united kingdom","gb","uk"])){
getElement("region").value="United Kingdom";
getElement("region_hidden").value="GB";
}else{
if(queryHasAny(["russian","russian"])){
getElement("region").value="Russian Federation";
getElement("region_hidden").value="RU";
}else{
if(queryHasAny(["eu","europe"])){
getElement("region").value="Europe";
getElement("region_hidden").value="eu";
}else{
_666=false;
forEach(items(StatCounter.GlobalStats.region_codes),function(item){
if(_668.search(item[1].toLowerCase())!==-1){
getElement("region").value=item[1];
getElement("region_hidden").value=item[0];
_666=true;
}
});
}
}
}
}
var _66e=["os","operating","system","systems","windows","osx","linux","unix"];
var _66f=_66e;
_66f.push("vista");
_66f.push("xp");
var _670=["search","searches","searchs","engne","engine","engines","bing","yahoo","google","cuil"];
if(queryHasAny(["mobile"])){
if(queryHasAny(_66e)){
getElement("statType").value="Mobile OS";
getElement("statType_hidden").value="mobile_os";
}else{
if(queryHasAny(_670)){
getElement("statType").value="Mobile Search";
getElement("statType_hidden").value="mobile_search_engine";
}else{
getElement("statType").value="Mobile Browser";
getElement("statType_hidden").value="mobile_browser";
}
}
}else{
if(queryHasAny(_66f)){
getElement("statType").value="Operating Systems";
getElement("statType_hidden").value="os";
}else{
if(queryHasAny(_670)){
getElement("statType").value="Search Engine";
getElement("statType_hidden").value="search_engine";
}else{
if((queryHasAny(["firefox","ff"])&&queryHasAny(["3","35","30"]))||(queryHasAny(["ie","internet explorer","msie"])&&queryHasAny(["8","80","70","7"]))||(queryHasAny(["versie","version","ie8","ie7","ie6","ff3"]))){
getElement("statType").value="Browser Version";
getElement("statType_hidden").value="browser_version";
}else{
_667=false;
}
}
}
}
if(_667||_666){
window.location.replace(window.location.href+StatCounter.GlobalStats.makeFullHash());
}
}});
StatCounter.GlobalStats.__new__();


