var Class=function(_1){
var _2=function(){
if(this.initialize&&arguments[0]!="noinit"){
return this.initialize.apply(this,arguments);
}else{
return this;
}
};
for(var _3 in this){
_2[_3]=this[_3];
}
_2.prototype=_1;
return _2;
};
Class.empty=function(){
};
Class.prototype={extend:function(_4){
var _5=new this("noinit");
var _6=function(_7,_8){
if(!_7.apply||!_8.apply){
return false;
}
return function(){
this.parent=_7;
return _8.apply(this,arguments);
};
};
for(var _9 in _4){
var _a=_5[_9];
var _b=_4[_9];
if(_a&&_a!=_b){
_b=_6(_a,_b)||_b;
}
_5[_9]=_b;
}
return new Class(_5);
},implement:function(_c){
for(var _d in _c){
this.prototype[_d]=_c[_d];
}
}};
Object.extend=function(){
var _e=arguments;
_e=(_e[1])?[_e[0],_e[1]]:[this,_e[0]];
for(var _f in _e[1]){
_e[0][_f]=_e[1][_f];
}
return _e[0];
};
Object.Native=function(){
for(var i=0;i<arguments.length;i++){
arguments[i].extend=Class.prototype.implement;
}
};
new Object.Native(Function,Array,String,Number,Class);
if(typeof HTMLElement=="undefined"){
var HTMLElement=Class.empty;
HTMLElement.prototype={};
}else{
HTMLElement.prototype.htmlElement=true;
}
window.extend=document.extend=Object.extend;
var Window=window;
function $type(obj){
if(obj===null||obj===undefined){
return false;
}
var _12=typeof obj;
if(_12=="object"){
if(obj.htmlElement){
return "element";
}
if(obj.push){
return "array";
}
if(obj.nodeName){
switch(obj.nodeType){
case 1:
return "element";
case 3:
return obj.nodeValue.test(/\S/)?"textnode":"whitespace";
}
}
}
return _12;
}
function $chk(obj){
return !!(obj||obj===0);
}
function $pick(obj,_15){
return ($type(obj))?obj:_15;
}
function $random(min,max){
return Math.floor(Math.random()*(max-min+1)+min);
}
function $clear(_18){
clearTimeout(_18);
clearInterval(_18);
return null;
}
if(window.ActiveXObject){
window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true;
}else{
if(document.childNodes&&!document.all&&!navigator.taintEnabled){
window.khtml=true;
}else{
if(document.getBoxObjectFor!=null){
window.gecko=true;
}
}
}
if(window.ie6){
try{
document.execCommand("BackgroundImageCache",false,true);
}
catch(e){
}
}
Array.prototype.forEach=Array.prototype.forEach||function(fn,_1a){
for(var i=0;i<this.length;i++){
fn.call(_1a,this[i],i,this);
}
};
Array.prototype.filter=Array.prototype.filter||function(fn,_1d){
var _1e=[];
for(var i=0;i<this.length;i++){
if(fn.call(_1d,this[i],i,this)){
_1e.push(this[i]);
}
}
return _1e;
};
Array.prototype.map=Array.prototype.map||function(fn,_21){
var _22=[];
for(var i=0;i<this.length;i++){
_22[i]=fn.call(_21,this[i],i,this);
}
return _22;
};
Array.prototype.every=Array.prototype.every||function(fn,_25){
for(var i=0;i<this.length;i++){
if(!fn.call(_25,this[i],i,this)){
return false;
}
}
return true;
};
Array.prototype.some=Array.prototype.some||function(fn,_28){
for(var i=0;i<this.length;i++){
if(fn.call(_28,this[i],i,this)){
return true;
}
}
return false;
};
Array.prototype.indexOf=Array.prototype.indexOf||function(_2a,_2b){
_2b=_2b||0;
if(_2b<0){
_2b=Math.max(0,this.length+_2b);
}
while(_2b<this.length){
if(this[_2b]===_2a){
return _2b;
}
_2b++;
}
return -1;
};
Array.extend({each:Array.prototype.forEach,copy:function(_2c,_2d){
_2c=_2c||0;
if(_2c<0){
_2c=this.length+_2c;
}
_2d=_2d||(this.length-_2c);
var _2e=[];
for(var i=0;i<_2d;i++){
_2e[i]=this[_2c++];
}
return _2e;
},remove:function(_30){
var i=0;
while(i<this.length){
if(this[i]===_30){
this.splice(i,1);
}else{
i++;
}
}
return this;
},test:function(_32,_33){
return this.indexOf(_32,_33)!=-1;
},extend:function(_34){
for(var i=0;i<_34.length;i++){
this.push(_34[i]);
}
return this;
},associate:function(_36){
var obj={},_38=Math.min(this.length,_36.length);
for(var i=0;i<_38;i++){
obj[_36[i]]=this[i];
}
return obj;
}});
function $A(_3a,_3b,_3c){
return Array.prototype.copy.call(_3a,_3b,_3c);
}
function $each(_3d,fn,_3f){
return Array.prototype.forEach.call(_3d,fn,_3f);
}
String.extend({test:function(_40,_41){
return ((typeof _40=="string")?new RegExp(_40,_41):_40).test(this);
},toInt:function(){
return parseInt(this);
},toFloat:function(){
return parseFloat(this);
},camelCase:function(){
return this.replace(/-\D/g,function(_42){
return _42.charAt(1).toUpperCase();
});
},hyphenate:function(){
return this.replace(/\w[A-Z]/g,function(_43){
return (_43.charAt(0)+"-"+_43.charAt(1).toLowerCase());
});
},capitalize:function(){
return this.toLowerCase().replace(/\b[a-z]/g,function(_44){
return _44.toUpperCase();
});
},trim:function(){
return this.replace(/^\s+|\s+$/g,"");
},clean:function(){
return this.replace(/\s{2,}/g," ").trim();
},rgbToHex:function(_45){
var rgb=this.match(/\d{1,3}/g);
return (rgb)?rgb.rgbToHex(_45):false;
},hexToRgb:function(_47){
var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
return (hex)?hex.slice(1).hexToRgb(_47):false;
}});
Array.extend({rgbToHex:function(_49){
if(this.length<3){
return false;
}
if(this[3]&&(this[3]==0)&&!_49){
return "transparent";
}
var hex=[];
for(var i=0;i<3;i++){
var bit=(this[i]-0).toString(16);
hex.push((bit.length==1)?"0"+bit:bit);
}
return _49?hex:"#"+hex.join("");
},hexToRgb:function(_4d){
if(this.length!=3){
return false;
}
var rgb=[];
for(var i=0;i<3;i++){
rgb.push(parseInt((this[i].length==1)?this[i]+this[i]:this[i],16));
}
return _4d?rgb:"rgb("+rgb.join(",")+")";
}});
Number.extend({toInt:function(){
return parseInt(this);
},toFloat:function(){
return parseFloat(this);
}});
Function.extend({create:function(_50){
var fn=this;
_50=Object.extend({"bind":fn,"event":false,"arguments":null,"delay":false,"periodical":false,"attempt":false},_50||{});
if($chk(_50.arguments)&&$type(_50.arguments)!="array"){
_50.arguments=[_50.arguments];
}
return function(_52){
var _53;
if(_50.event){
_52=_52||window.event;
_53=[(_50.event===true)?_52:new _50.event(_52)];
if(_50.arguments){
_53=_53.concat(_50.arguments);
}
}else{
_53=_50.arguments||arguments;
}
var _54=function(){
return fn.apply(_50.bind,_53);
};
if(_50.delay){
return setTimeout(_54,_50.delay);
}
if(_50.periodical){
return setInterval(_54,_50.periodical);
}
if(_50.attempt){
try{
return _54();
}
catch(err){
return err;
}
}
return _54();
};
},pass:function(_55,_56){
return this.create({"arguments":_55,"bind":_56});
},attempt:function(_57,_58){
return this.create({"arguments":_57,"bind":_58,"attempt":true})();
},bind:function(_59,_5a){
return this.create({"bind":_59,"arguments":_5a});
},bindAsEventListener:function(_5b,_5c){
return this.create({"bind":_5b,"event":true,"arguments":_5c});
},delay:function(ms,_5e,_5f){
return this.create({"delay":ms,"bind":_5e,"arguments":_5f})();
},periodical:function(ms,_61,_62){
return this.create({"periodical":ms,"bind":_61,"arguments":_62})();
}});
var Element=new Class({initialize:function(el){
if($type(el)=="string"){
el=document.createElement(el);
}
return $(el);
}});
function $(el){
if(!el){
return false;
}
if(el._element_extended_||[window,document].test(el)){
return el;
}
if($type(el)=="string"){
el=document.getElementById(el);
}
if($type(el)!="element"){
return false;
}
if(["object","embed"].test(el.tagName.toLowerCase())||el.extend){
return el;
}
el._element_extended_=true;
Garbage.collect(el);
el.extend=Object.extend;
if(!(el.htmlElement)){
el.extend(Element.prototype);
}
return el;
}
var Elements=new Class({});
new Object.Native(Elements);
document.getElementsBySelector=document.getElementsByTagName;
function $$(){
if(!arguments){
return false;
}
if(arguments.length==1){
if(!arguments[0]){
return false;
}
if(arguments[0]._elements_extended_){
return arguments[0];
}
}
var _65=[];
$each(arguments,function(_66){
switch($type(_66)){
case "element":
_65.push($(_66));
break;
case "string":
_66=document.getElementsBySelector(_66);
default:
if(_66.length){
$each(_66,function(el){
if($(el)){
_65.push(el);
}
});
}
}
});
_65._elements_extended_=true;
return Object.extend(_65,new Elements);
}
Elements.Multi=function(_68){
return function(){
var _69=arguments;
var _6a=[];
var _6b=true;
$each(this,function(el){
var _6d=el[_68].apply(el,_69);
if($type(_6d)!="element"){
_6b=false;
}
_6a.push(_6d);
});
if(_6b){
_6a=$$(_6a);
}
return _6a;
};
};
Element.extend=function(_6e){
for(var _6f in _6e){
HTMLElement.prototype[_6f]=_6e[_6f];
Element.prototype[_6f]=_6e[_6f];
Elements.prototype[_6f]=Elements.Multi(_6f);
}
};
Element.extend({inject:function(el,_71){
el=$(el)||new Element(el);
switch(_71){
case "before":
$(el.parentNode).insertBefore(this,el);
break;
case "after":
if(!el.getNext()){
$(el.parentNode).appendChild(this);
}else{
$(el.parentNode).insertBefore(this,el.getNext());
}
break;
case "inside":
el.appendChild(this);
}
return this;
},injectBefore:function(el){
return this.inject(el,"before");
},injectAfter:function(el){
return this.inject(el,"after");
},injectInside:function(el){
return this.inject(el,"inside");
},adopt:function(el){
this.appendChild($(el)||new Element(el));
return this;
},remove:function(){
this.parentNode.removeChild(this);
return this;
},clone:function(_76){
var el=this.cloneNode(_76!==false);
return $(el);
},replaceWith:function(el){
el=$(el)||new Element(el);
this.parentNode.replaceChild(el,this);
return el;
},appendText:function(_79){
if(window.ie){
switch(this.getTag()){
case "style":
this.styleSheet.cssText=_79;
return this;
case "script":
this.setProperty("text",_79);
return this;
}
}
this.appendChild(document.createTextNode(_79));
return this;
},hasClass:function(_7a){
return this.className.test("(?:^|\\s)"+_7a+"(?:\\s|$)");
},addClass:function(_7b){
if(!this.hasClass(_7b)){
this.className=(this.className+" "+_7b).clean();
}
return this;
},removeClass:function(_7c){
this.className=this.className.replace(new RegExp("(^|\\s)"+_7c+"(?:\\s|$)"),"$1").clean();
return this;
},toggleClass:function(_7d){
return this.hasClass(_7d)?this.removeClass(_7d):this.addClass(_7d);
},setStyle:function(_7e,_7f){
if(_7e=="opacity"){
this.setOpacity(parseFloat(_7f));
}else{
this.style[_7e.camelCase()]=(_7f.push)?"rgb("+_7f.join(",")+")":_7f;
}
return this;
},setStyles:function(_80){
switch($type(_80)){
case "object":
for(var _81 in _80){
this.setStyle(_81,_80[_81]);
}
break;
case "string":
this.style.cssText=_80;
}
return this;
},setOpacity:function(_82){
if(_82==0){
if(this.style.visibility!="hidden"){
this.style.visibility="hidden";
}
}else{
if(this.style.visibility!="visible"){
this.style.visibility="visible";
}
}
if(!this.currentStyle||!this.currentStyle.hasLayout){
this.style.zoom=1;
}
if(window.ie){
this.style.filter="alpha(opacity="+_82*100+")";
}
this.style.opacity=this.opacity=_82;
return this;
},getStyle:function(_83){
_83=_83.camelCase();
var _84=this.style[_83]||false;
if(!$chk(_84)){
if(_83=="opacity"){
return $chk(this.opacity)?this.opacity:1;
}
if(["margin","padding"].test(_83)){
return [this.getStyle(_83+"-top")||0,this.getStyle(_83+"-right")||0,this.getStyle(_83+"-bottom")||0,this.getStyle(_83+"-left")||0].join(" ");
}
if(document.defaultView){
_84=document.defaultView.getComputedStyle(this,null).getPropertyValue(_83.hyphenate());
}else{
if(this.currentStyle){
_84=this.currentStyle[_83];
}
}
}
if(_84=="auto"&&["height","width"].test(_83)){
return this["offset"+_83.capitalize()]+"px";
}
return (_84&&_83.test(/color/i)&&_84.test(/rgb/))?_84.rgbToHex():_84;
},addEvent:function(_85,fn){
this.events=this.events||{};
this.events[_85]=this.events[_85]||{"keys":[],"values":[]};
if(!this.events[_85].keys.test(fn)){
this.events[_85].keys.push(fn);
if(this.addEventListener){
this.addEventListener((_85=="mousewheel"&&window.gecko)?"DOMMouseScroll":_85,fn,false);
}else{
fn=fn.bind(this);
this.attachEvent("on"+_85,fn);
this.events[_85].values.push(fn);
}
}
return this;
},addEvents:function(_87){
if(_87){
for(var _88 in _87){
this.addEvent(_88,_87[_88]);
}
}
return this;
},removeEvent:function(_89,fn){
if(this.events&&this.events[_89]){
var pos=this.events[_89].keys.indexOf(fn);
if(pos==-1){
return this;
}
var key=this.events[_89].keys.splice(pos,1)[0];
if(this.removeEventListener){
this.removeEventListener((_89=="mousewheel"&&window.gecko)?"DOMMouseScroll":_89,key,false);
}else{
this.detachEvent("on"+_89,this.events[_89].values.splice(pos,1)[0]);
}
}
return this;
},removeEvents:function(_8d){
if(this.events){
if(_8d){
if(this.events[_8d]){
this.events[_8d].keys.each(function(fn){
this.removeEvent(_8d,fn);
},this);
this.events[_8d]=null;
}
}else{
for(var _8f in this.events){
this.removeEvents(_8f);
}
this.events=null;
}
}
return this;
},fireEvent:function(_90,_91){
if(this.events&&this.events[_90]){
this.events[_90].keys.each(function(fn){
fn.bind(this,_91)();
},this);
}
},getBrother:function(_93){
var el=this[_93+"Sibling"];
while($type(el)=="whitespace"){
el=el[_93+"Sibling"];
}
return $(el);
},getPrevious:function(){
return this.getBrother("previous");
},getNext:function(){
return this.getBrother("next");
},getFirst:function(){
var el=this.firstChild;
while($type(el)=="whitespace"){
el=el.nextSibling;
}
return $(el);
},getLast:function(){
var el=this.lastChild;
while($type(el)=="whitespace"){
el=el.previousSibling;
}
return $(el);
},getParent:function(){
return $(this.parentNode);
},getChildren:function(){
return $$(this.childNodes);
},setProperty:function(_97,_98){
switch(_97){
case "class":
this.className=_98;
break;
case "style":
this.setStyles(_98);
break;
case "name":
if(window.ie6){
var el=$(document.createElement("<"+this.getTag()+" name=\""+_98+"\" />"));
$each(this.attributes,function(_9a){
if(_9a.name!="name"){
el.setProperty(_9a.name,_9a.value);
}
});
if(this.parentNode){
this.replaceWith(el);
}
return el;
}
default:
this.setAttribute(_97,_98);
}
return this;
},setProperties:function(_9b){
for(var _9c in _9b){
this.setProperty(_9c,_9b[_9c]);
}
return this;
},setHTML:function(){
this.innerHTML=$A(arguments).join("");
return this;
},getProperty:function(_9d){
return (_9d=="class")?this.className:this.getAttribute(_9d);
},getTag:function(){
return this.tagName.toLowerCase();
},scrollTo:function(x,y){
this.scrollLeft=x;
this.scrollTop=y;
},getValue:function(){
switch(this.getTag()){
case "select":
if(this.selectedIndex!=-1){
var opt=this.options[this.selectedIndex];
return opt.value||opt.text;
}
break;
case "input":
if(!(this.checked&&["checkbox","radio"].test(this.type))&&!["hidden","text","password"].test(this.type)){
break;
}
case "textarea":
return this.value;
}
return false;
},getSize:function(){
return {"scroll":{"x":this.scrollLeft,"y":this.scrollTop},"size":{"x":this.offsetWidth,"y":this.offsetHeight},"scrollSize":{"x":this.scrollWidth,"y":this.scrollHeight}};
},getPosition:function(_a1){
_a1=_a1||[];
var el=this,_a3=0,top=0;
do{
_a3+=el.offsetLeft||0;
top+=el.offsetTop||0;
el=el.offsetParent;
}while(el);
_a1.each(function(_a5){
_a3-=_a5.scrollLeft||0;
top-=_a5.scrollTop||0;
});
return {"x":_a3,"y":top};
},getTop:function(){
return this.getPosition().y;
},getLeft:function(){
return this.getPosition().x;
},getCoordinates:function(_a6){
var _a7=this.getPosition(_a6);
var obj={"width":this.offsetWidth,"height":this.offsetHeight,"left":_a7.x,"top":_a7.y};
obj.right=obj.left+obj.width;
obj.bottom=obj.top+obj.height;
return obj;
}});
window.addEvent=document.addEvent=Element.prototype.addEvent;
window.removeEvent=document.removeEvent=Element.prototype.removeEvent;
window.removeEvents=document.removeEvents=Element.prototype.removeEvents;
var Garbage={elements:[],collect:function(_a9){
Garbage.elements.push(_a9);
},trash:function(){
Garbage.collect(window);
Garbage.collect(document);
Garbage.elements.each(function(el){
el.removeEvents();
for(var p in Element.prototype){
el[p]=null;
}
el.extend=null;
});
}};
window.addEvent("unload",Garbage.trash);
var Event=new Class({initialize:function(_ac){
this.event=_ac||window.event;
this.type=this.event.type;
this.target=this.event.target||this.event.srcElement;
if(this.target.nodeType==3){
this.target=this.target.parentNode;
}
this.shift=this.event.shiftKey;
this.control=this.event.ctrlKey;
this.alt=this.event.altKey;
this.meta=this.event.metaKey;
if(["DOMMouseScroll","mousewheel"].test(this.type)){
this.wheel=this.event.wheelDelta?(this.event.wheelDelta/(window.opera?-120:120)):-(this.event.detail||0)/3;
}else{
if(this.type.test(/key/)){
this.code=this.event.which||this.event.keyCode;
for(var _ad in Event.keys){
if(Event.keys[_ad]==this.code){
this.key=_ad;
break;
}
}
this.key=this.key||String.fromCharCode(this.code).toLowerCase();
}else{
if(this.type.test(/mouse/)||(this.type=="click")){
this.page={"x":this.event.pageX||this.event.clientX+document.documentElement.scrollLeft,"y":this.event.pageY||this.event.clientY+document.documentElement.scrollTop};
this.client={"x":this.event.pageX?this.event.pageX-window.pageXOffset:this.event.clientX,"y":this.event.pageY?this.event.pageY-window.pageYOffset:this.event.clientY};
this.rightClick=(this.event.which==3)||(this.event.button==2);
switch(this.type){
case "mouseover":
this.relatedTarget=this.event.relatedTarget||this.event.fromElement;
break;
case "mouseout":
this.relatedTarget=this.event.relatedTarget||this.event.toElement;
}
}
}
}
},stop:function(){
this.stopPropagation();
this.preventDefault();
return this;
},stopPropagation:function(){
if(this.event.stopPropagation){
this.event.stopPropagation();
}else{
this.event.cancelBubble=true;
}
return this;
},preventDefault:function(){
if(this.event.preventDefault){
this.event.preventDefault();
}else{
this.event.returnValue=false;
}
return this;
}});
Event.keys={"enter":13,"up":38,"down":40,"left":37,"right":39,"esc":27,"space":32,"backspace":8,"delete":46};
Function.extend({bindWithEvent:function(_ae,_af){
return this.create({"bind":_ae,"arguments":_af,"event":Event});
}});
var Chain=new Class({chain:function(fn){
this.chains=this.chains||[];
this.chains.push(fn);
return this;
},callChain:function(){
if(this.chains&&this.chains.length){
this.chains.shift().delay(10,this);
}
},clearChain:function(){
this.chains=[];
}});
var Events=new Class({addEvent:function(_b1,fn){
if(fn!=Class.empty){
this.events=this.events||{};
this.events[_b1]=this.events[_b1]||[];
if(!this.events[_b1].test(fn)){
this.events[_b1].push(fn);
}
}
return this;
},fireEvent:function(_b3,_b4,_b5){
if(this.events&&this.events[_b3]){
this.events[_b3].each(function(fn){
fn.create({"bind":this,"delay":_b5,"arguments":_b4})();
},this);
}
return this;
},removeEvent:function(_b7,fn){
if(this.events&&this.events[_b7]){
this.events[_b7].remove(fn);
}
return this;
}});
var Options=new Class({setOptions:function(_b9,_ba){
this.options=Object.extend(_b9,_ba);
if(this.addEvent){
for(var _bb in this.options){
if(($type(this.options[_bb])=="function")&&_bb.test(/^on[A-Z]/)){
this.addEvent(_bb,this.options[_bb]);
}
}
}
return this;
}});
var Group=new Class({initialize:function(){
this.instances=$A(arguments);
this.events={};
this.checker={};
},addEvent:function(_bc,fn){
this.checker[_bc]=this.checker[_bc]||{};
this.events[_bc]=this.events[_bc]||[];
if(this.events[_bc].test(fn)){
return false;
}else{
this.events[_bc].push(fn);
}
this.instances.each(function(_be,i){
_be.addEvent(_bc,this.check.bind(this,[_bc,_be,i]));
},this);
return this;
},check:function(_c0,_c1,i){
this.checker[_c0][i]=true;
var _c3=this.instances.every(function(_c4,j){
return this.checker[_c0][j]||false;
},this);
if(!_c3){
return;
}
this.instances.each(function(_c6,j){
this.checker[_c0][j]=false;
},this);
this.events[_c0].each(function(_c8){
_c8.call(this,this.instances,_c1);
},this);
}});
function $E(_c9,_ca){
return ($(_ca)||document).getElement(_c9);
}
function $ES(_cb,_cc){
return ($(_cc)||document).getElementsBySelector(_cb);
}
Element.extend({getElements:function(_cd){
var _ce=[];
_cd.clean().split(" ").each(function(sel,i){
var _d1=sel.match(/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([*^$]?=)["']?([^"'\]]*)["']?)?])?$/);
if(!_d1){
return;
}
Filters.selector=_d1;
_d1[1]=_d1[1]||"*";
if(i==0){
if(_d1[2]){
var el=this.getElementById(_d1[2]);
if(!el||((_d1[1]!="*")&&(Element.prototype.getTag.call(el)!=_d1[1]))){
return;
}
_ce=[el];
}else{
_ce=$A(this.getElementsByTagName(_d1[1]));
}
}else{
_ce=Elements.prototype.getElementsByTagName.call(_ce,_d1[1],true);
if(_d1[2]){
_ce=_ce.filter(Filters.id);
}
}
if(_d1[3]){
_ce=_ce.filter(Filters.className);
}
if(_d1[4]){
_ce=_ce.filter(Filters.attribute);
}
},this);
return $$(_ce);
},getElementById:function(id){
var el=document.getElementById(id);
if(!el){
return false;
}
for(var _d5=el.parentNode;_d5!=this;_d5=_d5.parentNode){
if(!_d5){
return false;
}
}
return el;
},getElement:function(_d6){
return this.getElementsBySelector(_d6)[0];
},getElementsBySelector:function(_d7){
var els=[];
_d7.split(",").each(function(sel){
els.extend(this.getElements(sel));
},this);
return $$(els);
}});
document.extend({getElementsByClassName:function(_da){
return document.getElements("."+_da);
},getElement:Element.prototype.getElement,getElements:Element.prototype.getElements,getElementsBySelector:Element.prototype.getElementsBySelector});
var Filters={selector:[],id:function(el){
return (el.id==Filters.selector[2]);
},className:function(el){
return (Element.prototype.hasClass.call(el,Filters.selector[3]));
},attribute:function(el){
var _de=el.getAttribute(Filters.selector[4]);
if(!_de){
return false;
}
var _df=Filters.selector[5];
if(!_df){
return true;
}
var _e0=Filters.selector[6];
switch(_df){
case "*=":
return (_de.test(_e0));
case "=":
return (_de==_e0);
case "^=":
return (_de.test("^"+_e0));
case "$=":
return (_de.test(_e0+"$"));
}
return false;
}};
Elements.extend({getElementsByTagName:function(_e1){
var _e2=[];
this.each(function(el){
_e2.extend(el.getElementsByTagName(_e1));
});
return _e2;
}});
window.extend({addEvent:function(_e4,fn){
if(_e4=="domready"){
if(this.loaded){
fn();
}else{
if(!this.events||!this.events.domready){
var _e6=function(){
if(this.loaded){
return;
}
this.loaded=true;
if(this.timer){
this.timer=$clear(this.timer);
}
Element.prototype.fireEvent.call(this,"domready");
this.events.domready=null;
}.bind(this);
if(document.readyState&&this.khtml){
this.timer=function(){
if(["loaded","complete"].test(document.readyState)){
_e6();
}
}.periodical(50);
}else{
if(document.readyState&&this.ie){
var src=(window.location.protocol=="https:")?"://0":"javascript:void(0)";
document.write("<script id=\"ie_ready\" defer src=\""+src+"\"></script>");
$("ie_ready").onreadystatechange=function(){
if(this.readyState=="complete"){
_e6();
}
};
}else{
this.addEvent("load",_e6);
document.addEvent("DOMContentLoaded",_e6);
}
}
}
}
}
Element.prototype.addEvent.call(this,_e4,fn);
return this;
},onDomReady:function(_e8){
return this.addEvent("domready",_e8);
}});
window.extend({getWidth:function(){
if(this.khtml){
return this.innerWidth;
}
if(this.opera){
return document.body.clientWidth;
}
return document.documentElement.clientWidth;
},getHeight:function(){
if(this.khtml){
return this.innerHeight;
}
if(this.opera){
return document.body.clientHeight;
}
return document.documentElement.clientHeight;
},getScrollWidth:function(){
if(this.ie){
return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);
}
if(this.khtml){
return document.body.scrollWidth;
}
return document.documentElement.scrollWidth;
},getScrollHeight:function(){
if(this.ie){
return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);
}
if(this.khtml){
return document.body.scrollHeight;
}
return document.documentElement.scrollHeight;
},getScrollLeft:function(){
return this.pageXOffset||document.documentElement.scrollLeft;
},getScrollTop:function(){
return this.pageYOffset||document.documentElement.scrollTop;
},getSize:function(){
return {"size":{"x":this.getWidth(),"y":this.getHeight()},"scrollSize":{"x":this.getScrollWidth(),"y":this.getScrollHeight()},"scroll":{"x":this.getScrollLeft(),"y":this.getScrollTop()}};
},getPosition:function(){
return {"x":0,"y":0};
}});
var Tips=new Class({getOptions:function(){
return {onShow:function(tip){
tip.setStyle("visibility","visible");
},onHide:function(tip){
tip.setStyle("visibility","hidden");
},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{"x":16,"y":16},fixed:false};
},initialize:function(_eb,_ec){
this.setOptions(this.getOptions(),_ec);
this.toolTip=new Element("div").addClass(this.options.className+"-tip").setStyles({"position":"absolute","top":"0","left":"0","visibility":"hidden"}).injectInside(document.body);
this.wrapper=new Element("div").injectInside(this.toolTip);
$each(_eb,function(el){
this.build($(el));
},this);
if(this.options.initialize){
this.options.initialize.call(this);
}
},build:function(el){
el.myTitle=el.href?el.href.replace("http://",""):(el.rel||false);
if(el.title){
var _ef=el.title.split("::");
if(_ef.length>1){
el.myTitle=_ef[0].trim();
el.myText=_ef[1].trim();
}else{
el.myText=el.title;
}
el.removeAttribute("title");
}else{
el.myText=false;
}
if(el.myTitle&&el.myTitle.length>this.options.maxTitleChars){
el.myTitle=el.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;";
}
el.addEvent("mouseover",function(_f0){
this.start(el);
this.locate(_f0);
}.bindWithEvent(this));
if(!this.options.fixed){
el.addEvent("mousemove",this.locate.bindWithEvent(this));
}
el.addEvent("mouseout",this.end.bindWithEvent(this));
},start:function(el){
this.wrapper.setHTML("");
if(el.myTitle){
new Element("span").injectInside(new Element("div").addClass(this.options.className+"-title").injectInside(this.wrapper)).setHTML(el.myTitle);
}
if(el.myText){
new Element("span").injectInside(new Element("div").addClass(this.options.className+"-text").injectInside(this.wrapper)).setHTML(el.myText);
}
$clear(this.timer);
this.timer=this.show.delay(this.options.showDelay,this);
},end:function(_f2){
$clear(this.timer);
this.timer=this.hide.delay(this.options.hideDelay,this);
_f2.stop();
},locate:function(_f3){
var win={"x":window.getWidth(),"y":window.getHeight()};
var _f5={"x":window.getScrollLeft(),"y":window.getScrollTop()};
var tip={"x":this.toolTip.offsetWidth,"y":this.toolTip.offsetHeight};
var _f7={"x":"left","y":"top"};
for(var z in _f7){
var pos=_f3.page[z]+this.options.offsets[z];
if((pos+tip[z]-_f5[z])>win[z]){
pos=_f3.page[z]-this.options.offsets[z]-tip[z];
}
this.toolTip.setStyle(_f7[z],pos+"px");
}
_f3.stop();
},show:function(){
this.fireEvent("onShow",[this.toolTip]);
},hide:function(){
this.fireEvent("onHide",[this.toolTip]);
}});
Tips.implement(new Events);
Tips.implement(new Options);

