var AJS={BASE_URL:"",getElement:function(id){
if(typeof (id)=="string"){
return document.getElementById(id);
}else{
return id;
}
},getElements:function(){
var _ca=new Array();
for(var i=0;i<arguments.length;i++){
var _cc=this.getElement(arguments[i]);
_ca.push(_cc);
}
return _ca;
},getQueryArgument:function(_cd){
var _ce=window.location.search.substring(1);
var _cf=_ce.split("&");
for(var i=0;i<_cf.length;i++){
var _d1=_cf[i].split("=");
if(_d1[0]==_cd){
return _d1[1];
}
}
return null;
},getFormElement:function(_d2,_d3){
var r=null;
AJS.map(_d2.elements,function(elm){
if(elm.name&&elm.name==_d3){
r=elm;
}
});
return r;
},isIe:function(){
return (navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1);
},isNetscape7:function(){
return (navigator.userAgent.toLowerCase().indexOf("netscape")!=-1&&navigator.userAgent.toLowerCase().indexOf("7.")!=-1);
},isSafari:function(){
return (navigator.userAgent.toLowerCase().indexOf("khtml")!=-1);
},isOpera:function(){
return (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
},isMozilla:function(){
return (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210);
},getBody:function(){
return this.getElementsByTagAndClassName("body")[0];
},getElementsByTagAndClassName:function(_d6,_d7,_d8){
var _d9=[];
if(!this.isDefined(_d8)){
_d8=document;
}
if(!this.isDefined(_d6)){
_d6="*";
}
var els=_d8.getElementsByTagName(_d6);
var _db=els.length;
var _dc=new RegExp("(^|\\s)"+_d7+"(\\s|$)");
for(i=0,j=0;i<_db;i++){
if(_dc.test(els[i].className)||_d7==null){
_d9[j]=els[i];
j++;
}
}
return _d9;
},nodeName:function(elm){
return elm.nodeName.toLowerCase();
},hasParent:function(elm,_df,_e0){
if(elm==_df){
return true;
}
if(_e0==0){
return false;
}
return hasParent(elm.parentNode,_df,_e0-1);
},isElementHidden:function(elm){
return elm.style.visibility=="hidden";
},getLast:function(_e2){
if(_e2.length>0){
return _e2[_e2.length-1];
}else{
return null;
}
},getFirst:function(_e3){
if(_e3.length>0){
return _e3[0];
}else{
return null;
}
},createArray:function(v){
if(this.isArray(v)){
return v;
}else{
if(!v){
return [];
}else{
return [v];
}
}
},map:function(_e5,fn,_e7,_e8){
var i=0,l=_e5.length;
if(_e7){
i=_e7;
}
if(_e8){
l=_e8;
}
for(i;i<l;i++){
fn.apply(this,[_e5[i]]);
}
},isIn:function(elm,_eb){
var i=this.getIndex(elm,_eb);
if(i!=-1){
return true;
}else{
return false;
}
},getIndex:function(elm,_ee,_ef){
for(var i=0;i<_ee.length;i++){
if(_ef&&_ef(_ee[i])||elm==_ee[i]){
return i;
}
}
return -1;
},documentInsert:function(_f1){
document.writeln("<span id=\"dummy_holder\"></span>");
this.swapDOM(this.$("dummy_holder"),_f1);
},appendChildNodes:function(_f2){
if(arguments.length>=2){
AJS.map(arguments,function(n){
if(this.isString(n)){
n=this.TN(n);
}
if(this.isDefined(n)){
_f2.appendChild(n);
}
},1);
}
return _f2;
},replaceChildNodes:function(_f4){
var _f5;
while((_f5=_f4.firstChild)){
_f4.removeChild(_f5);
}
if(arguments.length<2){
return _f4;
}else{
return this.appendChildNodes.apply(this,arguments);
}
return _f4;
},insertAfter:function(_f6,_f7){
_f7.parentNode.insertBefore(_f6,_f7.nextSibling);
return _f6;
},insertBefore:function(_f8,_f9){
_f9.parentNode.insertBefore(_f8,_f9);
return _f8;
},showElement:function(){
this.map(arguments,function(elm){
elm.style.display="";
});
},hideElement:function(elm){
this.map(arguments,function(elm){
elm.style.display="none";
});
},swapDOM:function(_fd,src){
_fd=this.getElement(_fd);
var _ff=_fd.parentNode;
if(src){
src=this.getElement(src);
_ff.replaceChild(src,_fd);
}else{
_ff.removeChild(_fd);
}
return src;
},removeElement:function(){
this.map(arguments,function(elm){
AJS.swapDOM(elm,null);
});
},createDOM:function(name,_102){
var i=0,attr;
elm=document.createElement(name);
if(this.isDict(_102[i])){
for(k in _102[0]){
if(k=="style"){
elm.style.cssText=_102[0][k];
}else{
if(k=="class"){
elm.className=_102[0][k];
}else{
attr=_102[0][k];
elm.setAttribute(k,attr);
}
}
}
i++;
}
if(_102[0]==null){
i=1;
}
AJS.map(_102,function(n){
if(this.isDefined(n)){
if(this.isString(n)){
n=this.TN(n);
}
elm.appendChild(n);
}
},i);
return elm;
},_createDOM:function(){
return this.createDOM.apply(this,arguments);
},UL:function(){
return this._createDOM("ul",arguments);
},LI:function(){
return this._createDOM("li",arguments);
},TD:function(){
return this._createDOM("td",arguments);
},TR:function(){
return this._createDOM("tr",arguments);
},TH:function(){
return this._createDOM("th",arguments);
},TBODY:function(){
return this._createDOM("tbody",arguments);
},TABLE:function(){
return this._createDOM("table",arguments);
},INPUT:function(){
return this._createDOM("input",arguments);
},SPAN:function(){
return this._createDOM("span",arguments);
},B:function(){
return this._createDOM("b",arguments);
},A:function(){
return this._createDOM("a",arguments);
},DIV:function(){
return this._createDOM("div",arguments);
},IMG:function(){
return this._createDOM("img",arguments);
},BUTTON:function(){
return this._createDOM("button",arguments);
},H1:function(){
return this._createDOM("h1",arguments);
},H2:function(){
return this._createDOM("h2",arguments);
},H3:function(){
return this._createDOM("h3",arguments);
},BR:function(){
return this._createDOM("br",arguments);
},TEXTAREA:function(){
return this._createDOM("textarea",arguments);
},FORM:function(){
return this._createDOM("form",arguments);
},P:function(){
return this._createDOM("p",arguments);
},SELECT:function(){
return this._createDOM("select",arguments);
},OPTION:function(){
return this._createDOM("option",arguments);
},TN:function(text){
return document.createTextNode(text);
},IFRAME:function(){
return this._createDOM("iframe",arguments);
},SCRIPT:function(){
return this._createDOM("script",arguments);
},CENTER:function(){
return this._createDOM("center",arguments);
},DL:function(){
return this._createDOM("DL",arguments);
},DT:function(){
return this._createDOM("DT",arguments);
},DD:function(){
return this._createDOM("DD",arguments);
},SMALL:function(){
return this._createDOM("SMALL",arguments);
},getCssDim:function(dim){
if(this.isString(dim)){
return dim;
}else{
return dim+"px";
}
},setWidth:function(){
var w=this.getLast(arguments);
this.map(arguments,function(elm){
elm.style.width=this.getCssDim(w);
},0,arguments.length-1);
},setHeight:function(){
var h=this.getLast(arguments);
this.map(arguments,function(elm){
elm.style.height=this.getCssDim(h);
},0,arguments.length-1);
},setLeft:function(){
var l=this.getLast(arguments);
this.map(arguments,function(elm){
elm.style.left=this.getCssDim(l);
},0,arguments.length-1);
},setTop:function(){
var t=this.getLast(arguments);
this.map(arguments,function(elm){
elm.style.top=this.getCssDim(t);
},0,arguments.length-1);
},setHTML:function(elm,html){
elm.innerHTML=html;
return elm;
},evalTxt:function(txt){
return eval("("+txt+")");
},getXMLHttpRequest:function(){
var _112=[function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
},function(){
return new ActiveXObject("Msxml2.XMLHTTP.4.0");
},function(){
throw "Browser does not support XMLHttpRequest";
}];
for(var i=0;i<_112.length;i++){
var func=_112[i];
try{
return func();
}
catch(e){
}
}
},doSimpleXMLHttpRequest:function(url){
var req=this.getXMLHttpRequest();
if(url.indexOf("http://")==-1){
url=AJS.BASE_URL+url;
}
req.open("GET",url,true);
return this.sendXMLHttpRequest(req);
},getRequest:function(url,data){
var req=this.getXMLHttpRequest();
if(url.indexOf("http://")==-1){
url=AJS.BASE_URL+url;
}
req.open("POST",url,true);
req.setRequestHeader("Content-type","application/x-www-form-urlencoded");
return this.sendXMLHttpRequest(req);
},sendXMLHttpRequest:function(req,data){
var d=new AJSDeferred(req);
var _11d=function(){
if(req.readyState==4){
var _11e="";
try{
_11e=req.status;
}
catch(e){
}
if(_11e==200||_11e==304||req.responseText==null){
d.callback(req,data);
}else{
if(_11e==500){
alert(req.responseText);
}else{
d.errback();
}
}
}
};
req.onreadystatechange=_11d;
return d;
},reprString:function(o){
return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
},serializeJSON:function(o){
var _121=typeof (o);
if(_121=="undefined"){
return "undefined";
}else{
if(_121=="number"||_121=="boolean"){
return o+"";
}else{
if(o===null){
return "null";
}
}
}
if(_121=="string"){
return AJS.reprString(o);
}
var me=arguments.callee;
var _123;
if(typeof (o.__json__)=="function"){
_123=o.__json__();
if(o!==_123){
return me(_123);
}
}
if(typeof (o.json)=="function"){
_123=o.json();
if(o!==_123){
return me(_123);
}
}
if(_121!="function"&&typeof (o.length)=="number"){
var res=[];
for(var i=0;i<o.length;i++){
var val=me(o[i]);
if(typeof (val)!="string"){
val="undefined";
}
res.push(val);
}
return "["+res.join(",")+"]";
}
res=[];
for(var k in o){
var _128;
if(typeof (k)=="number"){
_128="\""+k+"\"";
}else{
if(typeof (k)=="string"){
_128=AJS.reprString(k);
}else{
continue;
}
}
val=me(o[k]);
if(typeof (val)!="string"){
continue;
}
res.push(_128+":"+val);
}
return "{"+res.join(",")+"}";
},loadJSONDoc:function(url){
var d=this.getRequest(url);
var _12b=function(req){
var text=req.responseText;
if(text=="Error"){
d.errback(req);
}else{
return AJS.evalTxt(text);
}
};
d.addCallback(_12b);
return d;
},evalScriptTags:function(html){
var _12f=html.match(/<script.*?>((\n|\r|.)*?)<\/script>/g);
if(_12f!=null){
for(var i=0;i<_12f.length;i++){
var _131=_12f[i].replace(/<script.*?>/g,"");
_131=_131.replace(/<\/script>/g,"");
eval(_131);
}
}
},getMousePos:function(e){
var posx=0;
var posy=0;
if(!e){
var e=window.event;
}
if(e.pageX||e.pageY){
posx=e.pageX;
posy=e.pageY;
}else{
if(e.clientX||e.clientY){
posx=e.clientX+document.body.scrollLeft;
posy=e.clientY+document.body.scrollTop;
}
}
return [posx,posy];
},findPosX:function(obj){
var _136=0;
if(obj.offsetParent){
while(obj.offsetParent){
_136+=obj.offsetLeft;
obj=obj.offsetParent;
}
}else{
if(obj.x){
_136+=obj.x;
}
}
return _136;
},findPosY:function(obj){
var _138=0;
if(obj.offsetParent){
while(obj.offsetParent){
_138+=obj.offsetTop;
obj=obj.offsetParent;
}
}else{
if(obj.y){
_138+=obj.y;
}
}
return _138;
},getScrollTop:function(){
var t;
if(document.documentElement&&document.documentElement.scrollTop){
t=document.documentElement.scrollTop;
}else{
if(document.body){
t=document.body.scrollTop;
}
}
return t;
},absolutePosition:function(elm){
var _13b={"x":elm.offsetLeft,"y":elm.offsetTop};
if(elm.offsetParent){
var _13c=this.absolutePosition(elm.offsetParent);
_13b.x+=_13c.x;
_13b.y+=_13c.y;
}
return _13b;
},getWindowSize:function(){
var _13d,win_h;
if(self.innerHeight){
_13d=self.innerWidth;
win_h=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_13d=document.documentElement.clientWidth;
win_h=document.documentElement.clientHeight;
}else{
if(document.body){
_13d=document.body.clientWidth;
win_h=document.body.clientHeight;
}
}
}
return {"w":_13d,"h":win_h};
},getEventElm:function(e){
if(e&&!e.type&&!e.keyCode){
return e;
}
var targ;
if(!e){
var e=window.event;
}
if(e.target){
targ=e.target;
}else{
if(e.srcElement){
targ=e.srcElement;
}
}
if(targ.nodeType==3){
targ=targ.parentNode;
}
return targ;
},getRealScope:function(fn,_141,_142){
var _143=window;
_141=this.$A(_141);
if(fn._cscope){
_143=fn._cscope;
}
return function(){
var args=[];
var i=0;
if(_142){
i=1;
}
AJS.map(arguments,function(arg){
args.push(arg);
},i);
args=args.concat(_141);
return fn.apply(_143,args);
};
},unloadListeners:function(){
if(AJS.listeners){
AJS.map(AJS.listeners,function(elm,type,fn){
AJS.removeEventListener(elm,type,fn);
});
}
AJS.listeners=[];
},removeEventListener:function(elm,type,fn){
if(elm.removeEventListener){
elm.removeEventListener(type,fn,false);
}else{
if(elm.detachEvent){
elm.detachEvent("on"+type,fn);
}
}
},addEventListener:function(elm,type,fn,_150){
var elms=this.$A(elm);
this.map(elms,function(elmz){
if(_150){
fn=this.listenOnce(elmz,type,fn);
}
if(AJS.isIn(type,["submit","load","scroll","resize"])){
var old=elm["on"+type];
elm["on"+type]=function(){
if(old){
fn(arguments);
return old(arguments);
}else{
return fn(arguments);
}
};
return;
}
if(elmz.attachEvent){
elmz.attachEvent("on"+type,fn);
}else{
if(elmz.addEventListener){
elmz.addEventListener(type,fn,false);
}
}
this.listeners=AJS.$A(this.listeners);
this.listeners.push([elmz,type,fn]);
});
},bind:function(fn,_155,_156,_157){
fn._cscope=_155;
return AJS.GRS(fn,_156,_157);
},listenOnce:function(elm,type,fn){
var r_fn=function(){
AJS.removeEventListener(elm,type,r_fn);
fn(arguments);
};
return r_fn;
},callLater:function(fn,_15d){
var _15e=function(){
fn();
};
window.setTimeout(_15e,_15d);
},keys:function(obj){
var rval=[];
for(var prop in obj){
rval.push(prop);
}
return rval;
},urlencode:function(str){
return encodeURIComponent(str.toString());
},isDefined:function(o){
return (o!="undefined"&&o!=null);
},isArray:function(obj){
try{
if(this.isDefined(obj[0])){
return true;
}else{
return false;
}
}
catch(e){
return false;
}
},isString:function(obj){
return (typeof obj=="string");
},isObject:function(obj){
return (typeof obj=="object");
},isDict:function(o){
var _168=String(o);
return _168.indexOf(" Object")!=-1;
},exportToGlobalScope:function(){
for(e in AJS){
eval(e+" = this."+e);
}
}};
AJS.$=AJS.getElement;
AJS.$$=AJS.getElement;
AJS.$f=AJS.getFormElement;
AJS.$b=AJS.bind;
AJS.$A=AJS.createArray;
AJS.DI=AJS.documentInsert;
AJS.ACN=AJS.appendChildNodes;
AJS.RCN=AJS.replaceChildNodes;
AJS.AEV=AJS.addEventListener;
AJS.REV=AJS.removeEventListener;
AJS.GRS=AJS.getRealScope;
AJS.$bytc=AJS.getElementsByTagAndClassName;
AJSDeferred=function(req){
this.callbacks=[];
this.req=req;
this.callback=function(res){
while(this.callbacks.length>0){
var fn=this.callbacks.pop();
res=fn(res);
}
};
this.errback=function(e){
alert("Error encountered:\n"+e);
};
this.addErrback=function(fn){
this.errback=fn;
};
this.addCallback=function(fn){
this.callbacks.unshift(fn);
};
this.addCallbacks=function(fn1,fn2){
this.addCallback(fn1);
this.addErrback(fn2);
};
this.sendReq=function(data){
if(AJS.isObject(data)){
var _172=[];
for(k in data){
_172.push(k+"="+AJS.urlencode(data[k]));
}
_172=_172.join("&");
this.req.send(_172);
}else{
if(AJS.isDefined(data)){
this.req.send(data);
}else{
this.req.send("");
}
}
};
};
AJSDeferred.prototype=new AJSDeferred();
AJS.addEventListener(window,"unload",AJS.unloadListeners);

