Object.extend=function(_1,_2,_3){
for(var _4 in _2){
if(_3==false&&_1[_4]!=null){
continue;
}
_1[_4]=_2[_4];
}
return _1;
};
Object.extend(Function.prototype,{apply:function(o,a){
var r,x="__fapply";
if(typeof o!="object"){
o={};
}
o[x]=this;
var s="r = o."+x+"(";
for(var i=0;i<a.length;i++){
if(i>0){
s+=",";
}
s+="a["+i+"]";
}
s+=");";
eval(s);
delete o[x];
return r;
},bind:function(o){
if(!Function.__objs){
Function.__objs=[];
Function.__funcs=[];
}
var _c=o.__oid;
if(!_c){
Function.__objs[_c=o.__oid=Function.__objs.length]=o;
}
var me=this;
var _e=me.__fid;
if(!_e){
Function.__funcs[_e=me.__fid=Function.__funcs.length]=me;
}
if(!o.__closures){
o.__closures=[];
}
var _f=o.__closures[_e];
if(_f){
return _f;
}
o=null;
me=null;
return Function.__objs[_c].__closures[_e]=function(){
return Function.__funcs[_e].apply(Function.__objs[_c],arguments);
};
}},false);
Object.extend(Array.prototype,{push:function(o){
this[this.length]=o;
},addRange:function(_11){
if(_11.length>0){
for(var i=0;i<_11.length;i++){
this.push(_11[i]);
}
}
},clear:function(){
this.length=0;
return this;
},shift:function(){
if(this.length==0){
return null;
}
var o=this[0];
for(var i=0;i<this.length-1;i++){
this[i]=this[i+1];
}
this.length--;
return o;
}},false);
Object.extend(String.prototype,{trimLeft:function(){
return this.replace(/^\s*/,"");
},trimRight:function(){
return this.replace(/\s*$/,"");
},trim:function(){
return this.trimRight().trimLeft();
},endsWith:function(s){
if(this.length==0||this.length<s.length){
return false;
}
return (this.substr(this.length-s.length)==s);
},startsWith:function(s){
if(this.length==0||this.length<s.length){
return false;
}
return (this.substr(0,s.length)==s);
},split:function(c){
var a=[];
if(this.length==0){
return a;
}
var p=0;
for(var i=0;i<this.length;i++){
if(this.charAt(i)==c){
a.push(this.substring(p,i));
p=++i;
}
}
a.push(s.substr(p));
return a;
}},false);
Object.extend(String,{format:function(s){
for(var i=1;i<arguments.length;i++){
s=s.replace("{"+(i-1)+"}",arguments[i]);
}
return s;
},isNullOrEmpty:function(s){
if(s==null||s.length==0){
return true;
}
return false;
}},false);
if(typeof addEvent=="undefined"){
addEvent=function(o,_1f,f,_21){
if(o==null){
return false;
}
if(o.addEventListener){
o.addEventListener(_1f,f,_21);
return true;
}else{
if(o.attachEvent){
var r=o.attachEvent("on"+_1f,f);
return r;
}else{
try{
o["on"+_1f]=f;
}
catch(e){
}
}
}
};
}
if(typeof removeEvent=="undefined"){
removeEvent=function(o,_24,f,_26){
if(o==null){
return false;
}
if(o.removeEventListener){
o.removeEventListener(_24,f,_26);
return true;
}else{
if(o.detachEvent){
o.detachEvent("on"+_24,f);
}else{
try{
o["on"+_24]=function(){
};
}
catch(e){
}
}
}
};
}





Object.extend(Function.prototype,{getArguments:function(){
var _1=[];
for(var i=0;i<this.arguments.length;i++){
_1.push(this.arguments[i]);
}
return _1;
}},false);
var MS={"Browser":{}};
Object.extend(MS.Browser,{isIE:navigator.userAgent.indexOf("MSIE")!=-1,isFirefox:navigator.userAgent.indexOf("Firefox")!=-1,isOpera:window.opera!=null},false);
var AjaxPro={};
AjaxPro.IFrameXmlHttp=function(){
};
AjaxPro.IFrameXmlHttp.prototype={onreadystatechange:null,headers:[],method:"POST",url:null,async:true,iframe:null,status:0,readyState:0,responseText:null,abort:function(){
},readystatechanged:function(){
var _3=this.iframe.contentDocument||this.iframe.document;
if(_3!=null&&_3.readyState=="complete"&&_3.body!=null&&_3.body.res!=null){
this.status=200;
this.statusText="OK";
this.readyState=4;
this.responseText=_3.body.res;
this.onreadystatechange();
return;
}
setTimeout(this.readystatechanged.bind(this),10);
},open:function(_4,_5,_6){
if(_6==false){
alert("Synchronous call using IFrameXMLHttp is not supported.");
return;
}
if(this.iframe==null){
var _7="hans";
if(document.createElement&&document.documentElement&&(window.opera||navigator.userAgent.indexOf("MSIE 5.0")==-1)){
var _8=document.createElement("iframe");
_8.setAttribute("id",_7);
_8.style.visibility="hidden";
_8.style.position="absolute";
_8.style.width=_8.style.height=_8.borderWidth="0px";
this.iframe=document.getElementsByTagName("body")[0].appendChild(_8);
}else{
if(document.body&&document.body.insertAdjacentHTML){
document.body.insertAdjacentHTML("beforeEnd","<iframe name=\""+_7+"\" id=\""+_7+"\" style=\"border:1px solid black;display:none\"></iframe>");
}
}
if(window.frames&&window.frames[_7]){
this.iframe=window.frames[_7];
}
this.iframe.name=_7;
this.iframe.document.open();
this.iframe.document.write("<html><body></body></html>");
this.iframe.document.close();
}
this.method=_4;
this.url=_5;
this.async=_6;
},setRequestHeader:function(_9,_a){
for(var i=0;i<this.headers.length;i++){
if(this.headers[i].name==_9){
this.headers[i].value=_a;
return;
}
}
this.headers.push({"name":_9,"value":_a});
},getResponseHeader:function(_c,_d){
return null;
},addInput:function(_e,_f,_10,_11){
var ele;
var tag="input";
if(_11.indexOf("\n")>=0){
tag="textarea";
}
if(_e.all){
ele=_e.createElement("<"+tag+" name=\""+_10+"\" />");
}else{
ele=_e.createElement(tag);
ele.setAttribute("name",_10);
}
ele.setAttribute("value",_11);
_f.appendChild(ele);
ele=null;
},send:function(_14){
if(this.iframe==null){
return;
}
var doc=this.iframe.contentDocument||this.iframe.document;
var _16=doc.createElement("form");
doc.body.appendChild(_16);
_16.setAttribute("action",this.url);
_16.setAttribute("method",this.method);
_16.setAttribute("enctype","application/x-www-form-urlencoded");
for(var i=0;i<this.headers.length;i++){
switch(this.headers[i].name.toLowerCase()){
case "content-length":
case "accept-encoding":
case "content-type":
break;
default:
this.addInput(doc,_16,this.headers[i].name,this.headers[i].value);
}
}
this.addInput(doc,_16,"data",_14);
_16.submit();
setTimeout(this.readystatechanged.bind(this),0);
}};
var progids=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
var progid=null;
if(typeof ActiveXObject!="undefined"){
var ie7xmlhttp=false;
if(typeof XMLHttpRequest=="object"){
try{
var o=new XMLHttpRequest();
ie7xmlhttp=true;
}
catch(e){
}
}
if(typeof XMLHttpRequest=="undefined"||!ie7xmlhttp){
XMLHttpRequest=function(){
var _18=null;
if(!AjaxPro.noActiveX){
if(progid!=null){
return new ActiveXObject(progid);
}
for(var i=0;i<progids.length&&_18==null;i++){
try{
_18=new ActiveXObject(progids[i]);
progid=progids[i];
}
catch(e){
}
}
}
if(_18==null&&MS.Browser.isIE){
return new AjaxPro.IFrameXmlHttp();
}
return _18;
};
}
}
Object.extend(AjaxPro,{noOperation:function(){
},onLoading:function(){
},onError:function(){
},onTimeout:function(){
},onStateChanged:function(){
},cryptProvider:null,queue:null,token:"",version:"6.10.6.2",ID:"AjaxPro",noActiveX:false,timeoutPeriod:10*1000,queue:null,noUtcTime:false,m:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},toJSON:function(o){
if(o==null){
return "null";
}
var v=[];
var i;
var c=o.constructor;
if(c==Number){
return isFinite(o)?o.toString():AjaxPro.toJSON(null);
}else{
if(c==Boolean){
return o.toString();
}else{
if(c==String){
if(/["\\\x00-\x1f]/.test(o)){
o=o.replace(/([\x00-\x1f\\"])/g,function(a,b){
var c=AjaxPro.m[b];
if(c){
return c;
}
c=b.charCodeAt();
return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
});
}
return "\""+o+"\"";
}else{
if(c==Array){
for(i=0;i<o.length;i++){
v.push(AjaxPro.toJSON(o[i]));
}
return "["+v.join(",")+"]";
}else{
if(c==Date){
var d={};
d.__type="System.DateTime";
if(AjaxPro.noUtcTime==true){
d.Year=o.getFullYear();
d.Month=o.getMonth()+1;
d.Day=o.getDate();
d.Hour=o.getHours();
d.Minute=o.getMinutes();
d.Second=o.getSeconds();
d.Millisecond=o.getMilliseconds();
}else{
d.Year=o.getUTCFullYear();
d.Month=o.getUTCMonth()+1;
d.Day=o.getUTCDate();
d.Hour=o.getUTCHours();
d.Minute=o.getUTCMinutes();
d.Second=o.getUTCSeconds();
d.Millisecond=o.getUTCMilliseconds();
}
return AjaxPro.toJSON(d);
}
}
}
}
}
if(typeof o.toJSON=="function"){
return o.toJSON();
}
if(typeof o=="object"){
for(var _22 in o){
if(typeof o[_22]!="function"){
v.push("\""+_22+"\":"+AjaxPro.toJSON(o[_22]));
}
}
if(v.length>0){
return "{"+v.join(",")+"}";
}
return "{}";
}
return o.toString();
},dispose:function(){
if(AjaxPro.queue!=null){
AjaxPro.queue.dispose();
}
}},false);
addEvent(window,"unload",AjaxPro.dispose);
AjaxPro.Request=function(url){
this.url=url;
this.xmlHttp=null;
};
AjaxPro.Request.prototype={url:null,callback:null,onLoading:AjaxPro.noOperation,onError:AjaxPro.noOperation,onTimeout:AjaxPro.noOperation,onStateChanged:AjaxPro.noOperation,args:null,context:null,isRunning:false,abort:function(){
if(this.timeoutTimer!=null){
clearTimeout(this.timeoutTimer);
}
if(this.xmlHttp){
this.xmlHttp.onreadystatechange=AjaxPro.noOperation;
this.xmlHttp.abort();
}
if(this.isRunning){
this.isRunning=false;
this.onLoading(false);
}
},dispose:function(){
this.abort();
},getEmptyRes:function(){
return {error:null,value:null,request:{method:this.method,args:this.args},context:this.context,duration:this.duration};
},endRequest:function(res){
this.abort();
if(res.error!=null){
this.onError(res.error,this);
}
if(typeof this.callback=="function"){
this.callback(res,this);
}
},mozerror:function(){
if(this.timeoutTimer!=null){
clearTimeout(this.timeoutTimer);
}
var res=this.getEmptyRes();
res.error={Message:"Unknown",Type:"ConnectFailure",Status:0};
this.endRequest(res);
},doStateChange:function(){
this.onStateChanged(this.xmlHttp.readyState,this);
if(this.xmlHttp.readyState!=4||!this.isRunning){
return;
}
this.duration=new Date().getTime()-this.__start;
if(this.timeoutTimer!=null){
clearTimeout(this.timeoutTimer);
}
var res=this.getEmptyRes();
if(this.xmlHttp.status==200&&this.xmlHttp.statusText=="OK"){
res=this.createResponse(res);
}else{
res=this.createResponse(res,true);
res.error={Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status};
}
this.endRequest(res);
},createResponse:function(r,_28){
if(!_28){
var _29=""+this.xmlHttp.responseText;
if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider=="function"){
_29=AjaxPro.cryptProvider.decrypt(_29);
}
if(this.xmlHttp.getResponseHeader("Content-Type")=="text/xml"){
r.value=this.xmlHttp.responseXML;
}else{
if(_29!=null&&_29.trim().length>0){
r.json=_29;
eval("r.value = "+_29+"*"+"/");
}
}
}
return r;
},timeout:function(){
this.duration=new Date().getTime()-this.__start;
var r=this.onTimeout(this.duration,this);
if(typeof r=="undefined"||r!=false){
this.abort();
}else{
this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);
}
},invoke:function(_2b,_2c,_2d,_2e){
this.__start=new Date().getTime();
if(this.xmlHttp==null){
this.xmlHttp=new XMLHttpRequest();
}
this.isRunning=true;
this.method=_2b;
this.args=_2c;
this.callback=_2d;
this.context=_2e;
var _2f=typeof (_2d)=="function"&&_2d!=AjaxPro.noOperation;
if(_2f){
if(MS.Browser.isIE){
this.xmlHttp.onreadystatechange=this.doStateChange.bind(this);
}else{
this.xmlHttp.onload=this.doStateChange.bind(this);
this.xmlHttp.onerror=this.mozerror.bind(this);
}
this.onLoading(true);
}
var _30=AjaxPro.toJSON(_2c)+"";
if(AjaxPro.cryptProvider!=null){
_30=AjaxPro.cryptProvider.encrypt(_30);
}
this.xmlHttp.open("POST",this.url,_2f);
this.xmlHttp.setRequestHeader("Content-Type","text/plain; charset=utf-8");
this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Method",_2b);
if(AjaxPro.token!=null&&AjaxPro.token.length>0){
this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Token",AjaxPro.token);
}
if(!MS.Browser.isIE){
this.xmlHttp.setRequestHeader("Connection","close");
}
this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);
try{
this.xmlHttp.send(_30);
}
catch(e){
}
if(!_2f){
return this.createResponse({error:null,value:null});
}
return true;
}};
AjaxPro.RequestQueue=function(_31){
this.queue=[];
this.requests=[];
this.timer=null;
if(isNaN(_31)){
_31=2;
}
for(var i=0;i<_31;i++){
this.requests[i]=new AjaxPro.Request();
this.requests[i].callback=function(res){
var r=res.context;
res.context=r[3][1];
r[3][0](res,this);
};
this.requests[i].callbackHandle=this.requests[i].callback.bind(this.requests[i]);
}
};
AjaxPro.RequestQueue.prototype={process:function(){
this.timer=null;
if(this.queue.length==0){
return;
}
for(var i=0;i<this.requests.length&&this.queue.length>0;i++){
if(this.requests[i].isRunning==false){
var r=this.queue.shift();
this.requests[i].url=r[0];
this.requests[i].onLoading=r[3].length>2&&r[3][2]!=null&&typeof r[3][2]=="function"?r[3][2]:AjaxPro.onLoading;
this.requests[i].onError=r[3].length>3&&r[3][3]!=null&&typeof r[3][3]=="function"?r[3][3]:AjaxPro.onError;
this.requests[i].onTimeout=r[3].length>4&&r[3][4]!=null&&typeof r[3][4]=="function"?r[3][4]:AjaxPro.onTimeout;
this.requests[i].onStateChanged=r[3].length>5&&r[3][5]!=null&&typeof r[3][5]=="function"?r[3][5]:AjaxPro.onStateChanged;
this.requests[i].invoke(r[1],r[2],this.requests[i].callbackHandle,r);
r=null;
}
}
if(this.queue.length>0&&this.timer==null){
this.timer=setTimeout(this.process.bind(this),0);
}
},add:function(url,_38,_39,e){
this.queue.push([url,_38,_39,e]);
this.process();
},abort:function(){
this.queue.length=0;
if(this.timer!=null){
clearTimeout(this.timer);
}
this.timer=null;
for(var i=0;i<this.requests.length;i++){
if(this.requests[i].isRunning==true){
this.requests[i].abort();
}
}
},dispose:function(){
for(var i=0;i<this.requests.length;i++){
var r=this.requests[i];
r.dispose();
}
this.requests.clear();
}};
AjaxPro.queue=new AjaxPro.RequestQueue(2);
AjaxPro.AjaxClass=function(url){
this.url=url;
};
AjaxPro.AjaxClass.prototype={invoke:function(_3f,_40,e){
if(e!=null){
if(e.length!=6){
for(;e.length<6;){
e.push(null);
}
}
if(e[0]!=null&&typeof (e[0])=="function"){
return AjaxPro.queue.add(this.url,_3f,_40,e);
}
}
var r=new AjaxPro.Request();
r.url=this.url;
return r.invoke(_3f,_40);
}};








if(typeof Ajax=="undefined"){
Ajax={};
}
if(typeof Ajax.Web=="undefined"){
Ajax.Web={};
}
if(typeof Ajax.Web.NameValueCollection=="undefined"){
Ajax.Web.NameValueCollection={};
}
Ajax.Web.NameValueCollection=function(_1){
this.__type="System.Collections.Specialized.NameValueCollection";
this.keys=[];
this.values=[];
if(_1!=null&&!isNaN(_1.length)){
for(var i=0;i<_1.length;i++){
this.add(_1[i][0],_1[i][1]);
}
}
};
Object.extend(Ajax.Web.NameValueCollection.prototype,{add:function(k,v){
if(k==null||k.constructor!=String||v==null||v.constructor!=String){
return -1;
}
this.keys.push(k);
this.values.push(v);
return this.values.length-1;
},containsKey:function(_5){
for(var i=0;i<this.keys.length;i++){
if(this.keys[i]==_5){
return true;
}
}
return false;
},getKeys:function(){
return this.keys;
},getValue:function(k){
for(var i=0;i<this.keys.length&&i<this.values.length;i++){
if(this.keys[i]==k){
return this.values[i];
}
}
return null;
},setValue:function(k,v){
if(k==null||k.constructor!=String||v==null||v.constructor!=String){
return -1;
}
for(var i=0;i<this.keys.length&&i<this.values.length;i++){
if(this.keys[i]==k){
this.values[i]=v;
}
return i;
}
return this.add(k,v);
},toJSON:function(){
return AjaxPro.toJSON({__type:this.__type,keys:this.keys,values:this.values});
}},true);
if(typeof Ajax=="undefined"){
Ajax={};
}
if(typeof Ajax.Web=="undefined"){
Ajax.Web={};
}
if(typeof Ajax.Web.DataSet=="undefined"){
Ajax.Web.DataSet={};
}
Ajax.Web.DataSet=function(t){
this.__type="System.Data.DataSet,System.Data";
this.Tables=[];
this.addTable=function(t){
this.Tables.push(t);
};
if(t!=null){
for(var i=0;i<t.length;i++){
this.addTable(t[i]);
}
}
};
if(typeof Ajax=="undefined"){
Ajax={};
}
if(typeof Ajax.Web=="undefined"){
Ajax.Web={};
}
if(typeof Ajax.Web.DataTable=="undefined"){
Ajax.Web.DataTable={};
}
Ajax.Web.DataTable=function(c,r){
this.__type="System.Data.DataTable,System.Data";
this.Columns=[];
this.Rows=[];
this.addColumn=function(_11,_12){
this.Columns.push({Name:_11,__type:_12});
};
this.toJSON=function(){
var dt={};
var i;
dt.Columns=[];
for(i=0;i<this.Columns.length;i++){
dt.Columns.push([this.Columns[i].Name,this.Columns[i].__type]);
}
dt.Rows=[];
for(i=0;i<this.Rows.length;i++){
var row=[];
for(var j=0;j<this.Columns.length;j++){
row.push(this.Rows[i][this.Columns[j].Name]);
}
dt.Rows.push(row);
}
return AjaxPro.toJSON(dt);
};
this.addRow=function(row){
this.Rows.push(row);
};
if(c!=null){
for(var i=0;i<c.length;i++){
this.addColumn(c[i][0],c[i][1]);
}
}
if(r!=null){
for(var y=0;y<r.length;y++){
var row={};
for(var z=0;z<this.Columns.length&&z<r[y].length;z++){
row[this.Columns[z].Name]=r[y][z];
}
this.addRow(row);
}
}
};
if(typeof Ajax=="undefined"){
Ajax={};
}
if(typeof Ajax.Web=="undefined"){
Ajax.Web={};
}
if(typeof Ajax.Web.Profile=="undefined"){
Ajax.Web.Profile={};
}
Ajax.Web.Profile=function(){
this.toJSON=function(){
throw "Ajax.Web.Profile cannot be converted to JSON format.";
};
this.setProperty_callback=function(res){
};
this.setProperty=function(_1d,_1e){
this[_1d]=_1e;
AjaxPro.Services.Profile.SetProfile({name:o},this.setProperty_callback.bind(this));
};
};
if(typeof Ajax=="undefined"){
Ajax={};
}
if(typeof Ajax.Web=="undefined"){
Ajax.Web={};
}
if(typeof Ajax.Web.Dictionary=="undefined"){
Ajax.Web.Dictionary={};
}
Ajax.Web.Dictionary=function(_1f,_20){
this.__type=_1f;
this.keys=[];
this.values=[];
if(_20!=null&&!isNaN(_20.length)){
for(var i=0;i<_20.length;i++){
this.add(_20[i][0],_20[i][1]);
}
}
};
Object.extend(Ajax.Web.Dictionary.prototype,{add:function(k,v){
this.keys.push(k);
this.values.push(v);
return this.values.length-1;
},containsKey:function(key){
for(var i=0;i<this.keys.length;i++){
if(this.keys[i]==key){
return true;
}
}
return false;
},getKeys:function(){
return this.keys;
},getValue:function(key){
for(var i=0;i<this.keys.length&&i<this.values.length;i++){
if(this.keys[i]==key){
return this.values[i];
}
}
return null;
},setValue:function(k,v){
for(var i=0;i<this.keys.length&&i<this.values.length;i++){
if(this.keys[i]==k){
this.values[i]=v;
}
return i;
}
return this.add(k,v);
},toJSON:function(){
return AjaxPro.toJSON({__type:this.__type,keys:this.keys,values:this.values});
}},true);





