rr={'ver':'minicore 0.2'};
new function(){
var d=document,w=window,ua,av=navigator,v,i,f,z={},
zO,zW,zG,zI;
ua=av.userAgent,av=av.appVersion;
z.j2me=/J2ME[\/]/.test(av);
zO=!!(w.opera&&opera.buildNumber);
zW=/WebKit/.test(ua);
zG=!zW&&/Gecko/.test(ua);
zI=!zW&&!zO&&(/Explorer/gi).test(navigator.appName);
v=(ua.match(/.+(rv|WebKit|era|ie|MSIE|orer)[\/: ](\d+(\.\d+)?)/)||[])[2]-0;
z.Kqn=z.Opera=z.Gecko=z.IE=z.webkit=z.WebKit=z.flash=NaN;
if(/Konqueror/.test(ua)){
v=z.Kqn=3;
}else
if(zW){
v=z.webkit=parseInt(v,10);
z.WebKit=v>599?4:v>499?3:v>399?2:1;
}else
if(zO){
v=z.Opera=v;
}else
if(zG||!zI){
if(v<1.9&&d.getElementsByClassName)v=1.9;
v=z.Gecko=v||1.8;
}else v=z.IE=d.documentMode||v;
z.qIE=z.IE&&d.compatMode!="CSS1Compat";
z.ok=!!(z.Opera>=9||z.IE>=6||z.Gecko||z.webkit>499)&&!z.Kqn;
z.verb=v;
try{
f=!z.Kqn&&(/(\d+)\./).exec(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin.description)[1]||false;
}catch(e){f=false};
if(!f&&z.IE&&window.ActiveXObject){
try{
f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
f=f&&f.GetVariable("$version");
}catch(e){};
f=f&&(/WIN\s+(\d+)/).exec(f);
f=(f&&f[1])||false;
};
z.flash=f&&parseInt(f)||NaN;
if(!w._static_host)z.debug=true;
$is=rr.is=z;
rr.Opera=z.Opera;
rr.Gecko=z.Gecko;
rr.IE=z.IE;
rr.qIE=z.qIE;
rr.WebKit=z.webkit;
rr.SWF=rr.FlashPlayer=z.flash;
};
if(rr.IE==6)try{document.execCommand("BackgroundImageCache",false,true)}catch(oh){};
addInitDOM=rr.addInitDOM=rr.domReady=new function(){
var init,add;
new function(){
var callback=[],
callback_init=[],
contentLoaded=false,
jsl,d=document,h,s;
add=function(fn,x){
if(fn=='initDOM'){
return setTimeout(init,123);
};
if(fn=='fastInit')init();
if(typeof fn=='function'){
if((rr.include&&!jsl&&x)||!contentLoaded){
x=rr.include&&x?callback_init:callback;
x[x.length]=fn;
}else fn();
};
};
init=function(){
if(!contentLoaded){
contentLoaded=add.status=true;
_init(callback);
if(rr.include){
rr.include.addEvComplet(start);
}else jsl=true;
};
};
function start(){
if(jsl)return;
jsl=true;
_init(callback_init);
};
function _init(c,em){
var x,i=0;
while(x=c[i++]){
try{x()}catch(e){
setTimeout(function(){throw e},0);
};
};
c.length=0;
};
};
new function(){
var d=document,
w=window,s,tm,
g=init;
if(!/loaded|complete/.test(d.readyState+"")){
new function(){
var ol=w.onload;
w.onload=ol?function(){g();ol();w.onload=null}:g;
};
if(rr.IE){
w.attachEvent("onload",g);
d.write('<script id="__ie_onload" defer="defer" src="javascript:void(0)"></script>');
if(s=d.getElementById("__ie_onload")){
s.id='';
s.onreadystatechange=function(){
if(this.readyState=="complete")g();
};
};
return;
}
if(d.addEventListener){
d.addEventListener("DOMContentLoaded",g,false);
w.addEventListener("load",g,false);
};
if(rr.WebKit||rr.Opera<9){
tm=setInterval(function(){
if(/loaded|complete/.test(d.readyState)){
clearInterval(tm);
g()
}
},10)
};
}else g();
};
return add;
};
new function(d){
d=d||document;
if(typeof d.activeElement!='undefined'||!d.addEventListener||rr.Opera<8)return;
d.activeElement=d.body;
if(d.defaultView.getSelection)d.activeElement=d.defaultView.getSelection().focusNode||d.body;
function setIfr(nd){
nd.__setEvActiveElement=true;
var w=nd.contentWindow;
w.addEventListener('focus',function(e){
d.activeElement=nd;
},true);
w.addEventListener('blur',_blur_=function(e){
d.activeElement=d.body;
},true);
};
d.defaultView.addEventListener('focus',_focus_=function(e){
var t=e.target;
d.activeElement=(t==d||t==d.defaultView)?d.body:t;
},true);
d.defaultView.addEventListener('blur',_blur_=function(e){
var ar=d.getElementsByTagName("iframe"),l=ar.length,i;
for(i=0;i<l;i++)
if(ar[i].contentWindow&&!ar[i].__setEvActiveElement)setIfr(ar[i]);
ar=l=null;
d.activeElement=d.body;
},true);
};
if(rr.IE)new function(d){
d=d||document;
new function(){
var pnd;
d.attachEvent('onbeforeeditfocus',function(){
var nd=window.event.srcElement;
if(typeof nd.caret_pos=='undefined'){
setup(nd,pnd!=nd);
};
pnd==null;
});
d.attachEvent('onmouseup',function(){pnd=null});
d.attachEvent('onmousedown',function(){
pnd=window.event.srcElement;
pnd.selectionEnd=pnd.selectionStart=null;
});
};
function setup(nd,fs){
nd.caret_pos=false;
nd.attachEvent('onmousedown',function(){
nd.caret_pos=null;
nd.selectionEnd=nd.selectionStart=null;
});
nd.attachEvent('onfocus',function(){
if(typeof nd.selectionStart=='number'){
var r=nd.createTextRange(),n,u;
r.collapse(true);
r.moveStart('character',nd.selectionStart||0);
n=(nd.selectionEnd-nd.selectionStart)||0;
if(n>0)r.moveEnd('character',n);
r.select();
nd.selectionEnd=nd.selectionStart=u;
}else
if(nd.caret_pos)nd.caret_pos.select();
nd.caret_pos=null;
});
if(fs&&typeof nd.selectionStart!=='number')nd.selectionEnd=nd.selectionStart=0;
nd.attachEvent('onbeforedeactivate',function(){
nd.caret_pos=d.selection.createRange().duplicate();
});
};
};
if(!Date.now){Date.now=function(){return(new Date()).getTime();};};
if(typeof document.defaultView=='undefined'){document.defaultView={getComputedStyle:function(el,p){return el.currentStyle;}};};
new function(){
var ap=Array.prototype;
if(!ap.pop){ap.pop=function(){var last;if(this.length){last=this[this.length-1];this.length-=1;}return last;};}
if(!ap.push){ap.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i];}return this.length;};}
if(!ap.shift){ap.shift=function(){var first;if(this.length){first=this[0];for(var i=0;i<this.length-1;++i){this[i]=this[i+1];}this.length-=1;}return first;};}
if(!ap.unshift){ap.unshift=function(){if(arguments.length){var i,len=arguments.length;for(i=this.length+len-1;i>=len;--i){this[i]=this[i-len];}for(i=0;i<len;++i){this[i]=arguments[i];}}return this.length;};}
if(!ap.splice){ap.splice=function(index,howMany){var elements=[],removed=[],i;for(i=2;i<arguments.length;++i){elements.push(arguments[i]);}for(i=index;(i<index+howMany)&&(i<this.length);++i){removed.push(this[i]);}for(i=index+howMany;i<this.length;++i){this[i-howMany]=this[i];}this.length-=removed.length;for(i=this.length+elements.length-1;i>=index+elements.length;--i){this[i]=this[i-elements.length];}for(i=0;i<elements.length;++i){this[index+i]=elements[i];}return removed;};}
ap=Object.prototype;
if(!ap.hasOwnProperty)ap.hasOwnProperty=function(x){
if(x in this)try{
var p=this.constructor.prototype;
if(p[x]!==this[x]||!(x in p))return true;
}catch(e){return true};
return false;
};
ap=null;
};
new function(){
var fp=Function.prototype,
nm='__this_function_';
if(!fp.call){
fp.call=function(o){
var a=arguments,
l=a.length,
r,i,ag,un;
if(o===i||o===null)o=window;
o[nm]=this;
if(l>3){
for(i=1,ag=[];i<l;i++)ag[ag.length]='a['+i+']'
r=eval('o.'+nm+'('+ag.join(',')+')');
}else r=(l==3?o[nm](a[1],a[2]):l==2?o[nm](a[1]):o[nm]());
if(o[nm]==this)try{delete(o[nm])}catch(e){o[nm]=un};
return r;
};
};
if(!fp.apply){
fp.apply=function(o,a){
var l=a&&a.length||0,
r,i,ag,un;
if(o===i||o===null)o=window;
o[nm]=this;
if(l>2){
ag=[];while(l--)ag[l]=l;
r=eval('o.'+nm+'(a['+ag.join('],a[')+'])');
}else r=(l==2?o[nm](a[0],a[1]):l==1?o[nm](a[0]):o[nm]());
if(o[nm]==this)try{delete(o[nm])}catch(e){o[nm]=un};
return r;
};
};
};
rr._extend=function(o,a){
var i=a.length,n,e;
while(i--)if(e=a[i]){
for(n in e)
if(typeof e[n]!=='undefined'&&e.hasOwnProperty(n))
o[n]=e[n];
};
return this;
};
if(!Function.prototype.bind){
(Function.prototype.bind=function(o,f){
f=this;
return function(){return f.apply(o,arguments)};
}).bind=Function()();
};
if(!Function.prototype.extendPrototype){
Function.prototype.extendPrototype=function(e){
rr._extend(this.prototype,arguments);
return this;
};
};
if(!Function.prototype.extendObject){
Function.prototype.extendObject=function(e){
rr._extend(this,arguments);
return this;
};
};
if(!window.trim){
function trim(str){
if(typeof str=='number')return str.toString();
return typeof str=='string'?str.replace(/^[\s\xA0]+/,'').replace(/[\s\xA0]+$/,''):'';
};
};
rr.extendNS=function(o,n,ext){
var i,v;
if(!n&&!ext){
n=o;o=i;
};
o=o||window;
n=n.split('.');
for(i=0;i<n.length;i++){
if(!n[i])continue;
if(v){
if(!o[v])o[v]={};
o=o[v];
}
v=n[i];
};
if(!o[v])o[v]=ext||{};
o=o[v];
return o;
};
rr.extend=function(o,e){
var i=0,a=arguments,n;
if(typeof o=='string')o=this.extendNS(o);
if(!o)o={};
while(e=a[++i])
for(n in e)
if(e.hasOwnProperty(n))
o[n]=e[n];
return o;
};
new function(){
function crFn(){
return function(){
return arguments.callee.$func.apply(arguments.callee,arguments)
};
};
rr.init=function(n,o){
if(!n&&!o)return;
var tn=!o&&typeof n,
a=arguments,
l=a.lenght,
m,i,fn,xf;
if(tn=='function')return this.domReady(n,true);
if(tn=='object'){o=n;n=null};
if(typeof o.$func=='function'){
xf=crFn();
};
if(typeof n=='string'){
n=this.extendNS(null,n,xf||o.$);
}else n=xf||o.$||{};
if(l>2){
for(i=1,m=[n];i<l;i++)m.push(a[i]);
}else m=[n,o];
n=this.extend.apply(this,m);
if(n.$)delete(n.$);
if(typeof(fn=n.$domReady)=='function'){
this.domReady(fn.bind(n));
};
if(typeof(fn=n.$init)=='function'){
this.domReady(fn.bind(n),true);
};
return n;
};
};
rr.textSel={
set:function(n,s,e){
s=s||0;e=e||s;
var r;
if(n.setSelectionRange){
return n.setSelectionRange(s,e);
};
if((n.ownerDocument||document).activeElement!==n){
n.selectionStart=s;
n.selectionEnd=e;
return;
};
r=n.createTextRange();
r.collapse(true);
r.moveStart('character',s);
e=e-s;
if(e>0)r.moveEnd('character',e);
r.select();
},
get:function(n){
if(n.setSelectionRange){
return{start:n.selectionStart,end:n.selectionEnd};
}
var r=(n.ownerDocument||document).selection.createRange().duplicate(),
ps={},x=-1,
e=r.parentElement(),l;
if(e!==n)return{start:n.selectionStart,end:n.selectionEnd};
l=r.text.length
n.selectionStart=n.selectionEnd=null;
r.moveStart('character',-n.value.length);
x=r.text.length;
return{start:x,end:x+l};
},
collapse:function(n,f){
this.set(n,f?0:n.value);
}
};
new function(){
function x(r,v){
return function(v){return v&&r.test(v)?parseInt(v,10):null;}
};
rr.getPx=x(/px/i);
rr.getEm=x(/em/i);
rr.getEx=x(/ex/i);
rr.getPc=x(/%/i);
};
rr.$=function(e,d){
return typeof e==='string'?(d||document).getElementById(e):e;
};
rr.extend(rr,{
gId:rr.$,
newFunction:function(){
return function(){};
},
newTemplet:function(p,e){
var c=this.newFunction(),a=arguments.length;
c.prototype=p;
c=new c();
if(a<3)return this.extend(c,e);
a=Array.prototype.slice.call(arguments);
a[0]=c;
return this.extend.apply(this,a[0]);
},
each:function(o,cb,pr){
if(!o)return;
var i,l=o.length;
if(l!==i){
i=0;
if(o.item){
while(i<l){
if(cb(o.item(i),i++,pr)===false)
return
};
return true;
};
while(i<l){
if(cb(o[i],i++,pr)===false)
return
};
}else for(i in o)if(o.hasOwnProperty(i)){
if(cb(o[i],i,pr)===false)return;
};
return true;
},
addHandler:function(o,e,h,fl){
if(!o||!e||!h)return'error';
if(e=='mouseScroll')e=rr.Gecko?'DOMMouseScroll':'mousewheel';
if(typeof o.addEventListener!='undefined')
o.addEventListener(e,h,fl||false);
else if(typeof o.attachEvent!='undefined'){
o.attachEvent('on'+e,h,fl||false);
}else throw"Incompatible browser";
return h;
},
removeHandler:function(o,e,h){
if(!o||!e||!h)return'error';
if(e=='mouseScroll')e=rr.Gecko?'DOMMouseScroll':'mousewheel';
if(typeof o.removeEventListener!='undefined')
o.removeEventListener(e,h,false);
else if(typeof o.detachEvent!='undefined')
o.detachEvent('on'+e,h);
else throw"Incompatible browser";
},
getClientWH:function(d,x){
d=d||document;
var b=rr.WebKit||rr.qIE?d.body:d.documentElement;
if(!b)return;
return{
w:rr.IE?b.offsetWidth:d.defaultView.innerWidth,
h:rr.IE?b.offsetHeight:d.defaultView.innerHeight,
st:x||b.scrollTop,
sl:x||b.scrollLeft,
sw:x||b.scrollWidth,
sh:x||b.scrollHeight
};
},
getAbsolutePos:document.documentElement.getBoundingClientRect?function(el){
if(!el||!el.getBoundingClientRect)return;
var bx=el.getBoundingClientRect(),
w=window,d=document,dE=d.documentElement,b=d.body;
return{
y:bx.top+(w.pageYOffset||dE.scrollTop||b&&b.scrollTop||0)-(dE.clientTop||b&&b.clientTop||0),
x:bx.left+(w.pageXOffset||dE.scrollLeft||b&&b.scrollLeft||0)-(dE.clientLeft||b&&b.clientLeft||0)
};
}:function(el){
var r={x:el.offsetLeft,y:el.offsetTop},tmp,op=el.offsetParent;
if(op){
tmp=arguments.callee(op);
if(!op.offsetParent)return r;
if(rr.IE&&op.tagName=='HTML')return r;
r.x+=tmp.x-op.scrollLeft;
r.y+=tmp.y-op.scrollTop;
}
return r;
},
getParentNode:function(t,nd,f){
t=(t&&t.toUpperCase())||'TR';
if(!f&&nd)nd=nd.parentNode;
var tag;
while(tag=nd&&nd.tagName){
if(tag==t)return nd;
nd=nd.parentNode;
};
},
getAtt:function(nd,nm){
if(nd)
if(!nd.getAttributeNode){
return nd.getAttribute(nm);
}else if(nm=nd.getAttributeNode(nm))return nm.value;
},
removeAtt:function(nd,nm){
if(nd)
if(!nd.getAttributeNode){
nd.removeAttribute(nm);
}else if(nm=nd.getAttributeNode(nm))
nd.removeAttributeNode(nm);
},
getSelectedText:function(w){
w=w||window;
var tx="",s,d=w.document;
if(w.getSelection){
if(typeof(w.getSelection)=="function"){
tx=w.getSelection().toString();
}else tx=d.getSelection();
}else if(d.selection&&d.selection.createRange){
tx=d.selection.createRange().text;
}
return tx;
},
getCStyle:function(o,dv){
o=this.$(o);
if(o)return o.currentStyle||(o.ownerDocument||document).defaultView.getComputedStyle(o,null);
},
setStyle:function(nd,pr){
nd=this.$(nd);
if(typeof pr=='object'){
var st=nd.style,v;
if(typeof pr.cssText!='undefined'){
rr.Opera<9?nd.setAttribute('style',pr.cssText):nd.style.cssText=pr.cssText;
delete(pr.cssText);
};
if(rr.IE<8){
if(typeof(v=pr.opacity)!='undefined'){
st.filter=v!==''?'alpha(opacity='+Math.round(v*100)+')':'';
delete(pr.opacity)
};
};
this.extend(nd.style,pr);
}else rr.Opera<9?nd.setAttribute('style',pr):nd.style.cssText=pr;
},
removeNode:function(nd){
nd=this.gId(nd);
if(!nd||!nd.parentNode)return;
nd=nd.parentNode.removeChild(nd);
if(rr.IE<7&&nd.tagName=='STYLE'){
var s=document.documentElement.style,p=s.borderColor;
s.borderColor=p=='#FFFFFF'?'#FFE':'#FFF';
s.borderColor=p;
};
return nd;
},
createEl_doc:function(d){
d=d&&d.ownerDocument||d;
return function(nd,p){
if(arguments.length>2){
p=Array.prototype.slice.call(arguments);
p.shift();
};
return rr.createEl(nd,p,d);
};
},
createEl:function(tag,pr,doc){
if(!tag)return;
var nn,i,l,n,pa,fc,und;
doc=doc||pr&&pr.document||document;
if(tag=='text'){
return doc.createTextNode(pr||'');
};
if(typeof pr=='string'||pr&&(pr instanceof Array||pr.nodeType||pr.ruiType)){
pa=pr;
pr=null;
}else if(pr)pa=pr.add;
if(fc=typeof tag=='string'){
var id,cl;
i=tag.indexOf("#");
if(i>0){
n=tag;
tag=n.substring(0,i);
id=n.substring(i+1);
};
i=tag.indexOf(".");
if(i>0){
n=tag;
tag=n.substring(0,i);
cl=n.substring(i+1);
};
if(!pr&&(id||cl))pr={};
if(id)pr.id=id;
if(cl)pr.className=(n=pr.className)?cl+" "+n:cl;
if(rr.IE&&tag=='input'){
nn=doc.createElement('<INPUT '+(pr.name?' name="'+pr.name+'"':'')+(pr.type?' type="'+pr.type+'"':'')+' />');
}else nn=doc.createElement(tag);
}else nn=tag;
if(pr){
if(typeof pr.style!=='undefined'){
rr.setStyle(nn,pr.style);
};
for(n in pr){
if(n=='text'||n=='parent'||n=='add'||n=='style'||n=='appendChild'||n=='insertAfter'||n=='insertBefore')continue;
i=pr[n];
if((fc?i!==und:true)&&pr.hasOwnProperty(n)){
nn[n]=i;
};
};
};
if(pa){
var add=function(x){
x=typeof x=='string'?doc.createTextNode(x):(x.ruiType&&x.node)||x;
if(x)nn.appendChild(x);
};
if(pa instanceof Array){
for(i=0,l=pa.length;i<l;i++){
if(n=pa[i])add(n);
};
}else add(pa);
add=null;
};
if(pr){
if(pr.text){
nn.appendChild(doc.createTextNode(pr.text));
};
}else return nn;
var ib,ip;
if(n=pr.insertAfter){
ib=n.nextSibling
if(!ib)ip=n.parentNode;
};
if(n=pr.parent||pr.appendChild||ip){
nn=n.appendChild(nn);
}else
if(n=pr.insertBefore||ib){
nn=n.parentNode.insertBefore(nn,n);
};
return nn;
},
stopEvent:function(e){
e=e||window.event;
if(e.preventDefault){e.preventDefault()}else{e.returnValue=false};
if(e.stopPropagation)e.stopPropagation();
e.cancelBubble=true;
return false;
},
stopEventDefault:function(e){
e=e||window.event;
if(e.preventDefault){
e.preventDefault()
}else{
e.returnValue=false
};
return false;
},
stopPropagation:function(e){
e=e||window.event;
if(e.stopPropagation)e.stopPropagation();
event.cancelBubble=true;
}
});
rr.killBubble=rr.stopEvent;
rr.extend('rr.cookie',{
getHash:function(n){
var v=this.get(n),h;
if(v){
rr.each(v.split('&'),function(v){
v=v.split('=');
h=h||{};
h[unescape(v[0])]=unescape(v[1]);
});
}
return h;
},
setHash:function(n,v,e,p,d,s){
var o='';
rr.each(v,function(v,k){
o+=(!o?'':'&')+escape(k)+'='+escape(v);
});
this.set(n,o,e,p,d,s);
},
get:function(n){
var c=document.cookie,e,p=n+"=",b;
if(!c)
return;
b=c.indexOf("; "+p);
if(b==-1){
b=c.indexOf(p);
if(b!=0)
return null;
}else
b+=2;
e=c.indexOf(";",b);
if(e==-1)
e=c.length;
return unescape(c.substring(b+p.length,e));
},
set:function(n,v,e,p,d,s){
if(typeof e=='number'){
e=new Date(new Date().getTime()+e);
};
document.cookie=n+"="+escape(v)+
((e)?"; expires="+e.toGMTString():"")+
((p)?"; path="+escape(p):"")+
((d)?"; domain="+d:"")+
((s)?"; secure":"");
},
remove:function(n,p,d){
this.set(n,'',-1000,p,d);
}
});
new function(){
var rg=/([^{}\s][^{}]*)\s*\{([^{}]*)\}/i,rgSp=/,\s*/g;
rr.extend(rr,{
createCSS:function(pr,pf,o){
if(!pr)return;
pf=pf?pf+"":'';
o=this.gId(o);
var sht,ndSt,v,i,l=pr.length,tx="\n",doc;
if(o)if(o.documentElement){
doc=o;
o=null;
}else if(o.tagName.toLowerCase()!='style')return;
doc=doc||(o&&o.ownerDocument)||document;
ndSt=o||this.createEl('style',{
type:'text/css',
appendChild:doc.getElementsByTagName("head")[0]
},doc);
for(i=0;i<l;i++){
v=pr[i];
if(typeof v!='string'||!v)continue;
if(pf){
v=rg.exec(v);
if(v&&v[1]&&v[2])tx+=pf+v[1].replace(rgSp,', '+pf)+' {'+v[2]+'}\n';
}else tx+=v+'\n';
};
if(sht=ndSt.styleSheet){
sht.cssText+=tx;
}else this.createEl(ndSt,tx);
return ndSt;
}
});
};
new function(){
var _rxPrb=/\s+/,_rxPrbTst=/.\s+./,_rxSlh=/[\/]/;
function _g(o){
return typeof o=="string"?document.getElementById(o):o;
};
rr.extend('rr.css',{
_g:_g,
exists:function(cl,cn){
if(typeof cn!='string')cn=cn&&cn.className;
if(cl&&!cn)return;
var s=' ';
if((s+cn+s).indexOf(s+cl+s)!==-1)return true;
},
is:function(cl,n){
n=_g(n);
if(!cl||!n||!(n=n.className))return;
cl=cl.split(_rxPrb);
n=' '+n+' ';
var i=0,c;
while(c=cl[i++]){
if(n.indexOf(' '+c+' ')===-1)return;
};
return true
},
add:function(cl,o,cn){
if(typeof o==='string')o=rr.$(o);
if(o&&!this.exists(cl,cn=o.className))return o.className=cn+" "+cl;
},
remove:function(cl,o){
if(typeof o==='string')o=rr.$(o);
var und,cn=o&&o.className,ac,i=0,s,sp=' ',flg,f1;
if(!cn)return;
ac=cn.split(_rxPrb);
cl=sp+cl+sp;
while((s=ac[i])!==und){
if(s)
if(cl.indexOf(sp+s+sp)!==-1){
ac[i]='';
flg=true;
}else f1=true;
i++;
};
if(flg){
if(!f1){
o.className='';
o.removeAttribute('class');
}else o.className=ac.join(sp);
};
return flg;
},
flip:function(cl,o){
o=_g(o);
if(o&&!this.exists(cl,o)){
o.className+=" "+cl;
return true;
};
this.remove(cl,o);
},
get:function(cl,o){
o=_g(o);
if(!o||!cl)return;
var ac=o.className.split(_rxPrb),acl=cl.split(_rxPrb),i,l=acl.length,ii,ll=ac.length;
for(i=0;i<l;i++)
if(acl[i])for(ii=0;ii<ll;ii++)
if(ac[ii]&&(acl[i]==ac[ii]))return acl[i];
},
set:function(cl,o,fl){
return fl?this.add(cl,o):this.remove(cl,o);
},
replace:function(cl,cl2,o){
if(this.remove(cl,o)){
this.add(cl2,o);
return true;
};
},
firstChild:function(cl,o){
if(o=_g(o)){
o=o.firstChild;
while(o){
if(this.exists(cl,o))return o;
o=o.nextSibling;
};
};
},
nextSibling:function(cl,o){
if(o=_g(o))
while(o=o.nextSibling){
if(this.exists(cl,o))return o;
};
},
previousSibling:function(cl,o){
if(o=_g(o))
while(o=o.previousSibling){
if(this.exists(cl,o))return o;
};
},
parentNode:function(cl,o,f){
o=_g(o);
if(!o)return;
var v;
this.returnValue=v;
if(!f)o=o.parentNode;
if(_rxPrbTst.test(cl)){
while(o&&o.tagName&&o.nodeType==1){
if(v=this.get(cl,o)){
this.returnValue=v;
return o;
};
o=o.parentNode;
};
}else while(o&&o.tagName&&o.nodeType==1){
if(this.exists(cl,o))return o;
o=o.parentNode;
};
},
scan:function(pt,nd){
var ptA=pt.split(_rxSlh),l=ptA.length,i;
for(i in ptA){
if(!ptA[i])continue;
nd=this.firstChild(ptA[i],nd);
if(!nd)return;
};
return nd;
}
});
};
rr.extendNS(null,'rr.expansion_event',{
addEvent:function(p,h,up){
if(h&&typeof p=='string')return this.addEventListener(p,h,up);
var i,f;
for(i in p){
if(p.hasOwnProperty(i)&&typeof(f=p[i])=='function'){
this.addEventListener(i,f,h);
};
};
},
addEventListener:function(name,listener,up){
if(!listener||typeof name!='string'||!name)return;
if(!this._eventList)this._eventList={};
if(!this._eventList[name])this._eventList[name]=[];
var ls=this._eventList[name];
if(up){
ls.unshift(listener);
}else ls[ls.length]=listener;
return listener;
},
removeEventListener:function(name,listener){
if(typeof name!='string'&&!name||!this._eventList)return;
var ls=this._eventList[name],und,i;
if(!ls||!ls.length)return;
if(!listener)delete(this._eventList[name]);
i=ls.length;
while(i--){
if(ls[i]==listener)ls[i]=und;
};
},
removeEventAll:function(name){
if(typeof type=='string'){
if(this._eventList[name])delete(this._eventList[name]);
return;
};
this._eventList={};
},
pauseEvent:function(nm,fg){
var t=this,
ls=t._eventList,
l,i,a,fn;
if(!ls)ls=t._eventList={};
ls=ls[name];
if(!ls)ls=ls[name]=[];
ls.stopEvent=!!fg;
},
initEvent:function(name,e){
var ls=this._eventList,
l,i,a,fn;
ls=ls&&ls[name];
if(!name||!ls||ls.stopEvent)return e;
for(i=1,l=arguments.length,a=[];i<l;i++)a.push(arguments[i]);
i=0;
while((fn=ls[i++])||i<ls.length){
if(typeof fn=='function'){
try{
if(fn.apply(this,a)===false)
return false
}catch(e){
setTimeout(function(){throw e},0)
};
};
};
return e;
}
});
rr.class_listHandler=function(){
};
rr.class_listHandler.prototype={
_fn:function(fn){
return function(e){
e=this.event;
e.target=e.srcElement;
return fn(e);
}
},
add:function(o,e,h,key,x){
if(!h||!e||!o)return;
var t=this,
en='ev_'+e,
ls=t[en],
i=0;
h=rr.addHandler(o,e,h,x);
if(!ls)ls=t[en]=[];
while(ls[i]){i++};
ls[i]=e={o:o,h:h};
if(key)e.k=key;
return h;
},
remove:function(e,h,key){
var en='ev_'+e,
ls=this[en],
i,und,ev;
if(!ls)return;
i=ls.length;
while(i--){
ev=ls[i];
if(!ev||(key&&ev.k!=key)||(h&&ev.h!=h))continue;
rr.removeHandler(ev.o,e,ev.h);
ls[i]=und;
};
},
removeAll:function(key){
var t=this,i;
for(i in t)if(t.hasOwnProperty(i)&&!i.indexOf("ev_")){
t.remove(i.substr(3),null,key);
};
}
};
rr.extendNS(null,'rr.class_objEvent',function(pr,ofn){
function evObj(name,e){
return arguments.callee.initEvent(name,e);
};
rr.extend(ofn||evObj,rr.expansion_event).addEvent(pr);;
return evObj;
});
rr.extendNS(null,'rr.include',function(url,fn,fst){
return arguments.callee.loadjs(url,fn,fst);
});
rr.extend('rr.include',{
_listJs:{},
_listName:{},
_callback:{},
add:function(ns,url,fn){
var i,t=this;
if(ns)if(typeof ns=='string'){
t._add(ns,url);
fn&&t.load(ns,fn,true);
}else for(i in ns)if(ns.hasOwnProperty(i))t._add(i,ns[i]);
},
_add:function(ns,url){
var t=this,o;
url=t._gFUrl(url);
if(o=t._listName[ns]){
if(o===true)t._listName[ns]=url;
return true;
};
t._listName[ns]=url;
},
addHandler:function(ns,fn){
return this.load(ns,fn,true);
},
isLoad:function(ns){
var a=ns.split(/\s+/),i,nm,t=this;
for(i in a)if(nm=a[i]){
nm=t._listName[nm];
if(nm&&t._listJs[nm]!==true)return;
};
return true;
},
load:function(ns,fn,sLd){
var a=ns.split(/\s+/),i,nm,t=this,fnl,x;
for(i in a)if(nm=a[i]){
x=t._loadJs(t._listName[nm],ns,sLd);
if(!x)fnl=true;
};
if(fn)if(fnl){
if(i=t._callback[ns]){
i[i.length]=fn;
}else t._callback[ns]=[fn];
}else fn();
return!fnl;
},
loadjs:function(url,fn){
var rgx=/#([^#]+)$/i,ns,t=this;
ns=rgx.exec(url);
ns=ns&&ns[1];
url=url.replace(rgx,'');
if(!ns)return t._loadJs(t._gFUrl(url),fn);
ns=trim(ns);
t._add(ns,url);
t.load(ns,fn);
},
_loadJs:function(url,fn,sLd){
var t=this,oUrl,s;
oUrl=url&&t._listJs[url];
if(!url||oUrl===true)return true;
if(sLd)return;
if(!oUrl){
t._addJs(url);
oUrl=(t._listJs[url]=[]);
};
if(fn)oUrl[oUrl.length]=fn;
},
_addJs:function(furl){
var t=this;
if(rr.addInitDOM.status)return t._addjs2(furl);
rr.addInitDOM(function(){
t._addjs2(furl);
});
},
_addjs2:function(furl){
var s,t=this,h=document.getElementsByTagName("head")[0],fn;
s=rr.createEl('script',{
charset:t.jschar,
type:'text/javascript',
_rrinclude:true
});
s.setAttribute('defer','defer');
s.setAttribute('async','async');
if(rr.Opera<9){
s.src=furl;
s=h.insertBefore(s,h.firstChild);
setTimeout(function(){
t._hendlerJs(furl);
},12000);
return;
};
fn=function(){
if(!s.onload)return;
var rs=s.readyState;
if(rr.Opera&&rs=='interactive')return;
if(rr.IE&&!(rs=='complete'||rs=='loaded'))return;
s.onreadystatechange=s.onload=null;
setTimeout(function(){
t._hendlerJs(furl);
},50);
};
s.onreadystatechange=s.onload=fn;
s.onerror=function(){
s.onerror=null;
};
s.src=furl;
s=h.insertBefore(s,h.firstChild);
},
_hendlerJs:function(furl){
var t=this,ofile=t._listJs[furl],i,hendler,n,cb,l;
t._listJs[furl]=true;
if(!ofile)return;
if(ofile!==true)
for(i=0;i<ofile.length;i++){
if(typeof ofile[i]=='function')ofile[i]();
ofile[i]=null;
};
for(i in t._callback){
if(!t.load(i,null,true))continue;
cb=t._callback[i];
l=cb.length;
for(n=0;n<l;n++){
if(cb[n])cb[n]();
cb[n]=null;
};
delete(t._callback[i]);
};
},
_gFUrl:function(url){
if(url){
var lc=location,host=lc.protocol+"//"+lc.host,path=host+lc.pathname,p=path.lastIndexOf('/');
path=path.substring(0,p<0?path.length-1:p);
return url.indexOf('://')>0?url:!url.indexOf('/')?host+url:path+"/"+url;
};
},
init:function(er,ns){
var t=this,tx;
if(typeof ns=='string')er=ns;
if(er)
if(typeof er=='string'){
tx=t._listName[er];
if(!rr.addInitDOM.status){
if(tx)t._hendlerJs(tx);
return
};
}else if(rr.Opera<9){
tx=er.fileName||er.filename||er.message;
tx=tx&&tx.match(/https?:\/\/[^\s?]+/);
tx=tx&&tx[0];
};
if(tx)setTimeout(function(){
t._hendlerJs(tx);
},0);
},
addEvComplet:function(fn){
if(!fn)return;
var t=this,i,v,ls=[];
for(i in t._listName){
v=t._listJs[t._listName[i]];
if(v&&v!==true)ls[ls.length]=i;
};
if(ls.length){
t.addHandler(ls.join(" "),fn);
return true;
}else fn();
},
getUrl:function(nm){
var ln=this._listName,u;
if(nm&&ln[nm]&&ln.hasOwnProperty(nm))u=ln[nm];
return u;
},
loadLine:function(ns,fn){
ns=ns&&trim(ns);
if(!ns)return true;
var ar=ns.split(/\s+\>\s+/),
i,l,nns='',t=this;
for(i=1;i<ar.length;i++)nns+=' > '+ar[i];
nns=nns&&nns.substring(3);
if(!nns)return t.load(ns,fn);
return t._loadLine(ar[0],nns,fn)
},
_loadLine:function(ns,nns,fn){
var t=this;
return t.load(ns,function(){
return t.loadLine(nns,fn);
});
}
});
