var Rico={Version:"1.1.2",prototypeVersion:parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1]),init:function(){var b=document.getElementsByTagName("script");
for(var a=0;
a<b.length;
a++){if(!b[a].src){continue
}var c=b[a].src.toLowerCase();
if(c.indexOf("ricocommon.js")==-1){continue
}c=c.substring(0,c.lastIndexOf("/")+1);
this.jsDir=c;
this.cssDir=c.replace(/js\/$/,"css/");
this.imgDir=c.replace(/js\/$/,"images/");
break
}}};
Rico.init();
var RicoUtil={getElementsComputedStyle:function(d,a,b){if(arguments.length==2){b=a
}var c=$(d);
if(c.currentStyle){return c.currentStyle[a]
}else{return document.defaultView.getComputedStyle(c,null).getPropertyValue(b)
}},createXmlDocument:function(){if(document.implementation&&document.implementation.createDocument){var a=document.implementation.createDocument("","",null);
if(a.readyState==null){a.readyState=1;
a.addEventListener("load",function(){a.readyState=4;
if(typeof a.onreadystatechange=="function"){a.onreadystatechange()
}},false)
}return a
}if(window.ActiveXObject){return Try.these(function(){return new ActiveXObject("MSXML2.DomDocument")
},function(){return new ActiveXObject("Microsoft.DomDocument")
},function(){return new ActiveXObject("MSXML.DomDocument")
},function(){return new ActiveXObject("MSXML3.DomDocument")
})||false
}return null
},getInnerText:function(d){if(typeof d=="string"){return d
}if(typeof d=="undefined"){return d
}var c=d.childNodes;
var a=c.length;
if(d.innerText){return d.innerText
}var e="";
for(var b=0;
b<a;
b++){switch(c[b].nodeType){case 1:e+=(c[b].tagName.toLowerCase()=="img")?c[b].src:ts_getInnerText(c[b]);
break;
case 3:e+=c[b].nodeValue;
break
}}return e
},getContentAsString:function(a){return a.xml!=undefined?this._getContentAsStringIE(a):this._getContentAsStringMozilla(a)
},_getContentAsStringIE:function(a){var c="";
for(var b=0;
b<a.childNodes.length;
b++){var d=a.childNodes[b];
if(d.nodeType==4){c+=d.nodeValue
}else{c+=d.xml
}}return c
},_getContentAsStringMozilla:function(b){var a=new XMLSerializer();
var d="";
for(var c=0;
c<b.childNodes.length;
c++){var e=b.childNodes[c];
if(e.nodeType==4){d+=e.nodeValue
}else{d+=a.serializeToString(e)
}}return d
},docElement:(document.compatMode&&document.compatMode.indexOf("CSS")!=-1)?document.documentElement:document.body,windowHeight:function(){return window.innerHeight?innerHeight:this.docElement.clientHeight
},windowWidth:function(){return window.innerWidth?innerWidth:this.docElement.clientWidth
},toViewportPosition:function(a){if(a.all&&!window.opera&&a.currentStyle){return this._toAbsolute(a,true)
}else{return this._toAbsoluteMozilla(a,true)
}},toDocumentPosition:function(a){return this._toAbsolute(a,false)
},_toAbsolute:function(b,e){var a=0;
var h=0;
var f="";
var d=b;
while(d){var c=0;
var g=0;
if(d!=b){var c=parseInt(this.getElementsComputedStyle(d,"borderLeftWidth"));
var g=parseInt(this.getElementsComputedStyle(d,"borderTopWidth"));
c=isNaN(c)?0:c;
g=isNaN(g)?0:g
}f+="/"+d.offsetTop;
a+=d.offsetLeft-d.scrollLeft+c;
h+=d.offsetTop-d.scrollTop+g;
d=d.offsetParent
}if(e){a-=this.docScrollLeft();
h-=this.docScrollTop()
}return{x:a,y:h,ie:1,yaudit:f}
},_toAbsoluteMozilla:function(c,e){var a=0;
var f=0;
var b="";
var d=c;
while(d){a+=d.offsetLeft;
f+=d.offsetTop;
b+="/"+d.tagName+"="+d.offsetLeft;
d=d.offsetParent
}d=c;
while(d&&d!=document.body&&d!=document.documentElement){if(d.scrollLeft){a-=d.scrollLeft
}if(d.scrollTop){f-=d.scrollTop
}d=d.parentNode
}if(e){a-=this.docScrollLeft();
f-=this.docScrollTop()
}return{x:a,y:f,ie:0,yaudit:b}
},docScrollLeft:function(){if(window.pageXOffset){return window.pageXOffset
}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft
}else{if(document.body){return document.body.scrollLeft
}else{return 0
}}}},docScrollTop:function(){if(window.pageYOffset){return window.pageYOffset
}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop
}else{if(document.body){return document.body.scrollTop
}else{return 0
}}}},nan2zero:function(a){return isNaN(a)||typeof(a)==undefined?0:a
},eventKey:function(a){if(typeof(a.keyCode)=="number"){return a.keyCode
}else{if(typeof(a.which)=="number"){return a.which
}else{if(typeof(a.charCode)=="number"){return a.charCode
}}}return -1
},getPreviosSiblingByTagName:function(c,b){var a=c.previousSibling;
while(a){if((a.tagName==b)&&(a.style.display!="none")){return a
}a=a.previousSibling
}return null
},getParentByTagName:function(c,a){var b=c;
while(b){if(b.tagName==a){return b
}b=b.parentNode
}return null
},wrapChildren:function(c,b,f,d){var a=d?d:"div";
var e=document.createElement(a);
if(f){e.id=f
}if(b){e.className=b
}while(c.firstChild){e.appendChild(c.firstChild)
}c.appendChild(e);
return e
},formatPosNumber:function(f,g,c,e){var b=f.toFixed(g).split(/\./);
if(c){var d=/(\d+)(\d{3})/;
while(d.test(b[0])){b[0]=b[0].replace(d,"$1"+c+"$2")
}}return b.join(e)
},DOMNode_insertAfter:function(a,b){var c=b.parentNode;
if(c.lastChild==b){return c.appendChild(a)
}else{return c.insertBefore(a,b.nextSibling)
}},isKonqueror:navigator.userAgent.toLowerCase().indexOf("konqueror")>=0,isSafari:navigator.userAgent.toLowerCase().indexOf("safari")>=0,isOpera:(typeof(window.opera)=="object")&&(window.opera!=null),isIE:(typeof(document.all)=="object")&&(!window.opera),startTime:new Date(),timeStamp:function(){var a=new Date();
return(a.getTime()-this.startTime.getTime())+": "
}};
Rico.Shim=Class.create();
if(RicoUtil.isIE){Rico.Shim.prototype={initialize:function(){this.ifr=document.createElement("iframe");
this.ifr.style.position="absolute";
this.ifr.style.display="none";
document.body.appendChild(this.ifr)
},hide:function(){this.ifr.style.display="none"
},show:function(a){this.ifr.style.width=a.offsetWidth;
this.ifr.style.height=a.offsetHeight;
this.ifr.style.top=a.style.top;
this.ifr.style.left=a.style.left;
this.ifr.style.zIndex=a.currentStyle.zIndex-1;
this.ifr.style.display="block"
}}
}else{Rico.Shim.prototype={initialize:function(){},hide:function(){},show:function(){}}
}Rico.Menu=Class.create();
Rico.Menu.prototype={initialize:function(c,b,a){this.defaultMenuWidth=(typeof c=="string")?c:"15em";
this.hideOnEscape=(typeof b=="boolean")?b:true;
this.hideOnClick=(typeof a=="boolean")?a:true;
this.hideFunc=null
},createDiv:function(){if(this.div){return
}this.div=document.createElement("div");
this.div.className="ricoMenu";
this.div.style.position="absolute";
this.div.style.width=this.defaultMenuWidth;
document.body.appendChild(this.div);
this.width=this.div.offsetWidth;
this.shim=new Rico.Shim();
this.hidemenu();
if(this.hideOnClick){Event.observe(this.div,"click",this.ignoreClick.bindAsEventListener(this),false);
Event.observe(document,"click",this.cancelmenu.bindAsEventListener(this),false)
}if(this.hideOnEscape){Event.observe(document,"keyup",this.checkKey.bindAsEventListener(this),false)
}},ignoreClick:function(a){Event.stop(a);
return false
},checkKey:function(a){if(RicoUtil.eventKey(a)==27){this.cancelmenu(a)
}return true
},showmenu:function(f,b){Event.stop(f);
this.hideFunc=b;
if(this.div.childNodes.length==0){this.cancelmenu();
return false
}var d=RicoUtil.docScrollLeft()+f.clientX;
if(f.clientX+this.width>RicoUtil.windowWidth()){d-=this.width
}this.div.style.left=d+"px";
var a=RicoUtil.docScrollTop()+f.clientY;
this.div.style.top=a+"px";
this.div.style.display="block";
var c=this.div.offsetHeight;
if(f.clientY+c>RicoUtil.windowHeight()){a=Math.max(a-c,0);
this.div.style.top=a+"px"
}this.shim.show(this.div);
return false
},clearMenu:function(){this.div.innerHTML="";
this.defaultAction=null
},addMenuHeading:function(c,b){var a=document.createElement("div");
a.innerHTML=(b==null||b==true)?RicoTranslate.getPhrase(c):c;
a.className="ricoMenuHeading";
this.div.appendChild(a)
},addMenuBreak:function(){var a=document.createElement("div");
a.className="ricoMenuBreak";
this.div.appendChild(a)
},addMenuItem:function(b,e,d,g,f){var c=document.createElement("a");
if(arguments.length<3||d){switch(typeof e){case"function":c.href="#";
c.onclick=e;
break;
case"string":c.href=e;
break
}c.className="enabled";
if(this.defaultAction==null){this.defaultAction=e
}}else{c.disabled=true;
c.className="disabled"
}c.innerHTML=(f==null||f==true)?RicoTranslate.getPhrase(b):b;
if(g!=null){c.title=(f==null||f==true)?RicoTranslate.getPhrase(g):g
}this.div.appendChild(c)
},isVisible:function(){return this.div&&this.div.style.display!="none"
},cancelmenu:function(){if(this.hideFunc){this.hideFunc()
}this.hidemenu()
},hidemenu:function(){if(!this.div){return
}this.shim.hide();
this.div.style.display="none";
this.hideFunc=null
}};
