if(typeof Prototype=="undefined"){throw ("Rico requires the Prototype JavaScript framework")
}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
}}};
if(Rico.prototypeVersion<1.3){throw ("Rico requires Prototype JavaScript framework version 1.3 or greater")
}Rico.init();
Rico.ArrayExtensions=new Array();
if(Object.prototype.extend){Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Object.prototype.extend
}else{Object.prototype.extend=function(a){return Object.extend.apply(this,[this,a])
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Object.prototype.extend
}if(Array.prototype.push){Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.push
}if(!Array.prototype.remove){Array.prototype.remove=function(a){if(isNaN(a)||a>this.length){return false
}for(var b=0,c=0;
b<this.length;
b++){if(b!=a){this[c++]=this[b]
}}this.length-=1
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.remove
}if(!Array.prototype.removeItem){Array.prototype.removeItem=function(b){for(var a=0;
a<this.length;
a++){if(this[a]==b){this.remove(a);
break
}}};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.removeItem
}if(!Array.prototype.pushHTMLCollection){Array.prototype.pushHTMLCollection=function(a){for(var b=0;
b<a.length;
b++){this.push(a.item(b))
}};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.pushHTMLCollection
}if(!Array.prototype.indices){Array.prototype.indices=function(){var a=new Array();
for(index in this){var c=false;
for(var b=0;
b<Rico.ArrayExtensions.length;
b++){if(this[index]==Rico.ArrayExtensions[b]){c=true;
break
}}if(!c){a[a.length]=index
}}return a
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.indices
}if(window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){if(!Document.prototype.loadXML){Document.prototype.loadXML=function(b){var c=(new DOMParser()).parseFromString(b,"text/xml");
while(this.hasChildNodes()){this.removeChild(this.lastChild)
}for(var a=0;
a<c.childNodes.length;
a++){this.appendChild(this.importNode(c.childNodes[a],true))
}}
}Document.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this)
})
}document.getElementsByTagAndClassName=function(d,e){if(d==null){d="*"
}var c=document.getElementsByTagName(d)||document.all;
var f=new Array();
if(e==null){return c
}for(var b=0;
b<c.length;
b++){var k=c[b];
var g=k.className.split(" ");
for(var a=0;
a<g.length;
a++){if(g[a]==e){f.push(k);
break
}}}return f
};
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 i=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;
i+=d.offsetTop-d.scrollTop+g;
d=d.offsetParent
}if(e){a-=this.docScrollLeft();
i-=this.docScrollTop()
}return{x:a,y:i,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())+": "
}};
Number.prototype.zf=function(b){var a=this.toString();
while(a.length<b){a="0"+a
}return a
};
Date.prototype.formatDate=function(a){var c=RicoTranslate.dateFmt;
var b=this;
switch(typeof a){case"object":if(typeof a.dateFmt=="string"){c=a.dateFmt
}break;
case"string":c=a;
break
}return c.replace(/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi,function(d){switch(d.toLowerCase()){case"yyyy":return b.getFullYear();
case"mmmm":return RicoTranslate.monthNames[b.getMonth()];
case"mmm":return RicoTranslate.monthNames[b.getMonth()].substr(0,3);
case"mm":return(b.getMonth()+1).zf(2);
case"dddd":return RicoTranslate.dayNames[b.getDay()];
case"ddd":return RicoTranslate.dayNames[b.getDay()].substr(0,3);
case"dd":return b.getDate().zf(2);
case"hh":return((h=b.getHours()%12)?h:12).zf(2);
case"nn":return b.getMinutes().zf(2);
case"ss":return b.getSeconds().zf(2);
case"a/p":return b.getHours()<12?"a":"p"
}})
};
String.prototype.formatDate=function(a){var b=this.replace(/-/g,"/");
var c=new Date(b);
return isNaN(c)?this:c.formatDate(a)
};
String.prototype.formatNumber=function(c){var b=parseFloat(this);
if(isNaN(b)){return this
}if(typeof c.multiplier=="number"){b*=c.multiplier
}var j=typeof c.decPlaces=="number"?c.decPlaces:0;
var e=typeof c.thouSep=="string"?c.thouSep:RicoTranslate.thouSep;
var f=typeof c.decPoint=="string"?c.decPoint:RicoTranslate.decPoint;
var d=c.prefix||"";
var g=c.suffix||"";
var a=typeof c.negSign=="string"?c.negSign:"L";
a=a.toUpperCase();
var k,i;
if(b<0){k=RicoUtil.formatPosNumber(-b,j,e,f);
if(a=="P"){k="("+k+")"
}k=d+k;
if(a=="L"){k="-"+k
}if(a=="T"){k+="-"
}i="negNumber"
}else{i=b==0?"zeroNumber":"posNumber";
k=d+RicoUtil.formatPosNumber(b,j,e,f)
}return"<span class='"+i+"'>"+k+g+"</span>"
};
var RicoTranslate={phrases:new Array(),thouSep:",",decPoint:".",langCode:"en",re:/^(\W*)\b(.*)\b(\W*)$/,dateFmt:"mm/dd/yyyy",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],addPhrase:function(b,a){this.phrases[b]=a
},getPhrase:function(c){var e=c.split(/\t/);
var a,d="";
for(var b=0;
b<e.length;
b++){if(this.re.exec(e[b])){a=this.phrases[RegExp.$2];
d+=(typeof a=="string")?RegExp.$1+a+RegExp.$3:e[b]
}else{d+=e[b]
}}return d
}};
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
}};
