var Ly = {
$: function (ID//String/* *) {
return document.getElementById (ID);
},
Addevent:function (EVT/* String */, ACT//function/, obj/* Object/) {
obj = obj | | This
EVT = Evt.substr (0, 2) = = ' on '? Evt.substr (2, evt.length): evt;
var fun = function (event) {
Act.call (obj, obj, event);
};
if (obj.attachevent) {
EVT = evt.length > 2? ' on ' + evt:null;
Obj.attachevent (evt, fun);
}else if (obj.addeventlistener) {
EVT = evt.length > 2? Evt:null;
Obj.addeventlistener (evt, fun, false);
}
}
};
Ly.ajax = (function () {
var xmlHttp,
Control
_this = this;
(function () {
if (window.top!= window) {
if (!window.top.ly &&!window.top.__lyerror__) {
window.top.__lyerror__ = true;
Return
}
Control = Window.top.Ly.Ajax.control ();
XmlHttp = Window.top.Ly.Ajax.xmlHttp ();
} else {
Control = {
List: [],
Lock:false
};
!xmlhttp && (xmlHttp = Createxmlhttprequest ());
}
})();
Function method (M/* String */) {
m = m | | '';
Control.list[control.list.length-1].method = m.touppercase () = = ' Get '? ' Get ': ' POST ';
return _this;
}
function CharSet (c/* String */) {
var _charset;
c = (C | | "). toUpperCase ();
Switch (c) {
Case ' GB2312 ':
_charset = ' GB2312 ';
Break
Case ' GBK ':
_charset = ' GBK ';
Break
Case ' GB18030 ':
_charset = ' GB18030 ';
Break
Case ' BIG5 ':
_charset = ' BIG5 ';
Break
Default:
_charset = ' UTF-8 ';
}
Control.list[control.list.length-1].charset = _charset;
return _this;
}
function URL (U/* String */) {
Control.list[control.list.length-1].url = u | | Document. URL;
return _this;
}
function Async (A/* String */) {
Control.list[control.list.length-1].async = typeof A = ' Boolean '? A:true;
return _this;
}
Function success (FN/function/*) {
if (typeof fn = = ' function ' && fn.constructor = = function) {
control.list[control.list.length-1].success = fn;
} else {
control.list[control.list.length-1].success = function () {};
}
return _this;
}
Function failure (FN/function/*) {
if (typeof fn = = ' object ' && fn.constructor = = Function) {
Control.list[control.list.length-1].failure = fn;
} else {
Control.list[control.list.length-1].failure = function () {};
}
return _this;
}
function params (p/* Object */) {
var _params;
p = P | | '';
if (typeof p = = ' string ') {
_params = p;
else if (typeof p = = ' object ') {
for (var _p in P) {
_params + = ' & ' + _p + ' = ' + p[_p].tostring (). Replace (/+/g, '%2b '). Replace (/&/g, '%26 ');
}
if (_params.length > 1) {
_params = _PARAMS.SUBSTR (1);
}
}
Control.list[control.list.length-1].params = _params;
return _this;
}
function Createxmlhttprequest () {
var xh;
try {
XH = new XMLHttpRequest ();
catch (e) {
try {
XH = new ActiveXObject (' microsoft.xmlhttp ');
catch (e) {
try {
XH = new ActiveXObject (' MSXML2. XMLHTTP ');
catch (e) {
Alert ('