function L(i,f){
if(typeof (JSManager)!="undefined"){
JSManager.setLoaded(i,f);
}
}
var Prototype={Version:"1.4.0",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Log={info:function(){
}};
var Abstract=new Object(),WidgetManager={},BankAutocompleter={},ProgressBar=Class.create();
var G_TAGS=[],G_CONTACTS=[];
var g_uid;
var g={};
function gotoUrl(_4,w){
var _6=location.href;
_6=_6.replace("/#.*/","");
var _7=_6.split("/");
_7.pop();
location.href=_7.join("/")+"/"+_4;
}
function findParent(_8,_9){
while(_8&&(_8.nodeType!=1||_8.localName.toLowerCase()!=_9)){
_8=_8.parentNode;
}
return _8;
}
function hasClass(_a,_b){
var re=new RegExp("(^|\\s)"+_b+"($|\\s)");
return re.exec(_a.getAttribute("class"))!=null;
}
function toggleBlueness(_d){
var _e="blueButton";
if(hasClass(_d,_e)){
Element.removeClassName(_d,_e);
}else{
Element.addClassName(_d,_e);
}
}
function roundToCents(n){
return Math.round(n*100)/100;
}
function toCents(f){
return Math.round(f*100);
}
function toDollars(c){
return c/100;
}
L(148,"iphone/Utils.js");
var JSManager={bitmap:[],setNumFiles:function(n){
for(var i=0;i<n;i++){
this.bitmap[i]="0";
}
},getNumFiles:function(){
return this.bitmap.length;
},isLoaded:function(_14){
return this.bitmap[_14]=="1";
},setLoaded:function(_15,_16){
this.bitmap[_15]="1";
},getBitMapString:function(){
return this.bitmap.join("");
}};
L(229,"Manager.js");
var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function encode64(_17){
_17=_17;
var _18="";
var _19,_1a,_1b;
var _1c,_1d,_1e,_1f;
var i=0;
do{
_19=_17.charCodeAt(i++);
_1a=_17.charCodeAt(i++);
_1b=_17.charCodeAt(i++);
_1c=_19>>2;
_1d=((_19&3)<<4)|(_1a>>4);
_1e=((_1a&15)<<2)|(_1b>>6);
_1f=_1b&63;
if(isNaN(_1a)){
_1e=_1f=64;
}else{
if(isNaN(_1b)){
_1f=64;
}
}
_18=_18+keyStr.charAt(_1c)+keyStr.charAt(_1d)+keyStr.charAt(_1e)+keyStr.charAt(_1f);
}while(i<_17.length);
return _18;
}
function decode64(_21){
_21=_21||"";
var _22="";
var _23,_24,_25;
var _26,_27,_28,_29;
var i=0;
_21=_21.replace(/[^A-Za-z0-9\+\/\=]/g,"");
do{
_26=keyStr.indexOf(_21.charAt(i++));
_27=keyStr.indexOf(_21.charAt(i++));
_28=keyStr.indexOf(_21.charAt(i++));
_29=keyStr.indexOf(_21.charAt(i++));
_23=(_26<<2)|(_27>>4);
_24=((_27&15)<<4)|(_28>>2);
_25=((_28&3)<<6)|_29;
_22=_22+String.fromCharCode(_23);
if(_28!=64){
_22=_22+String.fromCharCode(_24);
}
if(_29!=64){
_22=_22+String.fromCharCode(_25);
}
}while(i<_21.length);
return _22;
}
L(72,"lib/base64.js");
function isIE(){
return navigator.userAgent.match(/MSIE/);
}
function isFirefox(){
return navigator.userAgent.match(/Firefox/);
}
function isMozilla(){
return navigator.userAgent.match(/Mozilla.*Gecko/);
}
function isKHTML(){
return navigator.userAgent.match(/Konqueror|KHTML|Safari/);
}
function isSafari(){
return navigator.userAgent.match(/Safari/);
}
function isChrome(){
return navigator.userAgent.match(/Chrome/);
}
function isOpera(){
return window.opera;
}
function isUnsupported(){
return !isIE()&&!isFirefox()&&!isMozilla()&&!isKHTML();
}
function isIE6(){
return isIE()&&!navigator.appVersion.match(/MSIE 7.0/);
}
L(203,"browsers/Utils.js");
var $A=Array.from=function(_2b){
if(!_2b){
return [];
}
if(_2b.toArray){
return _2b.toArray();
}else{
var _2c=[];
for(var i=0;i<_2b.length;i++){
_2c.push(_2b[i]);
}
return _2c;
}
};
Object.extend=function(_2e,_2f){
for(property in _2f){
_2e[property]=_2f[property];
}
return _2e;
};
var $E=Object.extend;
Function.prototype.bind=function(){
var _30=this,_31=$A(arguments),_32=_31.shift();
return function(){
return _30.apply(_32,_31.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_33){
var _34=this;
return function(_35){
return _34.call(_33,_35||window.event);
};
};
function $$(x){
return document.getElementById(x);
}
function $(_37,_38){
_38=_38||{};
if(typeof _37=="string"){
var id=_37;
_37=document.getElementById(_37);
if(!_37){
return false;
}
}
return _37;
}
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_3a){
var _3b=0;
try{
this._each(function(_3c){
try{
_3a(_3c,_3b++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
},collect:function(_3d){
var _3e=[];
this.each(function(_3f,_40){
_3e.push(_3d(_3f,_40));
});
return _3e;
},invoke:function(_41){
var _42=$A(arguments).slice(1);
return this.collect(function(_43){
return _43[_41].apply(_43,_42);
});
},reject:function(_44){
var _45=[];
this.each(function(_46,_47){
if(!_44(_46,_47)){
_45.push(_46);
}
});
return _45;
},include:function(_48){
var _49=false;
this.each(function(_4a){
if(_4a==_48){
_49=true;
throw $break;
}
});
return _49;
}};
Object.extend(Array.prototype,Enumerable);
Array.prototype._reverse=Array.prototype.reverse;
Object.extend(Array.prototype,{_each:function(_4b){
for(var i=0;i<this.length;i++){
_4b(this[i]);
}
},inArray:function(_4d){
var i;
for(i=0;i<this.length;i++){
if(this[i]==_4d){
return true;
}
}
return false;
}});
var Hash={_each:function(_4f){
for(key in this){
var _50=this[key];
if(typeof _50=="function"){
continue;
}
var _51=[key,_50];
_51.key=key;
_51.value=_50;
_4f(_51);
}
}};
function $H(_52){
var _53=Object.extend({},_52||{});
Object.extend(_53,Enumerable);
Object.extend(_53,Hash);
return _53;
}
function $K(_54){
var _55=[];
$H(_54).each(function(it){
_55.push(it.key);
});
return _55;
}
if(!window.Element){
var Element=new Object();
}
Object.extend(Element,{visible:function(_57){
var _58=$(_57);
if(!_58){
return false;
}
return _58.style.display!="none";
},toggle:function(el){
Element[$EV(el)?"hide":"show"](el);
},getStyle:function(_5a,_5b){
_5a=$(_5a);
var _5c=_5a.style[_5b.camelize()];
if(!_5c){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_5a,null);
_5c=css?css.getPropertyValue(_5b):null;
}else{
if(_5a.currentStyle){
_5c=_5a.currentStyle[_5b.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_5b)){
if(Element.getStyle(_5a,"position")=="static"){
_5c="auto";
}
}
return _5c=="auto"?null:_5c;
},checkIsInDom:function(_5e,_5f){
elem=$(_5e);
if(!elem){
return false;
}
return true;
},hide:function(a){
if(!Element.checkIsInDom(a,"Element.hide")){
return;
}
$(a).style.display="none";
},show:function(_61){
if(!Element.checkIsInDom(_61,"Element.show")){
return;
}
_61=$(_61);
var _62={table:"table",tr:"table-row",span:"inline",td:"table-cell",label:"inline"};
if(isIE()){
$E(_62,{tr:"block",table:"block"});
}
_61.style.display=_62[_61.tagName.toLowerCase()]||"block";
},getWidth:function(_63){
var dim=Element.getDimensions(_63);
return dim.width;
},getHeight:function(_65){
var dim=Element.getDimensions(_65);
return dim.height;
},getDimensions:function(_67){
_67=$(_67);
if(Element.getStyle(_67,"display")!="none"){
return {width:_67.offsetWidth,height:_67.offsetHeight};
}
var els=_67.style;
var _69=els.visibility;
var _6a=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _6b=_67.clientWidth;
var _6c=_67.clientHeight;
els.display="none";
els.position=_6a;
els.visibility=_69;
return {width:_6b,height:_6c};
}});
var $EH=Element.hide,$ES=Element.show,$ET=Element.toggle,$EV=Element.visible;
function $ESV(_6d){
$(_6d).style.visibility="visible";
}
function $EHV(_6e){
$(_6e).style.visibility="hidden";
}
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{observers:false,_observeAndCache:function(_6f,_70,_71,_72){
if(!this.observers){
this.observers=[];
}
if(_6f.addEventListener){
this.observers.push([_6f,_70,_71,_72]);
_6f.addEventListener(_70,_71,_72);
}else{
if(_6f.attachEvent){
this.observers.push([_6f,_70,_71,_72]);
_6f.attachEvent("on"+_70,_71);
}
}
},observeElem:function(_73,_74,_75,_76){
_76=_76||false;
if(_74=="keypress"&&(isKHTML()||_73.attachEvent)){
_74="keydown";
}
this._observeAndCache(_73,_74,_75,_76);
},observe:function(e,n,o,u){
this.observeElem($(e),n,o,u);
},stopObserving:function(_7b,_7c,_7d,_7e){
var _7b=$(_7b);
_7e=_7e||false;
if(_7c=="keypress"&&(isKHTML()||_7b.detachEvent)){
_7c="keydown";
}
if(_7b.removeEventListener){
_7b.removeEventListener(_7c,_7d,_7e);
}else{
if(_7b.detachEvent&&_7b[_7c]){
_7b.detachEvent("on"+_7c,_7d);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0;i<Event.observers.length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
}});
Event.observe(window,"unload",Event.unloadCache,false);
var Position={includeScrollOffsets:false,getScrollX:function(){
this.prepare();
return this.deltaX;
},getScrollY:function(){
this.prepare();
return this.deltaY;
},prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_80){
var _81=0,_82=0;
do{
_81+=_80.scrollTop||0;
_82+=_80.scrollLeft||0;
_80=_80.parentNode;
}while(_80);
return [_82,_81];
},page_IncludingScrolling:function(_83){
var _84=0,_85=0;
var _86=$(_83);
do{
_84+=_86.offsetTop||0;
_85+=_86.offsetLeft||0;
if(_86.offsetParent==document.body){
if(Element.getStyle(_86,"position")=="absolute"){
break;
}
}
}while(_86=_86.offsetParent);
return [_85,_84];
}};
var Try={these:function(){
var _87;
for(var i=0;i<arguments.length;i++){
var _89=arguments[i];
try{
_87=_89();
break;
}
catch(e){
}
}
return _87;
}};
Object.extend(String.prototype,{trim:function(){
return this.replace(/^\s+|\s+$/g,"");
},camelize:function(){
var _8a=this.split("-");
if(_8a.length==1){
return _8a[0];
}
var _8b=this.indexOf("-")==0?_8a[0].charAt(0).toUpperCase()+_8a[0].substring(1):_8a[0];
for(var i=1,len=_8a.length;i<len;i++){
var s=_8a[i];
_8b+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _8b;
}});
Element.setStyle=function(_8f,_90){
_8f=$(_8f);
for(k in _90){
_8f.style[k.camelize()]=_90[k];
}
};
Element.getOpacity=function(_91){
var _92;
if(_92=Element.getStyle(_91,"opacity")){
return parseFloat(_92);
}
if(_92=(Element.getStyle(_91,"filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_92[1]){
return parseFloat(_92[1])/100;
}
}
return 1;
};
Element.setOpacity=function(_93,_94){
_93=$(_93);
if(_94==1){
Element.setStyle(_93,{opacity:(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:null});
if(/MSIE/.test(navigator.userAgent)){
Element.setStyle(_93,{filter:Element.getStyle(_93,"filter").replace(/alpha\([^\)]*\)/gi,"")});
}
}else{
if(_94<0.00001){
_94=0;
}
Element.setStyle(_93,{opacity:_94});
if(/MSIE/.test(navigator.userAgent)){
Element.setStyle(_93,{filter:Element.getStyle(_93,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_94*100+")"});
}
}
};
L(147,"iphone/prototype.js");
Object.extend(Number.prototype,{toColorPart:function(){
var _95=this.toString(16);
if(this<16){
return "0"+_95;
}
return _95;
},succ:function(){
return this+1;
},times:function(_96){
$R(0,this,true).each(_96);
return this;
}});
Object.extend(String.prototype,{find:function(_97){
return (this.indexOf(_97)>=0?true:false);
},toArray:function(){
return this.split("");
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_99,_9a){
return _99+_9a.nodeValue;
}):div.childNodes[0].nodeValue):"";
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
}});
Object.extend(Enumerable,{any:function(_9b){
var _9c=true;
this.each(function(_9d,_9e){
if(_9c=!!(_9b||Prototype.K)(_9d,_9e)){
throw $break;
}
});
return _9c;
},all:function(_9f){
var _a0=true;
this.each(function(_a1,_a2){
_a0=_a0&&!!(_9f||Prototype.K)(_a1,_a2);
if(!_a0){
throw $break;
}
});
return _a0;
},detect:function(_a3){
var _a4;
this.each(function(_a5,_a6){
if(_a3(_a5,_a6)){
_a4=_a5;
throw $break;
}
});
return _a4;
},findAll:function(_a7){
var _a8=[];
this.each(function(_a9,_aa){
if(_a7(_a9,_aa)){
_a8.push(_a9);
}
});
return _a8;
},grep:function(_ab,_ac){
var _ad=[];
this.each(function(_ae,_af){
var _b0=_ae.toString();
if(_b0.match(_ab)){
_ad.push((_ac||Prototype.K)(_ae,_af));
}
});
return _ad;
},inject:function(_b1,_b2){
this.each(function(_b3,_b4){
_b1=_b2(_b1,_b3,_b4);
});
return _b1;
},max:function(_b5){
var _b6=null;
this.each(function(_b7,_b8){
_b7=(_b5||Prototype.K)(_b7,_b8);
if(_b6===null||_b7>=_b6){
_b6=_b7;
}
});
return _b6;
},min:function(_b9){
var _ba=null;
this.each(function(_bb,_bc){
_bb=(_b9||Prototype.K)(_bb,_bc);
if(_ba===null||_bb<=_ba){
_ba=_bb;
}
});
return _ba;
},pluck:function(_bd){
var _be=[];
this.each(function(_bf,_c0){
_be.push(_bf[_bd]);
});
return _be;
},sortBy:function(_c1){
return this.collect(function(_c2,_c3){
return {value:_c2,criteria:_c1(_c2,_c3)};
}).sort(function(_c4,_c5){
var a=_c4.criteria,b=_c5.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect(Prototype.K);
}});
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
Object.extend(Array.prototype,Enumerable);
Array.prototype._reverse=Array.prototype.reverse;
Object.extend(Array.prototype,{clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_c8){
return _c8!=undefined||_c8!=null;
});
},flatten:function(){
return this.inject([],function(_c9,_ca){
return _c9.concat(_ca.constructor==Array?_ca.flatten():[_ca]);
});
},without:function(){
var _cb=$A(arguments);
return this.select(function(_cc){
return !_cb.include(_cc);
});
},indexOf:function(_cd){
for(var i=0;i<this.length;i++){
if(this[i]==_cd){
return i;
}
}
return -1;
},reverse:function(_cf){
return (_cf!==false?this:this.toArray())._reverse();
},shift:function(){
var _d0=this[0];
for(var i=0;i<this.length-1;i++){
this[i]=this[i+1];
}
this.length--;
return _d0;
}});
Object.extend(Hash,{keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_d2){
return $H(_d2).inject($H(this),function(_d3,_d4){
_d3[_d4.key]=_d4.value;
return _d3;
});
},toQueryString:function(){
return this.map(function(_d5){
return _d5.map(encodeURIComponent).join("=");
}).join("&");
}});
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_d6,end,_d8){
this.start=_d6;
this.end=end;
this.exclusive=_d8;
},_each:function(_d9){
var _da=this.start;
do{
_d9(_da);
_da=_da.succ();
}while(this.include(_da));
},include:function(_db){
if(_db<this.start){
return false;
}
if(this.exclusive){
return _db<this.end;
}
return _db<=this.end;
}});
var $R=function(_dc,end,_de){
return new ObjectRange(_dc,end,_de);
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_df){
this.adjacency=_df;
};
Abstract.Insertion.prototype={initialize:function(_e0,_e1){
this.element=$(_e0);
this.content=_e1;
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
if(this.element.tagName.toLowerCase()=="tbody"){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_e3){
_e3.each((function(_e4){
this.element.parentNode.insertBefore(_e4,this.element.nextSibling);
}).bind(this));
}});
var Field={clear:function(){
for(var i=0;i<arguments.length;i++){
$(arguments[i]).value="";
}
},focus:function(_e6){
$(_e6).focus();
},present:function(){
for(var i=0;i<arguments.length;i++){
if($(arguments[i]).value==""){
return false;
}
}
return true;
},select:function(_e8){
$(_e8).select();
},activate:function(_e9){
_e9=$(_e9);
_e9.focus();
if(_e9.select){
_e9.select();
}
}};
document.getElementsByClassName=function(_ea,_eb){
var _ec=($(_eb)||document.body).getElementsByTagName("*");
return $A(_ec).inject([],function(_ed,_ee){
if(_ee.className.match(new RegExp("(^|\\s)"+_ea+"(\\s|$)"))){
_ed.push(_ee);
}
return _ed;
});
};
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_ef){
this.element=$(_ef);
},_each:function(_f0){
this.element.className.split(/\s+/).select(function(_f1){
return _f1.length>0;
})._each(_f0);
},set:function(_f2){
this.element.className=_f2;
},add:function(_f3){
if(this.include(_f3)){
return;
}
this.set(this.toArray().concat(_f3).join(" "));
},remove:function(_f4){
if(!this.include(_f4)){
return;
}
this.set(this.select(function(_f5){
return _f5!=_f4;
}).join(" "));
},toString:function(){
return this.toArray().join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
Object.extend(Element,{remove:function(_f6){
_f6=$(_f6);
_f6.parentNode.removeChild(_f6);
},update:function(_f7,_f8){
$(_f7).innerHTML=_f8.stripScripts();
setTimeout(function(){
_f8.evalScripts();
},10);
},classNames:function(_f9){
return new Element.ClassNames(_f9);
},hasClassName:function(_fa,_fb){
if(!(_fa=$(_fa))){
return;
}
return Element.classNames(_fa).include(_fb);
},addClassName:function(_fc,_fd){
if(!(_fc=$(_fc))){
return;
}
return Element.classNames(_fc).add(_fd);
},removeClassName:function(_fe,_ff){
if(!(_fe=$(_fe))){
return;
}
return Element.classNames(_fe).remove(_ff);
},cleanWhitespace:function(_100){
_100=$(_100);
for(var i=0;i<_100.childNodes.length;i++){
var node=_100.childNodes[i];
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
Element.remove(node);
}
}
},empty:function(_103){
return $(_103).innerHTML.match(/^\s*$/);
},scrollTo:function(_104,_105){
_104=$(_104);
_105=_105||{};
var _106=_105.width||Element.getWidth(_104);
var _107=_105.height||Element.getHeight(_104);
var pos=Position.page(_104);
var x=pos[0]+_106+40-Page.getWidth();
var y=pos[1]+_107+40-Page.getHeight();
if(x<0){
x=0;
}
if(y<0){
y=0;
}
if(x>0||y>0){
window.scrollBy(x,y);
}
},setStyle:function(_10b,_10c){
_10b=$(_10b);
for(name in _10c){
_10b.style[name.camelize()]=_10c[name];
}
},makePositioned:function(_10d){
_10d=$(_10d);
var pos=Element.getStyle(_10d,"position");
if(pos=="static"||!pos){
_10d._madePositioned=true;
_10d.style.position="relative";
if(window.opera){
_10d.style.top=0;
_10d.style.left=0;
}
}
},undoPositioned:function(_10f){
_10f=$(_10f);
if(_10f._madePositioned){
_10f._madePositioned=undefined;
_10f.style.position=_10f.style.top=_10f.style.left=_10f.style.bottom=_10f.style.right="";
}
},makeClipping:function(_110){
_110=$(_110);
if(_110._overflow){
return;
}
_110._overflow=_110.style.overflow;
if((Element.getStyle(_110,"overflow")||"visible")!="hidden"){
_110.style.overflow="hidden";
}
},undoClipping:function(_111){
_111=$(_111);
if(_111._overflow){
return;
}
_111.style.overflow=_111._overflow;
_111._overflow=undefined;
},appear:function(elem){
this.slowEffect(elem,"show");
},disappear:function(elem){
this.slowEffect(elem,"hide");
},slowEffect:function(elem,_115){
elem=$(elem);
elem.style.overflow="hidden";
if(_115=="show"){
if(!elem.maxHeight){
elem.maxHeight=elem.style.height.replace(/px$/,"");
elem.style.height="0px";
}
$ES(elem);
}
var _116=parseInt(elem.style.height.replace(/px$/,""));
_116=_115=="hide"?Math.max(0,_116-2):Math.min(elem.maxHeight,_116+2);
elem.style.height=_116+"px";
if(_115=="hide"&&_116==0){
$EH(elem);
return;
}
if(_115=="show"&&_116==elem.maxHeight){
delete elem.maxHeight;
return;
}
window.setTimeout(function(){
Element.slowEffect(elem,_115);
},0);
},open:function(elem,_118){
_118=_118||{};
var step=_118.step||0;
var _11a=15;
var _11b=Element.getWidth(elem);
var _11c=Element.getHeight(elem);
var _11d=Math.ceil(step*_11b/_11a);
var _11e=Math.ceil(step*_11c/_11a);
_11d=Math.min(_11d,_11b);
_11e=Math.min(_11e,_11c);
if(step==0){
elem=$(elem);
$ES(elem);
}
elem.style.clip="rect(auto, "+_11d+"px, "+_11e+"px, auto)";
if(_11d==_11b&&_11e==_11c){
Element.scrollTo(elem,{width:_11b,height:_11c});
elem.style.clip="rect(auto,auto,auto,auto)";
return;
}
++step;
var o={};
$E(o,_118);
o.step=step;
window.setTimeout(function(){
Element.open(elem,o);
},0);
},load:function(_120,_121,_122){
_122=_122||{};
var _123=_122.onLoad||function(){
};
if(_122.onLoad){
delete _122.onLoad;
}
_120=$(_120);
if(_120.innerHTML!=""&&!_122.forceLoad){
$ET(_120);
_123();
}else{
$ES(_120);
_120.innerHTML="Loading ...";
_121.callback=_123;
$AJS(_121,$E(_122,{target:_120.id,targetReplacement:"innerHTML"}));
}
}});
var $EO=Element.open,$EL=Element.load;
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_END:35,KEY_HOME:36,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_124){
return _124.target||_124.srcElement;
},isLeftClick:function(_125){
return (((_125.which)&&(_125.which==1))||((_125.button)&&(_125.button==1)));
},pointerX:function(_126){
return _126.pageX||(_126.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_127){
return _127.pageY||(_127.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stopBubble:function(_128){
if(_128.stopPropogation){
_128.stopPropagation();
}else{
_128.cancelBubble=true;
}
},stop:function(_129){
if(_129.preventDefault){
_129.preventDefault();
_129.stopPropagation();
}else{
_129.returnValue=false;
_129.cancelBubble=true;
}
},findElement:function(_12a,_12b){
var _12c=Event.element(_12a);
while(_12c.parentNode&&(!_12c.tagName||(_12c.tagName.toUpperCase()!=_12b.toUpperCase()))){
_12c=_12c.parentNode;
}
return _12c;
},fireOnlyOnSelf:function(_12d,elem,_12f){
if(_12d.target==elem){
_12f();
}
}});
var $EVS=Event.stop;
Object.extend(Position,{within:function(_130,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_130,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_130);
return (y>=this.offset[1]&&y<this.offset[1]+_130.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_130.offsetWidth);
},withinIncludingScrolloffsets:function(_133,x,y){
var _136=this.realOffset(_133);
this.xcomp=x+_136[0]-this.deltaX;
this.ycomp=y+_136[1]-this.deltaY;
this.offset=this.cumulativeOffset(_133);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_133.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_133.offsetWidth);
},overlap:function(mode,_138){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_138.offsetHeight)-this.ycomp)/_138.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_138.offsetWidth)-this.xcomp)/_138.offsetWidth;
}
},clone:function(_139,_13a){
_139=$(_139);
_13a=$(_13a);
_13a.style.position="absolute";
var _13b=this.cumulativeOffset(_139);
var _13c=this.realOffset(_139);
_13a.style.top=(_13b[1]-_13c[1])+"px";
_13a.style.left=(_13b[0]-_13c[0])+"px";
_13a.style.width=_139.offsetWidth+"px";
_13a.style.height=_139.offsetHeight+"px";
},page:function(_13d){
var _13e=0,_13f=0;
var _140=_13d;
do{
_13e+=_140.offsetTop||0;
_13f+=_140.offsetLeft||0;
if(_140.offsetParent==document.body){
if(Element.getStyle(_140,"position")=="absolute"){
break;
}
}
}while(_140=_140.offsetParent);
_140=_13d;
do{
_13e-=_140.scrollTop||0;
_13f-=_140.scrollLeft||0;
}while(_140=_140.parentNode);
return [_13f,_13e];
},cumulativeOffset:function(_141){
var _142=0,_143=0;
do{
_142+=_141.offsetTop||0;
_143+=_141.offsetLeft||0;
_141=_141.offsetParent;
}while(_141);
return [_143,_142];
},positionedOffset:function(_144){
var _145=0,_146=0;
do{
_145+=_144.offsetTop||0;
_146+=_144.offsetLeft||0;
_144=_144.offsetParent;
if(_144){
p=Element.getStyle(_144,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_144);
return [_146,_145];
},offsetParent:function(_147){
if(_147.offsetParent){
return _147.offsetParent;
}
if(_147==document.body){
return _147;
}
while((_147=_147.parentNode)&&_147!=document.body){
if(Element.getStyle(_147,"position")!="static"){
return _147;
}
}
return document.body;
},clone:function(_148,_149){
var _14a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_148=$(_148);
var p=Position.page(_148);
_149=$(_149);
var _14c=[0,0];
var _14d=null;
if(Element.getStyle(_149,"position")=="absolute"){
_14d=Position.offsetParent(_149);
_14c=Position.page(_14d);
}
if(_14d==document.body){
_14c[0]-=document.body.offsetLeft;
_14c[1]-=document.body.offsetTop;
}
if(_14a.setLeft){
_149.style.left=(p[0]-_14c[0]+_14a.offsetLeft)+"px";
}
if(_14a.setTop){
_149.style.top=(p[1]-_14c[1]+_14a.offsetTop)+"px";
}
if(_14a.setWidth){
_149.style.width=_148.offsetWidth+"px";
}
if(_14a.setHeight){
_149.style.height=_148.offsetHeight+"px";
}
}});
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_14e){
var _14f=0,_150=0;
do{
_14f+=_14e.offsetTop||0;
_150+=_14e.offsetLeft||0;
if(_14e.offsetParent==document.body){
if(Element.getStyle(_14e,"position")=="absolute"){
break;
}
}
_14e=_14e.offsetParent;
}while(_14e);
return [_150,_14f];
};
}
L(68,"lib/prototypeExtra.js");
String.prototype.parseColor=function(){
var _151="#";
if(this.slice(0,4)=="rgb("){
var cols=this.slice(4,this.length-1).split(",");
var i=0;
do{
_151+=parseInt(cols[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_151+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_151=this.toLowerCase();
}
}
}
return (_151.length==7?_151:(arguments[0]||this));
};
Element.collectTextNodes=function(_154){
return $A($(_154).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_156,_157){
return $A($(_156).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,_157))?Element.collectTextNodes(node):""));
}).flatten().join("");
};
Element.getInlineOpacity=function(_159){
return $(_159).style.opacity||"";
};
Array.prototype.call=function(){
var args=arguments;
this.each(function(f){
f.apply(this,args);
});
};
var Effect={};
var Effect2=Effect;
Effect.Transitions={};
Effect.Transitions.sinoidal=function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
};
Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_15d){
this.effects._each(_15d);
},add:function(_15e){
var _15f=new Date().getTime();
var _160=(typeof _15e.options.queue=="string")?_15e.options.queue:_15e.options.queue.position;
switch(_160){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_15e.finishOn;
e.finishOn+=_15e.finishOn;
});
break;
case "end":
_15f=this.effects.pluck("finishOn").max()||_15f;
break;
}
_15e.startOn+=_15f;
_15e.finishOn+=_15f;
this.effects.push(_15e);
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),40);
}
},remove:function(_163){
this.effects=this.effects.reject(function(e){
return e==_163;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _165=new Date().getTime();
this.effects.invoke("loop",_165);
}});
Effect.Queues={instances:$H(),get:function(_166){
if(typeof _166!="string"){
return _166;
}
if(!this.instances[_166]){
this.instances[_166]=new Effect.ScopedQueue();
}
return this.instances[_166];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_167){
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_167||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.event("beforeStart");
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_168){
if(_168>=this.startOn){
if(_168>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_168-this.startOn)/(this.finishOn-this.startOn);
var _16a=Math.round(pos*this.options.fps*this.options.duration);
if(_16a>this.currentFrame){
this.render(pos);
this.currentFrame=_16a;
}
}
},render:function(pos){
if(this.state=="idle"){
this.state="running";
this.event("beforeSetup");
if(this.setup){
this.setup();
}
this.event("afterSetup");
}
if(this.state=="running"){
if(this.options.transition){
pos=this.options.transition(pos);
}
pos*=(this.options.to-this.options.from);
pos+=this.options.from;
this.position=pos;
this.event("beforeUpdate");
if(this.update){
this.update(pos);
}
this.event("afterUpdate");
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_16c){
if(this.options[_16c+"Internal"]){
this.options[_16c+"Internal"](this);
}
if(this.options[_16c]){
this.options[_16c](this);
}
},inspect:function(){
return "#<Effect:"+$H(this).inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_16d){
this.element=$(_16d);
if(/MSIE/.test(navigator.userAgent)&&(!this.element.hasLayout)){
Element.setStyle(this.element,{zoom:1});
}
var _16e=Object.extend({from:Element.getOpacity(this.element)||0,to:1},arguments[1]||{});
this.start(_16e);
},update:function(_16f){
Element.setOpacity(this.element,_16f);
}});
Effect.Fade=function(_170){
var _171=Element.getInlineOpacity(_170);
var _172=Object.extend({from:Element.getOpacity(_170)||1,to:0,afterFinishInternal:function(_173){
with(Element){
if(_173.options.to!=0){
return;
}
hide(_173.element);
setStyle(_173.element,{opacity:_171});
}
}},arguments[1]||{});
return new Effect.Opacity(_170,_172);
};
Effect.Appear=function(_174){
var _175=Object.extend({from:(Element.getStyle(_174,"display")=="none"?0:Element.getOpacity(_174)||0),to:1,beforeSetup:function(_176){
with(Element){
setOpacity(_176.element,_176.options.from);
show(_176.element);
}
}},arguments[1]||{});
return new Effect.Opacity(_174,_175);
};
L(70,"lib/effects.js");
var Autocompleter={};
Autocompleter.Base=function(){
};
Autocompleter.Base.prototype={baseInitialize:function(_177,_178,_179){
this.element=$(_177);
if(!this.element){
Log.error("ac: element",_177,"not present!");
return;
}
this.update=$(_178);
this.hasFocus=false;
this.changed=false;
this.active=false;
this.index=0;
this.entryCount=0;
if(this.setOptions){
this.setOptions(_179);
}else{
this.options=_179||{};
}
this.options.paramName=this.options.paramName||this.element.name;
this.options.tokens=this.options.tokens||[];
this.options.frequency=this.options.frequency||0.4;
this.options.minChars=this.options.minChars||1;
this.options.onShow=this.options.onShow||function(_17a,_17b){
if(!_17b.style.position||_17b.style.position=="absolute"){
_17b.style.position="absolute";
Position.clone(_17a,_17b,{setHeight:false,offsetTop:_17a.offsetHeight});
}
Effect.Appear(_17b,{duration:0.01});
};
this.options.onHide=this.options.onHide||function(_17c,_17d){
new Effect.Fade(_17d,{duration:0.15});
};
if(typeof (this.options.tokens)=="string"){
this.options.tokens=new Array(this.options.tokens);
}
this.observer=null;
this.element.setAttribute("autocomplete","off");
Element.hide(this.update);
Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));
Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this));
if(this.options.minChars<0){
Event.observe(this.element,"click",this.onFocus.bindAsEventListener(this));
}
},deRegister:function(){
Event.stopObserving(this.element,"blur",this.onBlur.bindAsEventListener(this));
Event.stopObserving(this.element,"keydown",this.onKeyPress.bindAsEventListener(this));
if(this.options.minChars<0){
Event.stopObserving(this.element,"click",this.onFocus.bindAsEventListener(this));
}
},show:function(){
if(Element.getStyle(this.update,"display")=="none"){
this.options.onShow(this.element,this.update);
}
if(!this.iefix&&(navigator.appVersion.indexOf("MSIE")>0)&&(navigator.userAgent.indexOf("Opera")<0)&&(Element.getStyle(this.update,"position")=="absolute")){
new Insertion.After(this.update,"<iframe id=\""+this.update.id+"_iefix\" "+"style=\"display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" "+"src=\"javascript:false;\" frameborder=\"0\" scrolling=\"no\"></iframe>");
this.iefix=$(this.update.id+"_iefix");
}
if(this.iefix){
setTimeout(this.fixIEOverlapping.bind(this),50);
}
},fixIEOverlapping:function(){
Position.clone(this.update,this.iefix);
this.iefix.style.zIndex=1;
this.update.style.zIndex=2;
Element.show(this.iefix);
},hide:function(){
if(Element.getStyle(this.update,"display")!="none"){
this.options.onHide(this.element,this.update);
}
if(this.iefix){
Element.hide(this.iefix);
}
},onFocus:function(_17e){
this.changed=true;
this.hasFocus=true;
if(this.observer){
clearTimeout(this.observer);
}
this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);
},onKeyPress:function(_17f){
if(this.active){
switch(_17f.keyCode){
case Event.KEY_TAB:
case Event.KEY_RETURN:
this.selectEntry();
Event.stop(_17f);
case Event.KEY_ESC:
this.hide();
this.active=false;
Event.stop(_17f);
return;
case Event.KEY_LEFT:
case Event.KEY_RIGHT:
return;
case Event.KEY_UP:
this.markPrevious();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_17f);
}
return;
case Event.KEY_DOWN:
this.markNext();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_17f);
}
return;
}
}else{
if(_17f.keyCode==Event.KEY_TAB||_17f.keyCode==Event.KEY_RETURN){
return;
}
}
this.changed=true;
this.hasFocus=true;
if(this.observer){
clearTimeout(this.observer);
}
this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);
},onHover:function(_180){
var _181=Event.findElement(_180,"LI");
if(this.index!=_181.autocompleteIndex){
this.index=_181.autocompleteIndex;
this.render();
}
Event.stop(_180);
},onClick:function(_182){
var _183=Event.findElement(_182,"LI");
this.index=_183.autocompleteIndex;
this.selectEntry();
this.hide();
},onBlur:function(_184){
setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false;
},render:function(){
if(this.entryCount>0){
for(var i=0;i<this.entryCount;i++){
this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");
}
if(this.hasFocus){
this.show();
this.active=true;
}
}else{
this.active=false;
this.hide();
}
},markPrevious:function(){
if(this.index>0){
this.index--;
}else{
this.index=this.entryCount-1;
}
},markNext:function(){
if(this.index<this.entryCount-1){
this.index++;
}else{
this.index=0;
}
},getEntry:function(_186){
return this.update.firstChild.childNodes[_186];
},getCurrentEntry:function(){
return this.getEntry(this.index);
},selectEntry:function(){
this.active=false;
this.updateElement(this.getCurrentEntry());
},updateElement:function(_187){
var _188="";
if(this.options.selectCB){
_188=this.options.selectCB(_187);
}else{
if(this.options.select){
var _189=document.getElementsByClassName(this.options.select,_187)||[];
if(_189.length>0){
_188=Element.collectTextNodes(_189[0],this.options.select);
}
}
}
var _18a=this.findLastToken();
if(_18a!=-1){
var _18b=this.element.value.substr(0,_18a+1);
var _18c=this.element.value.substr(_18a+1).match(/^\s+/);
if(_18c){
_18b+=_18c[0];
}
this.element.value=_18b+_188;
}else{
this.element.value=_188;
}
this.element.focus();
},updateChoices:function(_18d){
if(!this.changed&&this.hasFocus){
this.update.innerHTML=_18d;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.firstChild);
if(this.update.firstChild&&this.update.firstChild.childNodes){
this.entryCount=this.update.firstChild.childNodes.length;
for(var i=0;i<this.entryCount;i++){
var _18f=this.getEntry(i);
_18f.autocompleteIndex=i;
this.addObservers(_18f);
}
}else{
this.entryCount=0;
}
this.index=0;
this.render();
}
},addObservers:function(_190){
Event.observe(_190,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(_190,"click",this.onClick.bindAsEventListener(this));
},onObserverEvent:function(){
this.changed=false;
if(this.getToken().length>=this.options.minChars){
this.getUpdatedChoices();
}else{
this.active=false;
this.hide();
}
},getToken:function(){
var _191=this.findLastToken();
if(_191!=-1){
var ret=this.element.value.substr(_191+1).replace(/^\s+/,"").replace(/\s+$/,"");
}else{
var ret=this.element.value;
}
return /\n/.test(ret)?"":ret;
},findLastToken:function(){
var _193=-1;
for(var i=0;i<this.options.tokens.length;i++){
var _195=this.element.value.lastIndexOf(this.options.tokens[i]);
if(_195>_193){
_193=_195;
}
}
return _193;
}};
Autocompleter.Local=Class.create();
Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_196,_197,_198,_199){
this.baseInitialize(_196,_197,_199);
this.options.array=_198;
},getUpdatedChoices:function(){
this.updateChoices(this.options.selector(this));
},setOptions:function(_19a){
this.options=Object.extend({choices:10,partialChars:2,selector:function(_19b){
var ret=[];
var _19d=[];
var _19e=_19b.getToken().trim();
var _19f=0;
var _1a0=_19b.options.arrayCB?_19b.options.arrayCB("l"):_19b.options.array.length;
for(var i=0;i<_1a0;i++){
var elem=_19b.options.arrayCB?_19b.options.arrayCB("e",i):_19b.options.array[i];
if(!elem){
continue;
}
var _1a3=elem.toLowerCase();
var _1a4=_19e.toLowerCase();
var _1a5=_1a3.indexOf(_1a4);
while(_1a5!=-1){
if(_1a5==0){
ret.push("<li><strong>"+elem.substr(0,_19e.length)+"</strong>"+elem.substr(_19e.length)+"</li>");
break;
}else{
if(_19e.length>=_19b.options.partialChars&&_1a5!=-1){
var c=elem.substr(_1a5-1,1);
var _1a7=((c>="a"&&c<="z")||(c>="A"&&c<="Z"));
if(!_1a7){
_19d.push("<li>"+elem.substr(0,_1a5)+"<strong>"+elem.substr(_1a5,_19e.length)+"</strong>"+elem.substr(_1a5+_19e.length)+"</li>");
break;
}
}
}
_1a5=_1a3.indexOf(_1a4,_1a5+1);
}
}
if(_19d.length){
ret=ret.concat(_19d.slice(0,_19b.options.choices-ret.length));
}
var _1a8=ret.length;
var _1a9=150;
var _1aa=7;
var _1ab="";
if(_1a8>_1aa){
_1ab="height: "+_1a9+"px;";
}
var ul="<ul style='"+_1ab+"'>"+ret.join("")+"</ul>";
return ul;
}},_19a||{});
}});
L(77,"lib/controls.js");
function parseBackendResponse(resp,_1ae){
_1ae=encode64(_1ae);
var pos=resp.indexOf(_1ae);
var _1b0="";
if(pos!=-1){
_1b0=resp.substr(pos+_1ae.length+1);
resp=resp.substr(0,pos);
}
return [resp,_1b0];
}
function getOutputVarFromAsyncResponse(resp){
var _1b2=encode64("=====mahatma=====gandhi=====");
if(resp.indexOf(_1b2)==-1){
ErrorManager.showErrorMessage("Network error occured. Please refresh the page before continuing.");
return;
}
resp=resp.replace(_1b2,"");
var _1b3=parseBackendResponse(resp,"=====hrithik=====roshan=====");
resp=_1b3[0];
var _1b4=_1b3[1];
_1b3=parseBackendResponse(_1b4,"=====sachin=====tendulkar=====");
_1b4=_1b3[0];
var _1b5=_1b3[1];
_1b3=parseBackendResponse(_1b5,"=====harry=====potter=====");
_1b5=_1b3[0];
var html=_1b3[1];
_1b3=parseBackendResponse(html,"=====zaphod=====beeblebrox=====");
html=_1b3[0];
var _1b7=_1b3[1];
scriptParts=parseBackendResponse(_1b7,"=====arthur=====dent=====");
var _1b8=scriptParts[0];
_1b7=scriptParts[1];
try{
eval(_1b8);
eval(resp);
}
catch(e){
ErrorManager.handleSystemError(e.message);
return;
}
if(!outputVar){
return null;
}
outputVar.script=_1b7;
outputVar.html=html;
outputVar.signalHtml=_1b4;
outputVar.signalScript=_1b5;
return outputVar;
}
function $AJS(_1b9){
_1b9.silent=true;
var cb=_1b9.callback;
delete _1b9["callback"];
var args=[];
for(var k in _1b9){
args.push(k+"="+_1b9[k]);
}
iui.showPageByHref("decode.php",args,"POST",false,cb);
}
L(142,"iphone/ajax/Utils.js");
(function(){
var _1bd=90;
var _1be=0;
var _1bf=null;
var _1c0=null;
var _1c1=0;
var _1c2=location.hash;
var _1c3="#_";
var _1c4=[];
var _1c5=0;
var _1c6;
var _1c7=false;
window.iui={showPage:function(page,_1c9){
if(!page){
return;
}
if(_1c0){
_1c0.removeAttribute("selected");
_1c0=null;
}
if(hasClass(page,"dialog")){
showDialog(page);
}else{
var _1ca=_1bf;
_1bf=page;
if(_1ca&&_1ca.id!=page.id){
setTimeout(slidePages,20,_1ca,page,_1c9);
scrollTo(0,1);
}else{
updatePage(page,_1ca);
}
}
},showPageById:function(_1cb){
var page=$(_1cb);
if(page){
var _1cd=_1c4.indexOf(_1cb);
var _1ce=_1cd!=-1;
if(_1ce){
_1c4.splice(_1c7?_1cd+1:_1cd,_1c4.length);
}
if(!_1c7){
iui.showPage(page,_1ce);
}
}
},showPageByHref:function(href,args,_1d1,_1d2,cb){
var _1d4=args?args.silent:false;
if(!_1d4){
_1bf.setAttribute("scroll",window.pageYOffset);
}
href+=(href.indexOf("?")>=0?"&":"?")+"__mode=async";
var req=new XMLHttpRequest();
req.onerror=function(){
if(cb){
cb(false);
}
};
req.onreadystatechange=function(){
if(req.readyState!=4){
return;
}
var _1d6=getOutputVarFromAsyncResponse(req.responseText);
if(!_1d6){
return;
}
if(_1d6.status!="OK"){
var mesg=_1d6.mesg;
if(mesg.match(/Not logged in/)||mesg.match(/Code version/)){
alert(_1d6.html);
eval(_1d6.script);
}else{
ErrorManager.showErrorMessage(_1d6.sysError?ErrorManager.SYS_ERROR_MESSAGE:mesg);
}
return;
}
if(!_1d4){
if(_1d2){
replaceElementWithSource(_1d2,_1d6.html);
eval(_1d6.script);
}else{
var frag=document.createElement("div");
frag.innerHTML=_1d6.html;
iui.insertPages(frag.childNodes);
eval(_1d6.script);
}
}
if(cb){
setTimeout(cb,1000,_1d6);
}
};
if(args){
req.open(_1d1||"GET",href,true);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(args.join("&"));
}else{
req.open(_1d1||"GET",href,true);
req.send(null);
}
},insertPages:function(_1d9){
var _1da;
for(var i=0;i<_1d9.length;++i){
var _1dc=_1d9[i];
if(_1dc.nodeType==1){
if(!_1dc.id){
_1dc.id="__"+(++_1c5)+"__";
}
var _1dd=$(_1dc.id);
if(_1dd){
_1dd.parentNode.replaceChild(_1dc,_1dd);
}else{
document.body.appendChild(_1dc);
}
if(_1dc.getAttribute("selected")=="true"||!_1da){
_1da=_1dc;
}
--i;
}
}
if(_1da){
iui.showPage(_1da);
setTimeout(function(){
_1c7=false;
},1000);
}
},getSelectedPage:function(){
for(var _1de=document.body.firstChild;_1de;_1de=_1de.nextSibling){
if(_1de.nodeType==1&&_1de.getAttribute("selected")=="true"){
return _1de;
}
}
}};
addEventListener("load",function(_1df){
var page=iui.getSelectedPage();
if(page){
iui.showPage(page);
}
setTimeout(preloadImages,0);
setTimeout(checkOrientAndLocation,0);
_1c6=setInterval(checkOrientAndLocation,300);
},false);
addEventListener("click",function(_1e1){
var link=findParent(_1e1.target,"a");
if(link){
function unselect(){
link.removeAttribute("selected");
}
if(link.href&&link.hash&&link.hash!="#"){
link.setAttribute("selected","true");
iui.showPage($(link.hash.substr(1)));
setTimeout(unselect,500);
}else{
if(link.id=="backButton"){
history.back();
}else{
if(link.getAttribute("type")=="submit"){
Form.submit(findParent(link,"form"));
}else{
if(link.getAttribute("type")=="cancel"){
cancelDialog(findParent(link,"form"));
}else{
if(link.target=="_replace"){
link.setAttribute("selected","progress");
iui.showPageByHref(link.href,null,null,link,unselect);
}else{
if(!link.target){
if(!link.hasAttribute("noprogress")){
link.setAttribute("selected","progress");
}
iui.showPageByHref(link.href,null,null,null,unselect);
}else{
if(link.target=="_blank"){
Event.stop(_1e1);
window.open(link.href,"");
}else{
return;
}
}
}
}
}
}
}
_1e1.preventDefault();
}
},true);
addEventListener("click",function(_1e3){
var div=findParent(_1e3.target,"div");
if(div&&hasClass(div,"toggle")){
div.setAttribute("toggled",div.getAttribute("toggled")!="true");
_1e3.preventDefault();
}
},true);
function checkOrientAndLocation(_1e5){
if(!_1e5&&_1c7){
return;
}
if(window.innerWidth!=_1c1){
_1c1=window.innerWidth;
var _1e6=_1c1<=320?"profile":"landscape";
document.body.setAttribute("orient",_1e6);
setTimeout(scrollTo,100,0,1);
}
if(location.hash!=_1c2){
var _1e7=location.hash.substr(_1c3.length);
iui.showPageById(_1e7);
}
}
function showDialog(page){
_1c0=page;
page.setAttribute("selected","true");
if(hasClass(page,"dialog")&&!page.target){
showForm(page);
}
}
function showForm(form){
form.onsubmit=function(_1ea){
_1ea.preventDefault();
Form.submit(form);
};
form.onclick=function(_1eb){
if(_1eb.target==form&&hasClass(form,"dialog")){
cancelDialog(form);
}
};
}
function cancelDialog(form){
form.removeAttribute("selected");
}
function updatePage(page,_1ee){
if(!page.id){
page.id="__"+(++_1c5)+"__";
}
var id=page.id;
if(id=="__home__"||_1c2!=(_1c3+id)){
_1c4.push(id);
}
location.href=_1c2=_1c3+id;
if(!page.hasAttribute("selected")){
page.setAttribute("selected","true");
}
var _1f0=$("backButton");
if(_1f0){
var _1f1=$(_1c4[_1c4.length-2]);
if(_1f1&&!page.getAttribute("hideBackButton")){
_1f0.style.display="inline";
_1f0.innerHTML=_1f1.title?_1f1.title:"Back";
}else{
_1f0.style.display="none";
}
}
}
function slidePages(_1f2,_1f3,_1f4){
_1f5=0;
if(!hasClass(_1f3,"dialog")){
_1f2.removeAttribute("selected");
}
clearInterval(_1f6);
_1c6=setInterval(checkOrientAndLocation,300);
if(_1f4){
if(_1f3.hasAttribute("scroll")){
setTimeout(scrollTo,10,0,_1f3.getAttribute("scroll"));
}
}
setTimeout(updatePage,0,_1f3,_1f2);
return;
var axis=(_1f4?_1f2:_1f3).getAttribute("axis");
if(axis=="y"){
(_1f4?_1f2:_1f3).style.top="100%";
}else{
_1f3.style.left="100%";
}
_1f3.setAttribute("selected","true");
clearInterval(_1c6);
var _1f5=100;
slide();
var _1f6=setInterval(slide,_1be);
function slide(){
_1f5-=_1bd;
if(_1f5<=0){
_1f5=0;
if(!hasClass(_1f3,"dialog")){
_1f2.removeAttribute("selected");
}
clearInterval(_1f6);
_1c6=setInterval(checkOrientAndLocation,300);
if(_1f4){
if(_1f3.hasAttribute("scroll")){
setTimeout(scrollTo,10,0,_1f3.getAttribute("scroll"));
}
}
setTimeout(updatePage,0,_1f3,_1f2);
}
if(axis=="y"){
_1f4?_1f2.style.top=(100-_1f5)+"%":_1f3.style.top=_1f5+"%";
}else{
_1f2.style.left=(_1f4?(100-_1f5):(_1f5-100))+"%";
_1f3.style.left=(_1f4?-_1f5:_1f5)+"%";
}
}
}
function preloadImages(){
var _1f8=document.createElement("div");
_1f8.id="preloader";
document.body.appendChild(_1f8);
}
function replaceElementWithSource(_1f9,_1fa){
var page=_1f9.parentNode;
var _1fc=_1f9;
while(page.parentNode!=document.body&&_1fc.localName.toLowerCase()!="div"){
page=page.parentNode;
_1fc=_1fc.parentNode;
}
var frag=document.createElement(_1fc.localName);
frag.innerHTML=_1fa;
page.removeChild(_1fc);
while(frag.firstChild){
page.appendChild(frag.firstChild);
}
}
function ddd(){
console.log.apply(console,arguments);
}
})();
L(141,"iphone/ajax/iui.js");
var TabManager={invalidateTabsOfType:function(){
}};
L(149,"iphone/TabManager.js");
var ErrorManager={SYS_ERROR_MESSAGE:"Sorry, the system encountered an error. Please try again later",showErrorMessage:function(mesg){
alert(mesg);
},handleUserError:function(mesg){
this.showErrorMessage(mesg);
},handleJSError:function(mesg){
this.handleSystemError(mesg,{dontShowBugReportForm:1});
},handleSystemError:function(mesg,_202){
_202=_202||{};
if(true||!_202.dontShowBugReportForm){
this.showErrorMessage(this.SYS_ERROR_MESSAGE);
}
this.sendReportToBackend(mesg);
},sendReportToBackend:function(mesg){
mesg+=" [iphone] [js-error]";
$AJS({cmd:"Error.frontEndError",mesg:mesg});
}};
window.onerror=ErrorManager.handleJSError.bind(ErrorManager);
L(146,"iphone/ErrorManager.js");
var Form={submit:function(form){
form=$(form);
var args=[];
["input","select","textarea"].each((function(tag){
Log.info(tag);
var _207=form.getElementsByTagName(tag);
for(var i=0;i<_207.length;++i){
if(_207[i].name){
args.push(_207[i].name+"="+this.escapeString(_207[i].value));
}
}
}).bind(this));
iui.showPageByHref(form.action||"POST",args,form.method);
},escapeString:function(x){
if(encodeURIComponent){
return encodeURIComponent(x);
}else{
return escape(x);
}
}};
L(143,"iphone/forms/Form.js");
function ac_select_cb(_20a){
return Element.collectTextNodes(_20a);
}
function ac_select_comma_cb(_20b){
return ac_select_cb(_20b)+", ";
}
function ac_onshow(_20c,_20d){
if(!_20d.style.position||_20d.style.position=="absolute"){
_20d.style.position="absolute";
Position.clone(_20c,_20d,{setHeight:false,setWidth:false,offsetTop:_20c.offsetHeight});
}
_20d.style.display="block";
}
function ac_onhide(_20e,_20f){
_20f.style.display="none";
}
ac_options={frequency:0.1,fullSearch:false,minChars:2,onShow:ac_onshow,onHide:ac_onhide};
var regACs={};
function unInstallAutocompleter(_210){
var ac=regACs[_210];
if(ac){
ac.deRegister();
}
delete regACs[_210];
Element.removeClassName(_210,"ac-installed");
}
function reInstallAutocompleter(what,_213,_214){
unInstallAutocompleter(_213);
installAutocompleter(what,_213,_214);
}
function installAutocompleter(what,_216,_217){
_217=_217||{};
var _218=_217.callback||"";
if(Element.hasClassName(_216,"ac-installed")){
return;
}
Element.addClassName(_216,"ac-installed");
var t_op=ac_options;
t_op.minChars=1;
t_op.selectCB=ac_select_cb;
var _21a=null;
switch(what){
case "contact":
t_op.arrayCB=ac_contacts_cb;
t_op.tokens="////";
break;
case "contacts":
t_op.arrayCB=ac_contacts_cb;
t_op.selectCB=ac_select_comma_cb;
t_op.tokens=[","];
break;
case "groups":
t_op.arrayCB=ac_groups_cb;
break;
case "single-contact-or-group":
t_op.arrayCB=ac_contacts_group_cb;
break;
case "multiple-contacts-or-groups":
t_op.arrayCB=ac_contacts_group_cb;
t_op.selectCB=ac_select_contacts_groups_cb;
t_op.tokens=[","];
break;
case "single-tag":
t_op.arrayCB=ac_tags_cb;
break;
case "tags":
t_op.tokens=[",",":"];
t_op.arrayCB=ac_tags_cb;
t_op.selectCB=ac_select_comma_cb;
t_op.minChars=1;
break;
case "banks":
t_op.arrayCB=BankAutocompleter.autocompleteBanks.bind(BankAutocompleter);
t_op.minChars=1;
break;
}
if(_218){
t_op.selectCB=_218;
}
regACs[_216]=new Autocompleter.Local(_216,"the_auto_completer",_21a,t_op);
}
L(199,"autoCompleters/Utils.js");
function ac_tags_cb(cmd,i){
if(cmd=="l"){
return G_TAGS.length;
}else{
return G_TAGS[i].ac_name;
}
}
L(42,"tags/autocomplete.js");
ProgressBar.prototype={initialize:function(_21d,_21e,_21f){
_21f=_21f||{};
this.prefix=_21d;
this.statusFile=_21e;
this.timerId=null;
this.outerProgressBarWidth=_21f.width||100;
},start:function(){
this.attempts=0;
this.display();
this._setTimer(200);
},display:function(){
Element.show(this.prefix+"-outer");
},_setTimer:function(_220){
this.timerId=setTimeout(this.updateProgressBar.bind(this),_220);
},updateProgressBar:function(){
$AJS({cmd:"Import.getStatus",statusFile:this.statusFile,callback:this.CB_updateProgressBar.bind(this)},{indicator:"none",target:"__ignore"});
},CB_updateProgressBar:function(resp){
if(!this.timerId){
return;
}
var _222=resp.html;
if(_222<0){
this.attempts++;
if(this.attempts>10){
this.stop();
return;
}
}
if(_222>0){
this.setPercent(_222);
}
if(_222==1){
this.stop();
return;
}
this._setTimer(1000);
},setPercent:function(_223){
var _224=Math.max(5,parseInt(_223*this.outerProgressBarWidth));
var el=$(this.prefix+"-inner");
if(!el){
return;
}
el.style.width=_224+"px";
},stop:function(){
if(this.timerId){
clearTimeout(this.timerId);
}
this.setPercent(1);
this.timerId=null;
}};
L(208,"widgets/ProgressBar.js");
var IW=IPhoneTransInputWidget={initialize:function(_226,_227,_228,_229){
this.viewerId=_226;
this.idPrefix=_227;
this.contacts=_229;
this.form=$(this.idPrefix+"-form");
this.setNumParticipants(0);
this.maxParticipants=_228;
this.edited=[];
},setNumParticipants:function(_22a){
this.nParticipants=_22a;
this.form.numParticipants.value=this.nParticipants;
},getRowId:function(i){
return "row-"+i;
},getNameId:function(i){
return "name-"+i;
},getSpentId:function(i){
return "samt-"+i;
},getPaidId:function(i){
return "pamt-"+i;
},getAmountId:function(){
return this.idPrefix+"-amt";
},parseValue:function(x){
return x==""?0:parseFloat(x);
},getSpent:function(i){
return this.parseValue(this.form[this.getSpentId(i)].value);
},setSpent:function(i,_232){
this.form[this.getSpentId(i)].value=_232;
},getPaid:function(i){
return this.parseValue(this.form[this.getPaidId(i)].value);
},setPaid:function(i,_235){
this.form[this.getPaidId(i)].value=_235;
},getTotal:function(){
return this.parseValue(this.form[this.getAmountId()].value);
},reset:function(){
this.form[this.idPrefix+"-n"].value=1;
var _236=["-desc","-amt","-tags"];
for(var i=0;i<_236.length;i++){
this.form[this.idPrefix+_236[i]].value="";
}
this.form[this.idPrefix+"-type"].value=3;
this.switchBillType(3);
$EH(this.idPrefix+"-more");
this.edited=[];
this.setNumParticipants(0);
this.initializeSharedParticipants();
this.addParticipantRow();
this.addParticipantRow();
},deleteParticipantRow:function(_238){
var row=$(this.getRowId(_238));
$EH(row);
row.innerHTML="";
this.setNumParticipants(this.nParticipants-1);
this.compute();
},addParticipantRow:function(_23a){
this.setNumParticipants(this.nParticipants+1);
_23a=_23a||{};
var row=$(this.getRowId(this.nParticipants));
if($EV(row)){
return;
}
if(!_23a.uid&&this.nParticipants==1){
_23a.uid=this.viewerId;
}
row.innerHTML="<fieldset>"+" <div class='row vFaint'>"+"  <span class='info' onclick='IW.deleteParticipantRow ("+this.nParticipants+")'>delete</span>"+"  <label>Participant "+this.nParticipants+"</label>"+" </div>"+" <div class='row input'>"+"  <label>Name</label>"+this.getContactSelect(this.nParticipants,_23a.uid||-1)+" </div>"+" <div class='row input'>"+"  <label>Paid</label>"+"  <input type='number' class='g' onchange='IW.compute(this)'"+"          name='"+this.getPaidId(this.nParticipants)+"' value='"+(_23a.paid||0)+"'/>"+" </div>"+" <div class='row input'>"+"  <label>Spent</label>"+"  <input type='number' class='r' onchange='IW.compute(this)'"+"         name='"+this.getSpentId(this.nParticipants)+"' value='"+(_23a.spent||0)+"'/>"+" </div>"+"</fieldset>";
$ES(row);
this.compute();
},getContactSelect:function(_23c,_23d){
var html="<select style='width: 200px;' name='"+this.getNameId(_23c)+"'>"+" <option value='-1'>Select &hellip;</option>";
for(var i=0;i<this.contacts.length;i++){
var _240=this.contacts[i];
html+="<option value='"+_240[0]+"' "+(_240[0]==_23d?"selected":"")+">"+_240[1]+"</option>";
}
html+="</select>";
return html;
},compute:function(_241){
if(!this.form){
return;
}
if(_241){
this.edited[_241.name]=true;
}
if(this.nParticipants==0){
return;
}
this.setSpentAmounts();
for(var i=1;i<=this.nParticipants;i++){
if(!this.edited[this.getPaidId(i)]){
this.setPaid(i,i==1?toDollars(toCents(this.getTotal())):"0.00");
}
}
},setSpentAmounts:function(){
var _243=toCents(this.getTotal());
var _244=[],_245=[];
for(var i=1;i<=this.nParticipants;i++){
var _247=this.getSpent(i);
if(this.edited[this.getSpentId(i)]){
_243-=toCents(_247);
this.setSpent(i,toDollars(toCents(_247)));
}else{
_245.push(i);
}
}
var each,_249,_24a,_24b,_24c=_245.length;
if(_24c==0){
return;
}
each=Math.floor(_243/_24c);
_249=_243%_24c;
var _24a=Math.floor(_249/_24c);
var _24b=_249%_24c;
for(var i=0;i<_245.length;i++){
var _24d=_245[i];
if(each<=0){
this.setSpent(_24d,0);
}else{
var _24e=0;
if(_249>0){
_24e=(i<_24b?1:0);
this.setSpent(_24d,toDollars(each*1+_24a+_24e));
}else{
this.setSpent(_24d,toDollars(each*1));
}
_249-=(_24a+_24e);
}
}
},switchBillType:function(type){
for(var i=0;i<9;i++){
var _251=$(this.idPrefix+"-i-"+i);
if(_251){
(type==i?$ES:$EH)(_251);
}
}
if(type==0&&this.nParticipants==0){
this.addParticipantRow();
this.addParticipantRow();
}
}};
L(145,"iphone/transactions/InputWidget.js");

