if(typeof (_localeLookup)=="undefined"){
_localeLookup=function(s){
return null;
};
}
function loc(){
var _2=_localeLookup(arguments[0]);
if(!_2){
_2=arguments[0].replace(/\[_(\d+)\]/g,"&$1");
}
for(var i=1;i<arguments.length;++i){
var _4=new RegExp("&"+i,"g");
_2=_2.replace(_4,arguments[i]);
}
return _2;
}
std={};
std.browser={isFF:null,isIE:null,isMoz:null,isOpera:null,isAppleWebKit:null,isSupport:null,major:null,minor:null,gecko:null,isSafariWin:null,isSafariMobile:null};
std.browser.platform={};
std.browser.applewebkit={};
std.browser.applewebkit.parseVersion=function(_5){
var _6=_5.split(".");
var _7=(_5[_5.length-1]=="+");
if(_7){
var _8="+";
}else{
var _8=parseInt(_6[1]);
if(isNaN(_8)){
_8="";
}
}
return {major:parseInt(_6[0]),minor:_8,is_nightly:_7};
};
std.browser.applewebkit.getVersion=function(){
var _9=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");
var _a=_9.exec(navigator.userAgent);
if(_a){
var _b=std.browser.applewebkit.parseVersion(_a[1]);
}
return {major:_b["major"],minor:_b["minor"],is_nightly:_b["is_nightly"]};
};
(function(){
var i,_d;
var ua=navigator.userAgent;
if((std.browser.isOpera=(i=ua.indexOf("Opera"))>=0)){
std.browser.major=parseFloat(ua.substr(i+6));
}else{
if((std.browser.isAppleWebKit=((i=ua.indexOf("AppleWebKit"))>=0))){
var _f=std.browser.applewebkit.getVersion();
std.browser.major=_f["major"];
std.browser.minor=_f["minor"];
std.browser.isSafariWin=navigator.platform.indexOf("Win")==0;
std.browser.isSafariMobile=(ua.indexOf("Mobile")!=-1);
std.browser.isChrome=(ua.indexOf("Chrome")!=-1);
}else{
if((std.browser.isIE=(i=ua.indexOf("MSIE "))>=0)){
std.browser.major=parseFloat(ua.substr(i+5));
}else{
if(std.browser.isMoz=(_d=/^Mozilla.+ rv:([0-9]+\.[0-9]+)(\.[0-9]+(?:\.[0-9]+)?)?/.exec(ua))!=null){
std.browser.major=_d[1];
std.browser.minor=_d[2];
std.browser.isFF=ua.indexOf("Firefox/")!=-1;
_d=/Gecko\/([0-9]+)/.exec(ua);
if(_d){
std.browser.gecko=_d[1];
}
}
}
}
}
std.browser.platform.isWin=navigator.platform.indexOf("Win")==0;
std.browser.platform.isMacOS=(ua.indexOf("Mac OS")!=-1);
std.browser.isSupport=(std.browser.isIE&&std.browser.major>=6)||(std.browser.isMoz&&std.browser.major>=1.7&&std.browser.gecko!="20060127")||(std.browser.isOpera&&std.browser.major>=9)||(std.browser.isAppleWebKit&&std.browser.major>=3);
std.browser.isIEQuirksMode=(document.compatMode=="BackCompat"&&std.browser.isIE);
std.browser.isBorderBox=!(document.compatMode=="CSS1Compat"&&std.browser.isIE)||(std.browser.isAppleWebKit&&std.browser.major<3);
})();
std.browser.no={};
std.browser.buggy={};
(std.browser.recalcRules=function(){
if(std.browser.isSafariMobile){
std.browser.no.ondblclick=true;
}
})();
std.lang={};
std.lang.bind=function(){
var _10=std.array.from(arguments);
var obj=_10.shift(),_12=_10.shift();
if(!_12||typeof (_12)!="function"){
null.assert;
}
if(_10.length==0){
return function binded(){
return arguments.length?_12.apply(obj,arguments):_12.call(obj);
};
}else{
return function binded(){
if(arguments.length==0){
return _12.apply(obj,_10);
}else{
var _13=_10.concat();
for(var i=0;i<arguments.length;i++){
_13.push(arguments[i]);
}
return _12.apply(obj,_13);
}
};
}
};
std.lang.later=function(){
var _15=std.array.from(arguments);
var _16=_15.shift(),obj=_15.shift(),_18=_15.shift();
return setTimeout(function(){
return _18.apply(obj,_15);
},_16);
};
std.lang.defaultize=function(_19,_1a){
return typeof (_19)=="undefined"?_1a:_19;
};
std.lang.evaluate=function(ref){
return typeof (ref)=="function"?ref():ref;
};
std.lang.undef=function(val){
return typeof (val)=="undefined";
};
std.lang.isArray=function(val){
for(var i=0;i<arguments.length;i++){
var val=arguments[i];
if(typeof (val)=="undefined"||val==null||val.constructor!=Array){
return false;
}
}
return true;
};
std.lang.isString=function(val){
return (typeof (val)=="string")||(val instanceof String);
};
std.list={};
std.list.iterate=function(_20,_21){
if(typeof (_20.forEach)=="function"){
_20.forEach(_21);
}else{
for(var i=0;i<_20.length;i++){
_21(_20[i],i);
}
}
};
std.list.map=function(_23,_24){
if(typeof (_23.map)=="function"){
return _23.map(_24);
}else{
var _25=new Array();
for(var i=0;i<_23.length;i++){
_25.push(_24(_23[i],i));
}
return _25;
}
};
std.list.grep=function(_27,_28){
if(typeof (_27.filter)=="function"){
return _27.filter(_28);
}else{
var _29=new Array();
for(var i=0;i<_27.length;i++){
if(_28(_27[i],i)){
_29.push(_27[i]);
}
}
return _29;
}
};
std.list.max=function(_2b,_2c){
var max=Number.NEGATIVE_INFINITY;
for(var i=0;i<_2b.length;i++){
if(_2b[i]!=null){
max=Math.max(max,_2c(_2b[i]));
}
}
return max;
};
std.list.min=function(_2f,_30){
var min=Number.POSITIVE_INFINITY;
for(var i=0;i<_2f.length;i++){
if(_2f[i]!=null){
min=Math.min(min,_30(_2f[i]));
}
}
return min;
};
std.list.find=function(_33,_34){
for(var i=0;i<_33.length;i++){
if(_34(_33[i],i)){
return _33[i];
}
}
return null;
};
std.list.findIndex=function(_36,_37){
if(typeof (_36.indexOf)=="function"){
return _36.indexOf(_37);
}else{
for(var i=0;i<_36.length;i++){
if(_36[i]==_37){
return i;
}
}
return -1;
}
};
std.string={};
std.string._scriptFragment="(?:<script.*?>)((\n|\r|.)*?)(?:</script>)";
std.string.enclose=function(_39,_3a,end,_3c){
return _3c?_3a+_39+end:_39;
};
std.string.stripTags=function(_3d){
return _3d.replace(/<\/?[^>]+>/gi,"");
};
std.string.stripScripts=function(_3e){
return _3e.replace(new RegExp(std.string._scriptFragment,"img"),"");
};
std.string.extractScripts=function(_3f){
var _40=new RegExp(std.string._scriptFragment,"img");
var _41=new RegExp(std.string._scriptFragment,"im");
return std.list.map(_3f.match(_40)||[],function(_42){
return (_42.match(_41)||["",""])[1];
});
};
std.string.evalScripts=function(_43){
return std.list.map(std.string.extractScripts(_43),function(_44){
eval(_44);
});
};
std.string.escapeHTML=function(s){
return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");
};
std.string.fullEscapeHTML=function(s){
return std.string.escapeHTML(s).replace(/\n/g,"<br/>").replace(/  /g,"&nbsp; ");
};
std.string.autoLink=function(s){
s=s.replace(/([\d\w-+]+:\/\/[\S]+)/g,"<a href=\"$1\" target=\"_blank\" title=\"link\">$1</a>");
s=s.replace(/([\d\w-+]+@[\d\w-]+\.[\d\w-\.]{2,})/g,"<a href=\"mailto:$1\" title=\"email\">$1</a>");
return s;
};
std.string.autoLink2=function(s){
return s.replace(/\b((?:(?:http|https|ftp|news|file):\/\/)[^, \r\n"\(\)'<>]+)/g,"<a\thref=\"$1\"\ttarget=\"_blank\">$1</a>").replace(/\b([\w!#\$\%&'\*\+\-\/=\?\^`\{\|\}~\.]*[\w!#\$\%&'\*\+\-\/=\?\^`\{\|\}~]@[\w\-]+(?:\.[\w\-]+)+)/g,"<a\thref=\"mailto:$1\"\ttarget=\"_blank\">$1</a>");
};
std.string.isWhiteListURL=function(url){
return url.indexOf("#")==0||url.match(/^(http|https|ftp|news|file|mailto||editgrid):/i);
};
std.string.unescapeHTML=function(_4a){
var div=document.createElement("div");
div.innerHTML=std.string.stripTags(_4a);
return div.childNodes[0]?div.childNodes[0].nodeValue:"";
};
std.string.htmlEntities=function(s){
var div=document.createElement("div");
var _4e=document.createTextNode(s);
div.appendChild(_4e);
return div.innerHTML;
};
std.string.encodeUTF8=function(_4f){
_4f=_4f.replace(/\r\n/g,"\n");
var _50=[],ac=0;
for(var n=0;n<_4f.length;n++){
var c=_4f.charCodeAt(n);
if(c<128){
_50[ac++]=String.fromCharCode(c);
}else{
if((c>127)&&(c<2048)){
_50[ac++]=String.fromCharCode((c>>6)|192);
_50[ac++]=String.fromCharCode((c&63)|128);
}else{
_50[ac++]=String.fromCharCode((c>>12)|224);
_50[ac++]=String.fromCharCode(((c>>6)&63)|128);
_50[ac++]=String.fromCharCode((c&63)|128);
}
}
}
return _50.join("");
};
std.string.decodeUTF8=function(_54){
var _55=[],i=ac=c=c1=c2=0;
while(i<_54.length){
c=_54.charCodeAt(i);
if(c<128){
_55[ac++]=String.fromCharCode(c);
i++;
}else{
if((c>191)&&(c<224)){
c2=_54.charCodeAt(i+1);
_55[ac++]=String.fromCharCode(((c&31)<<6)|(c2&63));
i+=2;
}else{
c2=_54.charCodeAt(i+1);
c3=_54.charCodeAt(i+2);
_55[ac++]=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));
i+=3;
}
}
}
return _55.join("");
};
std.string.toArray=function(_57){
return _57.split("");
};
std.string.camelize=function(_58){
var _59=_58.split("-");
if(_59.length==1){
return _59[0];
}
var _5a=_58.indexOf("-")==0?_59[0].charAt(0).toUpperCase()+_59[0].substring(1):_59[0];
for(var i=1,len=_59.length;i<len;i++){
var s=_59[i];
_5a+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _5a;
};
std.string.capitalize=function(_5e){
return _5e.charAt(0).toUpperCase()+_5e.substring(1);
};
std.string.trim=function(_5f){
return _5f.replace(/^\s*(.*)\s*$/,"$1");
};
std.string.parsePosition=function(s){
s=s.split(" ");
p={top:0,bottom:0,left:0,right:0};
for(var i=0;i<s.length;i++){
switch(s[i]){
case "top":
if(!p.bottom){
p.top=1;
}
break;
case "bottom":
if(!p.top){
p.bottom=1;
}
break;
case "left":
if(!p.right){
p.left=1;
}
break;
case "right":
if(!p.left){
p.right=1;
}
break;
}
}
return p;
};
std.string.printPosition=function(p){
s=[];
if(p.top){
s.push("top");
}else{
if(p.bottom){
s.push("bottom");
}
}
if(p.left){
s.push("left");
}else{
if(p.right){
s.push("right");
}
}
return s.join(" ");
};
std.string.times=function(s,_64){
for(var i=1;i<_64;i<<=1){
s=s+s;
}
return s.substr(0,_64);
};
std.string.lpad=function(s,len,c){
var _69=std.string.times(c,len-s.length);
return _69+s;
};
std.string.right=function(s,len){
return s.length<len?s:s.substr(s.length-len,len);
};
std.jexpr={};
std.jexpr.evaluate=function(_6c){
var _6d=typeof (_6c);
if(_6d=="function"){
return _6c.call();
}else{
if(_6d=="number"||_6d=="boolean"||_6d=="string"||_6d=="undefined"||_6c==null){
return _6c;
}else{
if(typeof (_6c.not)!="undefined"){
return !std.jexpr.evaluate(_6c.not);
}else{
if(typeof (_6c.and)=="object"){
_6c=_6c.and;
for(var i=0;i<_6c.length;i++){
if(!std.jexpr.evaluate(_6c[i])){
return false;
}
}
return true;
}else{
_6c=typeof (_6c.or)=="object"?_6c.or:_6c;
for(var i=0;i<_6c.length;i++){
if(std.jexpr.evaluate(_6c[i])){
return true;
}
}
return false;
}
}
}
}
};
std.jexpr.functor=function(_6f){
return function(){
return std.jexpr.evaluate(_6f);
};
};
std.keytable={BACKSPACE:[8,"Backspace"],TAB:[9,"Tab"],ENTER:[13,"Enter"],SHIFT:[16,"Shift"],CTRL:[17,"Ctrl"],ALT:[18,"Alt"],PAUSE:[19,"Pause"],CAPS_LOCK:[20,"Caps"],ESCAPE:[27,"Esc"],SPACE:[32,"Space"],PAGE_UP:[33,"Page Up"],PAGE_DOWN:[34,"Page Down"],END:[35,"End"],HOME:[36,"Home"],LEFT_ARROW:[37,"Left"],UP_ARROW:[38,"Up"],RIGHT_ARROW:[39,"Right"],DOWN_ARROW:[40,"Down"],INSERT:[45,"Ins"],DELETE:[46,"Del"],LEFT_WINDOW:[91,""],RIGHT_WINDOW:[92,""],SELECT:[93,""],NUM_LOCK:[144,""],SCROLL_LOCK:[145,""],";":[186,";"],"=":[187,"="],",":[188,","],".":[190,"."],"/":[191,"/"],"`":[192,"`"],"[":[219,"["],"\\":[220,"\\"],"]":[221,"]"],"'":[222,"'"],CMD:[224,""],IME:[229,""]};
for(var i=48;i<=57;i++){
std.keytable[String.fromCharCode(i)]=[i,String.fromCharCode(i)];
}
for(var i=65;i<=90;i++){
std.keytable[String.fromCharCode(i)]=[i,String.fromCharCode(i)];
}
for(var i=112;i<=123;i++){
std.keytable["F"+(i-111)]=[i,"F"+(i-111)];
}
std.action={};
std.action.AbstractAction=function(){
};
std.action.AbstractAction.prototype._initAbstractAction=function(_70){
_70=_70||{};
this._icon=_70.icon||"";
this._text=_70.text||"";
this._mnemonic=_70.mnemonic||"";
this._selected=_70.selected||"";
this._disabled=_70.disabled||false;
this.setShortcutList(_70.shortcutList||[]);
};
std.action.AbstractAction.prototype.getIcon=function(){
return std.lang.evaluate(this._icon);
};
std.action.AbstractAction.prototype.getText=function(){
return std.lang.evaluate(this._text);
};
std.action.AbstractAction.prototype.getMnemonic=function(){
return std.lang.evaluate(this._mnemonic);
};
std.action.AbstractAction.prototype.isSelected=function(){
return std.jexpr.evaluate(this._selected);
};
std.action.AbstractAction.prototype.setSelected=function(_71){
this._selected=_71;
};
std.action.AbstractAction.prototype.getShortcutList=function(){
return this._shortcutList;
};
std.action.AbstractAction.prototype.setShortcutList=function(_72){
if(_72 instanceof Array){
this._shortcutList=_72;
}else{
this._shortcutList=std.action.KeyComb.fromString(_72);
}
};
std.action.AbstractAction.prototype.addShortcut=function(_73){
if(_73 instanceof std.action.KeyComb){
this._shortcutList.push(_73);
}else{
this._shortcutList.push(new std.action.KeyComb(_73));
}
};
std.action.AbstractAction.prototype.isDisabled=function(){
return std.jexpr.evaluate(this._disabled);
};
std.action.AbstractAction.prototype.setDisabled=function(_74){
this._disabled=_74;
};
std.action.AbstractAction.prototype.getValue=function(){
return this._value;
};
std.action.AbstractAction.prototype.setValue=function(_75){
this._value=_75;
};
std.action.AbstractAction.prototype.performAction=function(){
};
std.action.Nil=function(_76){
this._initAbstractAction(_76);
};
std.action.Nil.prototype=new std.action.AbstractAction();
std.action.Script=function(_77){
this._initAbstractAction(_77);
this._script=_77.script;
};
std.action.Script.prototype=new std.action.AbstractAction();
std.action.Script.prototype.performAction=function(){
var _78=[this];
for(var i=0;i<arguments.length;i++){
_78.push(arguments[i]);
}
this._script.apply(null,_78);
};
std.action.Url=function(_7a){
this._initAbstractAction(_7a);
this._url=_7a.url;
this._popup=_7a.popup;
};
std.action.Url.prototype=new std.action.AbstractAction();
std.action.Url.prototype.performAction=function(){
std.host.open(std.lang.evaluate(this._url),this._popup);
};
std.action.KeyComb=function(_7b){
this._key=null;
this._reqCtrl=false;
this._reqAlt=false;
this._reqShift=false;
std.list.iterate(_7b.toUpperCase().split(" "),std.lang.bind(this,function(key){
switch(key){
case "CTRL":
this._reqCtrl=true;
break;
case "ALT":
this._reqAlt=true;
break;
case "SHIFT":
this._reqShift=true;
break;
default:
if(key){
this._key=std.keytable[key];
}
}
}));
};
std.action.KeyComb.fromString=function(str){
var _7e=[];
std.list.iterate(str.split(";;"),function(_7f){
_7f=std.string.trim(_7f);
if(_7f){
_7e.push(new std.action.KeyComb(_7f));
}
});
return _7e;
};
std.action.KeyComb.prototype.toString=function(){
if(!this._string){
var _80=[];
if(this._reqCtrl){
_80.push("Ctrl");
}
if(this._reqAlt){
_80.push("Alt");
}
if(this._reqShift){
_80.push("Shift");
}
_80.push(this._key[1]);
this._string=_80.join("+");
}
return this._string;
};
std.action.KeyComb.prototype.check=function(_81,_82,_83,_84,_85){
_82=_82?true:false;
_83=_83?true:false;
_84=_84?true:false;
return (_82==this._reqCtrl||(std.browser.platform.isMacOS&&(_85==this._reqCtrl)))&&_83==this._reqAlt&&_84==this._reqShift&&_81==this._key[0];
};
std.array={};
std.array.from=function(_86){
var arr=[];
for(var i=0;i<_86.length;i++){
arr.push(_86[i]);
}
return arr;
};
std.array.contains=function(_89,_8a){
for(var i=0;i<_89.length;i++){
if(_89[i]==_8a){
return true;
}
}
return false;
};
std.array.without=function(_8c,_8d,_8e){
var _8f=new Array();
if(_8e){
for(var i=0;i<_8c.length;i++){
if(!_8e(_8c[i],_8d)){
_8f.push(_8c[i]);
}
}
}else{
for(var i=0;i<_8c.length;i++){
if(_8c[i]!=_8d){
_8f.push(_8c[i]);
}
}
}
return _8f;
};
std.event={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46};
std.event.observers=false;
std.event._observeAndCache=function(_91,_92,_93,_94){
if(!this.observers){
this.observers=[];
}
if(_91.addEventListener){
this.observers.push([_91,_92,_93,_94]);
_91.addEventListener(_92,_93,_94);
}else{
if(_91.attachEvent){
this.observers.push([_91,_92,_93,_94]);
_91.attachEvent("on"+_92,_93);
}
}
};
std.event.unloadCache=function(){
if(!std.event.observers){
return;
}
for(var i=0;i<std.event.observers.length;i++){
std.event.stopObserving.apply(this,std.event.observers[i]);
std.event.observers[i][0]=null;
}
std.event.observers=false;
};
std.event.nativeSetObserved=function(_96,_97,_98,_99,_9a){
return _96?std.event.nativeObserve(_97,_98,_99,_9a):std.event.nativeStopObserving(_97,_98,_99,_9a);
};
std.event.nativeObserve=function(_9b,_9c,_9d,_9e){
_9b=typeof (_9b)=="string"?document.getElementById(_9b):_9b;
_9b.tagName;
_9e=_9e||false;
std.event._observeAndCache(_9b,_9c,_9d,_9e);
};
std.event.nativeStopObserving=function(_9f,_a0,_a1,_a2){
_9f=typeof (_9f)=="string"?document.getElementById(_9f):_9f;
_a2=_a2||false;
if(_9f.removeEventListener){
_9f.removeEventListener(_a0,_a1,_a2);
}else{
if(_9f.detachEvent){
_9f.detachEvent("on"+_a0,_a1);
}
}
};
std.event.observe=function(_a3,_a4,_a5,_a6){
if(_a4=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||document.attachEvent)){
_a4="keydown";
}
std.event.nativeObserve(_a3,_a4,_a5,_a6);
};
std.event.stopObserving=function(_a7,_a8,_a9,_aa){
if(_a8=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||document.detachEvent)){
_a8="keydown";
}
std.event.nativeStopObserving(_a7,_a8,_a9,_aa);
};
std.event.observe(window,"unload",std.event.unloadCache,false);
std.event.listener=function(obj,_ac){
var _ad=std.array.from(arguments);
var obj=_ad.shift();
var _ac=_ad.shift();
_ac.prototype;
if(typeof _ac!="function"){
throw "Invalid method: "+_ac;
}
return function(e){
return _ac.apply(obj,[e||window.event].concat(_ad));
};
};
std.hash={};
std.hash.merge=function(){
var _af=std.array.from(arguments);
var _b0={};
for(var i=0;i<_af.length;i++){
var _b2=_af[i];
for(var _b3 in _b2){
_b0[_b3]=_b2[_b3];
}
}
return _b0;
};
std.hash.iterate=function(_b4,_b5){
for(var k in _b4){
_b5(k,_b4[k]);
}
};
std.hash.keys=function(_b7){
var _b8=[];
for(var k in _b7){
_b8.push(k);
}
return _b8;
};
std.hash.values=function(_ba){
var _bb=[];
for(var k in _ba){
_bb.push(_ba[k]);
}
return _bb;
};
std.hash.map=function(_bd,_be){
var _bf={};
for(var i=0;i<_bd.length;i++){
var _c1=_be(_bd[i],i);
_bf[_c1[0]]=_c1[1];
}
return _bf;
};
std.hash.size=function(_c2){
var cnt=0;
for(var k in _c2){
cnt++;
}
return cnt;
};
std.hash.notEmpty=function(_c5){
for(var k in _c5){
return true;
}
return false;
};
std.hash.empty=function(_c7){
for(var k in _c7){
return false;
}
return true;
};
std.dom={};
std.dom.element=function(_c9){
if(_c9){
return typeof (_c9)=="string"?document.getElementById(_c9):_c9;
}else{
return null;
}
};
std.dom.newTree=function(_ca){
var _cb=std.dom.newElement("div");
_cb.innerHTML=_ca;
return _cb.firstChild;
};
std.dom.update=function(_cc,_cd){
std.dom.element(_cc).innerHTML=std.string.stripScripts(_cd);
setTimeout(function(){
std.string.evalScripts(_cd);
},10);
};
std.conv={};
std.conv._hexTab=[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70];
std.conv.intToRGB=function(num){
return String.fromCharCode(this._hexTab[(num>>20)&15],this._hexTab[(num>>16)&15],this._hexTab[(num>>12)&15],this._hexTab[(num>>8)&15],this._hexTab[(num>>4)&15],this._hexTab[num&15]);
};
std.conv.hexToInt=function(c){
var _d0=c.toUpperCase().charCodeAt(0);
if(48<=_d0&&_d0<=58){
return _d0-48;
}
if(65<=_d0&&_d0<=70){
return _d0-65+10;
}
return 0;
};
std.conv.rgbToIntArray=function(s){
if(s===null){
return null;
}
if(s===undefined||!s.charAt){
return undefined;
}
return [16*std.conv.hexToInt(s.charAt(0))+std.conv.hexToInt(s.charAt(1)),16*std.conv.hexToInt(s.charAt(2))+std.conv.hexToInt(s.charAt(3)),16*std.conv.hexToInt(s.charAt(4))+std.conv.hexToInt(s.charAt(5))];
};
std.conv.rgbToInt=function(s){
var arr=std.conv.rgbToIntArray(s);
if(!arr){
return undefined;
}
return arr[0]*65536+arr[1]*256+arr[2];
};
std.conv.rgbArrayToInt=function(r,g,b){
return r*65536+g*256+b;
};
std.conv.anyRGBToInt=function(any){
if(any===undefined){
return any;
}else{
if(any===null||any===-1){
return -1;
}else{
if(typeof any=="number"){
return any;
}else{
if(typeof any=="string"){
return std.conv.rgbToInt(any);
}else{
if(typeof any=="object"){
if(any.r!==undefined&&any.g!==undefined&&any.b!==undefined){
return std.conv.rgbArrayToInt(any.r,any.g,any.b);
}else{
if(any[0]!==undefined&&any[1]!==undefined&&any[2]!==undefined){
return std.conv.rgbArrayToInt(any[0],any[1],any[2]);
}
}
}
}
}
}
}
throw new Error("Cannot convert ["+any+"] into an integer");
};
std.ajax={};
std.ajax._processorCount=0;
std.ajax._jsonpProcessors={};
std.ajax._emptyFunction=function(){
};
std.ajax.obtainProcessorId=function(){
if(std.ajax._processorCount>100000){
std.ajax._processorCount=0;
}
return std.ajax._processorCount++;
};
std.ajax.registerJsonpProcessor=function(id,_d9){
std.ajax._jsonpProcessors[id]=_d9;
};
std.ajax.removeJsonpProcessor=function(id){
delete std.ajax._jsonpProcessors[id];
};
std.ajax.jsonp=function(_db,_dc,_dd,_de){
if(typeof _dd=="undefined"){
_dd=200;
}
if(typeof _de=="undefined"){
_de="";
}
std.ajax._jsonpProcessors[_db](_dd,_de,_dc);
};
std.ajax.ScriptTagRequest=function(){
this._jsonpId=std.ajax.obtainProcessorId();
this._tag=null;
this._url=null;
this._content=null;
this._responseSuccess=false;
this._processError=false;
this.onreadystatechange=null;
this.readyState=0;
this.responseText="";
this.status=0;
this.statusText="";
this._headers=null;
this._maxLength=std.ajax.ScriptTagRequest.MAX_LENGTH;
};
std.ajax.ScriptTagRequest.MAX_LENGTH=1800;
std.ajax.ScriptTagRequest._idPrefix=Math.random()+"."+new Date().getTime();
std.ajax.ScriptTagRequest.prototype._reset=function(){
this._removeScriptTag();
this._content=null;
this._responseSuccess=false;
this._processError=false;
this.readyState=0;
this.responseText="";
this.status=0;
this.statusText="";
this._headers=null;
this._maxLength=std.ajax.ScriptTagRequest.MAX_LENGTH;
};
std.ajax.ScriptTagRequest.prototype._removeScriptTag=function(){
if(this._tag){
document.getElementsByTagName("HEAD")[0].removeChild(this._tag);
}
this._tag=null;
if(this._jsonpId){
std.ajax.removeJsonpProcessor(this._jsonpId);
}
};
std.ajax.ScriptTagRequest.prototype._createScriptTag=function(_df,_e0,_e1){
this._removeScriptTag();
this._responseSuccess=false;
this._processError=false;
std.ajax.registerJsonpProcessor(this._jsonpId,std.lang.bind(this,this._processResponse));
this._tag=document.createElement("script");
this._tag.type="text/javascript";
this._tag.charset="utf-8";
var url=this._url+(this._url.indexOf("?")==-1?"?":"&")+"i="+std.ajax.ScriptTagRequest._idPrefix;
url+="&jsonp="+this._jsonpId;
url+="&c="+_df;
if(_e0){
url+="&f=1";
}
if(_e1){
url+="&l=1";
}
this._tag.src=url;
std.event.observe(this._tag,"load",std.event.listener(this,this._onload));
std.event.observe(this._tag,"error",std.event.listener(this,this._onerror));
std.event.observe(this._tag,"readystatechange",std.event.listener(this,this._onreadystatechange));
document.getElementsByTagName("HEAD")[0].appendChild(this._tag);
};
std.ajax.ScriptTagRequest.prototype._onload=function(){
this._removeScriptTag();
if(!this._responseSuccess){
this._onerror();
}else{
this._sendContent();
}
};
std.ajax.ScriptTagRequest.prototype._onerror=function(){
this._removeScriptTag();
if(!this._processError){
this._processError=true;
this.status=500;
this.statusText="Error";
this.readyState=4;
this.responseText="";
if(this.onreadystatechange&&typeof this.onreadystatechange=="function"){
this.onreadystatechange();
}
}
};
std.ajax.ScriptTagRequest.prototype._onreadystatechange=function(){
if(this._tag&&this._tag.readyState&&this._tag.readyState=="loaded"){
this._onload();
}
};
std.ajax.ScriptTagRequest.prototype._sendContent=function(_e3){
if(_e3==null&&this._content==null){
return;
}
var _e4=(_e3!=null);
var _e5;
if(_e4){
this._content=_e3;
}
var c;
if(this._content.length>this._maxLength){
var _e7=this._getMaxLength();
c=this._content.substring(0,_e7);
this._content=this._content.substring(_e7);
_e5=false;
}else{
c=this._content;
this._content=null;
_e5=true;
}
this._createScriptTag(c,_e4,_e5);
};
std.ajax.ScriptTagRequest.prototype._getMaxLength=function(){
var _e8=this._maxLength;
var _e9=this._content;
while(true){
if(_e9.charAt(_e8-1)=="%"){
_e8-=1;
}else{
if(_e9.charAt(_e8-2)=="%"){
_e8-=2;
}else{
if(_e9.charAt(_e8-3)=="%"){
var _ea=std.conv.hexToInt(_e9.charAt(_e8-2));
if(_ea<=7){
break;
}
if(_ea>=8&&_ea<=11){
_e8-=3;
}
if(_ea>=12){
_e8-=3;
break;
}
}else{
break;
}
}
}
}
return _e8;
};
std.ajax.ScriptTagRequest.prototype._processResponse=function(_eb,_ec,_ed){
this._responseSuccess=true;
if(_eb!=-1){
this.status=_eb;
this._headers=_ec;
this.responseText=_ed;
this.readyState=4;
if(this.onreadystatechange&&typeof this.onreadystatechange=="function"){
this.onreadystatechange();
}
}
};
std.ajax.ScriptTagRequest.prototype.open=function(_ee,url,_f0,_f1,_f2){
this._reset();
this._url=url;
this._maxLength-=url.length;
};
std.ajax.ScriptTagRequest.prototype.send=function(_f3){
this._reset();
_f3=_f3==null?"":encodeURIComponent(_f3);
this._sendContent(_f3);
};
std.ajax.ScriptTagRequest.prototype.setRequestHeader=function(){
};
std.ajax.ScriptTagRequest.prototype.getAllResponseHeaders=function(){
return this._headers;
};
std.ajax.ScriptTagRequest.prototype.getResponseHeader=function(key){
if(!key){
return null;
}
var _f5=null;
key=key.toLowerCase()+":";
var _f6=this._headers.toLowerCase();
var i=-1;
if((i=_f6.indexOf(key))!=-1){
_f5=this._headers.substring(i+key.length,this._headers.indexOf("\n",i));
_f5=std.string.trim(_f5);
}
return _f5;
};
std.ajax.ScriptTagRequest.prototype.abort=function(){
this._removeScriptTag();
};
std.ajax.getTransport=function(_f8){
if(typeof _f8=="string"){
return eval(_f8)();
}
return std.ajax.getDefaultTransport();
};
std.ajax.getScriptTagTransport=function(){
return new std.ajax.ScriptTagRequest();
};
std.ajax.getDefaultTransport=function(){
try{
return new XMLHttpRequest();
}
catch(e){
}
finally{
}
try{
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
}
finally{
}
try{
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
}
finally{
}
return false;
};
std.ajax._activeRequestCount=0;
std.ajax.responders={};
std.ajax.responders._list=[];
std.ajax.responders._register=function(_f9){
if(!std.array.contains(this._list,_f9)){
this._list.push(_f9);
}
};
std.ajax.responders._unregister=function(_fa){
this._list=std.array.without(this._list,_fa);
};
std.ajax.responders._dispatch=function(_fb,_fc,_fd,_fe){
std.list.iterate(this._list,function(_ff){
if(_ff[_fb]&&typeof _ff[_fb]=="function"){
try{
_ff[_fb].apply(_ff,[_fc,_fd,_fe]);
}
catch(e){
}
}
});
};
std.ajax.responders._register({onCreate:function(){
std.ajax._activeRequestCount++;
},onComplete:function(){
std.ajax._activeRequestCount--;
}});
std.ajax.Base=function(){
};
std.ajax.Base.prototype.setOptions=function(_100){
this.options={method:"post",asynchronous:true,parameters:""};
if(_100){
this.options=std.hash.merge(this.options,_100);
}
};
std.ajax.Base.prototype.responseIsSuccess=function(){
return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);
};
std.ajax.Base.prototype.responseIsFailure=function(){
return !this.responseIsSuccess();
};
std.ajax.Request=function(url,_102){
this.setOptions(_102);
this.transport=std.ajax.getTransport(this.options.transportFactory);
this.request(url);
};
std.ajax.Request.prototype=new std.ajax.Base();
std.ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
std.ajax.Request.prototype.request=function(url){
var _104=this.options.parameters||"";
if(_104.length>0){
_104+="&_=";
}
try{
this.url=url;
if(this.options.method=="get"&&_104.length>0){
this.url+=(this.url.match(/\?/)?"&":"?")+_104;
}
std.ajax.responders._dispatch("onCreate",this,this.transport);
this.transport.open(this.options.method,this.url,this.options.asynchronous);
if(this.options.asynchronous){
this.transport.onreadystatechange=std.lang.bind(this,this.onStateChange);
setTimeout(std.lang.bind(this,function(){
this.respondToReadyState(1);
}),10);
}
this.setRequestHeaders();
var body=this.options.postBody?this.options.postBody:_104;
this.transport.send(this.options.method.toLowerCase()=="post"||this.options.method.toLowerCase()=="put"?body:null);
}
catch(e){
this.dispatchException(e);
}
};
std.ajax.Request.prototype.setRequestHeaders=function(){
var _106=[];
if(this.options.method.toLowerCase()=="post"){
_106.push("Content-type",this.options.contentType?this.options.contentType:"application/x-www-form-urlencoded");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
_106.push("Connection","close");
}
}
if(this.options.requestHeaders){
_106.push.apply(_106,this.options.requestHeaders);
}
for(var i=0;i<_106.length;i+=2){
this.transport.setRequestHeader(_106[i],_106[i+1]);
}
};
std.ajax.Request.prototype.onStateChange=function(){
var _108=this.transport.readyState;
if(_108!=1){
this.respondToReadyState(this.transport.readyState);
}
};
std.ajax.Request.prototype.header=function(name){
try{
return this.transport.getResponseHeader(name);
}
catch(e){
}
};
std.ajax.Request.prototype.evalJSON=function(){
try{
return eval(this.header("X-JSON"));
}
catch(e){
}
};
std.ajax.Request.prototype.evalResponse=function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
};
std.ajax.Request.prototype.respondToReadyState=function(_10a){
if(typeof (std)=="undefined"){
return;
}
var _10b=std.ajax.Request.Events[_10a];
var _10c=this.transport,json=this.evalJSON();
if(_10b=="Complete"){
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||std.ajax._emptyFunction)(_10c,json);
}
catch(e){
this.dispatchException(e);
}
if((this.header("Content-type")||"").match(/^text\/javascript/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_10b]||std.ajax._emptyFunction)(_10c,json);
std.ajax.responders._dispatch("on"+_10b,this,_10c,json);
}
catch(e){
this.dispatchException(e);
}
if(_10b=="Complete"){
this.transport.onreadystatechange=std.ajax._emptyFunction;
}
};
std.ajax.Request.prototype.dispatchException=function(_10e){
(this.options.onException||std.ajax._emptyFunction)(this,_10e);
std.ajax.responders._dispatch("onException",this,_10e);
};
std.ajax.Updater=function(_10f,url,_111){
this.containers={success:_10f.success?std.dom.element(_10f.success):std.dom.element(_10f),failure:_10f.failure?std.dom.element(_10f.failure):(_10f.success?null:std.dom.element(_10f))};
this.transport=std.ajax.getTransport();
this.setOptions(_111);
var _112=this.options.onComplete||std.ajax._emptyFunction;
this.options.onComplete=std.lang.bind(this,function(_113,_114){
this.updateContent();
_112(_113,_114);
});
this.request(url);
};
std.ajax.Updater.prototype=new std.ajax.Request();
std.ajax.Updater.prototype.updateContent=function(){
var _115=this.responseIsSuccess()?this.containers.success:this.containers.failure;
var _116=this.transport.responseText;
if(!this.options.evalScripts){
_116=std.string.stripScripts(_116);
}
if(_115){
if(this.options.insertion){
new this.options.insertion(_115,_116);
}else{
std.dom.update(_115,_116);
}
}
if(this.responseIsSuccess()){
if(this.onComplete){
setTimeout(std.lang.bind(this,this.onComplete),10);
}
}
};
std.ajax.getText=function(url,_118){
var ajax=new std.ajax.Request(url,{method:_118||"post",asynchronous:false});
return ajax.transport.responseText;
};
std.ajax.newTree=function(url){
var text=std.ajax.getText(url);
return std.dom.newTree(text);
};
std.ajax.ping=function(url,_11d){
new std.ajax.Request(url,std.hash.merge(_11d,{method:"post",asynchronous:true}));
};
std.ajax.loadMap=function(map,_11f,_120){
var len=0;
var dst={};
for(var i in map){
len++;
}
for(var i in map){
(function(idx){
new std.ajax.Request(map[i],std.hash.merge(_120,{onSuccess:function(_125){
dst[idx]={responseText:_125.responseText};
if(!--len){
_11f(dst);
}
}}));
})(i);
}
};
std.ani={};
std.ani.Interpolator=function(){
this._onEvent=null;
this._cp=null;
this._timer=null;
};
std.ani.Interpolator.prototype.restart=function(sp,ep,_128,step){
this.reset(sp);
this.start(sp,ep,_128,step);
};
std.ani.Interpolator.prototype.start=function(sp,ep,_12c,step){
this.stop();
if(this._cp==null){
this._cp=sp;
}
if(sp>ep){
this._cp=Math.min(sp,this._cp);
this._cp=Math.max(ep,this._cp);
}else{
this._cp=Math.max(sp,this._cp);
this._cp=Math.min(ep,this._cp);
}
this._sp=parseFloat(sp);
this._ep=parseFloat(ep);
this._period=parseFloat(_12c);
this._step=parseFloat(step);
this._st=this._calStartTime();
this._timer=setTimeout(std.lang.bind(this,this._onStep),this._step);
this._fireEvent(true,false,false);
};
std.ani.Interpolator.prototype._onStep=function(){
this._cp=this._calCurPoint();
if((this._sp>this._ep&&this._cp<=this._ep)||(this._sp<this._ep&&this._cp>=this._ep)){
this._cp=this._ep;
this._timer=null;
this._fireEvent(false,true,true);
}else{
this._timer=setTimeout(std.lang.bind(this,this._onStep),this._step);
this._fireEvent(false,false,false);
}
};
std.ani.Interpolator.prototype.stop=function(){
if(this._timer!=null){
clearTimeout(this._timer);
this._timer=null;
this._fireEvent(false,true,false);
}
};
std.ani.Interpolator.prototype.reset=function(cp){
this.stop();
this._cp=cp;
this._fireEvent(false,true,false);
};
std.ani.Interpolator.prototype.getCurPoint=function(){
return this._cp;
};
std.ani.Interpolator.prototype.setOnEvent=function(_12f){
this._onEvent=_12f;
};
std.ani.Interpolator.prototype._calStartTime=function(){
return new Date()-this._period*(this._cp-this._sp)/(this._ep-this._sp);
};
std.ani.Interpolator.prototype._calCurPoint=function(){
return this._sp+(this._ep-this._sp)*(new Date()-this._st)/this._period;
};
std.ani.Interpolator.prototype._fireEvent=function(_130,_131,_132){
if(this._onEvent!=null){
this._onEvent(this,_130,_131,_132);
}
};
std.console={};
std.console.firefoxConsole={};
std.console.firefoxConsole.log=function(_133,_134){
switch(_133){
case "DEBUG":
console.debug(_134);
break;
case " INFO":
console.info(_134);
break;
case " WARN":
console.warn(_134);
break;
case "ERROR":
console.error(_134);
break;
}
};
std.console.webkitConsole={};
std.console.webkitConsole.log=function(_135,_136){
console.log("["+_135+"] "+_136);
};
std.console.operaConsole={};
std.console.operaConsole.log=function(_137,_138){
opera.postError("["+_137+"] "+_138);
};
std.console.nullConsole={};
std.console.nullConsole.log=function(_139,_13a){
};
std.console.defaultConsole=(function(){
if(typeof console!="undefined"){
return std.browser.isAppleWebKit?std.console.webkitConsole:std.console.firefoxConsole;
}else{
if(typeof opera!="undefined"){
return std.console.operaConsole;
}
}
return std.console.nullConsole;
})();
std.log={};
std.log._console=std.console.defaultConsole;
std.log.debug=function(_13b){
std.log._console.log("DEBUG",_13b);
};
std.log.info=function(_13c){
std.log._console.log(" INFO",_13c);
};
std.log.warn=function(_13d){
std.log._console.log(" WARN",_13d);
};
std.log.error=function(_13e){
std.log._console.log("ERROR",_13e);
};
std.log.setConsole=function(_13f){
std.log._console=_13f;
};
std.log.getConsole=function(){
return std.log._console;
};
std.async={};
std.async.call=function(obj,func){
var args=[];
if(func.__async__){
args.push(function(){
});
args.push(func.__throw__?func.__throw__:function(e){
setTimeout(function(){
throw e;
},0);
});
}
for(var i=2;i<arguments.length;i++){
args.push(arguments[i]);
}
func.apply(obj,args);
};
std.cookies={};
std.cookies.set=function(name,_146,days){
if(days){
var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var _149="; expires="+date.toGMTString();
}else{
var _149="";
}
document.cookie=name+"="+_146+_149+"; path=/";
};
std.cookies.get=function(name){
var _14b=name+"=";
var ca=document.cookie.split(";");
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==" "){
c=c.substring(1,c.length);
}
if(c.indexOf(_14b)==0){
return c.substring(_14b.length,c.length);
}
}
return null;
};
std.cookies.remove=function(name){
std.cookies.set(name,"",-1);
};
std.css={};
std.css.bulkset=function(){
var attr=arguments[0];
for(var i=1;i<arguments.length;i++){
var data=arguments[i];
var _153=data[0];
for(var j=1;j<data.length;j++){
std.dom.element(data[j]).style[attr]=_153;
}
}
};
std.css.getStyle=function(_155,_156){
std.css.getElementStyle(std.dom.element(_155),_156);
};
std.css.getElementStyle=function(_157,_158){
var _159=_157.style[std.string.camelize(_158)];
if(!_159){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_157,null);
_159=css?css.getPropertyValue(_158):null;
}else{
if(_157.currentStyle){
_159=_157.currentStyle[std.string.camelize(_158)];
}
}
}
if(window.opera&&(_158=="left"||_158=="top"||_158=="right"||_158=="bottom")){
if(std.css.getStyle(_157,"position")=="static"){
_159="auto";
}
}
return _159=="auto"?null:_159;
};
std.css.setStyle=function(_15b,_15c){
_15b=std.dom.element(_15b);
for(name in _15c){
_15b.style[std.string.camelize(name)]=_15c[name];
}
};
std.css.includeClass=function(_15d,_15e){
var _15f=_15d.className.split(" ");
var _160=0;
for(var i=0;i<_15f.length;i++){
if(_15f[i]==_15e){
_160=1;
break;
}
}
if(!_160){
_15f.push(_15e);
_15d.className=_15f.join(" ");
}
};
std.css.excludeClass=function(_162,_163){
var _164=_162.className.split(" ");
var _165=[];
for(var i=0;i<_164.length;i++){
if(_164[i]!=_163){
_165.push(_164[i]);
}
}
if(_164.length!=_165.length){
_162.className=_165.join(" ");
}
};
std.css._switchOnEvent=function(_167,_168,_169,_16a){
std.css.includeClass(_167,_169);
if(!_167[_168]){
if(_16a){
std.event.observe(_167,_16a,std.lang.bind(null,std.css.excludeClass,_167,_169));
}
_167[_168]=true;
}
};
std.css.hoverClass=function(_16b,_16c){
std.css._switchOnEvent(_16b,"std.css.hoverClass.set",_16c,"mouseout");
};
std.css.clickClass=function(_16d,_16e){
std.css._switchOnEvent(_16d,"std.css.clickClass.set",_16e,"mouseup");
};
std.css.focusClass=function(_16f,_170){
std.css._switchOnEvent(_16f,"std.css.focusClass.set",_170,"blur");
};
std.customfocus={};
std.customfocus.Manager=function(){
this._focusList={next:null};
this._docFocusListenerList=[];
this._docBlurListenerList=[];
std.event.observe(document,"mousedown",std.event.listener(this,this._onDocMouseDown));
};
std.customfocus.Manager.prototype.newDelegator=function(_171,_172,_173){
return new std.customfocus.Delegator(this,_171,_172,_173);
};
std.customfocus.Manager.prototype.focus=function(obj,_175,_176){
this.detach(obj);
var _177=this._focusList.next;
var _178={obj:obj,onfocus:_175,onblur:_176,next:this._focusList.next};
this._focusList.next=_178;
if(_177&&_177.onblur){
_177.onblur.call();
}
if(_178.onfocus){
_178.onfocus.call();
}
};
std.customfocus.Manager.prototype.blur=function(obj){
if(this.isFocused(obj)){
var _17a=this._focusList.next;
var _17b=this._focusList.next.next;
this._focusList.next=_17b;
if(_17a.onblur){
_17a.onblur.call();
}
if(_17b&&_17b.onfocus){
_17b.onfocus.call();
}
}
};
std.customfocus.Manager.prototype.detach=function(obj){
for(var edge=this._focusList;edge.next;edge=edge.next){
if(edge.next.obj==obj){
edge.next=edge.next.next;
return;
}
}
};
std.customfocus.Manager.prototype.focusOnEvent=function(obj,_17f,_180){
if(!this._inEvent){
this._inEvent=true;
setTimeout(std.lang.bind(this,this._afterEvent),0);
this.focus(obj,_17f,_180);
}
};
std.customfocus.Manager.prototype._afterEvent=function(){
this._inEvent=false;
};
std.customfocus.Manager.prototype.isFocused=function(obj){
return this._focusList.next&&this._focusList.next.obj==obj;
};
std.customfocus.Manager.prototype.attachDocFocusListener=function(_182){
this._docFocusListenerList.push(_182);
};
std.customfocus.Manager.prototype.attachDocBlurListener=function(_183){
this._docBlurListenerList.push(_183);
};
std.customfocus.Manager.prototype.detachDocFocusListener=function(_184){
for(var i=0;i<this._docFocusListenerList.length;i++){
if(this._docFocusListenerList[i]==_184){
this._docFocusListenerList.splice(i,1);
break;
}
}
};
std.customfocus.Manager.prototype.detachDocBlurListener=function(_186){
for(var i=0;i<this._docBlurListenerList.length;i++){
if(this._docBlurListenerList[i]==_186){
this._docBlurListenerList.splice(i,1);
break;
}
}
};
std.customfocus.Manager.prototype._onDocMouseDown=function(e){
this.focusOnEvent(document,std.lang.bind(this,this._onDocFocus),std.lang.bind(this,this._onDocBlur));
};
std.customfocus.Manager.prototype._onDocFocus=function(){
std.list.iterate(this._docFocusListenerList,function(_189){
_189.call();
});
};
std.customfocus.Manager.prototype._onDocBlur=function(){
std.list.iterate(this._docBlurListenerList,function(_18a){
_18a.call();
});
};
std.customfocus.getManager=function(){
return std.customfocus._manager||(std.customfocus._manager=new std.customfocus.Manager());
};
std.customfocus.Delegator=function(_18b,_18c,_18d,_18e){
this._manager=_18b;
this._relative=_18c;
this._onfocus=_18d;
this._onblur=_18e;
};
std.customfocus.Delegator.prototype.focus=function(){
this._manager.focus(this,this._onfocus,this._onblur);
};
std.customfocus.Delegator.prototype.focusOnEvent=function(){
this._manager.focusOnEvent(this,this._onfocus,this._onblur);
};
std.customfocus.Delegator.prototype.blur=function(){
this._manager.blur(this);
};
std.customfocus.Delegator.prototype.isFocused=function(){
return this._manager.isFocused(this);
};
std.customfocus.Delegator.prototype.detach=function(){
this._manager.detach(this);
};
std.date={};
std.date.fromSqlUTC=function(str){
var time=Date.UTC(str.substr(0,4),str.substr(4,2)-1,str.substr(6,2),str.substr(8,2),str.substr(10,2),str.substr(12,2));
return new Date(time);
};
std.date.asTimeStrUTC=function(date){
return date.toUTCString().split(" ")[4]+(date.getUTCMilliseconds()/1000).toFixed(3).substring(1);
};
std.date.format=function(dt,fmt){
var _194={y:"getFullYear",M:"getMonth",d:"getDate",H:"getHours",m:"getMinutes",s:"getSeconds"};
var _195={};
var _196=["yyyy","yy","MM","dd","HH","mm","ss"];
var _197=[4,2,2,2,2,2,2];
var _198=[0,0,1,0,0,0,0];
var _199=[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11];
var _19a=[1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0];
var _19b=["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var val,res;
while(fmt.indexOf("MMM")!=-1){
if(val==null){
val=""+_19b[_195["M"]=dt.getMonth()+1];
}
fmt=fmt.replace("MMM",val);
}
val=null;
while(fmt.indexOf("hh")!=-1){
if(val==null){
val=dt.getHours();
}
fmt=fmt.replace("hh",_199[val]);
}
while(fmt.indexOf("a")!=-1){
if(val==null){
val=dt.getHours();
}
fmt=fmt.replace("a",_19a[val]?"AM":"PM");
}
for(var i=0;i<_196.length;++i){
var pat=_196[i],val=null;
while(fmt.indexOf(pat)!=-1){
if(val==null){
var c=pat.charAt(0);
var r=_197[i];
if((res=_195[c])==null){
res=_195[c]=""+((dt[_194[c]]()-0)+_198[i]);
}
val=std.string.lpad(std.string.right(res,r),r,"0");
}
fmt=fmt.replace(pat,val);
}
}
return fmt;
};
std.dom.newElement=function(_1a2,_1a3,_1a4,_1a5,doc){
var ele=(doc||document).createElement(_1a2);
if(_1a4){
for(var key in _1a4){
ele[key]=_1a4[key];
}
}
if(_1a5){
for(var key in _1a5){
ele.style[key]=_1a5[key];
}
}
if(_1a3){
_1a3.appendChild(ele);
}
return ele;
};
std.dom.setStyles=function(node,_1aa){
for(var key in _1aa){
node.style[key]=_1aa[key];
}
};
std.dom.remove=function(_1ac){
_1ac=std.dom.element(_1ac);
_1ac.parentNode.removeChild(_1ac);
};
std.dom.getDimensions=function(_1ad){
_1ad=std.dom.element(_1ad);
if(_1ad==document.body){
return std.dom.getBodyExtent();
}
if(std.css.getStyle(_1ad,"display")!="none"){
return {width:_1ad.offsetWidth,height:_1ad.offsetHeight};
}
var els=_1ad.style;
var _1af=els.visibility;
var _1b0=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _1b1=_1ad.clientWidth;
var _1b2=_1ad.clientHeight;
els.display="none";
els.position=_1b0;
els.visibility=_1af;
return {width:_1b1,height:_1b2};
};
std.dom.newDiv=function(_1b3,_1b4,_1b5,doc){
return std.dom.newElement("div",_1b3,_1b4,_1b5,doc);
};
std.dom.newText=function(data,_1b8,doc){
doc=doc||document;
var node=doc.createTextNode(data);
if(_1b8){
_1b8.appendChild(node);
}
return node;
};
std.dom.newComment=function(data,_1bc,doc){
doc=doc||document;
var node=doc.createComment(data);
if(_1bc){
_1bc.appendChild(node);
}
return node;
};
std.dom.parentForm=function(_1bf){
_1bf=std.dom.element(_1bf);
while(_1bf.parentNode){
_1bf=_1bf.parentNode;
if(_1bf.tagName.toLowerCase()=="form"){
return _1bf;
}
}
return null;
};
std.dom.backtrack=function(_1c0,func){
_1c0=std.dom.element(_1c0);
while(_1c0&&func(_1c0)){
_1c0=_1c0.parentNode;
}
return _1c0;
};
std.dom.findPrev=function(_1c2,func){
_1c2=std.dom.element(_1c2);
do{
_1c2=_1c2.previousSibling;
}while(_1c2&&!func(_1c2));
return _1c2;
};
std.dom.findNext=function(_1c4,func){
_1c4=std.dom.element(_1c4);
do{
_1c4=_1c4.nextSibling;
}while(_1c4&&!func(_1c4));
return _1c4;
};
std.dom.show=function(_1c6){
_1c6=std.dom.element(_1c6);
_1c6.style.display="";
_1c6._showAtTime=new Date();
};
std.dom.hide=function(_1c7,_1c8){
var now=new Date();
_1c8=_1c8||0;
_1c7=std.dom.element(_1c7);
if(_1c8>0){
var _1ca=_1c7._showAtTime||0;
var _1cb=now-_1c7._showAtTime;
if(_1cb>=_1c8){
_1c7.style.display="none";
}else{
setTimeout(std.lang.bind(null,std.dom.hide,_1c7,0),_1c8-_1cb);
}
}else{
_1c7.style.display="none";
}
};
std.dom.toggleShowHide=function(_1cc,_1cd){
_1cc=std.dom.element(_1cc);
if(_1cc.style.display=="none"){
this.show(_1cc);
}else{
this.hide(_1cc,_1cd);
}
};
std.dom.Builder=function(_1ce,doc){
this.current=_1ce;
this.doc=doc;
};
std.dom.Builder.prototype.push=function(_1d0,_1d1,_1d2){
return this.current=this.append(_1d0,_1d1,_1d2);
};
std.dom.Builder.prototype.pushElement=function(_1d3){
return this.push(std.lang.isString(_1d3)?[_1d3]:_1d3);
};
std.dom.Builder.prototype.pop=function(){
var node=this.current;
this.current=this.current.parentNode;
return node;
};
std.dom.Builder.prototype.peek=function(){
return this.current;
};
std.dom.Builder.prototype.next=function(_1d5,_1d6,_1d7){
this.pop();
return this.push(_1d5,_1d6,_1d7);
};
std.dom.Builder.prototype.nextElement=function(_1d8){
return this.next(std.lang.isString(_1d8)?[_1d8]:_1d8);
};
std.dom.Builder.prototype.append=function(_1d9,_1da,_1db){
if(typeof (_1d9.join)=="function"){
return std.dom.newText(_1d9.join("\n"),this.current,this.doc);
}else{
if(typeof (_1d9.nodeType)=="number"){
this.current.appendChild(_1d9);
return _1d9;
}else{
if(_1d9){
return std.dom.newElement(_1d9,this.current,_1da,_1db,this.doc);
}
}
}
};
std.dom.Builder.prototype.appendElement=function(_1dc){
return this.append(std.lang.isString(_1dc)?[_1dc]:_1dc);
};
std.dom.Builder.prototype.reset=function(){
this.current=null;
};
std.dom.addOption=function(_1dd,_1de){
if(_1dd.options&&_1dd.options.add){
_1dd.options.add(_1de);
}else{
_1dd.add(_1de,null);
}
};
std.dom.clearOptions=function(_1df){
while(_1df.length){
_1df.remove(0);
}
};
std.dom.clearChildren=function(node){
if(std.browser.isIE){
var _1e1;
while(_1e1=node.lastChild){
node.removeChild(_1e1);
}
}else{
node.innerHTML="";
}
};
std.dom.appendChildren=function(node,_1e3){
if(!std.lang.isArray(_1e3)){
_1e3=[_1e3];
}
for(var i=0;i<_1e3.length;i++){
node.appendChild(_1e3[i]);
}
};
std.dom.setChildren=function(node,_1e6){
std.dom.clearChildren(node);
std.dom.appendChildren(node,_1e6);
};
std.dom.opacity=function(_1e7,op){
_1e7=std.dom.element(_1e7);
if(std.browser.isIE){
_1e7.style.filter=op==1?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+parseInt(op*100)+")";
}else{
_1e7.style.opacity=op;
}
};
std.dom.extractAttachmentPoints=function(root,_1ea){
root=std.dom.element(root);
var _1eb=_1ea?_1ea:"attachPoint";
var _1ec=root.getElementsByTagName("*");
var map={};
for(var i=_1ec.length-1;i>=0;i--){
var node=_1ec.item(i);
var attr=node.getAttribute(_1eb);
if(attr){
if(map[attr]){
if(map[attr] instanceof Array){
map[attr].push(node);
}else{
map[attr]=[map[attr],node];
}
}else{
map[attr]=node;
}
}
}
if(root.getAttribute(_1eb)){
map[root.getAttribute(_1eb)]=root;
}
return map;
};
std.dom.getEventTarget=function(e){
var e=e?e:window.event;
return e.target?e.target:e.srcElement;
};
std.dom.getTargetPos=function(_1f2){
var pos={x:0,y:0};
if(_1f2.x&&_1f2.y){
pos.x+=_1f2.x;
pos.y+=_1f2.y;
}else{
do{
pos.x+=_1f2.offsetLeft||0;
pos.y+=_1f2.offsetTop||0;
_1f2=_1f2.offsetParent;
if(_1f2&&_1f2!=document.body){
pos.x-=_1f2.scrollLeft;
pos.y-=_1f2.scrollTop;
}
}while(_1f2);
}
return pos;
};
std.dom.getBounds=function(node){
var pos=std.dom.getTargetPos(node);
var size=std.dom.getDimensions(node);
return {top:pos.y,left:pos.x,bottom:pos.y+size.height-1,right:pos.x+size.width-1,height:size.height,width:size.width};
};
std.dom.getEventPos=function(e){
return std.dom.getTargetPos(std.dom.getEventTarget(e));
};
std.dom.getOffsetMid=function(node){
return node.offsetLeft+parseInt(node.offsetWidth/2);
};
std.dom.getOffset=function(node){
return node.offsetLeft;
};
std.dom.getBodyExtent=function(){
if(std.browser.isSafariMobile){
return {width:window.innerWidth,height:window.innerHeight};
}else{
if(!std.dom._bodyExtendProbe){
std.dom._bodyExtendProbe=std.dom.newElement("div",document.body,null,{position:"absolute",top:"100%",left:"100%",visibility:"hidden"});
}
var pos=std.dom.getTargetPos(std.dom._bodyExtendProbe);
return {width:pos.x,height:pos.y};
}
};
std.dom.noselect=function(node){
node.style.MozUserSelect="none";
node.unselectable="on";
};
std.event.KeyCodes={};
std.event.KeyCodes.generic={KEY_BACKSPACE:8,KEY_TAB:9,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_INSERT:45,KEY_DELETE:46,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT:93,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145,KEY_CMD:224,KEY_IME:229};
std.event.KeyCodes.webkit418={KEY_BACKSPACE:8,KEY_TAB:9,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE:63250,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:63276,KEY_PAGE_DOWN:63277,KEY_END:63275,KEY_HOME:63273,KEY_LEFT_ARROW:63234,KEY_UP_ARROW:63232,KEY_RIGHT_ARROW:63235,KEY_DOWN_ARROW:63233,KEY_INSERT:63302,KEY_DELETE:63272,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT:93,KEY_F1:63236,KEY_F2:63237,KEY_F3:63238,KEY_F4:63239,KEY_F5:63240,KEY_F6:63241,KEY_F7:63242,KEY_F8:63243,KEY_F9:63244,KEY_F10:63245,KEY_F11:63246,KEY_F12:63247,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145};
std.event.KeyMap={AppleWebKit:{63250:19,63276:33,63277:34,63275:35,63273:36,63234:37,63232:38,63235:39,63233:40,63302:45,63272:46,63236:112,63237:113,63238:114,63239:115,63240:116,63241:117,63242:118,63243:119,63244:120,63245:121,63246:122,63247:123}};
std.event.getKeyCodes=function(e){
if(e&&e.type!="keypress"){
return std.event.KeyCodes.generic;
}
if(std.browser.isAppleWebKit&&!std.browser.isSafariWin){
return std.event.KeyCodes.webkit418;
}
return std.event.KeyCodes.generic;
};
std.event.getKeyCode=function(e){
if(std.browser.isSafariWin&&std.browser.major>=3){
var key=e.keyIdentifier.toLowerCase();
var _1ff=std.event.getKeyCodes(e);
var _200={"up":_1ff.KEY_UP_ARROW,"down":_1ff.KEY_DOWN_ARROW,"left":_1ff.KEY_LEFT_ARROW,"right":_1ff.KEY_RIGHT_ARROW,"home":_1ff.KEY_HOME,"end":_1ff.KEY_END,"pageup":_1ff.KEY_PAGE_UP,"pagedown":_1ff.KEY_PAGE_DOWN,"insert":_1ff.KEY_INSERT,"u+00007f":_1ff.KEY_DELETE,"f2":_1ff.KEY_F2};
if(_200[key]){
return _200[key];
}
}
return e.keyCode||e.which;
};
std.event.getChar=function(e){
var code=std.browser.isIE||std.browser.isOpera?e.keyCode:e.charCode;
if(std.browser.isAppleWebKit){
if(e.ctrlKey&&code<96){
code+=96;
}
}
return String.fromCharCode(code).toUpperCase();
};
std.event.getCharCode=function(e){
return std.browser.isIE?e.keyCode:std.browser.isOpera?e.which:e.charCode;
};
std.event.getOffset=function(e){
return {x:e.offsetX||e.layerX,y:e.offsetY||e.layerY};
};
std.event.listener=function(){
var _205=std.array.from(arguments);
var obj=_205.shift(),_207=_205.shift();
if(!_207||typeof (_207)!="function"){
null.assert;
}
if(_205.length==0){
return function listener(e){
return _207.call(obj,e||window.event);
};
}else{
return function listener(e){
return _207.apply(obj,[e||window.event].concat(_205));
};
}
};
std.event.element=function(_20a){
return _20a.target||_20a.srcElement;
};
std.event.toElement=function(_20b){
return _20b.relatedTarget||_20b.toElement;
};
std.event.fromElement=function(_20c){
return _20c.relatedTarget||_20c.fromElement;
};
std.event.isLeftClick=function(_20d){
return (((_20d.which)&&(_20d.which==1))||((_20d.button)&&(_20d.button==1)));
};
std.event.isCmdDown=function(_20e){
return _20e.metaKey&&std.browser.platform.isMacOS;
};
std.event.pointerX=function(_20f){
return _20f.pageX||(_20f.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
};
std.event.pointerY=function(_210){
return _210.pageY||(_210.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
};
std.event.vanish=function(_211){
std.event.stop(_211);
std.event.preventDefault(_211);
};
std.event.stop=function(_212){
_212=_212||window.event;
if(_212.stopPropagation){
_212.stopPropagation();
}else{
_212.cancelBubble=true;
}
};
std.event.dispatchMouseEvent=function(node,_214,evt){
if(node.dispatchEvent){
if(evt==null){
evt={bubbles:true,cancelable:true,view:window,detail:0,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,button:0,relatedTarget:null};
}
var e=document.createEvent("MouseEvents");
e.initMouseEvent(_214,evt.bubbles,evt.cancelable,evt.view,evt.detail,evt.screenX,evt.screenY,evt.clientX,evt.clientY,evt.ctrlKey,evt.altKey,evt.shiftKey,evt.metaKey,evt.button,evt.relatedTarget);
return node.dispatchEvent(e);
}
return true;
};
std.event.preventDefault=function(_217){
_217=_217||window.event;
if(_217.preventDefault){
_217.preventDefault();
}else{
_217.returnValue=false;
}
};
std.event.ObserverChain=function(_218,name){
this.clz=std.event.ObserverChain;
this.element=_218;
this.name=name;
this.observers=[];
this.listener=std.event.listener(this,this._observer);
std.event.observe(_218,name,this.listener,false);
};
std.event.ObserverChain._instances=[];
std.event.ObserverChain.getInstance=function(_21a,name){
var _21c=std.event.ObserverChain._instances;
for(var i=0;i<_21c.length;i++){
var _21e=_21c[i];
if(_21e.element==_21a&&_21e.name==name){
return _21e;
}
}
var _21e=new std.event.ObserverChain(_21a,name);
_21c.push(_21e);
return _21e;
};
std.event.ObserverChain.removeInstance=function(_21f){
std.event.ObserverChain._instances=std.array.without(std.event.ObserverChain._instances,_21f);
};
std.event.ObserverChain.prototype.addObserver=function(_220){
this.observers.push(_220);
};
std.event.ObserverChain.prototype.removeObserver=function(_221){
this.observers=std.array.without(this.observers,_221);
if(this.observers.length==0){
std.event.stopObserving(this.listener);
this.clz.removeInstance(this);
}
};
std.event.ObserverChain.prototype._observer=function(e){
for(var i=0;i<this.observers.length;i++){
this.observers[i](e);
}
};
std.event.chainObserve=function(_224,name,_226){
std.event.ObserverChain.getInstance(_224,name).addObserver(_226);
};
std.event.stopChainObserving=function(_227,name,_229){
std.event.ObserverChain.getInstance(_227,name).removeObserver(_229);
};
std.event.keyObserve=function(_22a,name,_22c,_22d){
return std.event.keySetObserved(true,_22a,name,_22c,_22d);
};
std.event.keyStopObserving=function(_22e,name,_230,_231){
return std.event.keySetObserved(false,_22e,name,_230,_231);
};
std.event.keySetObserved=function(_232,_233,name,_235,_236){
var _237=null;
var _238;
if((_238=this._keyListenerTable[name])==null){
_238=this._keyListenerTable[name]=[];
}
if(_232){
_237=std.event._keyListener(_235,name);
_238.push({observer:_235,keyObserver:_237});
}else{
for(var i=0;i<_238.length;++i){
if(_238[i]&&_238[i].observer===_235){
_237=_238[i].keyObserver;
_238[i]=null;
break;
}
}
if(_237==null){
return;
}
}
switch(name){
case "keydown":
case "keyup":
std.event.nativeSetObserved(_232,_233,name,_237,_236);
break;
case "keypress":
if(std.browser.isIE){
std.event.nativeSetObserved(_232,_233,"keydown",_237,_236);
}else{
if(std.browser.isAppleWebKit){
if(std.browser.major<=525&&std.browser.platform.IsMacOS){
std.event.nativeSetObserved(_232,_233,"keypress",_237,_236);
std.event.nativeSetObserved(_232,_233,"keydown",_237,_236);
}else{
std.event.nativeSetObserved(_232,_233,"keydown",_237,_236);
}
}else{
std.event.nativeSetObserved(_232,_233,"keypress",_237,_236);
}
}
break;
case "keyinput":
if(std.browser.isAppleWebKit&&std.browser.platform.isMacOS){
if(std.browser.major==522){
std.event.nativeSetObserved(_232,_233,"keydown",_237,_236);
}
std.event.nativeSetObserved(_232,_233,"keypress",_237,_236);
}else{
if(std.browser.isAppleWebKit){
std.event.nativeSetObserved(_232,_233,"keypress",_237,_236);
}else{
std.event.nativeSetObserved(_232,_233,"keypress",_237,_236);
}
}
break;
default:
throw "Unsupported event: "+name;
}
};
std.event._keyListenerTable={};
std.event._keyListener=function(_23a,name){
return function(e){
var ke={keyIdentifier:null,evt:e||window.event};
switch(name){
case "keydown":
case "keyup":
if(std.browser.isFF){
if(ke.evt.keyCode==59){
ke.keyIdentifier=186;
}else{
ke.keyIdentifier=ke.evt.keyCode;
}
}else{
if(std.browser.isOpera){
if(ke.evt.keyCode==44){
ke.keyIdentifier=188;
}else{
if(ke.evt.keyCode==47){
ke.keyIdentifier=191;
}else{
if(ke.evt.keyCode==59){
ke.keyIdentifier=186;
}else{
if(ke.evt.keyCode==96){
ke.keyIdentifier=192;
}else{
ke.keyIdentifier=ke.evt.keyCode;
}
}
}
}
}else{
ke.keyIdentifier=ke.evt.keyCode;
}
}
break;
case "keypress":
if(std.browser.isFF){
if(ke.evt.keyCode){
ke.keyIdentifier=ke.evt.keyCode;
}else{
if(ke.evt.charCode==59){
ke.keyIdentifier=186;
}else{
if(ke.evt.charCode==32||(ke.evt.charCode>=65&&ke.evt.charCode<=90)||(ke.evt.charCode>=48&&ke.evt.charCode<=57)){
ke.keyIdentifier=ke.evt.charCode;
}else{
if(ke.evt.charCode>=97&&ke.evt.charCode<=122){
ke.keyIdentifier=ke.evt.charCode-32;
}else{
ke.keyIdentifier=0;
}
}
}
}
}else{
if(std.browser.isAppleWebKit){
if(ke.evt.type=="keydown"){
ke.keyIdentifier=ke.evt.keyCode;
}else{
if(ke.evt.charCode==32||(ke.evt.charCode>=65&&ke.evt.charCode<=90)||(ke.evt.charCode>=48&&ke.evt.charCode<=57)){
ke.keyIdentifier=ke.evt.charCode;
}else{
if(ke.evt.charCode>=97&&ke.evt.charCode<=122){
ke.keyIdentifier=ke.evt.charCode-32;
}else{
ke.keyIdentifier=std.event.KeyMap.AppleWebKit[ke.evt.charCode]||0;
}
}
}
}else{
if(std.browser.isOpera){
if(!ke.evt.which){
ke.keyIdentifier=ke.evt.keyCode;
}else{
if(ke.evt.keyCode==59){
ke.keyIdentifier=186;
}else{
if(ke.evt.keyCode==32||(ke.evt.keyCode>=65&&ke.evt.keyCode<=90)||(ke.evt.keyCode>=48&&ke.evt.keyCode<=57)){
ke.keyIdentifier=ke.evt.keyCode;
}else{
if(ke.evt.keyCode>=97&&ke.evt.keyCode<=122){
ke.keyIdentifier=ke.evt.keyCode-32;
}else{
ke.keyIdentifier=ke.evt.keyCode;
}
}
}
}
}else{
ke.keyIdentifier=ke.evt.keyCode;
}
}
}
break;
case "keyinput":
if(std.browser.isIE){
ke.keyIdentifier=ke.evt.keyCode;
}else{
if(std.browser.isOpera){
ke.keyIdentifier=ke.evt.keyCode==ke.evt.which?ke.evt.keyCode:0;
}else{
ke.keyIdentifier=ke.evt.charCode;
}
}
break;
default:
throw "Illegal event: "+name;
}
return _23a(ke);
};
};
std.event.onContextMenu=function(_23e,_23f,_240){
var _241=std.event.listener(null,function(e){
var _243=std.dom.getEventTarget(e);
if(_243.tagName.match(/^a$/i)||(_243.tagName.match(/input/i)&&_243.type.match(/button/i))){
return;
}
if(e.button==0&&e.ctrlKey){
_23f(e);
}
});
std.event.observe(_23e,"mousedown",_241,_240);
std.event.observe(_23e,"contextmenu",_23f,_240);
};
std.event.getEventTarget=function(_244){
return _244.target||_244.srcElement;
};
std.event.afterLoaded=function(func){
std.event.observe(window,"load",func,false);
};
std.external={};
std.external.addFavorite=function(url,_247){
if(window.sidebar&&window.sidebar.addPanel){
try{
window.sidebar.addPanel(_247,url,"");
}
catch(e){
}
}else{
if(window.external){
window.external.AddFavorite(url,_247);
}else{
alert("To add bookmark, please press "+(std.browser.isMacOS?"Cmd+D":"Ctrl+D"));
}
}
};
std.form={};
std.form.submit=function(form){
if(typeof form.onsubmit=="function"){
if(form.onsubmit()){
form.submit();
}
}else{
form.submit();
}
};
std.form.serialize=function(form){
var _24a=std.form.getElements(std.dom.element(form));
var _24b=new Array();
for(var i=0;i<_24a.length;i++){
var _24d=std.form.element.serialize(_24a[i]);
if(_24d){
_24b.push(_24d);
}
}
return _24b.join("&");
};
std.form.getElements=function(form){
form=std.dom.element(form);
var _24f=new Array();
for(tagName in std.form.element.serializer){
var _250=form.getElementsByTagName(tagName);
for(var j=0;j<_250.length;j++){
_24f.push(_250[j]);
}
}
return _24f;
};
std.form.getInputs=function(form,_253,name){
form=std.dom.element(form);
var _255=form.getElementsByTagName("input");
if(!_253&&!name){
return _255;
}
var _256=new Array();
for(var i=0;i<_255.length;i++){
var _258=_255[i];
if((_253&&_258.type!=_253)||(name&&_258.name!=name)){
continue;
}
_256.push(_258);
}
return _256;
};
std.form.calculateChecked=function(form,name){
var _25b=std.form.getInputs(form,"checkbox",name);
var c=0;
for(var i=0;i<_25b.length;i++){
if(_25b[i].checked){
c++;
}
}
return c;
};
std.form.checkboxSync=function(_25e,name){
std.list.iterate(std.form.getInputs(_25e.form,"checkbox",name),function(_260){
_260.checked=_25e.checked;
});
};
std.form.value=function(form,name){
return std.form.values(form,name)[0];
};
std.form.values=function(form,name){
var _265=std.list.grep(form.elements,function(ele){
return (ele.name==name)&&!ele.disabled&&((ele.type!="radio"&&ele.type!="checkbox")||ele.checked);
});
return std.list.map(_265,function(ele){
return std.form.element.getValue(ele);
});
};
std.form.disable=function(form){
var _269=std.form.getElements(form);
for(var i=0;i<_269.length;i++){
var _26b=_269[i];
_26b.blur();
_26b.disabled="true";
}
};
std.form.enable=function(form){
var _26d=std.form.getElements(form);
for(var i=0;i<_26d.length;i++){
var _26f=_26d[i];
_26f.disabled="";
}
};
std.form.findFirstElement=function(node){
var _271=node.tagName.toLowerCase()=="form"?[node]:node.getElementsByTagName("form");
for(var i=0;i<_271.length;i++){
var _273=std.form.getElements(_271[i]);
for(var j=0;j<_273.length;j++){
var _275=_273[j].tagName.toLowerCase();
if(_273[j].type!="hidden"&&!_273[j].disabled&&("input"==_275||"select"==_275||"textarea"==_275)){
return _273[j];
}
}
}
return null;
};
std.form.isIntrinsicControl=function(node){
return "|BUTTON|INPUT|TEXTAREA|SELECT|OPTION|A|".indexOf(node.tagName)!=-1;
};
std.form.focusFirstElement=function(node){
var _278=std.form.findFirstElement(node);
if(_278){
_278.focus();
if(_278.select){
_278.select();
}
return true;
}else{
return false;
}
};
std.form.focusDocumentFirstElement=function(){
var _279=document.forms;
for(var i=0;i<_279.length;i++){
if(std.form.focusFirstElement(_279[i])){
break;
}
}
};
std.form.reset=function(form){
std.dom.element(form).reset();
};
std.form.element={};
std.form.element.serialize=function(_27c){
_27c=std.dom.element(_27c);
var _27d=_27c.tagName.toLowerCase();
var _27e=std.form.element.serializer[_27d](_27c);
if(_27e){
var key=encodeURIComponent(_27e[0]);
if(key.length==0){
return;
}
if(_27e[1].constructor!=Array){
_27e[1]=[_27e[1]];
}
return std.list.map(_27e[1],function(_280){
return key+"="+encodeURIComponent(_280);
}).join("&");
}
};
std.form.element.getValue=function(_281){
_281=std.dom.element(_281);
var _282=_281.tagName.toLowerCase();
var _283=std.form.element.serializer[_282](_281);
if(_283){
return _283[1];
}
};
std.form.element.serializer={};
std.form.element.serializer.input=function(_284){
switch(_284.type.toLowerCase()){
case "submit":
case "hidden":
case "password":
case "text":
return std.form.element.serializer.textarea(_284);
case "checkbox":
case "radio":
return std.form.element.serializer.inputSelector(_284);
}
return false;
};
std.form.element.serializer.inputSelector=function(_285){
if(_285.checked){
return [_285.name,_285.value];
}
};
std.form.element.serializer.textarea=function(_286){
return [_286.name,_286.value];
};
std.form.element.serializer.select=function(_287){
return std.form.element.serializer[_287.type=="select-one"?"selectOne":"selectMany"](_287);
};
std.form.element.serializer.selectOne=function(_288){
var _289="",opt,_28b=_288.selectedIndex;
if(_28b>=0){
opt=_288.options[_28b];
_289=opt.value;
if(!_289&&!("value" in opt)){
_289=opt.text;
}
}
return [_288.name,_289];
};
std.form.element.serializer.selectMany=function(_28c){
var _28d=new Array();
for(var i=0;i<_28c.length;i++){
var opt=_28c.options[i];
if(opt.selected){
var _290=opt.value;
if(!_290&&!("value" in opt)){
_290=opt.text;
}
_28d.push(_290);
}
}
return [_28c.name,_28d];
};
std.form._ifEmptyDisableHandler=function(_291,_292){
for(var i=0;i<_292.length;++i){
(function(){
_292[i].disabled=_291.value=="";
})();
}
};
std.form.ifEmptyDisable=function(_294,_295){
std.event.observe(_294,"keyup",function(){
setTimeout(function(){
std.form._ifEmptyDisableHandler(_294,_295);
},1);
});
std.form._ifEmptyDisableHandler(_294,_295);
};
std.functor={};
std.functor.not=function(func){
return function(){
return !func();
};
};
std.functor.and=function(){
var _297=std.array.from(arguments);
return function(){
for(var i=0;i<_297.length;i++){
if(!_297[i]()){
return false;
}
}
return true;
};
};
std.functor.or=function(){
var _299=std.array.from(arguments);
return function(){
for(var i=0;i<_299.length;i++){
if(_299[i]()){
return true;
}
}
return false;
};
};
std.host={};
std.host.bookmark=function(_29b,url){
if(window.sidebar){
window.sidebar.addPanel(_29b,url,"");
}else{
if(window.external){
window.external.AddFavorite(url,_29b);
}else{
if(window.opera&&window.print){
return true;
}
}
}
};
std.host.open=function(url,_29e){
if(_29e){
if(typeof (_29e)=="string"){
var w=window.open(url,_29e);
w.focus();
}else{
window.open(url);
}
}else{
window.location.href=url;
}
};
std.host.reload=function(){
window.location.href=window.location.href;
};
std.json={};
std.json.arrayToJSONString=function(self){
var a=["["],b=0,i,l=self.length;
for(i=0;i<l;i+=1){
var s=std.json.toJSONString(self[i]);
if(b++){
a.push(",");
}
a.push(s);
}
a.push("]");
return a.join("");
};
std.json.booleanToJSONString=function(self){
return String(self);
};
std.json.dateToJSONString=function(self){
return std.date.format(self,"\"yyyy-MM-ddThh:mm:ss\"");
};
std.json.numberToJSONString=function(self){
return isFinite(self)?String(self):"null";
};
std.json.toJSONString=function(self){
switch(typeof self){
case "object":
if(self){
if(typeof self.toJSONString==="function"){
return (self.toJSONString());
}
var clz=self.constructor;
if(clz==Array){
return std.json.arrayToJSONString(self);
}else{
if(clz==Date){
return std.json.dateToJSONString(self);
}else{
if(clz==Object){
return std.json.mapToJSONString(self);
}
}
}
}else{
return "null";
}
case "string":
return std.json.stringToJSONString(self);
case "number":
return std.json.numberToJSONString(self);
case "boolean":
return std.json.booleanToJSONString(self);
}
};
std.json.mapToJSONString=function(self){
var a=["{"],b=0,k;
for(k in self){
if(self.hasOwnProperty(k)){
var s=std.json.toJSONString(self[k]);
if(b++){
a.push(",");
}
a.push(std.json.toJSONString(k),":",s);
}
}
a.push("}");
return a.join("");
};
std.json.parse=function(str){
var res={json:null,error:null,isSuccess:true,isError:false};
try{
res.json=eval("("+str+")");
}
catch(e){
res.error=e;
res.isSuccess=true;
res.isError=true;
}
return res;
};
std.json.parseJSON=function(self,_2b3){
try{
if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(self)){
var j=eval("("+self+")");
if(typeof _2b3==="function"){
std.log.warn("std.json.parseJSON(): filter not supported");
}
return j;
}
}
catch(e){
}
throw new SyntaxError("parseJSON");
};
std.json.stringToJSONString=function(self){
if(/["\\\x00-\x1f]/.test(self)){
return "\""+self.replace(/([\x00-\x1f\\"])/g,std.json._replaceFunc)+"\"";
}
return "\""+self+"\"";
};
std.json._replaceFunc=function(a,b){
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"};
var c=m[b];
if(c){
return c;
}
c=b.charCodeAt();
return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
};
std.math={};
std.math.compareQuad=function(a1,a2,b1,b2){
var res={};
if(a1[0]==b1[0]&&a1[1]==b1[1]&&a2[0]==b2[0]&&a2[1]==b2[1]){
res.enclose=0;
res.overlap=2;
}else{
if(a2[0]<b1[0]||a1[0]>b2[0]||a2[1]<b1[1]||a1[1]>b2[1]){
res.enclose=0;
res.overlap=0;
}else{
if(a1[0]<=b1[0]&&a1[1]<=b1[1]&&a2[0]>=b2[0]&&a2[1]>=b2[1]){
res.enclose=1;
res.overlap=1;
}else{
if(a1[0]>=b1[0]&&a1[1]>=b1[1]&&a2[0]<=b2[0]&&a2[1]<=b2[1]){
res.enclose=-1;
res.overlap=1;
}else{
res.enclose=0;
res.overlap=1;
}
}
}
}
return res;
};
std.math.calcPointAlign=function(x,y,w,h,W,H){
var _2c5={"bottom":0,"top":0,"right":0,"left":0};
var _2c6=H-(y+h);
var _2c7=y-h;
var _2c8=W-(x+w);
var _2c9=x-w;
_2c5[(_2c6<0&&_2c7>_2c6)?"bottom":"top"]=1;
_2c5[(_2c8<0&&_2c9>_2c8)?"right":"left"]=1;
return _2c5;
};
std.math.calcPointPlacement=function(x,y,w,h,W,H){
var _2d0=std.math.calcPointAlign(x,y,w,h,W,H);
return {align:_2d0,x:x-_2d0.right*w,y:y-_2d0.bottom*h};
};
std.math.calcBoxAlign=function(bx,by,bw,bh,w,h,W,H,_2d9){
var hori=_2d9?1:0;
var vert=_2d9?0:1;
var _2dc={"bottom":0,"top":0,"right":0,"left":0};
var _2dd=H-(by+(bh*hori)+h);
var _2de=by+(bh*vert)-h;
var _2df=W-(bx+(bw*vert)+w);
var _2e0=bx+(bw*hori)-w;
_2dc[(_2dd<0&&_2de>_2dd)?"bottom":"top"]=1;
_2dc[(_2df<0&&_2e0>_2df)?"right":"left"]=1;
return _2dc;
};
std.math.calcBoxPlacement=function(bx,by,bw,bh,w,h,W,H,_2e9){
var _2ea=std.math.calcBoxAlign(bx,by,bw,bh,w,h,W,H,_2e9);
if(_2e9){
return {align:_2ea,x:bx+_2ea.right*(bw-w),y:by+_2ea.top*bh-_2ea.bottom*h};
}else{
return {align:_2ea,x:bx+_2ea.left*bw-_2ea.right*w,y:by+_2ea.bottom*(bh-h)};
}
};
std.topic={};
std.topic.define=function(obj,name){
obj[name]={src:obj,subscribers:[]};
};
std.topic.subscribe=function(obj,name,func){
obj[name].subscribers.push(func);
};
std.topic.unsubscribe=function(obj,name,func){
obj[name].subscribers=std.array.without(obj[name].subscribers,func);
};
std.topic.hasSubscribers=function(obj,name){
return obj[name].subscribers.length>0;
};
std.topic.publish=function(obj,name){
var subs=obj[name].subscribers;
if(arguments.length<=2){
for(var i=0;i<subs.length;i++){
subs[i].call(this.src);
}
}else{
if(arguments.length<=3){
for(var i=0;i<subs.length;i++){
subs[i].call(this.src,arguments[2]);
}
}else{
var args=[];
for(var i=2;i<arguments.length;i++){
args[i-2]=arguments[i];
}
for(var i=0;i<subs.length;i++){
subs[i].apply(this.src,args);
}
}
}
};
std.mocker={instances:new Array(),regExpNodes:{},extractNodeContent:function(_2fa,html){
var re,res;
if(!(re=std.mocker.regExpNodes[_2fa])){
std.mocker.regExpNodes[_2fa]=re=new RegExp("<"+_2fa+"[^>]*>","im");
}
res=re.exec(html);
return res?html.substring(res.index+res[0].length,html.indexOf("</"+_2fa+">")):"";
},release:function(){
for(var k in std.mocker.instances){
std.mocker.instances[k].release();
}
}};
std.mocker.mock=function(_2ff,url,_301,_302,_303,_304){
var _305=new std.mocker.MockInstance(_2ff,url,_303,_304);
std.topic.subscribe(_305,"onLoad",_302);
if(_301){
window.setTimeout(std.lang.bind(_305,_305.load),0);
}
return _305;
};
std.mocker.MockInstance=function(_306,_307,_308,_309){
this.target=std.dom.element(_306);
this.initUrl=_307;
this.instanceId=std.mocker.instances.length;
this.transportFactory=_308;
this.extraUrlParams=_309||{};
std.mocker.instances.push(this);
std.topic.define(this,"onLoad");
std.topic.define(this,"onRefresh");
};
std.mocker.MockInstance.prototype.load=function(){
this.loaded=false;
var ajax=new std.ajax.Request(this._constructUrl(this.initUrl),{transportFactory:this.transportFactory,method:"get",asynchronous:true,onSuccess:std.lang.bind(this,this._transfer)});
};
std.mocker.MockInstance.prototype._constructUrl=function(url){
for(var key in this.extraUrlParams){
url+=(url.indexOf("?")==-1?"?":"&")+encodeURIComponent(key)+"="+encodeURIComponent(this.extraUrlParams[key]);
}
return url;
};
std.mocker.MockInstance.prototype._handleSubmit=function(form){
var ajax=new std.ajax.Request(this._constructUrl(form.action),{transportFactory:this.transportFactory,method:"post",asynchronous:true,postBody:std.form.serialize(form),onSuccess:std.lang.bind(this,this._transfer)});
};
std.mocker.MockInstance.prototype._handleLink=function(link){
this.reload(link.href);
};
std.mocker.MockInstance.prototype.reload=function(url){
var ajax=new std.ajax.Request(this._constructUrl(url),{transportFactory:this.transportFactory,method:"get",asynchronous:true,onSuccess:std.lang.bind(this,this._transfer)});
};
std.mocker.MockInstance.prototype._transfer=function(req){
var self=this;
var html=req.responseText;
var _315=std.mocker.extractNodeContent("body",html);
this.target.innerHTML=std.string.stripScripts(_315);
std.list.iterate(this.target.getElementsByTagName("a"),function(link,idx){
if(link.getAttribute("preserve")){
return;
}
if(!link.href.indexOf("javascript:")){
return;
}
var _318=link.onclick;
link.onclick=function(e){
try{
if(_318){
_318.call(link,e);
}
self._handleLink(link);
}
catch(ex){
alert("Exception executing Mocker link: "+ex);
}
return false;
};
});
std.list.iterate(this.target.getElementsByTagName("form"),function(form,idx){
if(form.getAttribute("preserve")){
return;
}
if(!form.action.indexOf("javascript:")){
return;
}
var _31c=form.onsubmit;
form.onsubmit=function(e){
try{
var ret;
if(_31c){
ret=_31c.call(form,e);
}
if(typeof (ret)=="undefined"||ret){
self._handleSubmit(form);
}
}
catch(ex){
alert("Exception executing Mocker submit: "+ex);
}
return false;
};
});
try{
eval(std.mocker.extractNodeContent("script",_315));
}
catch(e){
std.log.warn(e);
}
if(!this.loaded){
this.loaded=true;
std.topic.publish(this,"onLoad");
}else{
std.topic.publish(this,"onRefresh");
}
};
std.mocker.MockInstance.prototype.release=function(req){
std.list.iterate(this.target.getElementsByTagName("a"),function(link,idx){
link.onclick=null;
link.innerHTML="";
});
std.list.iterate(this.target.getElementsByTagName("form"),function(form,idx){
form.onsubmit=null;
form.innerHTML="";
});
this.target.innerHTML="";
this.target=null;
};
std.perf={};
std.perf.base=new Date();
std.perf.data={};
std.perf.mark=function(_324,_325){
if(_325||typeof (this.data[_324])=="undefined"){
this.data[_324]=new Date()-std.perf.base;
}
};
std.perf.list=function(){
var _326=[];
var last=0;
for(var _328 in this.data){
var time=this.data[_328];
_326.push(_328+": "+(time-last)+" @"+time+"ms");
last=time;
}
return _326;
};
std.perf.csv=function(){
var _32a=[];
var _32b=[];
var last=0;
for(var _32d in this.data){
var time=this.data[_32d];
_32a.push(_32d);
_32b.push(time-last);
last=time;
}
_32a.push(_32b);
return _32a.join(",");
};
std.queue={};
std.queue.AsyncQueue=function(){
};
std.queue.AsyncQueue.prototype.init=function(_32f,prop){
this._callback=_32f;
this._prop=prop||{};
this._timeout=this._prop.timeout||0;
this._queue=[];
this._lock=false;
return this;
};
std.queue.AsyncQueue.prototype.enqueue=function(obj){
this._queue.push(obj);
var self=this;
if(!this._lock){
this._lock=true;
setTimeout(function(){
self._dequeue();
},this._timeout);
}
};
std.queue.AsyncQueue.prototype._dequeue=function(){
while(this._queue.length>0){
this._callback(this._queue.shift());
}
this._lock=false;
};
std.queue.BatchAsyncQueue=function(){
};
std.queue.BatchAsyncQueue.prototype=new std.queue.AsyncQueue();
std.queue.BatchAsyncQueue.prototype._dequeue=function(){
var objs=[];
while(this._queue.length>0){
objs.push(this._queue.shift());
}
this._callback(objs);
this._lock=false;
};
std.global=this;
std.range={};
std.range.moveCaretEnd=function(_334){
if(_334.setSelectionRange){
_334.focus();
_334.setSelectionRange(_334.value.length,_334.value.length);
}else{
if(_334.createTextRange){
var _335=_334.createTextRange();
_335["mo"+"ve"]("textedit",1);
_335.select();
}else{
throw "No suitable range impl";
}
}
};
std.range.moveCaretBegin=function(_336){
if(_336.setSelectionRange){
_336.focus();
_336.setSelectionRange(0,0);
}else{
if(_336.createTextRange){
var _337=_336.createTextRange();
_337["mo"+"ve"]("textedit",-1);
_337.select();
}else{
throw "No suitable range impl";
}
}
};
std.range.getInputSelection=function(_338){
var ret={start:0,end:0,size:0};
if(_338.selectionStart||_338.selectionStart=="0"){
ret.start=_338.selectionStart;
ret.end=_338.selectionEnd;
ret.size=ret.end-ret.start;
}else{
if(document.selection){
var sel=document.selection.createRange();
var full=sel.duplicate();
if(_338.tagName=="INPUT"){
full=_338.createTextRange();
}else{
full.moveToElementText(_338);
}
for(ret.size=0;sel.compareEndPoints("EndToStart",sel)==1;++ret.size){
sel.moveEnd("character",-1);
}
for(ret.start=0;sel.compareEndPoints("StartToStart",full)==1;++ret.start){
sel.moveStart("character",-1);
}
ret.end=ret.start+ret.size;
}else{
throw "No suitable range impl";
}
}
return ret;
};
std.range.insertAtCursor=function(_33c,str){
if(document.selection){
var sel=document.selection.createRange();
sel.text=str;
if(std.browser.isOpera&&std.browser.platform.isWin){
_33c.selectionStart+=str.replace("\n","\r\n").length;
}else{
sel.select();
}
}else{
if(_33c.selectionStart||_33c.selectionStart=="0"){
var _33f=_33c.selectionStart;
_33c.value=_33c.value.substring(0,_33f)+str+_33c.value.substring(_33c.selectionEnd,_33c.value.length);
_33c.selectionStart=_33f+=str.length;
_33c.selectionEnd=_33f;
}else{
_33c.value+=str;
}
}
};
std.global=this;
std.storage={};
std.storage.CookieStorage=function(_340){
this.expireDays=_340;
};
std.storage.CookieStorage.prototype.setItem=function(key,val){
std.cookies.set(key,val,this.expireDays);
};
std.storage.CookieStorage.prototype.getItem=function(key){
return std.cookies.get(key);
};
std.storage.CookieStorage.prototype.removeItem=function(key){
std.cookies.remove(key);
};
std.storage.cookieGlobalStorage=new std.storage.CookieStorage(365*25);
std.storage.global={};
std.storage.global.getStorage=function(_345){
try{
var key=_345||location.hostname;
return key.indexOf(".")!=-1?window.globalStorage[key]:std.storage.cookieGlobalStorage;
}
catch(e){
return std.storage.cookieGlobalStorage;
}
};
std.tunnel={};
std.tunnel.newTunnel=function(prop){
if(window.postMessage){
return new std.tunnel.PostMessageTunnel().init(prop);
}else{
if(std.browser.isIE){
return new std.tunnel.IEIFrameTunnel().init(prop);
}else{
return new std.tunnel.IFrameTunnel().init(prop);
}
}
};
std.tunnel.AbstractTunnel=function(){
};
std.tunnel.AbstractTunnel.prototype.DONE="d";
std.tunnel.AbstractTunnel.prototype.CALL="c";
std.tunnel.AbstractTunnel.prototype.RETURN="r";
std.tunnel.AbstractTunnel.prototype.SHUTDOWN="s";
std.tunnel.AbstractTunnel.prototype.DEFAULT_RATE_LIMIT=500;
std.tunnel.AbstractTunnel.prototype.init=function(prop){
this._done=false;
this._inited=false;
this._shutdown=false;
this._funcs={};
this._callbacks={};
this._errHandlers={};
this._pendingCalls=[];
this._rates={};
var self=this;
this._queue=new std.queue.BatchAsyncQueue().init(function(objs){
self._send(objs);
});
this._lastReceiveCid=-1;
this._lastCallCid=0;
this._debug=prop.debug;
this._rateLimit=prop.rateLimit||this.DEFAULT_RATE_LIMIT;
this.doInit(prop);
return this;
};
std.tunnel.AbstractTunnel.prototype.shutdown=function(_34b){
if(this._debug){
this.log("SHUTDO","Shutdown");
}
if(this._onShutdown){
this._onShutdown();
}
if(!this._remote){
this._send([this.SHUTDOWN]);
}
this._shutdown=true;
this._inited=false;
this._funcs=null;
this._callbacks=null;
this._errHandlers=null;
this._calls=null;
this._queue=null;
};
std.tunnel.AbstractTunnel.prototype.setConsole=function(_34c){
std.log.setConsole(_34c);
};
std.tunnel.AbstractTunnel.prototype.setOnShutdown=function(f){
this._onShutdown=f;
};
std.tunnel.AbstractTunnel.prototype.log=function(func,msg){
if(this._debug){
var msg="["+location.host+"] "+func+" - "+msg;
std.log.debug(msg);
}
};
std.tunnel.AbstractTunnel.prototype.register=function(fid,func){
if(this._debug){
this.log("REGIST",fid);
}
this._funcs[fid]=func;
};
std.tunnel.AbstractTunnel.prototype._send=function(msg){
};
std.tunnel.AbstractTunnel.prototype.send=function(cmd,msg){
if(this._debug){
this.log("SEND  ","["+cmd+"] "+msg);
}
this._queue.enqueue(cmd+msg);
};
std.tunnel.AbstractTunnel.prototype._receive=function(msgs){
if(this._debug){
this.log("Q-RECE",msgs);
}
var msgs=msgs.split("|");
for(var i=0;i<msgs.length;i++){
var msg=msgs[i];
this.receive(msg.charAt(0),msg.substring(1));
}
};
std.tunnel.AbstractTunnel.prototype.receive=function(cmd,msg){
if(this._shutdown){
return;
}
switch(cmd){
case this.DONE:
this.receiveDone(msg);
break;
case this.CALL:
this.receiveCall(msg);
break;
case this.RETURN:
this.receiveReturn(msg);
break;
case this.SHUTDOWN:
this.shutdown(true);
break;
default:
throw new Error("Unknown command ["+cmd+"]");
}
};
std.tunnel.AbstractTunnel.prototype.call=function(fid,args,_35c,_35d){
if(this._shutdown){
return;
}
if(!this._inited){
this._appendPendingCall(fid,args,_35c,_35d);
return;
}
var cid=this._lastCallCid++;
if(this._debug){
this.log("CALL  ",fid+"("+args+") - "+cid);
}
if(_35c){
this._callbacks[cid]=_35c;
}
if(_35d){
this._errHandlers[cid]=_35d;
}
var msg=encodeURIComponent(fid)+"&";
msg+=encodeURIComponent(args)+"&";
msg+=encodeURIComponent(cid);
this.send(this.CALL,msg);
};
std.tunnel.AbstractTunnel.prototype.receiveCall=function(s){
var s=s.split("&");
var fid=decodeURIComponent(s[0]);
var args=decodeURIComponent(s[1]);
var cid=parseInt(decodeURIComponent(s[2]));
if(this._debug){
this.log("R-CALL",fid+"("+args+") - "+cid);
}
this._enqueue(fid,args,cid);
};
std.tunnel.AbstractTunnel.prototype.returz=function(cid,ret,err){
if(!this._inited){
return;
}
if(this._debug){
this.log("RETURN",cid+"("+ret+", "+err+")");
}
var msg=encodeURIComponent(cid)+"&";
msg+=(ret===undefined?"@":(ret===null?"$":encodeURIComponent(ret)))+"&";
msg+=(err===undefined?"@":(err===null?"$":encodeURIComponent(err)));
this.send(this.RETURN,msg);
};
std.tunnel.AbstractTunnel.prototype.receiveReturn=function(s){
var s=s.split("&");
var cid=decodeURIComponent(s[0]);
var ret=s[1]=="@"?undefined:(s[1]=="$"?null:decodeURIComponent(s[1]));
var err=s[2]=="@"?undefined:(s[2]=="$"?null:decodeURIComponent(s[2]));
if(this._debug){
this.log("R-RETU",cid+"("+ret+", "+err+")");
}
var _36c=this._callbacks[cid];
var _36d=this._errHandlers[cid];
if(_36c){
delete this._callbacks[cid];
}
if(_36d){
delete this._errHandlers[cid];
}
if(err){
if(_36d){
try{
_36d(err);
}
catch(e){
setTimeout(function(){
throw e;
},0);
}
}else{
setTimeout(function(){
throw new Error(err);
},0);
}
}else{
if(_36c){
try{
_36c(ret);
}
catch(e){
setTimeout(function(){
throw e;
},0);
}
}
}
};
std.tunnel.AbstractTunnel.prototype.done=function(){
if(this._shutdown){
return;
}
if(this._debug){
this.log("DONE  ","Initialization done");
}
this._done=true;
this.send(this.DONE,"");
};
std.tunnel.AbstractTunnel.prototype.receiveDone=function(msg){
if(this._shutdown){
return;
}
if(this._debug){
this.log("R-DONE","Initialization done");
}
if(!this._inited){
this._inited=true;
if(this._done){
this.send(this.DONE,"");
}
this._firePendingCalls();
}
};
std.tunnel.AbstractTunnel.prototype._appendPendingCall=function(fid,args,_371,_372){
this._pendingCalls.push({fid:fid,args:args,callback:_371,errHandler:_372});
};
std.tunnel.AbstractTunnel.prototype._firePendingCalls=function(){
for(var i=0;i<this._pendingCalls.length;i++){
var call=this._pendingCalls[i];
this.call(call.fid,call.args,call.callback,call.errHandler);
}
this._pendingCalls=null;
};
std.tunnel.AbstractTunnel.prototype._enqueue=function(fid,args,cid){
this._queue[cid]={fid:fid,args:args,cid:cid};
if(cid==this._lastReceiveCid+1){
this._dequeue(cid);
}
};
std.tunnel.AbstractTunnel.prototype._dequeue=function(cid){
var call;
while((call=this._queue[cid])){
if(this._recordRate()){
return;
}
var ret,err;
var fid=call.fid;
var args=call.args;
delete this._queue[cid];
var func=this._funcs[fid];
if(!func){
err="Cannot find function: "+fid;
}else{
if(args!=""){
args=args.split(",");
for(var i=0;i<args.length;i++){
args[i]=decodeURIComponent(args[i]);
}
}
ret=func(args);
if(ret.error){
err=ret.error.message?ret.error.message:ret.error;
}
}
if(this._debug){
this.log("DEQUEU",fid+" - "+cid+"("+(ret?ret.result:"null")+", "+err+")");
}
try{
top.frames[location.host].tunnel.returz(cid,ret?ret.result:undefined,err);
}
catch(e){
top.frames["gridContainer"].frames[location.host].tunnel.returz(cid,ret?ret.result:undefined,err);
}
this._lastReceiveCid=cid;
cid=cid+1;
}
};
std.tunnel.AbstractTunnel.prototype._recordRate=function(){
var time=parseInt(new Date().getTime()/100);
if(!this._rates[time]){
this._rates[time]=1;
}else{
this._rates[time]++;
}
return this._checkRate(time);
};
std.tunnel.AbstractTunnel.prototype._checkRate=function(time){
var rate=0;
for(var i in this._rates){
if(i<time-600){
delete this._rates[i];
}else{
rate+=this._rates[i];
}
}
if(rate>this._rateLimit){
this.shutdown();
return true;
}
return false;
};
std.tunnel.IFrameTunnel=function(){
};
std.tunnel.IFrameTunnel.prototype=new std.tunnel.AbstractTunnel();
std.tunnel.IFrameTunnel.prototype.doInit=function(prop){
this._courierUrl=prop.remoteBase+"tunnel/courier";
if(prop.remoteDomain){
this._courierUrl+="?d="+prop.remoteDomain;
}
var self=this;
window.receive=function(s){
self._receive(s);
};
};
std.tunnel.IFrameTunnel.prototype._send=function(msgs){
var url=this._courierUrl+"#"+msgs.join("|");
this._createIFrame(url);
};
std.tunnel.IFrameTunnel.prototype._createIFrame=function(url){
if(this._debug){
this.log("I-SEND",url);
}
var _38a=document.createElement("iframe");
if(!std.browser.isIE){
document.body.appendChild(_38a);
}
function __onload(){
setTimeout(function(){
document.body.removeChild(_38a);
},0);
}
if(_38a.attachEvent){
_38a.attachEvent("onload",__onload);
}else{
if(_38a.addEventListener){
_38a.addEventListener("load",__onload,false);
}
}
_38a.src=url;
if(std.browser.isIE){
document.body.appendChild(_38a);
}
};
std.tunnel.IEIFrameTunnel=function(){
this._id=0;
this._buffers={};
};
std.tunnel.IEIFrameTunnel.prototype=new std.tunnel.IFrameTunnel();
std.tunnel.IEIFrameTunnel.prototype.MAX_LENGTH=3800;
std.tunnel.IEIFrameTunnel.prototype._send=function(msgs){
var msg=msgs.join("|");
var p=Math.ceil(msg.length/this.MAX_LENGTH);
var id=this._id++;
for(var i=0;i<p;i++){
var hash=id+"|"+i+"|"+p+"|"+msg.substring(i*this.MAX_LENGTH,(i+1)*this.MAX_LENGTH);
var url=this._courierUrl+"#"+hash;
this._createIFrame(url);
}
};
std.tunnel.IEIFrameTunnel.prototype._receive=function(msgs){
if(this._debug){
this.log("IE-REC",msgs);
}
msgs=msgs.split("|");
var id=msgs.shift();
var pos=msgs.shift();
var max=msgs.shift();
msgs=msgs.join("|");
if(max==1){
this._superReceive(msgs);
}else{
if(this._fillBuffer(id,pos,max,msgs)){
var m=this._flushBuffer(id);
this._superReceive(m);
}
}
};
std.tunnel.IEIFrameTunnel.prototype._superReceive=function(msgs){
std.tunnel.IFrameTunnel.prototype._receive.call(this,msgs);
};
std.tunnel.IEIFrameTunnel.prototype._getBuffer=function(id,max){
var _39a=this._buffers[id];
if(!_39a){
_39a=this._buffers[id]={buffer:[],count:0,max:max};
}
return _39a;
};
std.tunnel.IEIFrameTunnel.prototype._fillBuffer=function(id,pos,max,msgs){
var _39f=this._getBuffer(id,max);
_39f.buffer[pos]=msgs;
_39f.count++;
return _39f.count==_39f.max;
};
std.tunnel.IEIFrameTunnel.prototype._flushBuffer=function(id){
var _3a1=this._getBuffer(id);
if(_3a1.count!=_3a1.max){
throw new Error("Buffer is not ready for flush");
}
var ret=_3a1.buffer.join("");
delete this._buffers[id];
return ret;
};
std.tunnel.PostMessageTunnel=function(){
};
std.tunnel.PostMessageTunnel.prototype=new std.tunnel.AbstractTunnel();
std.tunnel.PostMessageTunnel.prototype.doInit=function(prop){
this._host=prop.remoteHost;
var self=this;
function _onMessage(e){
var msgs=e.data;
self._receive(msgs);
}
if(window.addEventListener){
window.addEventListener("message",_onMessage,false);
document.addEventListener("message",_onMessage,false);
}else{
if(window.attachEvent){
window.attachEvent("onmessage",_onMessage);
document.attachEvent("onmessage",_onMessage);
}
}
};
std.tunnel.PostMessageTunnel.prototype._send=function(msgs){
try{
try{
top.frames[this._host].postMessage(msgs.join("|"),"*");
}
catch(e){
top.frames["gridContainer"].frames[this._host].postMessage(msgs.join("|"),"*");
}
}
catch(e){
if(this._debug){
this.log("ERROR ",e.message);
}
}
};
std.updater={};
std.updater._beginUpdate=function(_3a8){
_3a8.src._std_updater_updating=true;
if(_3a8.busyElementId){
std.dom.element(_3a8.busyElementId).style.display="";
}
if(_3a8.busyDisableForm){
std.form.disable(_3a8.src);
}
if(_3a8.preUpdate&&_3a8.preUpdate!=""){
setTimeout(function(){
eval(_3a8.preUpdate);
},0);
}
};
std.updater._endUpdate=function(_3a9){
_3a9.src._std_updater_updating=null;
if(_3a9.busyElementId){
std.dom.element(_3a9.busyElementId).style.display="none";
}
if(_3a9.busyDisableForm){
std.form.enable(_3a9.src);
}
if(_3a9.postUpdate&&_3a9.postUpdate!=""){
setTimeout(function(){
eval(_3a9.postUpdate);
},0);
}
};
std.updater._responseHandler=function(resp,_3ab){
if(_3ab.updateElementId){
var div=document.createElement("div");
div.innerHTML=resp.responseText;
var _3ad=div.getElementsByTagName("*");
for(var i=0;i<_3ad.length;i++){
var id=_3ad[i].getAttribute("id");
if(id&&id==_3ab.updateElementId){
var dest=document.getElementById(_3ab.updateElementId);
if(dest){
dest.innerHTML=_3ad[i].innerHTML;
}
break;
}
}
}
};
std.updater.handleForm=function(form){
if(form._std_updater_updating){
return;
}
var url=form.action;
var _3b3=std.form.serialize(form);
var _3b4=form.getAttribute("busyDisableForm");
var _3b5={src:form,updateElementId:form.getAttribute("updateElement"),busyElementId:form.getAttribute("busyElement"),busyDisableForm:_3b4?"true"==_3b4.toLowerCase():false,preUpdate:form.getAttribute("preUpdate"),postUpdate:form.getAttribute("postUpdate")};
std.updater._beginUpdate(_3b5);
var req=new std.ajax.Request(url,{method:"post",parameters:_3b3,onComplete:function(resp){
std.updater._endUpdate(_3b5);
std.updater._responseHandler(resp,_3b5);
},onFailure:function(resp){
alert("ERROR "+resp.status+" -- "+resp.statusText);
}});
};
std.updater.handleLink=function(link){
if(link._std_updater_updating){
return;
}
var url=link.href;
var _3bb={src:link,updateElementId:link.getAttribute("updateElement"),busyElementId:link.getAttribute("busyElement"),preUpdate:link.getAttribute("preUpdate"),postUpdate:link.getAttribute("postUpdate")};
std.updater._beginUpdate(_3bb);
var req=new std.ajax.Request(url,{method:"get",onComplete:function(resp){
std.updater._endUpdate(_3bb);
std.updater._responseHandler(resp,_3bb);
},onFailure:function(resp){
alert("ERROR "+resp.status+" -- "+resp.statusText);
}});
};
std.viewport={};
std.viewport._resizeListeners=[];
std.viewport._resizeSeq=0;
std.viewport._resizeTimeout=40;
std.viewport.addResizeListener=function(_3bf){
if(!std.viewport._initialized){
std.event.observe(window,"resize",std.viewport._onResizeEvent);
std.event.observe(window,"load",std.viewport._onResizeEvent);
std.viewport._initialized=true;
if(std.browser.isSafariMobile){
setInterval(function(){
if(std.viewport._innerWidth==window.innerWidth&&std.viewport._innerHeight==window.innerHeight){
return;
}
std.viewport._onResizeEvent();
},300);
}
}
std.viewport._resizeListeners.push(_3bf);
};
std.viewport._lastWidth=0;
std.viewport._lastHeight=0;
std.viewport.fireResize=function(){
var clz=std.viewport;
var dim=std.dom.getBodyExtent();
for(var i=0;i<std.viewport._resizeListeners.length;i++){
std.viewport._resizeListeners[i](dim.width,dim.height,dim.width-clz._lastWidth,dim.height-clz._lastHeight);
}
clz._lastWidth=dim.width;
clz._lastHeight=dim.height;
};
std.viewport._onResizeEvent=function(){
std.viewport._innerWidth=window.innerWidth;
std.viewport._innerHeight=window.innerHeight;
std.viewport._resizeSeq++;
if(std.viewport._resizeListeners.length){
var seq=std.viewport._resizeSeq;
setTimeout(function(){
if(seq==std.viewport._resizeSeq){
std.viewport.fireResize();
}
},std.viewport._resizeTimeout);
}
};
std.viewport.enclose=function(x1,y1,x2,y2){
if(typeof (x1)!="number"){
var _3c8=std.dom.getBounds(std.dom.element(x1));
x1=_3c8.left;
y1=_3c8.top;
x2=_3c8.right;
y2=_3c8.bottom;
}
var dim=std.dom.getBodyExtent();
return std.math.compareQuad([0,0],[dim.width,dim.height],[x1,y1],[x2,y2]).enclose==1;
};
std.global=this;
var ui={};
ui.hintbox={};
ui.hintbox.HintBox=function(_3ca){
_3ca=_3ca||{};
this.content=_3ca.content||null;
this.style=_3ca.style||{};
this.anchor=_3ca.anchor||null;
this.offsetX=_3ca.offsetX||0;
this.offsetY=_3ca.offsetY||0;
this.align=_3ca.align||"bottom right";
this.snap=_3ca.snap||"top left";
this.fader=new std.ani.Interpolator();
this.fader.setOnEvent(std.lang.bind(this,this._onFaderEvent));
};
ui.hintbox.HintBox.prototype.getRootNode=function(){
this._realize();
return this.elements.root;
};
ui.hintbox.HintBox.prototype.setAnchorPosition=function(_3cb){
this._realize();
_3cb=std.string.parsePosition(_3cb);
this.elements.upAnchor.style.visibility=_3cb.top?"visible":"hidden";
this.elements.downAnchor.style.visibility=_3cb.top?"hidden":"visible";
this.elements.upAnchor.style.left=this.elements.downAnchor.style.left=_3cb.left?"0":"";
this.elements.upAnchor.style.right=this.elements.downAnchor.style.right=_3cb.left?"":"0";
};
ui.hintbox.HintBox.prototype.show=function(){
this._realize();
this._updatePosition();
this.fader.reset(1);
};
ui.hintbox.HintBox.prototype.fade=function(){
this._realize();
this.fader.start(1,0,350,25);
};
ui.hintbox.HintBox.prototype._updatePosition=function(){
if(this.anchor){
var root=this.elements.root;
var _3cd=this.elements.hintboxPane;
var _3ce=this.elements.coverframe;
var _3cf=std.string.parsePosition(this.align);
var snap=std.string.parsePosition(this.snap);
var _3d1=root.style.display;
root.style.display="";
this.setAnchorPosition(std.string.printPosition({top:_3cf.bottom,bottom:_3cf.top,left:_3cf.right,right:_3cf.left}));
var _3d2=std.dom.getDimensions(root);
var _3d3=std.dom.getDimensions(this.elements.upAnchor);
var _3d4=Math.round(_3d3.width/2);
var _3d5=std.dom.getDimensions(this.elements.outerbox);
var _3d6=std.dom.getDimensions(this.elements.hintboxPane);
root.style.display=_3d1;
var pos={};
if(this.anchor.length==2&&typeof (this.anchor[0])=="number"){
pos.top=pos.bottom=this.anchor;
}else{
var _3d8=std.dom.getBounds(this.anchor);
var x=Math.round((_3d8.left+_3d8.right)/2);
pos.top=[x,_3d8.top];
pos.bottom=[x,_3d8.bottom];
}
var _3da=[];
if(_3cf.right){
_3da[0]=this.offsetX+pos.top[0]-_3d4;
}else{
_3da[0]=this.offsetX+pos.top[0]-_3d2.width+_3d4;
}
if(_3cf.bottom){
_3da[1]=this.offsetY+pos.bottom[1];
}else{
_3da[1]=this.offsetY+pos.top[1]-_3d2.height;
}
var _3db=std.dom.getBodyExtent();
if(snap.right){
root.style.left="";
root.style.right=_3db.width-_3da[0]-_3d2.width+"px";
}else{
root.style.left=_3da[0]+"px";
root.style.right="";
}
if(snap.bottom){
root.style.top="";
root.style.bottom=_3db.height-_3da[1]-_3d2.height+"px";
if(_3ce){
_3ce.style.bottom=root.style.bottom;
}
}else{
root.style.top=_3da[1]+"px";
root.style.bottom="";
if(_3ce){
_3ce.style.top=(_3d6.height-_3d5.height)/2+"px";
}
}
if(_3ce){
_3ce.style.left=this.elements.outerbox.style.left;
_3ce.style.right=this.elements.outerbox.style.right;
_3ce.height=_3d5.height+"px";
_3ce.width=_3d5.width+"px";
}
}
};
ui.hintbox.HintBox.prototype._onFaderEvent=function(_3dc){
std.dom.opacity(this.elements.root,_3dc.getCurPoint());
this.elements.root.style.display=_3dc.getCurPoint()<=0?"none":"";
if(this.elements.coverframe){
this.elements.coverframe.style.display=_3dc.getCurPoint()<=0?"none":"";
}
};
ui.hintbox.HintBox.prototype._onRelayout=function(){
if(this.elements.root.style.display!="none"){
this._updatePosition();
}
};
ui.hintbox.HintBox.prototype._realize=function(){
if(!this.elements){
this.elements={};
var _3dd=new std.dom.Builder();
this.elements.root=_3dd.push("div",{className:"HintBoxRoot"},{display:"none"});
if(std.browser.isIE&&std.browser.major<7){
this.elements.coverframe=_3dd.append("iframe",{frameBorder:0,scrolling:"no",src:"javascript:'';",id:"HintBoxUnderCoverFrame"});
}
this.elements.hintboxPane=_3dd.push("div",{className:"HintBox"});
_3dd.push("div",{className:"HintBoxUp"});
this.elements.upAnchor=_3dd.push("div",{className:"HintBoxAnchor"});
_3dd.push("div");
_3dd.peek().appendChild(document["create"+"Comment"](" "));
_3dd.pop();
_3dd.pop();
_3dd.pop();
this.elements.outerbox=_3dd.push("div",{className:"HintBoxBorderOuter"});
_3dd.push("div",{className:"HintBoxBorderInner"});
this.elements.content=_3dd.append("div",{className:"HintBoxContent"});
_3dd.pop();
_3dd.pop();
_3dd.push("div",{className:"HintBoxDown"});
this.elements.downAnchor=_3dd.push("div",{className:"HintBoxAnchor"});
_3dd.push("div");
_3dd.peek().appendChild(document["create"+"Comment"](" "));
_3dd.pop();
_3dd.pop();
_3dd.pop();
if(this.content){
this.elements.content.appendChild(this.content);
}
std.css.setStyle(this.elements.hintboxPane,this.style);
document.body.appendChild(this.elements.root);
std.viewport.addResizeListener(std.lang.bind(this,this._onRelayout));
}
};
ui.notif={};
ui.notif.Notif=function(_3de,name){
this.baseUri=_3de.replace(/\/?$/,"/");
this.name=name;
};
ui.notif.Notif.prototype.accept=function(){
std.ajax.ping(this.baseUri+"notif/accept/"+this.name);
};
ui.notif.Notif.prototype.ifShallShow=function(_3e0){
new std.ajax.Request(this.baseUri+"notif/shallshow/"+this.name,{method:"post",asynchronous:true,onComplete:std.lang.bind(this,this._onShallShowComplete,_3e0)});
};
ui.notif.Notif.prototype._onShallShowComplete=function(_3e1,resp){
if(resp.responseText=="1"){
_3e1();
}
};
var mesgLoaded=false;
var privateMessageBoxOpened=false;
std.event.observe(window,"load",function(){
if(window.unreadHighMesg!=undefined&&unreadHighMesg>0){
displayPrivateMessageBox();
}
});
function showNextPrivateMessage(){
if(curMesg<maxMesg){
curMesg++;
updatePrivateMessageBox();
}
}
function showPrevPrivateMessage(){
if(curMesg>1){
curMesg--;
updatePrivateMessageBox();
}
}
function updatePrivateMessageBox(){
for(var i=1;i<=maxMesg;i++){
document.getElementById("PrivateMessage_N"+i).style.display=(i==curMesg)?"block":"none";
}
if(curMesg>1){
document.getElementById("PrevPrivateMesg").className="PrivateMessageButton";
}else{
document.getElementById("PrevPrivateMesg").className="PrivateMessageButtonDisabled";
}
if(curMesg<maxMesg){
document.getElementById("NextPrivateMesg").className="PrivateMessageButton";
}else{
document.getElementById("NextPrivateMesg").className="PrivateMessageButtonDisabled";
}
document.getElementById("TotalMesgCount").innerHTML=maxMesg;
document.getElementById("CurMesgNum").innerHTML=curMesg;
var _3e4=document.getElementById("PrivateMessage_N"+curMesg);
if(_3e4.getAttribute("priority")>1){
document.getElementById("PrivateMessageBoxCriticalHead").style.display="block";
}else{
if(!_3e4.setRead){
setMessageRead(_3e4.getAttribute("private_mesg_id"));
unreadMesg--;
_3e4.setRead=true;
}
document.getElementById("PrivateMessageBoxCriticalHead").style.display="none";
}
}
var privateMessageBox;
function displayPrivateMessageBox(){
var _3e5=document.getElementById("PrivateMessageIndicator");
if(!privateMessageBox){
privateMessageBox=new ui.hintbox.HintBox({content:std.dom.element("PrivateMessageBox"),anchor:_3e5,align:"bottom left",snap:"top left",offsetX:-230,offsetY:0,style:{padding:"0px",width:"220px"}});
}
var _3e6=document.getElementById("PrivateMessageBox");
var _3e7=document.getElementById("PrivateMessageIndicator");
if(_3e6){
privateMessageBoxOpened=true;
_3e6.style.display="block";
if(!mesgLoaded){
ajax=new std.ajax.Updater("PrivateMessageContent",base_uri+"privatemesg/private_mesg_box",{evalScripts:true});
mesgLoaded=true;
}
}
var p=std.lang.bind(privateMessageBox,privateMessageBox.show);
p();
}
function closePrivateMessageBox(){
privateMessageBox.fade();
var _3e9=document.getElementById("PrivateMessageBox");
var _3ea=document.getElementById("PrivateMessageIndicator");
var _3eb=document.getElementById("PrivateMessageIndicatorCount");
if(_3e9){
privateMessageBoxOpened=false;
if(curMesg>0){
for(var i=1;i<=maxMesg;i++){
var _3ed=document.getElementById("PrivateMessage_N"+i);
if(_3ed.getAttribute("priority")>1&&!_3ed.setRead){
setMessageRead(_3ed.getAttribute("private_mesg_id"));
unreadMesg--;
_3ed.setRead=true;
}
}
}
if(_3eb){
if(unreadMesg){
_3eb.innerHTML=unreadMesg;
}else{
var link=document.getElementById("PrivateMessageIndicatorLink");
link.innerHTML=loc("No New Message");
link.style.color="black";
}
}
}
if(unreadMesg==0){
document.getElementById("PrivateMessageIndicator").style.display="none";
}
}
function setMessageRead(_3ef){
ajax=new std.ajax.Request(base_uri+"privatemesg/set_private_mesg_read?private_mesg_id="+_3ef);
}
var userModeSwitchingBox;
function displayModeSwitchingBox(){
var _3f0=document.getElementById("UserModeIndicator");
if(!userModeSwitchingBox){
userModeSwitchingBox=new ui.hintbox.HintBox({content:std.dom.element("UserModeSwitchingBox"),anchor:_3f0,align:"bottom right",snap:"top left",offsetX:0,offsetY:0,style:{padding:"0px",width:"480px"}});
}
var p=std.lang.bind(userModeSwitchingBox,userModeSwitchingBox.show);
p();
}
function closeModeSwitchingBox(){
userModeSwitchingBox.fade();
}
var editgrid=editgrid||{};
editgrid.auth={};
editgrid.auth.AuthForm=function(form,base,_3f4,_3f5){
this._form=form;
this._base=base;
this._onError=_3f4;
this._onLoading=_3f5;
std.event.observe(form,"submit",std.event.listener(this,function(e){
this._onSubmit();
std.event.preventDefault(e);
return false;
}));
};
editgrid.auth.AuthForm.prototype.setUsernameGetter=function(_3f7){
this._usernameGetter=_3f7;
};
editgrid.auth.AuthForm.prototype.submit=function(){
this._onSubmit();
};
editgrid.auth.AuthForm.prototype._onSubmit=function(){
var _3f8=this._usernameGetter?this._usernameGetter(this._form):this._form.elements["username"].value;
var _3f9=this._form.elements["password"].value;
var _3fa=this._form.elements["remember"].checked?"1":"";
var _3fb=this._form.elements["return"].value;
var _3fc=this._form.elements["direct"].value;
new std.ajax.Request(this._base+"login/ajax_check",{parameters:"username="+encodeURIComponent(_3f8)+"&password="+encodeURIComponent(_3f9)+"&remember="+encodeURIComponent(_3fa)+"&return="+encodeURIComponent(_3fb)+"&direct="+encodeURIComponent(_3fc),method:"post",asynchronous:true,onSuccess:std.lang.bind(this,function(_3fd,json){
var _3ff=eval(_3fd.responseText);
if(_3ff.success){
location.href=_3ff.redirect;
return;
}else{
if(this._onError){
this._onError(_3ff.error);
this._form.elements["password"].focus();
}
}
}),onFailure:std.lang.bind(this,function(){
})});
this._onLoading(loc("processing..."));
};
dojo.provide("jstalyst.component.ApplicationState");
dojo.declare("jstalyst.component.ApplicationState",null,{dataFields:[],application:null,constructor:function(_400,_401,app){
if(_400==null){
_400={};
}
this.application=app;
this.stateData={};
this.changeUrl=false;
this.callback=_401||null;
this._buildGetters();
this._initStateData(_400);
this._setUrl();
},getStateId:function(){
return this.changeUrl;
},_buildGetters:function(){
var _403=this;
dojo.forEach(this.dataFields,function(_404){
var _405=_404.name.charAt(0).toUpperCase()+_404.name.substring(1);
_403["get"+_405]=function(){
return _403.stateData[_404.name];
};
});
},_initStateData:function(_406){
var _407=this;
dojo.forEach(this.dataFields,function(_408){
_407.stateData[_408.name]=_406[_408.name];
});
},_setUrl:function(){
var _409="";
var _40a=this;
dojo.forEach(this.dataFields,function(_40b,i){
var data=_40a.stateData[_40b.name];
if(typeof (_40b.serializer)=="function"){
var _40e=std.lang.bind(_40a,_40b.serializer);
data=_40e(data);
}
var hide=false;
if(typeof (_40b.hideInUrl)=="function"){
var _410=std.lang.bind(_40a,_40b.hideInUrl);
hide=_410(data);
}
if(!hide){
_409+=data;
}
if(i<_40a.dataFields.length){
_409+="/";
}
});
_409=_409.replace(/\/+$/,"");
if(_409){
this.changeUrl=_409;
}
},cloneStateData:function(){
var _411={};
var _412=this;
dojo.forEach(this.dataFields,function(_413){
var _414=_413.name.charAt(0).toUpperCase()+_413.name.substring(1);
_411[_413.name]=_412["get"+_414]();
});
return _411;
},clearUrl:function(){
this.changeUrl=false;
},back:function(){
if(this.callback){
this.callback(this,"back");
}
},forward:function(){
if(this.callback){
this.callback(this,"forward");
}
},mapStateDataFromUrl:function(){
var _415="";
var _416=window.location.href.split("#");
if(_416.length>1){
_415=unescape(_416[_416.length-1]);
}
if(_415){
var _417=_415.split("/");
var _418=this;
dojo.forEach(_417,function(data,i){
var _41b=_418.dataFields[i];
_418.stateData[_41b.name]=data;
if(typeof (_41b.deserializer)=="function"){
var _41c=std.lang.bind(_418,_41b.deserializer);
_418.stateData[_41b.name]=_41c(data);
}
});
}
return this.stateData;
}});
dojo.provide("jstalyst.component.Model");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.declare("jstalyst.component.Model",null,{name:"unnamed",enableLogging:true,store:null,modelTopics:[{topic:"ModelLoadStart",type:"asap"},{topic:"ModelLoadComplete",type:"final"},{topic:"ModelLoadError",type:"asap"},{topic:"ModelItemsUpdate",type:"final"},{topic:"ModelItemInsert",type:"final"},{topic:"ModelItemsDelete",type:"final"}],_objectTopics:{},_currentFetchParams:null,constructor:function(_41d,name){
this.classType=_41d;
this.name=name;
if(this.enableLogging){
this._logger=new jstalyst.component.Logger({namespace:"Model("+this.name+")"});
}
},destroy:function(){
for(var id in this._objectTopics){
var _420=this._objectTopics[id];
dojo.forEach(_420,function(_421){
dojo.unsubscribe(_421);
});
}
this.inherited(arguments);
},addSubscriber:function(id,obj){
if(!id||!obj){
return;
}
if(typeof (obj.dispatchModelTopic)=="function"){
if(this._objectTopics[id]!=null){
dojo.forEach(this._objectTopics[id],function(h){
dojo.unsubscribe(h);
});
}
this._objectTopics[id]=new Array();
for(var i=0;i<this.modelTopics.length;i++){
var _426=this.modelTopics[i].topic;
var h=dojo.subscribe(_426,obj,obj.dispatchModelTopic);
this._objectTopics[id].push(h);
}
}
},_getTopicType:function(_428){
var _429=dojo.filter(this.modelTopics,function(t){
return t.topic==_428;
})[0];
return _429.type;
},onLoadStart:function(_42b){
if(this._logger){
this._logger.write("ModelLoadStart: "+_42b);
}
dojo.publish("ModelLoadStart",["ModelLoadStart",this._getTopicType("ModelLoadStart"),this.name]);
},onLoadComplete:function(_42c,_42d){
var _42e={query:_42d.query,sort:_42d.sort,queryOptions:_42d.queryOptions,pageOffset:_42d.pageOffset,pageSize:_42d.pageSize};
if(this._logger){
this._logger.write("ModelLoadComplete: "+dojo.toJson(_42e));
}
_42e=std.hash.merge(_42e,_42d);
if(parseInt(_42d.pageOffset)==_42d.pageOffset&&parseInt(_42d.pageSize)==_42d.pageSize){
_42e.start=_42e.pageOffset;
_42e.count=_42e.pageSize;
_42e.total=_42c.length;
if(_42e.start>=_42e.total){
_42e.start=Math.ceil(_42e.total/_42e.count-1)*_42e.count;
}
var _42f=_42e.start?_42e.start:0;
var _430=_42e.count?(_42f+_42e.count):_42c.length;
_42c=_42c.slice(_42f,_430);
}
var _431=this.bindItems(_42c);
dojo.publish("ModelLoadComplete",["ModelLoadComplete",this._getTopicType("ModelLoadComplete"),this.name,_431,_42e]);
},onLoadError:function(_432,_433){
if(this._logger){
var _434={query:_433.query,sort:_433.sort,queryOptions:_433.queryOptions,pageOffset:_433.pageOffset,pageSize:_433.pageSize};
this._logger.write("ModelLoadError: "+dojo.toJson(_434));
}
dojo.publish("ModelLoadError",["ModelLoadError",this._getTopicType("ModelLoadError"),this.name,_432,_433]);
},onItemsUpdate:function(_435,_436){
if(this._logger){
this._logger.write("ModelItemsUpdate: "+dojo.toJson(_435));
}
var _437=this.bindItems(_436);
dojo.publish("ModelItemsUpdate",["ModelItemsUpdate",this._getTopicType("ModelItemsUpdate"),this.name,_437,_435]);
},onItemInsert:function(item){
if(this._logger){
this._logger.write("ModelItemInsert");
}
var _439=this.bindItems([item]);
dojo.publish("ModelItemInsert",["ModelItemInsert",this._getTopicType("ModelItemInsert"),this.name,_439[0]]);
},onItemsDelete:function(_43a,_43b){
if(this._logger){
this._logger.write("ModelItemsDelete"+dojo.toJson(_43a));
}
dojo.publish("ModelItemsDelete",["ModelItemsDelete",this._getTopicType("ModelItemsDelete"),this.name,_43b,_43a]);
},load:function(_43c){
this.loadFromRemote(_43c);
},loadFromRemote:function(_43d){
if(_43d==null){
_43d={};
}
if(this.store){
this.store.close();
}
this.store=new this.classType({url:_43d.url});
this._currentFetchParams={query:{type:this.name},sort:_43d.sort,onComplete:this.onLoadComplete,onError:this.onLoadError,scope:this,_url:_43d.url,pageOffset:_43d.pageOffset||0,pageSize:_43d.pageSize||0};
if(_43d.query){
this._currentFetchParams.query=std.hash.merge(this._currentFetchParams.query,_43d.query);
}
if(_43d.queryOptions){
this._currentFetchParams.queryOptions=this._currentFetchParams.queryOptions||{};
this._currentFetchParams.queryOptions=std.hash.merge(this._currentFetchParams.queryOptions,_43d.queryOptions);
}
this.onLoadStart("load");
this.store.fetch(this._currentFetchParams);
},loadFromLocal:function(_43e){
if(_43e==null){
_43e={};
}
if(!this.store||(this._currentFetchParams&&this._currentFetchParams._url!=_43e.url)){
return this.loadFromRemote(_43e);
}
this._currentFetchParams={query:{type:this.name},sort:_43e.sort,onComplete:this.onLoadComplete,onError:this.onLoadError,scope:this,_url:_43e.url,pageOffset:_43e.pageOffset||0,pageSize:_43e.pageSize||0};
if(_43e.query){
this._currentFetchParams.query=std.hash.merge(this._currentFetchParams.query,_43e.query);
}
if(_43e.queryOptions){
this._currentFetchParams.queryOptions=this._currentFetchParams.queryOptions||{};
this._currentFetchParams.queryOptions=std.hash.merge(this._currentFetchParams.queryOptions,_43e.queryOptions);
}
this.onLoadStart("load-local");
this.store.fetch(this._currentFetchParams);
},sort:function(_43f,_440){
if(!this._currentFetchParams||!_43f){
return;
}
if(_440==null){
_440={};
}
this._currentFetchParams.sort=_43f;
if(_440.mixinFetchParams){
this._currentFetchParams=std.hash.merge(this._currentFetchParams,_440.mixinFetchParams);
}
this.onLoadStart("sort");
this.store.fetch(this._currentFetchParams);
},filter:function(_441,_442){
if(!this._currentFetchParams){
return;
}
if(_441==null){
_441={};
}
if(_442==null){
_442={};
}
this._currentFetchParams.query=std.hash.merge(this._currentFetchParams.query,_441);
if(_442.reset){
this._currentFetchParams.query={type:this.name};
}
if(_442.mixinFetchParams){
this._currentFetchParams=std.hash.merge(this._currentFetchParams,_442.mixinFetchParams);
}
this.onLoadStart("filter");
this.store.fetch(this._currentFetchParams);
},query:function(_443,_444,_445){
if(!_443){
return;
}
var _446=this;
var _447=function(_448,_449){
var _44a=_448;
if(!_445){
_44a=_446.bindItems(_448);
}
_444(_44a);
};
this.store.fetch({query:_443,onComplete:_447});
},countIf:function(_44b,_44c){
if(!_44b){
return;
}
var _44d=this;
var _44e=function(_44f,_450){
_44c(_44f.length);
};
this.store.fetch({query:_44b,onComplete:_44e});
},updateOn:function(_451,_452,_453){
var _454=this;
var _455=function(_456){
dojo.forEach(_456,function(item){
if(_454.store.isItem(item)){
_454._updateItem(item,_452,_453);
}
});
if(_454.store.isDirty()){
_454.store.save();
_454.onItemsUpdate(_451,_456);
}
};
this.query(_451,_455,true);
},_updateItem:function(item,_459,_45a){
if(_45a==null){
_45a={};
}
for(var key in _459){
var _45c=this.store.getIdentityAttributes(item);
var _45d=dojo.some(_45c,function(k){
return k==key;
});
if(_45d){
continue;
}
if(this._containReference(_459[key])){
if(!_45a.resolveReference){
continue;
}
_459[key]=this._resolveReference(_459[key]);
}
this.store.setValue(item,key,_459[key]);
}
},insert:function(_45f,_460){
if(_460==null){
_460={};
}
var _461=this;
var _462=false;
var func=function(item){
if(_461.store.isItem(item)){
_462=true;
if(_460.updateIfExists){
_461._updateItem(item,_45f,_460);
}
}
};
var _465=this.store.getFeatures()["dojo.data.api.Identity"];
this.store.fetchItemByIdentity({identity:_45f[_465],onItem:func});
if(!_462){
if(_460.resolveReference){
for(var key in _45f){
if(this._containReference(_45f[key])){
_45f[key]=this._resolveReference(_45f[key]);
}
}
}
var item=this.store.newItem(_45f);
}
if(this.store.isDirty()){
this.store.save();
this.onItemInsert(item);
}
},deleteOn:function(_468,_469){
var _46a=this;
var _46b=function(_46c){
var _46d=_46a.bindItems(_46c);
dojo.forEach(_46c,function(item){
if(_46a.store.isItem(item)){
_46a.store.deleteItem(item);
}
});
if(_46a.store.isDirty()){
_46a.store.save();
_46a.onItemsDelete(_468,_46d);
}
};
this.query(_468,_46b,true);
},_containReference:function(obj){
if(obj&&typeof (obj)=="object"){
if(obj._reference){
return true;
}
if(std.lang.isArray(obj)){
var _470=this;
return dojo.some(obj,function(o){
return _470._containReference(o);
});
}
for(var k in obj){
if(this._containReference(obj[k])){
return true;
}
}
}
return false;
},_resolveReference:function(obj){
if(typeof (obj)=="object"){
if(obj._reference){
if(this.store._itemsByIdentity){
obj=this.store._itemsByIdentity[obj._reference];
}
return obj;
}
if(std.lang.isArray(obj)){
var _474=this;
return dojo.map(obj,function(o){
return _474._resolveReference(o);
});
}
for(var k in obj){
obj[k]=this._resolveReference(obj[k]);
}
}
return obj;
},bindItems:function(_477){
var _478=[];
var _479=this.store;
for(var i=0;i<_477.length;i++){
var _47b={};
this._items2Params(_477[i],_47b);
_47b._identityAttr=_479.getIdentityAttributes(_477[i])[0];
_47b[_47b._identityAttr]=_479.getIdentity(_477[i]);
_478.push(_47b);
}
return _478;
},_items2Params:function(item,_47d){
if(!item){
return;
}
var _47e=this;
var _47f=this.store;
var _480=_47f.getAttributes(item);
dojo.forEach(_480,function(_481){
var _482=_47f.getValues(item,_481);
if(_482.length==0){
_47d[_481]=[];
}
for(var i=0;i<_482.length;i++){
var _484=_482[i];
var _485=(_482.length==1);
if(_47f.isItem(_484)){
if(_47f.isItemLoaded(_484)){
var _486=_484;
if(_485){
_47d[_481]={};
_47e._items2Params(_486,_47d[_481]);
}else{
if(_47d[_481]==null||i==0){
_47d[_481]=[];
}
_47d[_481].push({});
_47e._items2Params(_486,_47d[_481][(_47d[_481].length-1)]);
}
}
}else{
if(_485){
_47d[_481]=_484;
}else{
_47d[_481]=[];
_47d[_481].push(_484);
}
}
}
});
}});
jstalyst.component.model={};
jstalyst.component.model.createReadWriteModel=function(name){
if(!name){
return null;
}
return new jstalyst.component.Model(dojo.data.ItemFileWriteStore,name);
};
dojo.provide("jstalyst.component.Widget");
dojo.declare("jstalyst.component.Widget",null,{myApplication:null,myWidgetId:null,requestProfile:null,stash:null,ready4Update:true,deferredTopics:[],_forceReady:false,setApplication:function(app,myId){
this.myApplication=app;
this.myWidgetId=myId;
if(this._forceReady){
this.iAmReady();
}
},iAmReady:function(){
this._forceReady=true;
if(this.myApplication&&this.myWidgetId){
this.myApplication.setWidgetReady(this.myWidgetId);
}
},dispatchApplicationTopic:function(_48a,_48b,_48c,_48d){
this.requestProfile=_48c;
this.stash=_48d;
this["_W_"+_48b+"TopicType"](_48a,_48b);
this.requestProfile=null;
this.stash=null;
},dispatchModelTopic:function(){
var args=std.array.from(arguments);
var _48f=args[0];
var _490=args[1];
var _491=this["_W_"+_490+"TopicType"];
_491.apply(this,args);
},_dispatchActualTopicHandler:function(args){
var _493=args[0];
var _494=this["on"+_493];
if(typeof (_494)=="function"){
_494.apply(this,args.slice(2));
}
},_W_resetTopicType:function(){
this.ready4Update=false;
this.deferredTopics=new Array();
this._dispatchActualTopicHandler(std.array.from(arguments));
},_W_normalTopicType:function(){
this._dispatchActualTopicHandler(std.array.from(arguments));
this.ready4Update=true;
if(this.deferredTopics){
var _495=this;
dojo.forEach(this.deferredTopics,function(_496){
_495._dispatchActualTopicHandler(_496);
});
}
},_W_asapTopicType:function(){
this._dispatchActualTopicHandler(std.array.from(arguments));
},_W_finalTopicType:function(){
if(this.ready4Update){
this._dispatchActualTopicHandler(std.array.from(arguments));
}else{
this.deferredTopics.push(std.array.from(arguments));
}
}});
dojo.provide("jstalyst.component.Dialog");
dojo.require("dijit.Dialog");
var _jstalyst_dialog_onload_elem2focus=null;
dojo.declare("jstalyst.component.Dialog",dijit.Dialog,{myApplication:null,myDialogId:null,_myForms:{},title:"",href:"",duration:200,constructor:function(_497){
if(_497==null){
_497={};
}
this.myApplication=_497.application;
this.myDialogId=_497.id;
},getDialogNodes:function(id){
if(id){
return dojo.query("[dialogAttachPoint=\""+id+"\"]",this.domNode);
}else{
return dojo.query("[dialogAttachPoint]",this.domNode);
}
},registerWidgets:function(){
var _499=this;
var _49a=this.getDescendants();
dojo.forEach(_49a,function(_49b){
_49b.myDialog=_499;
_499[_49b.id]=_49b;
});
},registerAttachPoints:function(_49c){
if(_49c==null){
_49c={};
}
var _49d=this;
var _49e=this.getDialogNodes();
if(_49c.resetFirst){
dojo.forEach(_49e,function(node){
nodeName=node.getAttribute("dialogAttachPoint");
_49d[nodeName]=null;
delete (_49d[nodeName]);
});
}
dojo.forEach(_49e,function(node){
nodeName=node.getAttribute("dialogAttachPoint");
if(_49d[nodeName]!=null){
if(!std.lang.isArray(_49d[nodeName])){
var _4a1=_49d[nodeName];
_49d[nodeName]=new Array();
_49d[nodeName].push(_4a1);
}
_49d[nodeName].push(node);
}else{
_49d[nodeName]=node;
}
node.myDialog=_49d;
});
},_focusFirstFormElement:function(){
var _4a2=null;
var _4a3=dojo.query(".dijitDialogDefaultFocus",this.containerNode)[0];
if(!_4a3){
_4a3=dojo.query("input, textarea, select, button",this.containerNode)[0];
}
if(_4a3){
_4a2=_4a3;
var _4a4=dijit.getEnclosingWidget(_4a3);
if(_4a4&&typeof (_4a4.focus)=="function"){
_4a2=_4a4;
}
if(std.browser.isIE){
_jstalyst_dialog_onload_elem2focus=_4a2;
window.setTimeout("if (_jstalyst_dialog_onload_elem2focus) _jstalyst_dialog_onload_elem2focus.focus()",100);
window.setTimeout("if (_jstalyst_dialog_onload_elem2focus) _jstalyst_dialog_onload_elem2focus.focus()",120);
}else{
_4a2.focus();
}
}
},onLoad:function(){
this.registerWidgets();
this.registerAttachPoints();
this._focusFirstFormElement();
this.customOnLoad(arguments);
this._position();
},customOnLoad:function(){
},show:function(){
this.inherited(arguments);
this.onShow();
},onShow:function(){
},hide:function(){
this.onHide();
this.inherited(arguments);
this._finally();
},onHide:function(){
},_finally:function(){
},validate:function(){
return true;
},getForm:function(id){
if(id&&this._myForms[id]){
return this._myForms[id];
}
var _4a6=this;
var _4a7=function(e){
if(this.validate()&&_4a6.validate(this.getValues(),this.id)){
_4a6.execute(this.getValues(),this.id);
}
return false;
};
this._myForms={};
var _4a9=this.getDescendants();
var _4aa=null;
dojo.forEach(_4a9,function(_4ab){
if(_4ab.declaredClass=="dijit.form.Form"){
_4a6._myForms[_4ab.id]=_4ab;
_4ab.onSubmit=_4a7;
if(_4aa==null){
_4aa=_4ab;
}
}
});
if(id==null){
return _4aa;
}
return this._myForms[id];
},setSubmitButtonsDisabled:function(flag){
var _4ad=this.getDescendants();
dojo.forEach(_4ad,function(_4ae){
if(_4ae.declaredClass=="dijit.form.Button"&&_4ae.type=="submit"){
_4ae.setAttribute("disabled",flag);
}
});
},execute:function(_4af,_4b0){
try{
this.onSubmitting(_4af,_4b0);
}
catch(err){
this.myApplication.handleException(err);
}
},onSubmitting:function(){
this.hide();
}});
dojo.provide("jstalyst.component.AdvanceTemplated");
dojo.require("dijit._Templated");
dojo.declare("jstalyst.component.AdvanceTemplated",dijit._Templated,{myself:null,useTemplateMacro:false,_emptyVar:"",staticVars:{_tokenizedTplStr:null,_lastTokenizedTplStr:""},constructor:function(){
this.myself=this;
},runTemplateMacro:function(){
this.templateString=this._parseJSTemplate(this.templateString);
},_parseJSTemplate:function(tmpl){
var _4b2=tmpl;
eval("var _this = this;");
_4b2=_4b2.replace(/#init\((.*?)\)#/g,function(_4b3,code){
code=code.replace(/this\./g,"_this.");
code+=";\"\";";
code=code.replace(";",";\n");
return eval(code);
});
var _4b5={bExpr:[true],trueValues:[""],falseValues:[""]};
var _4b6={col:"trueValues",row:0};
var _4b7=[];
var _4b8={isActive:false,atRow:0};
var _4b9;
if(this.staticVars._tokenizedTplStr&&(this.staticVars._lastTokenizedTplStr==_4b2)){
_4b9=this.staticVars._tokenizedTplStr;
}else{
_4b9=this._tokenizeIfThenElse(_4b2);
this.staticVars._tokenizedTplStr=_4b9;
this.staticVars._lastTokenizedTplStr=_4b2;
}
for(var i=0;i<_4b9.length;i++){
var _4bb=_4b9[i];
var _4bc=_4bb.match(/#if\(\s*(.*?)\s*\)#/);
if(_4bc){
_4bc=_4bc[1];
}
if(_4bc){
var _4bd=_4b6;
_4b7.push(_4bd);
_4b6={col:"trueValues",row:_4bd.row+1};
_4bc=_4bc.replace(/this\./g,"_this.");
if((_4b5.bExpr[_4bd.row]&&_4bd.col=="falseValues")||(!_4b5.bExpr[_4bd.row]&&_4bd.col=="trueValues")){
_4b8.isActive=true;
_4b8.atRow=_4bd.row;
}
if(!_4b8.isActive){
_4b5.bExpr[_4b6.row]=Boolean(eval(_4bc));
}else{
_4b5.bExpr[_4b6.row]=_4bc;
}
_4b5.trueValues[_4b6.row]="";
_4b5.falseValues[_4b6.row]="";
}else{
if(_4bb.match(/#else#/)){
var _4bd=_4b6;
_4b7.push(_4bd);
_4b6={col:"falseValues",row:_4bd.row};
}else{
if(_4bb.match(/#end#/)){
var row=_4b6.row;
if(_4b8.isActive&&((_4b8.atRow+1)==row)){
_4b8.isActive=false;
}
if(_4b5.bExpr[row]==null||_4b5.trueValues[row]==null){
throw new SyntaxError(loc("Invalid boolean expressions in widget template."));
}
if(_4b5.falseValues[row]==null){
_4b5.falseValues="";
}
var _4bf=_4b6;
_4b6=_4b7.pop();
if(_4bf.col=="falseValues"){
_4b6=_4b7.pop();
}
if(_4b6==null){
throw new SyntaxError(loc("Unmatched if-then-else statements in widget template"));
}
if(_4b5.bExpr[_4bf.row]){
_4b5[_4b6.col][_4b6.row]+=_4b5.trueValues[_4bf.row];
}else{
_4b5[_4b6.col][_4b6.row]+=_4b5.falseValues[_4bf.row];
}
_4b5.bExpr[_4bf.row]=null;
_4b5.trueValues[_4bf.row]=null;
_4b5.falseValues[_4bf.row]=null;
}else{
_4b5[_4b6.col][_4b6.row]+=_4bb;
}
}
}
}
_4b2=_4b5.trueValues[0];
_4b2=_4b2.replace(/#eval\((.*?)\)#/g,function(_4c0,code){
code=code.replace(/this\./g,"_this.");
code=code.replace(";",";\n");
return eval(code);
});
_4b2=_4b2.replace(/#exec\((.*?)\)#/g,function(_4c2,code){
code=code.replace(/this\./g,"_this.");
code+=";\"\";";
code=code.replace(";",";\n");
return eval(code);
});
var _4c4=function(_4c5,_4c6){
var _4c7="";
if(_4c5){
var _4c8=dojo.isArray(_4c5)?_4c5:[_4c5];
dojo.forEach(_4c8,function(item){
_4c7+=_4c6.replace(/%\{(.*?)\}/g,function(_4ca,code){
if(!code){
code="item";
}else{
code="item."+code;
}
return eval(code);
});
_4c7=_4c7.replace(/%eval\{(.*?)\}/g,function(_4cc,code){
code=code.replace(/this\./g,"item.");
code=code.replace(";",";\n");
return eval(code);
});
});
}
return _4c7;
};
_4b2=_4b2.replace(/#each\(\s*(.*?)\s*,\s*'(.*?)'\s*\)#/g,function(_4ce,_4cf,_4d0){
_4cf=_4cf.replace(/this\./g,"_this.");
return _4c4(eval(_4cf),_4d0);
});
return _4b2;
},_tokenizeIfThenElse:function(str){
var _4d2=[];
var _4d3=str.split(/#if\(\s*.*?\s*\)#|#else#|#end#/g);
var _4d4=str.match(/#if\(\s*.*?\s*\)#|#else#|#end#/g);
var j=0;
for(var i=0;i<_4d3.length;i++){
_4d2.push(_4d3[i]);
if(_4d4&&j<_4d4.length){
_4d2.push(_4d4[j++]);
}
}
return _4d2;
}});
dojo.provide("jstalyst.component.QualityFeedbackAgent");
dojo.declare("jstalyst.component.QualityFeedbackAgent",null,{constructor:function(_4d7){
if(_4d7==null){
_4d7={};
}
this.namespace=_4d7.namespace||"";
this.request={};
this.request.uri=_4d7.requestUri;
this.request.method=_4d7.requestMethod||"post";
this.request.contentType=_4d7.requestContentType||"text/plain";
this.logger=new jstalyst.component.Logger({namespace:this.namespace});
},submit:function(_4d8){
if(!this.request.uri){
return;
}
if(typeof (_4d8)!="function"){
_4d8=function(){
};
}
var _4d9={url:this.request.uri,handleAs:"text",contentType:this.request.contentType,timeout:10000,load:_4d8,error:function(){
}};
if(this.request.method.match(/get/i)){
_4d9.content=this.logger.getString();
dojo.xhrGet(_4d9);
}else{
if(this.request.method.match(/post/i)){
_4d9.postData=this.logger.getString();
dojo.rawXhrPost(_4d9);
}
}
}});
dojo.provide("jstalyst.component.Logger");
dojo.declare("jstalyst.component.Logger",null,{_static:{buffer:[],max:500,start:0,next:0},constructor:function(_4da){
if(_4da==null){
_4da={};
}
this.namespace=_4da.namespace||"";
},write:function(_4db){
this._static.buffer[this._static.next]={namespace:this.namespace,time:new Date(),message:_4db};
this._static.next=(this._static.next+1)%this._static.max;
if(this._static.start==this._static.next){
this._static.start=(this._static.start+1)%this._static.max;
}
return _4db;
},getString:function(){
var text=[];
var n=(this._static.next-this._static.start+this._static.max)%this._static.max;
for(var i=0;i<n;i++){
var _4df=this._static.buffer[(this._static.start+i)%this._static.max];
text.push(std.date.asTimeStrUTC(_4df.time)+" "+_4df.namespace+" - "+_4df.message);
}
return text.join("\n");
}});
dojo.provide("jstalyst.dialog.StandardError");
dojo.require("dijit.Dialog");
dojo.declare("jstalyst.dialog.StandardError",dijit.Dialog,{title:loc("Sorry, an error has occurred"),duration:200,footer:loc("We will figure out how to resolve the problem. You may wish to [_1]reload this page[_2] to continue your work.","<a href=\"javascript: void(0)\" title=\"reload\" onclick=\"window.location.reload()\">","</a>"),useFooter:true,dialogTemplate:"<div class=\"dijitDialogContentHolder tundra\"><h4>${codeMessage}</h4><p>${message}</p><p>${footer}</p><p><button dojoType=\"dijit.form.Button\" type=\"submit\">${okbutton}</button></p></div>",constructor:function(_4e0){
if(_4e0==null){
_4e0={};
}
this.code=_4e0.code;
this.message=_4e0.message;
if(_4e0.useFooter==false){
this.useFooter=false;
}
if(!this.code){
this.code="custom";
}
if(!this.message){
this.message="";
}
},_getCodeMessage:function(code){
switch(code){
case 404:
return loc("404 - Not found");
break;
case 403:
return loc("403 - Forbidden");
break;
case 500:
return loc("500 - Internal server error");
break;
case "custom":
return loc("Application error");
break;
case "timeout":
return loc("Request aborted");
break;
}
},_buildContent:function(){
var _4e2=this.dialogTemplate;
_4e2=_4e2.replace(/\$\{codeMessage\}/,this._getCodeMessage(this.code));
_4e2=_4e2.replace(/\$\{message\}/,this.message);
if(this.useFooter){
_4e2=_4e2.replace(/\$\{footer\}/,this.footer);
}else{
_4e2=_4e2.replace(/\$\{footer\}/,"");
}
_4e2=_4e2.replace(/\$\{okbutton\}/,loc("OK"));
return _4e2;
},show:function(){
this.setContent(this._buildContent());
this.inherited(arguments);
}});
dojo.provide("jstalyst.core.Controller");
dojo.require("dojo.back");
dojo.require("dojo.io.iframe");
dojo.require("jstalyst.component.ApplicationState");
dojo.require("jstalyst.component.Model");
dojo.require("jstalyst.component.Widget");
dojo.require("jstalyst.component.Dialog");
dojo.require("jstalyst.component.AdvanceTemplated");
dojo.require("jstalyst.component.QualityFeedbackAgent");
dojo.require("jstalyst.dialog.StandardError");
dojo.declare("jstalyst.core.Controller",null,{defaultXhrTimeout:10000,base:"/",appName:"A JStalyst Application",defaultState:{},initialState:{},currentState:null,stateClass:jstalyst.component.ApplicationState,stash:{},requestProfile:{},actionsProfile:{},applicationTopics:[{topic:"ApplicationRequestStart",type:"reset"},{topic:"ApplicationRequestComplete",type:"normal"},{topic:"ApplicationRequestError",type:"asap"}],_widgets:{},_dialogClasses:{},_dialogArgs:{},_dialogs:{},_preRequisites:{},_widgetTopics:{},constructor:function(_4e3){
if(_4e3==null){
_4e3={};
}
if(_4e3["base"]){
this.base=_4e3["base"];
}
if(_4e3["appName"]){
this.appName=_4e3["appName"];
}
if(_4e3["defaultState"]){
this.defaultState=_4e3["defaultState"];
}
},registerWidget:function(id,obj,_4e6){
if(!id||!obj){
return;
}
this._widgets[id]=obj;
if(_4e6&&_4e6.startingPreRequisite){
this._addPreRequisite(id);
}
if(typeof (obj.setApplication)=="function"){
obj.setApplication(this,id);
}
this._subscribeWidget(id);
},widget:function(id){
return this._widgets[id];
},_subscribeWidget:function(_4e8){
var _4e9=this.widget(_4e8);
if(!_4e9){
return;
}
if(typeof (_4e9.dispatchApplicationTopic)=="function"){
if(this._widgetTopics[_4e8]!=null){
dojo.forEach(this._widgetTopics[_4e8],function(h){
dojo.unsubscribe(h);
});
}
this._widgetTopics[_4e8]=new Array();
for(var i=0;i<this.applicationTopics.length;i++){
var _4ec=this.applicationTopics[i].topic;
var h=dojo.subscribe(_4ec,_4e9,_4e9.dispatchApplicationTopic);
this._widgetTopics[_4e8].push(h);
}
}
},_publishApplicationTopic:function(_4ee){
var _4ef=false;
var _4f0="";
for(var i=0;i<this.applicationTopics.length;i++){
if(this.applicationTopics[i].topic==_4ee){
_4ef=true;
_4f0=this.applicationTopics[i].type;
break;
}
}
if(_4ef){
dojo.publish(_4ee,[_4ee,_4f0,this.requestProfile,this.stash]);
}
},runOnBehalfOf:function(obj,_4f3){
var args=std.array.from(arguments).slice(2);
var _4f5=obj;
if(_4f5&&typeof (_4f5[_4f3])=="function"){
return _4f5[_4f3].apply(_4f5,args);
}
_4f5=dijit.getEnclosingWidget(obj);
if(_4f5&&typeof (_4f5[_4f3])=="function"){
return _4f5[_4f3].apply(_4f5,args);
}
},_addPreRequisite:function(id){
this._preRequisites[id]=false;
},_markPreRequisite:function(id,flag){
var boo=true;
if(flag!=null&&!flag){
boo=false;
}
this._preRequisites[id]=boo;
},setWidgetReady:function(id){
this._markPreRequisite(id);
},_readyToStart:function(){
for(var k in this._preRequisites){
if(!this._preRequisites[k]){
return false;
}
}
return true;
},start:function(){
jstalyst.core.controller.currentApp=this.appName;
jstalyst.core.controller.scheduledApps[this.appName]=this;
jstalyst.core.controller.startAppTimer();
},initialize:function(){
if(this.qfAgentProfile&&this.qfAgentProfile.requestPath&&!dojo.config.isDebug){
this.qfAgentProfile.namespace=this.appName;
this.qfAgentProfile.requestUri=this.base+this.qfAgentProfile.requestPath;
this.qfAgent=new jstalyst.component.QualityFeedbackAgent(this.qfAgentProfile);
}
for(var k in this.defaultState){
if(this.initialState[k]==null){
this.initialState[k]=this.defaultState[k];
}
}
var _4fd=new this.stateClass(null,std.lang.bind(this,this.changeToState),this);
var _4fe=_4fd.mapStateDataFromUrl();
this.setInitialState(_4fe);
var _4ff=true;
this.markState(this.initialState,_4ff);
},finalize:function(){
for(var _500 in this._widgetTopics){
var _501=this._widgetTopics[_500];
dojo.forEach(_501,function(_502){
dojo.unsubscribe(_502);
});
}
},markState:function(data,_504,_505){
if(data==null){
data={};
}
var _506=new this.stateClass(data,std.lang.bind(this,this.changeToState),this);
var _507=function(){
if(_504){
_506.clearUrl();
dojo.back.setInitialState(_506);
}else{
dojo.back.addToHistory(_506);
}
};
if(!_505){
_507();
}else{
this._deferredMarkState=_507;
}
this.currentState=_506;
},updateState:function(_508,_509){
var _50a=this.currentState.cloneStateData();
var data=std.hash.merge(_50a,_508);
this.markState(data,_509,true);
},setInitialState:function(_50c){
this.initialState=_50c;
},changeToState:function(_50d,_50e){
},_request:function(_50f,_510,_511,_512){
var _513=this[_50f];
var _514=null;
this.requestProfile={action:_50f,params:_510};
try{
if(typeof (_513)=="function"){
this._controlLocking=_512?true:false;
this.stash={};
this.onRequestStart();
this._publishApplicationTopic("ApplicationRequestStart");
if(this.qfAgent){
this.qfAgent.logger.write("ApplicationRequestStart: "+_50f+", Parameters: "+dojo.toJson(_510));
}
_514=this[_50f](_510);
if(_514!=false&&!_511){
this._controlLocking=false;
this.onRequestComplete();
if(typeof (this._deferredMarkState)=="function"){
this._deferredMarkState();
delete (this._deferredMarkState);
}
if(this.qfAgent){
this.qfAgent.logger.write("ApplicationRequestComplete: (sync) "+_50f+", ReturnValue: "+dojo.toJson(_514));
}
this._publishApplicationTopic("ApplicationRequestComplete");
}
}else{
throw new Error(loc("Invalid request"));
}
}
catch(err){
this.handleException(err);
}
return _514;
},request:function(_515,_516){
if(this.currentState==null){
return;
}
if(this._controlLocking){
return;
}
var _517=this.actionsProfile[_515];
var _518=(_517&&_517.controlLock)?true:false;
if(_517&&_517.asynchronous){
this._request(_515,_516,true,_518);
}else{
this._request(_515,_516,false,_518);
}
},completeAsyncAction:function(){
this._controlLocking=false;
this.onRequestComplete();
if(typeof (this._deferredMarkState)=="function"){
this._deferredMarkState();
delete (this._deferredMarkState);
}
if(this.qfAgent){
this.qfAgent.logger.write("ApplicationRequestComplete: (async) "+this.requestProfile.action);
}
this._publishApplicationTopic("ApplicationRequestComplete");
},onRequestStart:function(){
},onRequestComplete:function(){
},_prepareRemoteRequest:function(_519){
var _51a=this;
if(!_519){
return;
}
if(_519.handleAs==null){
_519.handleAs="json";
}
if(_519.customError==null){
_519.customError=function(_51b){
_51a.showErrorDialog("custom",_51b);
};
}
var _51c={url:_519.url,handleAs:_519.handleAs,timeout:_519.timeout||this.defaultXhrTimeout,content:_519.content,load:std.lang.bind(this,function(_51d){
var _51e=true;
if(_519.handleAs=="text"&&_51d){
var _51f=null;
try{
_51f=dojo.fromJson(_51d);
}
catch(err){
}
if(_51f&&typeof (_51f)=="object"){
if(_51f.successful){
_51e=false;
}
}else{
_51e=false;
}
}
if(_519.handleAs=="json"&&_51d.successful){
_51e=false;
}
if(_51e){
if(typeof (_519.customError)=="function"){
_519.customError(_51d);
}
_51a._publishApplicationTopic("ApplicationRequestError");
}else{
var _520=std.lang.bind(this,_519.load);
_520(_51d);
}
return _51d;
}),error:function(_521,_522){
if(_521.dojoType=="timeout"){
_51a.showErrorDialog("timeout",_521.message);
}else{
if(_522.xhr){
var _523=_521.message;
try{
_523=eval(_522.xhr.responseText);
}
catch(err){
}
_51a.showErrorDialog(_522.xhr.status,_523);
}else{
_51a.showErrorDialog("custom",_521.message);
}
}
_51a._publishApplicationTopic("ApplicationRequestError");
},form:_519.form};
if(_519.noTimeout){
_51c.timeout=null;
}
return _51c;
},xhrGet:function(_524){
var _525=this._prepareRemoteRequest(_524);
dojo.xhrGet(_525);
},xhrPost:function(_526){
var _527=this._prepareRemoteRequest(_526);
dojo.xhrPost(_527);
},iframeSend:function(_528){
if(!_528){
return;
}
if(_528.method==null){
_528.method="post";
}
if(_528.handleAs==null){
_528.handleAs="text";
}
_528.noTimeout=true;
var _529=this._prepareRemoteRequest(_528);
dojo.io.iframe.send(_529);
},handleException:function(_52a){
if(!_52a){
return;
}
var _52b="";
var _52c=false;
if(typeof (_52a)=="object"){
var _52d=false;
if(_52a.responseText){
try{
var _52e=eval(_52a.responseText);
if(typeof (_52e)=="object"){
if(_52e.redirect){
window.location.href=_52e.redirect;
return;
}
}else{
_52b+=_52e.slice(0,1023);
}
_52c=true;
_52d=true;
}
catch(err){
}
}
if(!_52d){
_52b+=loc("Application name")+": "+this.appName+"<br/>\n";
_52b+=loc("Requested action")+": "+this.requestProfile.action+"<br/>\n";
var _52f=_52a.message.slice(0,1023);
_52b+=_52a.name+": "+_52f+(_52a.message.length>1024?"...":"");
}
}else{
_52b=_52a;
}
var _530="custom";
if(std.browser.isFF&&_52a.status==0){
if(typeof (this._fixAbortedXhr)=="function"){
this._fixAbortedXhr(_52a);
return;
}
}
if(_52a.status){
_530=_52a.status;
}
var _531=std.lang.bind(this,function(_532){
if(_532){
var _533=parseInt(_532);
if(!isNaN(_533)){
_52b+="<br/>\n"+loc("Quality feedback ticket ID")+": #"+_533+"<br/>\n";
}
}
this.showErrorDialog(_530,_52b,{noFooter:_52c});
});
if(this.qfAgent){
this.qfAgent.logger.write("ErrorCode: "+_530+", Exception: "+_52b);
this.qfAgent.submit(_531);
}else{
_531();
}
if(console){
console.warn(_52a);
}
},showErrorDialog:function(_534,_535,_536){
if(_536==null){
_536={};
}
var _537={code:_534,message:_535};
if(_536.noFooter){
_537.useFooter=false;
}
var _538=new jstalyst.dialog.StandardError(_537);
_538.show();
},registerDialog:function(id,_53a,args){
if(!id||!_53a){
return;
}
this._dialogClasses[id]=_53a;
this._dialogArgs[id]=args||{};
},openDialog:function(id,_53d,_53e){
if(!id){
return;
}
if(_53e==null){
_53e={};
}
if(_53e.forceReload==null){
_53e.forceReload=true;
}
if(_53e.forceReload&&this._dialogs[id]){
this._dialogs[id].destroyRecursive();
this._dialogs[id]=null;
}
if(!this._dialogs[id]){
var _53f=this._dialogClasses[id];
if(typeof (_53f)=="function"){
if(_53d==null){
_53d={};
}
_53d.application=this;
_53d.id=id;
_53d=std.hash.merge(this._dialogArgs[id],_53d);
this._dialogs[id]=new _53f(_53d);
}
}
if(_53e.forceReload&&this._dialogs[id]){
var _app=this;
this._dialogs[id]._finally=std.lang.bind(this._dialogs[id],function(){
this.destroyRecursive();
delete (_app._dialogs[id]);
});
}
this._dialogs[id].show();
}});
jstalyst.core.controller={};
jstalyst.core.controller.currentApp=null;
jstalyst.core.controller.scheduledApps=[];
jstalyst.core.controller.startAppTimer=function(){
var app=jstalyst.core.controller.scheduledApps[jstalyst.core.controller.currentApp];
if(!app){
throw new Error(loc("Cannot start JStalyst application properly!"));
}
if(app._readyToStart()){
app.initialize();
}else{
setTimeout("jstalyst.core.controller.startAppTimer()",200);
}
};
dojo.provide("exploretab.lib.explore.applicationstate");
dojo.provide("exploretab.lib.explore.ApplicationState");
dojo.require("jstalyst.component.ApplicationState");
dojo.declare("exploretab.lib.explore.ApplicationState",jstalyst.component.ApplicationState,{dataFields:[{name:"stateName"},{name:"stateParam"}]});
dojo.require("jstalyst.component.Dialog");
dojo.provide("exploretab.lib.explore.wizard.SignupOrLogin");
dojo.declare("exploretab.lib.explore.wizard.SignupOrLogin",jstalyst.component.Dialog,{title:loc("Please Sign-Up or Login first"),mode:"signup",returnPath:"home",returnState:"",refreshOnShow:true,constructor:function(_542){
if(_542==null){
_542={};
}
this.returnState=_542.returnState;
this.href=this.myApplication.base+"explore/wizard/signup_or_login";
},onSubmitting:function(){
this.setSubmitButtonsDisabled(true);
var _543=this;
var _544=this.getForm(this.mode+"Form").containerNode;
var _545={url:this.myApplication.base+"explore/wizard/"+_543.mode,load:function(_546){
_543.switchMode("success");
_543.myApplication.request("reloadToState",{returnPath:_543.returnPath,returnState:_543.returnState});
},customError:function(_547){
if(_543.mode=="signup"){
_543.signupErrorNode.innerHTML=_547.errors.join("<br/>");
_543.signupErrorNode.style.display="inline";
}else{
if(_543.mode=="login"){
_543.loginErrorNode.innerHTML=_547.errors.join("<br/>");
_543.loginErrorNode.style.display="inline";
}
}
_543.setSubmitButtonsDisabled(false);
},form:_544};
this.myApplication.xhrPost(_545);
},customOnLoad:function(){
this.timezoneOffsetField.value=this.getVisitorTimezoneOffset();
},switchMode:function(mode){
this.signupErrorNode.style.display="none";
this.loginErrorNode.style.display="none";
if(mode=="login"){
this.mode="login";
this.loginFormNode.style.display="";
this.signupFormNode.style.display="none";
}else{
if(mode=="signup"){
this.mode="signup";
this.loginFormNode.style.display="none";
this.signupFormNode.style.display="";
}else{
if(mode=="success"){
this.displayUsernameNode.innerHTML=this.getUsername();
if(this.mode=="signup"){
this.signedUpMessageNode.style.display="";
}
this.mode="success";
this.successResponseNode.style.display="";
this.loginFormNode.style.display="none";
this.signupFormNode.style.display="none";
}
}
}
this.layout();
this.layout();
},toggleLoginType:function(type){
if(type=="personal"){
this.organisationIdNode.style.display="none";
this.togglePersonalLoginNode.style.display="none";
this.toggleOrgLoginNode.style.display="";
}else{
if(type=="organisation"){
this.organisationIdNode.style.display="";
this.togglePersonalLoginNode.style.display="";
this.toggleOrgLoginNode.style.display="none";
}
}
},getUsername:function(){
form=this.getForm(this.mode+"Form").containerNode;
return form.username.value;
},getVisitorTimezoneOffset:function(){
var _54a=new Date();
var _54b="";
if(_54a){
var _54c=_54a.getTimezoneOffset();
var _54d=_54c<=0;
_54c=Math.abs(_54c);
var _54e=parseInt(_54c/60);
var _54f=_54c-(_54e*60);
_54b=(_54d?"+":"-")+(_54e<10?"0"+_54e:_54e)+(_54f<10?"0"+_54f:_54f);
}
return _54b;
}});
dojo.require("jstalyst.component.Dialog");
dojo.provide("explorer.lib.spreadsheets.dialog.Imported");
dojo.declare("explorer.lib.spreadsheets.dialog.Imported",jstalyst.component.Dialog,{title:loc("Spreadsheet Uploaded"),mode:"single",refreshOnShow:true,constructor:function(_550){
if(_550==null){
_550={};
}
if(_550.workspaceButtonText){
this.workspaceButtonText=_550.workspaceButtonText;
}
if(_550.showCloseButton){
this.showCloseButton=_550.showCloseButton;
}
},customOnLoad:function(){
if(this.workspaceButtonText){
this.workspaceButtonTextNode.innerHTML=this.workspaceButtonText;
}
if(this.showCloseButton){
this.backButtonNode.style.display="inline";
}
},onSubmitting:function(){
this.hide();
},uploadMore:function(){
this.hide();
this.myApplication.openDialog("importBookDialog",{mode:this.mode});
},gotoWorkspace:function(){
this.hide();
location.href=this.myApplication.base+"workspace";
}});
dojo.provide("explorer.lib.spreadsheets.dialog.Import");
dojo.declare("explorer.lib.spreadsheets.dialog.Import",jstalyst.component.Dialog,{title:loc("Upload Spreadsheet"),mode:"single",refreshOnShow:true,constructor:function(_551){
if(_551==null){
_551={};
}
if(_551.mode){
this.mode=_551.mode;
}
if(_551.showCreateBlankLink){
this.showCreateBlankLink=_551.showCreateBlankLink;
}
if(_551.workspaceButtonText){
this.workspaceButtonText=_551.workspaceButtonText;
}
if(_551.showCloseButton){
this.showCloseButton=_551.showCloseButton;
}
this.href=this.myApplication.base+"workspace/dialog/import";
},onSubmitting:function(){
this.setSubmitButtonsDisabled(true);
this.progressBarNode.style.display="block";
var _552=this[this.mode+"ModeForm"];
var _553=this;
var _554={url:this.myApplication.base+"workspace/import/"+this.mode,form:_552,load:function(_555){
_555=dojo.fromJson(_555);
_553.progressBarNode.style.display="none";
_553.errorNode.style.display="none";
_553.hide();
var _556=new explorer.lib.spreadsheets.dialog.Imported({application:_553.myApplication,workspaceButtonText:_553.workspaceButtonText,showCloseButton:_553.showCloseButton});
_556.setContent(_555.dialogContent);
_556.mode=_553.mode;
_556.show();
var _557=_555.successBookIds;
if(_557&&_557.length){
_553.myApplication.request("insertBookItems",{bookIds:_557});
}
},customError:function(_558){
_553.setSubmitButtonsDisabled(false);
_553.progressBarNode.style.display="none";
var _559=dojo.fromJson(_558);
_553.errorNode.innerHTML=_559.errors.join("<br/>")+"<br/>";
_553.errorNode.style.display="inline";
}};
this.myApplication.iframeSend(_554);
},customOnLoad:function(){
this.switchMode(this.mode);
if(this.showCreateBlankLink){
this.createBlankLinkNode.style.display="inline";
}
},switchMode:function(mode){
this.errorNode.style.display="none";
if(mode=="single"){
this.mode="single";
this.dialogContainerNode.style.width="450px";
this.singleModeFormNode.style.display="";
this.multipleModeFormNode.style.display="none";
this.singleModeLinkNode.style.display="none";
this.multipleModeLinkNode.style.display="";
this.layout();
this.layout();
}else{
if(mode=="multiple"){
this.mode="multiple";
this.dialogContainerNode.style.width="880px";
this.singleModeFormNode.style.display="none";
this.multipleModeFormNode.style.display="";
this.singleModeLinkNode.style.display="";
this.multipleModeLinkNode.style.display="none";
this.layout();
}
}
},updateName:function(_55b){
var _55c=_55b.id;
var _55d=_55c.substring(_55c.lastIndexOf("_"),_55c.length);
var _55e=-1;
var _55f=-1;
if(_55b.value){
_55e=_55b.value.lastIndexOf("/");
if(_55e==-1){
_55e=_55b.value.lastIndexOf("\\");
}
if(_55e<0){
return;
}
_55f=_55b.value.lastIndexOf(".");
if(_55f<_55e){
_55f=_55b.value.length;
}
var _560=this["customNameInput"+_55d];
_560.value=_55b.value.substring(_55e+1,_55f);
}
},updateFormView:function(){
var _561=this.NameSelect;
var _562=this.CustomNameHeader;
var _563=this.CustomNameCell;
var _564=this.PermissionHeader;
var _565=this.PermissionCell;
var _566=this.DestHeader;
var _567=this.DestCell;
if(_561.value=="other"){
_562.style.display="";
_563.style.display="";
_564.style.display="";
_565.style.display="";
_566.style.display="";
_567.style.display="";
}else{
if(_561.value=="retain"){
_562.style.display="none";
_563.style.display="none";
_564.style.display="";
_565.style.display="";
_566.style.display="";
_567.style.display="";
}else{
if(_561.value=="untitled"){
_562.style.display="none";
_563.style.display="none";
_564.style.display="none";
_565.style.display="none";
_566.style.display="";
_567.style.display="";
}
}
}
}});
dojo.require("jstalyst.component.Dialog");
dojo.provide("exploretab.lib.explore.wizard.ViewerImport");
dojo.declare("exploretab.lib.explore.wizard.ViewerImport",jstalyst.component.Dialog,{title:loc("Quick Upload"),refreshOnShow:true,constructor:function(_568){
if(_568==null){
_568={};
}
this.href=this.myApplication.base+"explore/wizard/viewer_import";
},onSubmitting:function(){
this.setSubmitButtonsDisabled(true);
this.progressBarNode.style.display="block";
var _569=this["importForm"];
var _56a=this;
var _56b={url:this.myApplication.base+"explore/wizard/viewer_import",form:_569,load:function(_56c){
_56a.progressBarNode.style.display="none";
_56a.errorNode.style.display="none";
_56a.formNode.style.display="none";
_56a.successResponseNode.style.display="block";
},customError:function(_56d){
_56a.setSubmitButtonsDisabled(false);
_56a.progressBarNode.style.display="none";
var _56e=dojo.fromJson(_56d);
_56a.errorNode.innerHTML=_56e.errors.join("<br/>");
_56a.errorNode.style.display="inline";
}};
this.myApplication.iframeSend(_56b);
},customOnLoad:function(){
}});
dojo.provide("exploretab.lib.explore.wizard.StartPublish");
dojo.require("jstalyst.component.Dialog");
dojo.declare("exploretab.lib.explore.wizard.StartPublish",jstalyst.component.Dialog,{title:loc("Publish Wizard - Step 1 of 3"),refreshOnShow:true,constructor:function(_56f){
if(_56f==null){
_56f={};
}
this.href=this.myApplication.base+"explore/wizard/start_publish/";
},customOnLoad:function(){
},onSubmitting:function(){
},openImportMode:function(){
this.hide();
this.myApplication.openDialog("import4PublishDialog");
},openBookListMode:function(){
this.hide();
this.myApplication.openDialog("bookSelectorDialog");
}});
dojo.provide("exploretab.lib.explore.wizard.BookSelector");
dojo.require("jstalyst.component.Dialog");
dojo.declare("exploretab.lib.explore.wizard.BookSelector",jstalyst.component.Dialog,{title:loc("Publish Wizard - Step 2 of 3"),refreshOnShow:true,constructor:function(_570){
if(_570==null){
_570={};
}
this.href=this.myApplication.base+"explore/wizard/book_selector/";
},customOnLoad:function(){
std.event.observe(this.filterInput.domNode,"keyup",std.lang.bind(this,this.triggerFilter));
this.setSubmitButtonsDisabled(true);
},onSubmitting:function(){
var _571=parseInt(this.selectedBookIdInput.value);
if(_571>0){
this.hide();
this.myApplication.openDialog("publishSettingDialog",{bookId:_571});
}
},triggerFilter:function(e){
if(e&&std.event.getKeyCode(e)==13){
this.filterBookList();
}
},filterBookList:function(){
var _573=this;
var _574=encodeURI(this.filterInput.getValue());
var _575={url:this.myApplication.base+"explore/wizard/book_selector/?search_str="+_574,handleAs:"text",load:function(_576){
_573.loadingNode.style.display="none";
_573.bookListNode.innerHTML=_576;
_573.registerWidgets();
_573.registerAttachPoints({resetFirst:true});
},customError:function(_577){
_573.errorNode.innerHTML=_577.errors.join("<br/>");
_573.errorNode.style.display="block";
_573.loadingNode.style.display="none";
}};
this.loadingNode.style.display="inline";
this.myApplication.xhrGet(_575);
},onMouseOverRow:function(row){
if(row&&row.getAttribute("selected")!="selected"){
row.style.backgroundColor="#e5e9ee";
}
},onMouseOutRow:function(row){
if(row&&row.getAttribute("selected")!="selected"){
row.style.backgroundColor="";
}
},selectRow:function(row){
if(row){
var _57b=false;
dojo.query("tr[selected]").forEach(function(r){
r.removeAttribute("selected");
r.style.backgroundColor="";
if(r.getAttribute("bookId")==row.getAttribute("bookId")){
_57b=true;
}
});
if(!_57b){
row.setAttribute("selected","selected");
row.style.backgroundColor="#d3dbe4";
this.selectedBookNameLabel.innerHTML=row.getAttribute("bookName");
this.selectedBookIdInput.value=row.getAttribute("bookId");
this.setSubmitButtonsDisabled(false);
}else{
this.selectedBookNameLabel.innerHTML="&nbsp;";
this.selectedBookIdInput.value="";
this.setSubmitButtonsDisabled(true);
}
}
}});
dojo.require("jstalyst.component.Dialog");
dojo.provide("exploretab.lib.explore.wizard.Import4Publish");
dojo.declare("exploretab.lib.explore.wizard.Import4Publish",jstalyst.component.Dialog,{title:loc("Publish Wizard - Step 2 of 3"),refreshOnShow:true,constructor:function(_57d){
if(_57d==null){
_57d={};
}
if(_57d.workspaceButtonText){
this.workspaceButtonText=_57d.workspaceButtonText;
}
if(_57d.showCloseButton){
this.showCloseButton=_57d.showCloseButton;
}
this.href=this.myApplication.base+"explore/wizard/import4publish";
},onSubmitting:function(){
this.setSubmitButtonsDisabled(true);
this.progressBarNode.style.display="block";
var _57e=this["singleModeForm"];
var _57f=this;
var _580={url:this.myApplication.base+"explore/wizard/import4publish",form:_57e,load:function(_581){
_581=dojo.fromJson(_581);
_57f.progressBarNode.style.display="none";
_57f.errorNode.style.display="none";
_57f.hide();
_57f.myApplication.openDialog("publishSettingDialog",{bookId:_581.successBookIds[0]});
},customError:function(_582){
_57f.setSubmitButtonsDisabled(false);
_57f.progressBarNode.style.display="none";
var _583=dojo.fromJson(_582);
_57f.errorNode.innerHTML=_583.errors.join("<br/>")+"<br/>";
_57f.errorNode.style.display="inline";
}};
this.myApplication.iframeSend(_580);
},customOnLoad:function(){
},switch2WorkspaceDialog:function(){
},updateFormView:function(){
var _584=this.NameSelect;
var _585=this.CustomNameCell;
if(_584.value=="other"){
_585.style.display="";
}else{
if(_584.value=="retain"){
_585.style.display="none";
}
}
}});
dojo.provide("exploretab.lib.explore.wizard.PublishSetting");
dojo.require("jstalyst.component.Dialog");
dojo.declare("exploretab.lib.explore.wizard.PublishSetting",jstalyst.component.Dialog,{title:loc("Publish Wizard - Step 3 of 3"),bookId:null,forWorkspace:false,refreshOnShow:true,constructor:function(_586){
if(_586==null){
_586={};
}
this.bookId=_586.bookId;
this.forWorkspace=_586.forWorkspace?true:false;
if(this.forWorkspace){
this.title=loc("Publish Wizard");
}
this.href=this.myApplication.base+"explore/wizard/publish_setting/"+this.bookId;
},customOnLoad:function(){
std.event.observe(this.bookTagsInput.domNode,"keyup",std.lang.bind(this,this.updateTagList));
this.updateTagList();
if(this.forWorkspace){
this.myApplication.request("updateBookItems",{bookIds:this.bookId});
}
},onSubmitting:function(){
this.setSubmitButtonsDisabled(true);
var _587=this;
var _588={url:this.myApplication.base+"explore/wizard/publish_setting/"+this.bookId,load:function(_589){
_587.hide();
if(_587.forWorkspace){
_587.myApplication.request("updateTagTree",{addedTags:_589.addedTags,droppedTags:_589.droppedTags});
var _58a=_587.myApplication.currentState.getSortBy()[0].attribute=="bookName";
_587.myApplication.request("updateBookItems",{bookIds:_587.bookId,sortAgain:_58a});
}
_587.myApplication.openDialog("publishedDialog",{bookId:_587.bookId});
},customError:function(_58b){
_587.errorNode.innerHTML=_58b.errors.join("<br/>");
_587.errorNode.style.display="block";
_587.setSubmitButtonsDisabled(false);
},form:this.getForm().containerNode};
this.myApplication.xhrPost(_588);
},showRenameNode:function(){
this.renameNode.style.display="block";
},getInputTags:function(){
var text=this.bookTagsInput.getValue();
return std.list.map(text.split(/,/),std.string.trim);
},toggleTag:function(tag){
var _58e=this.getInputTags();
var _58f=[];
for(var i=0;i<_58e.length;i++){
if(_58e[i]!=""&&_58e[i]!=tag){
_58f.push(_58e[i]);
}
}
if(_58e.length==_58f.length||(_58e.length==1&&_58e[0]=="")){
_58f.push(tag);
}
this.bookTagsInput.setValue(_58f.join(", "));
this.updateTagList();
},updateTagList:function(e){
if(e&&std.event.getKeyCode(e)!=13){
this.errorNode.style.display="none";
}
var _592=this.getInputTags();
var _593={};
dojo.forEach(_592,function(tag){
_593[tag]=true;
});
var _595=this.tagNodes;
if(!_595){
return;
}
if(!std.lang.isArray(_595)){
_595=[_595];
}
dojo.forEach(_595,function(_596){
if(!_596){
return;
}
if(_593[_596.getAttribute("tag")]){
_596.setAttribute("tagSelected",1);
_596.style.backgroundColor="#6666CC";
_596.style.color="#ffffff";
}else{
_596.setAttribute("tagSelected",1);
_596.style.backgroundColor="";
_596.style.color="";
}
});
}});
dojo.provide("exploretab.lib.explore.wizard.Published");
dojo.require("jstalyst.component.Dialog");
dojo.declare("exploretab.lib.explore.wizard.Published",jstalyst.component.Dialog,{title:loc("Publish Wizard - Done!"),bookId:null,refreshOnShow:true,constructor:function(_597){
if(_597==null){
_597={};
}
this.bookId=_597.bookId;
this.href=this.myApplication.base+"explore/wizard/published/"+this.bookId;
},customOnLoad:function(){
},onSubmitting:function(){
}});
dojo.require("jstalyst.component.Dialog");
dojo.provide("exploretab.lib.explore.wizard.EditProfile");
dojo.declare("exploretab.lib.explore.wizard.EditProfile",jstalyst.component.Dialog,{title:loc("Edit your profile"),refreshOnShow:true,constructor:function(_598){
if(_598==null){
_598={};
}
this.returnState=_598.returnState;
this.href=this.myApplication.base+"explore/wizard/edit_profile";
},onSubmitting:function(){
this.setSubmitButtonsDisabled(true);
var _599=this;
var _59a=this.getForm().containerNode;
var _59b={url:this.myApplication.base+"explore/wizard/save_profile",load:function(_59c){
var _59d=location.href.replace(/#.*/,"");
location.href=_59d;
},customError:function(_59e){
_599.editErrorNode.innerHTML=_59e.errors.join("<br/>");
_599.editErrorNode.style.display="inline";
_599.setSubmitButtonsDisabled(false);
},form:_59a};
this.myApplication.xhrPost(_59b);
},customOnLoad:function(){
}});
dojo.provide("exploretab.controller.Explore");
dojo.require("jstalyst.core.Controller");
dojo.require("exploretab.lib.explore.ApplicationState");
dojo.require("exploretab.lib.explore.wizard.SignupOrLogin");
dojo.require("explorer.lib.spreadsheets.dialog.Import");
dojo.require("exploretab.lib.explore.wizard.ViewerImport");
dojo.require("exploretab.lib.explore.wizard.StartPublish");
dojo.require("exploretab.lib.explore.wizard.BookSelector");
dojo.require("exploretab.lib.explore.wizard.Import4Publish");
dojo.require("exploretab.lib.explore.wizard.PublishSetting");
dojo.require("exploretab.lib.explore.wizard.Published");
dojo.require("exploretab.lib.explore.wizard.EditProfile");
dojo.declare("exploretab.controller.Explore",jstalyst.core.Controller,{appName:"ExploreTab",stateClass:exploretab.lib.explore.ApplicationState,actionsProfile:{},qfAgentProfile:{requestPath:"qualityfeedback/JStalystTrace"},isLoggedIn:false,dialogsRequireLogin:["importBookDialog","startPublishDialog","bookSelectorDialog","import4PublishDialog","publishSettingDialog","publishedDialog"],dialogsReturnStateAfterLogin:{"importBookDialog":"import","startPublishDialog":"publish","bookSelectorDialog":"publish","import4PublishDialog":"publish","publishSettingDialog":"publish","publishedDialog":"publish"},initialize:function(){
this.inherited(arguments);
this.registerDialog("signupOrLoginDialog",exploretab.lib.explore.wizard.SignupOrLogin);
this.registerDialog("importBookDialog",explorer.lib.spreadsheets.dialog.Import,{showCreateBlankLink:true,workspaceButtonText:loc("Goto my workspace"),showCloseButton:true});
this.registerDialog("viewerImportDialog",exploretab.lib.explore.wizard.ViewerImport);
this.registerDialog("startPublishDialog",exploretab.lib.explore.wizard.StartPublish);
this.registerDialog("bookSelectorDialog",exploretab.lib.explore.wizard.BookSelector);
this.registerDialog("import4PublishDialog",exploretab.lib.explore.wizard.Import4Publish);
this.registerDialog("publishSettingDialog",exploretab.lib.explore.wizard.PublishSetting);
this.registerDialog("publishedDialog",exploretab.lib.explore.wizard.Published);
this.registerDialog("editProfileDialog",exploretab.lib.explore.wizard.EditProfile);
switch(this.currentState.getStateName()){
case "signup_or_login":
var _59f=this.currentState.getStateParam();
if(_59f){
this.openDialog("signupOrLoginDialog",{returnState:_59f});
}else{
this.openDialog("signupOrLoginDialog");
}
break;
case "edit_profile":
this.openDialog("editProfileDialog");
break;
case "import":
this.openDialog("importBookDialog");
break;
case "publish":
this.openDialog("startPublishDialog");
break;
}
},changeToState:function(_5a0,_5a1){
},openDialog:function(id,_5a3){
if(!this.isLoggedIn&&dojo.lastIndexOf(this.dialogsRequireLogin,id)!=-1){
var _5a4=this.dialogsReturnStateAfterLogin[id];
this.openDialog("signupOrLoginDialog",{returnState:_5a4});
return;
}
if(id=="signupOrLoginDialog"&&!this.base.match(/^https:\/\//)){
var _5a5=dojo.byId("switchHttpsHintNode");
if(_5a5){
_5a5.style.display="block";
}
if(_5a3&&_5a3.returnState){
this.reloadToState({useHttps:true,returnState:"signup_or_login",stateParam:_5a3.returnState});
}else{
this.reloadToState({useHttps:true,returnState:"signup_or_login"});
}
return;
}
if(!(std.browser.isIE||std.browser.isFF||std.browser.isAppleWebKit)){
if(id=="importBookDialog"||id=="import4PublishDialog"){
std.host.open(this.base+"legacy/workspace/import");
return;
}
if(id=="viewerImportDialog"){
std.host.open(this.base+"viewer");
return;
}
}
this.inherited(arguments);
},gotoBookListPage:function(_5a6,page,_5a8){
var _5a9=dojo.byId("bookListContainer");
_5a8=_5a8||"";
if(page<1||!_5a9){
return;
}
this.toggleLoadingMessageBox(true);
var _5aa=this;
dojo.xhrGet({url:this.base+"explore/booklist/list/"+_5a6+"/?page="+page+"&sort="+_5a8,handleAs:"text",timeout:8000,load:function(_5ab){
_5a9.innerHTML=_5ab;
_5aa.toggleLoadingMessageBox(false);
window.scroll(0,0);
},error:function(_5ac,_5ad){
}});
},gotoBookCommentPage:function(_5ae,page){
var _5b0=dojo.byId("bookCommentsContainer");
if(_5ae<1||page<1||!_5b0){
return;
}
this.toggleLoadingMessageBox(true);
var _5b1=this;
dojo.xhrGet({url:this.base+"explore/bookcomments/partial_list/"+_5ae+"?page="+page,handleAs:"text",timeout:8000,load:function(_5b2){
_5b0.innerHTML=_5b2;
_5b1.toggleLoadingMessageBox(false);
window.scroll(0,_5b0.offsetTop);
},error:function(_5b3,_5b4){
}});
},postBookComment:function(form,_5b6){
this.submitBookComment(form,_5b6,"post");
},replyBookComment:function(form,_5b8){
this.submitBookComment(form,_5b8,"reply");
},submitBookComment:function(form,_5ba,_5bb){
var _5bc=dojo.byId("bookCommentsContainer");
if(_5ba<0||!_5bc){
return;
}
this.toggleLoadingMessageBox(true);
var _5bd=this;
dojo.xhrPost({url:this.base+"explore/bookcomments/"+_5bb+"/"+_5ba,handleAs:"text",timeout:8000,form:form,load:function(_5be){
_5bc.innerHTML=_5be;
_5bd.toggleLoadingMessageBox(false);
dojo.query("input[name=\"title\"], textarea[name=\"content\"]",_5bc).forEach(function(c){
c.value="";
});
dojo.query("input[name=\"closed\"], input[name=\"sticky\"]",_5bc).forEach(function(c){
c.checked=false;
});
window.scroll(0,_5bc.offsetTop);
},error:function(_5c1,_5c2){
}});
},toggleLoadingMessageBox:function(flag){
var _5c4=std.dom.getBodyExtent().width;
var _5c5=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
var _5c6=dojo.byId("loadingMessageBox");
if(!_5c6){
return;
}
if(flag){
_5c6.style.top="";
_5c6.style.left="";
_5c6.style.display="block";
var _5c7=_5c6.offsetTop;
var _5c8=_5c4-_5c6.clientWidth;
var _5c9=(_5c5<_5c7)?_5c7:_5c5;
_5c6.style.left=_5c8+"px";
_5c6.style.top=_5c9+"px";
}else{
_5c6.style.display="none";
}
},insertBookItems:function(_5ca){
},reloadToState:function(_5cb){
if(!_5cb){
_5cb={};
}
var _5cc=location.href.replace(/#.*/,"");
if(_5cb.returnPath){
_5cc=this.base+_5cb.returnPath;
}
if(_5cb.returnState){
_5cc=_5cc+"#"+_5cb.returnState;
}
if(_5cb.returnState&&_5cb.stateParam){
_5cc=_5cc+"/"+_5cb.stateParam;
}
if(_5cb.useHttps){
_5cc=_5cc.replace(/^http:\/\//,"https://");
}
if(_5cb.useHttps||_5cb.returnPath){
location.href=_5cc;
return;
}
if(location.href.match(/#.*/)&&!_5cc.match(/#.*/)){
setTimeout("location.href=\""+_5cc+"\";",3000);
}else{
setTimeout("location.href=\""+_5cc+"\";location.reload();",3000);
}
}});

