var ff={info:"ffjs",_wcnt:0,_createXHR:function(){
var _1=null;
if(typeof XMLHttpRequest!="undefined"){
_1=new XMLHttpRequest();
}
return _1;
},wait:function(_2){
if(_2){
ff._wcnt++;
document.body.style.cursor="wait";
}else{
if(ff._wcnt--<=1){
ff._wcnt=0;
document.body.style.cursor="auto";
}
}
},request:function(_3){
var _4=function(_5){
this.xhr=_5;
this.text=function(){
return this.xhr.responseText;
};
this.xml=function(){
return this.xhr.responseXML;
};
this.json=function(){
eval("var __json="+this.xhr.responseText);
return __json;
};
this.html=function(){
var _6=document.createElement("div");
_6.innerHTML=this.xhr.responseText;
return _6.childNodes;
};
this.unlink=function(){
this.xhr=null;
};
_5=null;
};
if(!_3.response){
console.error("No response function.");
}
if(!_3.url){
console.error("No URL to request.");
}
var _7=_3.url;
var _8=_3.method||"GET";
var _9=_3.params;
var _a=_3.body;
if(!_a&&_9){
var _b;
if(_8=="GET"){
var _c=_7.indexOf("?")<0?"?":"&";
for(_b in _9){
_7=_7+_c+_b+"="+escape(_9[_b]);
_c="&";
}
}else{
if(_8=="POST"){
_a="";
for(_b in _9){
if(_a.length>0){
_a+="&";
}
_a+=_b+"="+escape(_9[_b]);
}
}else{
console.error("Unsupported HTTP Method "+_8);
return;
}
}
}
var _d=ff._createXHR();
if(!_d){
console.error("no xmlhttp");
return null;
}
if(_3.waitCursor){
ff.wait(true);
}
_d.open(_8,_7,true);
_d.onreadystatechange=function(){
try{
if(_d.readyState==4){
var _e=new _4(_d);
var _f=_d.status;
if(_f==200){
if(_3.waitCursor){
ff.wait(false);
}
var _10=_3.response;
_10(_e);
}else{
throw "HTTP error "+_f;
}
_e.unlink();
}
}
catch(e){
if(_3.waitCursor){
ff.wait(false);
}
if(_3.error){
_3.error(_e,e);
}else{
console.error(e);
}
if(_e){
_e.unlink();
}
}
};
if(_8=="POST"){
_d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
_d.send(_a);
},readParameter:function(_11){
if(_11&&_11.nodeName=="FORM"){
var _12=new Array();
var _13=_11.elements;
for(var i=0;i<_13.length;i++){
var e=_13[i];
if(e.name&&e.name.length>0){
_12[e.name]=e.value;
}
}
return _12;
}else{
throw "no form";
}
},forElement:function(_16,_17,fn,top){
var _1a=(top||document).getElementsByTagName(_16);
var re=ff.style._re(_17);
for(var i=0;i<_1a.length;i++){
var e=_1a[i];
if(re.test(ff.style.getClass(e))){
fn(e);
}
}
},hasCapabilities:function(){
var xhr=ff._createXHR();
return (xhr!=null&&document.createElement&&document.getElementById);
},dom:{clear:function(_1f){
while(_1f.hasChildNodes()){
_1f.removeChild(_1f.firstChild);
}
},replace:function(_20,_21){
ff.dom.clear(_20);
ff.dom.append(_20,_21);
},append:function(e,c){
if(c.length){
while(c.length){
e.appendChild(c[0]);
}
}else{
e.appendChild(c);
}
},init:function(_24){
_24=_24||ff.dom;
var _25=function(_26){
return function(){
return ff.dom.element(_26,arguments);
};
};
var _27="A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR".split(" ");
for(var i=0;i<_27.length;i++){
var _29=_27[i];
_24[_29]=_25(_29);
}
window.console.info("init DOM");
},element:function(_2a,_2b){
_2b=_2b||[];
var i=0;
var _2d={};
if(_2b.length>0&&!_2b[0].appendChild&&typeof _2b[0]=="object"){
_2d=_2b[0];
i++;
}
return this._el2(_2a,i,_2b,_2d);
},_el2:function(_2e,i,_30,_31){
var _32=document.createElement(_2e);
for(var m in _31){
if(typeof m!="function"){
this.setAttribute(_32,m,_31[m]);
}
}
while(i<_30.length){
var c=_30[i++];
if(c.appendChild){
_32.appendChild(c);
}else{
_32.appendChild(document.createTextNode(new String(c).valueOf()));
}
}
return _32;
},setAttribute:function(e,a,v){
e.setAttribute(a,v);
},getAttribute:function(e,a){
return e.getAttribute(a);
}},style:{setClass:function(_3a,c){
ff.dom.setAttribute(_3a,"class",c);
},getClass:function(_3c){
return ff.dom.getAttribute(_3c,"class");
},addClass:function(_3d,c){
var _3f=ff.style.getClass(_3d);
if(_3f){
_3f+=" "+c;
}else{
_3f=c;
}
ff.style.setClass(_3d,_3f);
},removeClass:function(_40,c){
var _42=ff.style.getClass(_40);
if(_42){
var _43="";
var _44=_42.split(" ");
for(var i=0;i<_44.length;i++){
var _46=_44[i];
if(_46!=c){
if(_43.length>0){
_43+=" ";
}
_43+=_46;
}
}
ff.style.setClass(_40,_43);
}
},_re:function(c){
return new RegExp("\\b"+c+"\\b");
},hasClass:function(el,c){
return this._re(c).test(this.getClass(el));
},toggleClass:function(el,c){
if(this.hasClass(el,c)){
this.removeClass(el,c);
}else{
this.addClass(el,c);
}
}},event:{add:function(obj,_4d,fn){
obj.addEventListener(_4d,fn,false);
},remove:function(obj,_50,fn){
obj.removeEventListener(_50,fn,false);
},onload:function(_52){
var _53=window.onload;
if(typeof window.onload!="function"){
window.onload=_52;
}else{
window.onload=function(){
_53();
_52();
};
}
},noBubble:function(e){
e.stopPropagation();
},preventDefault:function(e){
e.preventDefault();
}}};
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
ff.__cxhr=ff._createXHR;
ff.progIds=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
ff._createXHR=function(){
var xhr=ff.__cxhr();
for(var i=0;!xhr&&i<ff.progIds.length;i++){
try{
xhr=new ActiveXObject(ff.progIds[i]);
ff.progIds=[ff.progIds[i]];
}
catch(e){
console.error(e);
}
}
return xhr;
};
ff.event.add=function(obj,_59,fn){
obj["e"+_59+fn]=fn;
obj[_59+fn]=function(){
obj["e"+_59+fn](window.event);
};
obj.attachEvent("on"+_59,obj[_59+fn]);
};
ff.event.remove=function(obj,_5c,fn){
obj.detachEvent("on"+_5c,obj[_5c+fn]);
obj[_5c+fn]=null;
obj["e"+_5c+fn]=null;
};
ff.event.noBubble=function(e){
window.event.cancelBubble=true;
};
ff.event.preventDefault=function(e){
window.event.returnValue=false;
return false;
};
ff.dom._ar={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor"};
ff.dom.setAttribute=function(e,a,v){
var a2=this._ar[a];
if(a2){
e.setAttribute(a2,v);
}else{
if(a=="style"){
e.style.cssText=v;
}else{
if(a.substring(0,2)=="on"){
e[a]=new Function(v);
}else{
e.setAttribute(a,v);
}
}
}
};
ff.dom.getAttribute=function(e,a){
var a2=this._ar[a];
if(a2){
return e.getAttribute(a2);
}else{
return e.getAttribute(a);
}
};
ff.dom.__el2=ff.dom._el2;
ff.dom._el2=function(n,i,c,a){
if(i<c.length&&n=="TEXTAREA"){
a.value=c[i];
c=[];
}
var n2="<"+n;
if(a.name){
n2+=" name=\""+a.name+"\"";
}
if(n=="INPUT"&&a.type){
n2+=" type=\""+a.type+"\"";
}
n2+=">";
return this.__el2(n2,i,c,a);
};
ff.info+=" ( IE compat )";
@end @*/
(function(){
var _6c=window.location.search;
var _6d=_6c&&_6c.indexOf("ffdebug")>=0;
if(!window.console||_6d){
window.console={};
var _6e=function(){
};
var _6f=function(a,p){
for(var i=0;i<a.length;i++){
window.console[p+a[i]]=_6e;
}
};
_6f("debug info warn error trace time timeEnd count".split(" "),"");
var a="x Equals NotEquals Greater NotGreater Less NotLess Contains NotContains True False Null NotNull Undefined NotUndefined InstanceOf NotInstanceOf TypeOf NotTypeOf".split(" ");
a[0]="";
_6f(a,"assert");
if(_6d){
ff.event.onload(function(){
var _74=function(_75){
window.console[_75]=function(){
return window.console._log(_75,arguments);
};
};
window.console._log=function(_76,_77){
msg=_77[0];
var pos=1;
while(pos<_77.length){
msg=msg.replace(/\%[0-9\.a-zA-Z]/,_77[pos++]);
}
window.console._container.appendChild(ff.dom.element("DIV",[{"class":_76},msg]));
};
var _79=ff.dom.element("DIV",[{"id":"ffdebug"}]);
window.console._container=_79;
document.body.appendChild(window.console._container);
ff.event.add(_79,"dblclick",function(ev){
ff.style.toggleClass(this,"minimized");
ff.event.preventDefault(ev);
});
_74("debug");
_74("info");
_74("warn");
_74("error");
window.console.info(ff.info);
});
}
}else{
window.console.info(ff.info);
}
})();

