Moved rico.js to minsrc and is now part of rico_min.js. Files are now sent to the...
[infodrom/rico3] / ricoClient / js / rico_min.js
index b02d1bf..9215cf8 100644 (file)
@@ -1,3 +1,385 @@
+Rico.Version="3.0b2";
+Rico.theme={};
+Rico.onLoadCallbacks=[];
+Rico.windowIsLoaded=false;
+Rico.inputtypes={search:0,number:0,range:0,color:0,tel:0,url:0,email:0,date:0,month:0,week:0,time:0,datetime:0,"datetime-local":0};
+Rico.windowLoaded=function(){this.windowIsLoaded=true;
+if(typeof Rico_CONFIG=="object"){var b=document.createElement("style");
+document.getElementsByTagName("head")[0].appendChild(b);
+if(!window.createPopup){b.appendChild(document.createTextNode(""))
+}var a=document.styleSheets[document.styleSheets.length-1];
+this.addCssBackgroundRule(a,".rico-icon",Rico_CONFIG.imgIcons,"no-repeat");
+this.addCssBackgroundRule(a,".ricoLG_Resize",Rico_CONFIG.imgResize,"repeat");
+if(Rico_CONFIG.imgHeading){var c="repeat-x";
+var e="left center";
+this.addCssBackgroundRule(a,"tr.ricoLG_hdg th",Rico_CONFIG.imgHeading,c,e);
+this.addCssBackgroundRule(a,"tr.ricoLG_hdg td",Rico_CONFIG.imgHeading,c,e);
+this.addCssBackgroundRule(a,"table.ricoLiveGrid thead td",Rico_CONFIG.imgHeading,c,e);
+this.addCssBackgroundRule(a,"table.ricoLiveGrid thead th",Rico_CONFIG.imgHeading,c,e);
+this.addCssBackgroundRule(a,".ricoTitle",Rico_CONFIG.imgHeading,c,e);
+this.addCssBackgroundRule(a,".Rico_accTitle",Rico_CONFIG.imgHeading,c,e)
+}if(Rico_CONFIG.enableLogging){this.enableLogging()
+}if(Rico_CONFIG.enableHTML5){this._CheckInputTypes()
+}}Rico.writeDebugMsg=Rico.log;
+Rico.log("Processing callbacks");
+while(this.onLoadCallbacks.length>0){var d=this.onLoadCallbacks.shift();
+if(d){d()
+}}};
+Rico.addCssBackgroundRule=function(d,b,c,e,a){if(!c){return
+}this.addCssRule(d,b,"background-image:url('"+c+"')");
+this.addCssRule(d,b,"background-repeat:"+e);
+if(a){this.addCssRule(d,b,"background-position:"+a)
+}};
+Rico.addCssRule=function(b,a,c){if(b.addRule){b.addRule(a,c)
+}else{if(b.insertRule){b.insertRule(a+" { "+c+" }",0)
+}else{alert("unable to add rule: "+c)
+}}};
+Rico._CheckInputTypes=function(){var a=document.createElement("input");
+for(var b in this.inputtypes){a.setAttribute("type","text");
+a.setAttribute("type",b);
+this.inputtypes[b]=(a.type!=="text")
+}};
+Rico.onLoad=function(b,a){if(this.windowIsLoaded){b()
+}else{if(a){this.onLoadCallbacks.unshift(b)
+}else{this.onLoadCallbacks.push(b)
+}}};
+Rico.isKonqueror=navigator.userAgent.toLowerCase().indexOf("konqueror")>-1;
+Rico.isIE=!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1);
+Rico.isOpera=navigator.userAgent.indexOf("Opera")>-1;
+Rico.isWebKit=navigator.userAgent.indexOf("AppleWebKit/")>-1;
+Rico.isGecko=navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1;
+Rico.ieVersion=/MSIE (\d+\.\d+);/.test(navigator.userAgent)?new Number(RegExp.$1):null;
+Rico.startTime=new Date();
+Rico.timeStamp=function(){var a=new Date();
+return(a.getTime()-this.startTime.getTime())+": "
+};
+Rico.setDebugArea=function(c,a){if(!this.debugArea||a){var b=document.getElementById(c);
+if(!b){return
+}this.debugArea=b;
+b.value=""
+}};
+Rico.log=function(){};
+Rico.enableLogging=function(){if(this.debugArea){this.log=function(b,a){if(a){this.debugArea.value=""
+}this.debugArea.value+=this.timeStamp()+b+"\n"
+}
+}else{if(window.console){if(window.console.firebug){this.log=function(a){window.console.log(this.timeStamp(),a)
+}
+}else{this.log=function(a){window.console.log(this.timeStamp()+a)
+}
+}}else{if(window.opera){this.log=function(a){window.opera.postError(this.timeStamp()+a)
+}
+}}}};
+Rico.$=function(a){return typeof a=="string"?document.getElementById(a):a
+};
+Rico.runLater=function(){var b=Array.prototype.slice.call(arguments);
+var c=b.shift();
+var a=b.shift();
+var d=b.shift();
+return setTimeout(function(){a[d].apply(a,b)
+},c)
+};
+Rico.visible=function(a){return Rico.getStyle(a,"display")!="none"
+};
+Rico.show=function(a){a.style.display=""
+};
+Rico.hide=function(a){a.style.display="none"
+};
+Rico.toggle=function(a){a.style.display=a.style.display=="none"?"":"none"
+};
+Rico.direction=function(a){return(Rico.getStyle(a,"direction")||"ltr").toLowerCase()
+};
+Rico.viewportOffset=function(a){var b=Rico.cumulativeOffset(a);
+b.left-=this.docScrollLeft();
+b.top-=this.docScrollTop();
+return b
+};
+Rico.getInnerText=function(f,b,g,e){switch(typeof f){case"string":return f;
+case"undefined":return f;
+case"number":return f.toString()
+}var d=f.childNodes;
+var a=d.length;
+var h="";
+for(var c=0;
+c<a;
+c++){switch(d[c].nodeType){case 1:if(this.getStyle(d[c],"display")=="none"){continue
+}if(e&&this.hasClass(d[c],e)){continue
+}switch(d[c].tagName.toLowerCase()){case"img":if(!b){h+=d[c].alt||d[c].title||d[c].src
+}break;
+case"input":if(!g&&!d[c].disabled&&d[c].type.toLowerCase()=="text"){h+=d[c].value
+}break;
+case"select":if(!g&&d[c].selectedIndex>=0){h+=d[c].options[d[c].selectedIndex].text
+}break;
+case"textarea":if(!g&&!d[c].disabled){h+=d[c].value
+}break;
+default:h+=this.getInnerText(d[c],b,g,e);
+break
+}break;
+case 3:h+=d[c].nodeValue;
+break
+}}return h
+};
+Rico.getContentAsString=function(a,b){if(b){return this._getEncodedContent(a)
+}if(typeof a.xml!="undefined"){return this._getContentAsStringIE(a)
+}return this._getContentAsStringMozilla(a)
+};
+Rico._getEncodedContent=function(a){if(a.innerHTML){return a.innerHTML
+}switch(a.childNodes.length){case 0:return"";
+case 1:return a.firstChild.nodeValue;
+default:return a.childNodes[1].nodeValue
+}};
+Rico._getContentAsStringIE=function(a){var c="";
+for(var b=0;
+b<a.childNodes.length;
+b++){var d=a.childNodes[b];
+c+=(d.nodeType==4)?d.nodeValue:d.xml
+}return c
+};
+Rico._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
+};
+Rico.nan2zero=function(a){if(typeof(a)=="string"){a=parseInt(a,10)
+}return isNaN(a)||typeof(a)=="undefined"?0:a
+};
+Rico.stripTags=function(a){return a.replace(/<\/?[^>]+>/gi,"")
+};
+Rico.truncate=function(a,b){return a.length>b?a.substr(0,b-3)+"...":a
+};
+Rico.zFill=function(d,c,b){var a=d.toString(b||10);
+while(a.length<c){a="0"+a
+}return a
+};
+Rico.keys=function(c){var b=[];
+for(var a in c){b.push[a]
+}return b
+};
+Rico.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
+};
+Rico.eventLeftClick=function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))
+};
+Rico.eventRelatedTarget=function(a){return a.relatedTarget
+};
+Rico.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
+};
+Rico.getParentByTagName=function(d,a,c){var b=d;
+a=a.toLowerCase();
+while(b){if(b.tagName&&b.tagName.toLowerCase()==a){if(!c||b.className.indexOf(c)>=0){return b
+}}b=b.parentNode
+}return null
+};
+Rico.wrapChildren=function(b,a,e,c){var d=document.createElement(c||"div");
+if(e){d.id=e
+}if(a){d.className=a
+}while(b.firstChild){d.appendChild(b.firstChild)
+}b.appendChild(d);
+return d
+};
+Rico.positionCtlOverIcon=function(g,k){k=this.$(k);
+var c=this.cumulativeOffset(k);
+var j=this.docScrollTop();
+var a=this.windowHeight();
+if(g.style.display=="none"){g.style.display="block"
+}var h=2;
+var b=this.nan2zero(this.getStyle(k,"paddingLeft"));
+g.style.left=(c.left+b+h)+"px";
+var i=c.top+h;
+var f=g.offsetHeight;
+var e=k.offsetHeight;
+var d=10;
+if(i+e+f+d<a+j){i+=e
+}else{i=Math.max(i-f,j)
+}g.style.top=i+"px"
+};
+Rico.createFormField=function(d,b,f,g,a){var e;
+if(typeof a!="string"){a=g
+}if(this.isIE&&this.ieVersion<8){var c=b+' id="'+g+'"';
+if(f){c+=' type="'+f+'"'
+}if(b.match(/^(form|input|select|textarea|object|button|img)$/)){c+=' name="'+a+'"'
+}e=document.createElement("<"+c+" />")
+}else{e=document.createElement(b);
+if(f){e.type=f
+}e.id=g;
+if(typeof e.name=="string"){e.name=a
+}}d.appendChild(e);
+return e
+};
+Rico.addSelectOption=function(b,c,d){var a=document.createElement("option");
+if(typeof c=="string"){a.value=c
+}a.text=d;
+if(this.isIE){b.add(a)
+}else{b.add(a,null)
+}return a
+};
+Rico.getCookie=function(g){var b=g+"=";
+var f=b.length;
+var a=document.cookie.length;
+var d=0;
+while(d<a){var c=d+f;
+if(document.cookie.substring(d,c)==b){var e=document.cookie.indexOf(";",c);
+if(e==-1){e=document.cookie.length
+}return unescape(document.cookie.substring(c,e))
+}d=document.cookie.indexOf(" ",d)+1;
+if(d==0){break
+}}return null
+};
+Rico.getTBody=function(a){return a.tBodies.length==0?a.appendChild(document.createElement("tbody")):a.tBodies[0]
+};
+Rico.setCookie=function(e,g,f,d,a){var h=e+"="+escape(g);
+if(typeof(f)=="number"){var b=new Date();
+b.setTime(b.getTime()+(f*24*60*60*1000));
+h+="; expires="+b.toGMTString()
+}if(typeof(d)=="string"){h+="; path="+d
+}if(typeof(a)=="string"){h+="; domain="+a
+}document.cookie=h
+};
+Rico.phrasesById={};
+Rico.thouSep=",";
+Rico.decPoint=".";
+Rico.langCode="en";
+Rico.dateFmt="mm/dd/yyyy";
+Rico.timeFmt="hh:nn:ss a/pm";
+Rico.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];
+Rico.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
+Rico.monthAbbr=function(a){return this.monthNamesShort?this.monthNamesShort[a]:this.monthNames[a].substr(0,3)
+};
+Rico.dayAbbr=function(a){return this.dayNamesShort?this.dayNamesShort[a]:this.dayNames[a].substr(0,3)
+};
+Rico.addPhraseId=function(b,a){this.phrasesById[b]=a
+};
+Rico.getPhraseById=function(d){var b=this.phrasesById[d];
+if(!b){alert("Error: missing phrase for "+d);
+return""
+}if(arguments.length<=1){return b
+}var c=arguments;
+return b.replace(/(\$\d)/g,function(e){var a=parseInt(e.charAt(1),10);
+return(a<c.length)?c[a]:""
+})
+};
+Rico.formatPosNumber=function(e,f,c){var b=e.toFixed(f).split(/\./);
+if(c){var d=/(\d+)(\d{3})/;
+while(d.test(b[0])){b[0]=b[0].replace(d,"$1"+Rico.thouSep+"$2")
+}}return b.join(Rico.decPoint)
+};
+Rico.formatNumber=function(b,c){if(typeof b=="string"){b=parseFloat(b.replace(/,/,"."),10)
+}if(isNaN(b)){return"NaN"
+}if(typeof c.multiplier=="number"){b*=c.multiplier
+}var h=typeof c.decPlaces=="number"?c.decPlaces:0;
+var e=typeof c.thouSep=="undefined"?true:this.thouSep;
+var d=c.prefix||"";
+var f=c.suffix||"";
+var a=typeof c.negSign=="string"?c.negSign:"L";
+a=a.toUpperCase();
+var i,g;
+if(b<0){i=this.formatPosNumber(-b,h,e);
+if(a=="P"){i="("+i+")"
+}i=d+i;
+if(a=="L"){i="-"+i
+}if(a=="T"){i+="-"
+}g="negNumber"
+}else{g=b==0?"zeroNumber":"posNumber";
+i=d+this.formatPosNumber(b,h,e)
+}return"<span class='"+g+"'>"+i+f+"</span>"
+};
+Rico.formatDate=function(c,a){var b=(typeof a=="string")?a:"translateDate";
+switch(b){case"locale":case"localeDateTime":return c.toLocaleString();
+case"localeDate":return c.toLocaleDateString();
+case"translate":case"translateDateTime":b=this.dateFmt+" "+this.timeFmt;
+break;
+case"translateDate":b=this.dateFmt;
+break
+}return b.replace(/(yyyy|yy|mmmm|mmm|mm|dddd|ddd|dd|d|hh|nn|ss|a\/p)/gi,function(d){var e;
+switch(d){case"yyyy":return c.getFullYear();
+case"yy":return c.getFullYear().toString().substr(2);
+case"mmmm":return Rico.monthNames[c.getMonth()];
+case"mmm":return Rico.monthAbbr(c.getMonth());
+case"mm":return Rico.zFill(c.getMonth()+1,2);
+case"m":return(c.getMonth()+1);
+case"dddd":return Rico.dayNames[c.getDay()];
+case"ddd":return Rico.dayAbbr(c.getDay());
+case"dd":return Rico.zFill(c.getDate(),2);
+case"d":return c.getDate();
+case"hh":return Rico.zFill((e=c.getHours()%12)?e:12,2);
+case"h":return((e=c.getHours()%12)?e:12);
+case"HH":return Rico.zFill(c.getHours(),2);
+case"H":return c.getHours();
+case"nn":return Rico.zFill(c.getMinutes(),2);
+case"ss":return Rico.zFill(c.getSeconds(),2);
+case"a/p":return c.getHours()<12?"a":"p"
+}})
+};
+Rico.setISO8601=function(b,f){if(!b){return false
+}var e=b.match(/(\d\d\d\d)(?:-?(\d\d)(?:-?(\d\d)(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|(?:([-+])(\d\d)(?::?(\d\d))?)?)?)?)?)?/);
+if(!e){return false
+}if(!f){f=0
+}var a=new Date(e[1],0,1);
+if(e[2]){a.setMonth(e[2]-1)
+}if(e[3]){a.setDate(e[3])
+}if(e[4]){a.setHours(e[4])
+}if(e[5]){a.setMinutes(e[5])
+}if(e[6]){a.setSeconds(e[6])
+}if(e[7]){a.setMilliseconds(Number("0."+e[7])*1000)
+}if(e[8]){if(e[10]&&e[11]){f=(Number(e[10])*60)+Number(e[11])
+}f*=((e[9]=="-")?1:-1);
+f-=a.getTimezoneOffset()
+}var c=(Number(a)+(f*60*1000));
+a.setTime(Number(c));
+return a
+};
+Rico.toISO8601String=function(a,e,h){if(!e){e=6
+}if(!h){h="Z"
+}else{var g=h.match(/([-+])([0-9]{2}):([0-9]{2})/);
+var c=(Number(g[2])*60)+Number(g[3]);
+c*=((g[1]=="-")?-1:1);
+a=new Date(Number(Number(a)+(c*60000)))
+}var i=function(d){return((d<10)?"0":"")+d
+};
+var f=a.getUTCFullYear();
+if(e>1){f+="-"+i(a.getUTCMonth()+1)
+}if(e>2){f+="-"+i(a.getUTCDate())
+}if(e>3){f+="T"+i(a.getUTCHours())+":"+i(a.getUTCMinutes())
+}if(e>5){var b=Number(a.getUTCSeconds()+"."+((a.getUTCMilliseconds()<100)?"0":"")+i(a.getUTCMilliseconds()));
+f+=":"+i(b)
+}else{if(e>4){f+=":"+i(a.getUTCSeconds())
+}}if(e>3){f+=h
+}return f
+};
+Rico.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 Rico.tryFunctions(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
+};
+Rico.ajaxUpdater=function(c,b,a){this.updateSend(c,b,a)
+};
+Rico.ajaxUpdater.prototype={updateSend:function(d,c,b){this.element=d;
+this.onComplete=b.onComplete;
+var a=this;
+b.onComplete=function(e){a.updateComplete(e)
+};
+new Rico.ajaxRequest(c,b)
+},updateComplete:function(a){this.element.innerHTML=a.responseText;
+if(this.onComplete){this.onComplete(a)
+}}};
+try{document.execCommand("BackgroundImageCache",false,true)
+}catch(err){}Rico.eventBind(window,"load",Rico.eventHandle(Rico,"windowLoaded"));
 Rico.applyShadow=function(b,a){if(typeof a=="undefined"){a=true
 }if(a){Rico.addClass(b,"ricoShadow")
 }return b
@@ -33,7 +415,6 @@ if(this.options.position=="auto"){this.position=Rico.getStyle(this.container,"po
 while(this.container.firstChild){this.content.appendChild(this.container.firstChild)
 }this.container.appendChild(this.content);
 this.content.className="RicoPopupContent";
-this.content.style.position="relative";
 if(this.position!="absolute"){return
 }if(this.options.closeFunc){this.closeFunc=this.options.closeFunc
 }else{var a=this;
@@ -43,8 +424,9 @@ this.closeFunc=function(){a.closePopup()
 this.container.style.left="0px";
 this.container.style.display="none";
 if(this.options.zIndex>=0){this.container.style.zIndex=this.options.zIndex
-}this.content.style.zIndex=2;
-if(Rico.isIE&&Rico.ieVersion<7){this.ifr=document.createElement("iframe");
+}if(Rico.isIE&&Rico.ieVersion<7&&this.options.shim!==false){this.content.style.position="relative";
+this.content.style.zIndex=2;
+this.ifr=document.createElement("iframe");
 this.ifr.className="RicoShim";
 this.ifr.frameBorder=0;
 this.ifr.src="javascript:'';";
@@ -89,9 +471,8 @@ Rico.eventStop(d)
 },_endDrag:function(){this.container.style.cursor="";
 Rico.eventUnbind(document,"mousemove",this.dragHandler);
 Rico.eventUnbind(document,"mouseup",this.dropHandler)
-},openPopup:function(b,a){if(typeof b=="number"){this.container.style.left=b+"px"
-}if(typeof a=="number"){this.container.style.top=a+"px"
-}this.container.style.display="";
+},openPopup:function(b,a){this.move(b,a);
+this.container.style.display="";
 if(this.container.id){Rico.log("openPopup "+this.container.id+" at "+b+","+a)
 }Rico._AddOpenPopup(this)
 },centerPopup:function(){this.openPopup();
@@ -113,7 +494,7 @@ b.className="RicoCloseAnchor";
 if(Rico.theme.closeAnchor){Rico.addClass(b,Rico.theme.closeAnchor)
 }var c=b.appendChild(document.createElement("span"));
 c.title=Rico.getPhraseById("close");
-new Rico.HoverSet([b]);
+new Rico.HoverSet([b],{hoverClass:Rico.theme.hover||"ricoCloseHover"});
 Rico.addClass(c,Rico.theme.close||"rico-icon RicoClose");
 Rico.eventBind(b,"click",d);
 return b
@@ -164,7 +545,7 @@ if(a.height){this.contentDiv.style.height=a.height
 }if(a.width){this.contentDiv.style.width=a.width
 }if(a.overflow){this.contentDiv.style.overflow=a.overflow
 }Rico.addClass(this.content,"ricoWindow");
-if(Rico.theme.dialog){Rico.addClass(this.content,Rico.theme.dialog)
+if(Rico.theme.dialog){Rico.addClass(this.container,Rico.theme.dialog)
 }this.content=this.contentDiv
 },setTitle:function(a){this.titleContent.innerHTML=a
 }};
@@ -184,8 +565,7 @@ if(a){c.parent=a
 }this.createContainer(c);
 this.content.className=Rico.isWebKit?"ricoMenuSafari":"ricoMenu";
 this.content.style.width=this.options.width;
-this.direction=Rico.getStyle(this.container,"direction")||"ltr";
-this.direction=this.direction.toLowerCase();
+this.direction=Rico.direction(this.container);
 this.hidemenu();
 this.itemCount=0
 },showmenu:function(b,c){Rico.eventStop(b);
@@ -381,16 +761,8 @@ b++){Rico.removeClass(a[b],this.hoverClass)
 }},remove:function(){Rico.eventUnbind(element,"mousemove",this.movehandle);
 Rico.eventUnbind(element,"mouseout",this.outhandle)
 }};
-Rico.Effect={};
-Rico.Effect.easeIn=function(a){return Math.sqrt(a)
-};
-Rico.Effect.easeOut=function(a){return a*a
-};
 Rico.ContentTransitionBase=function(){};
-Rico.ContentTransitionBase.prototype={initBase:function(e,d,b){Rico.log("ContentTransitionBase#initBase");
-if(typeof e=="string"){e=Rico.select(e)
-}if(typeof d=="string"){d=Rico.select(d)
-}this.options=b||{};
+Rico.ContentTransitionBase.prototype={initBase:function(e,d,b){this.options=b||{};
 this.titles=e;
 this.contents=d;
 this.hoverSet=new Rico.HoverSet(e,b);
@@ -417,7 +789,7 @@ this.contents.push(a);
 this.hoverSet.add(b);
 this.selectionSet.add(b);
 Rico.hide(a)
-},removeBase:function(a){},removeAll:function(){this.hoverSet.removeAll();
+},removeAll:function(){this.hoverSet.removeAll();
 this.selectionSet.removeAll()
 }};
 Rico.Accordion=function(b,a){this.initialize(b,a)
@@ -465,36 +837,38 @@ this.selected.style.height=this.options.panelHeight+"px"
 }});
 Rico.TabbedPanel=function(b,a){this.initialize(b,a)
 };
-Rico.TabbedPanel.prototype=Rico.extend(new Rico.ContentTransitionBase(),{initialize:function(d,k){d=Rico.$(d);
-k=k||{};
-if(typeof k.panelWidth=="number"){k.panelWidth+="px"
-}if(typeof k.panelHeight=="number"){k.panelHeight+="px"
-}d.className=k.tabClass||Rico.theme.tabPanel||"Rico_tabPanel";
-if(k.panelWidth){d.style.width=k.panelWidth
+Rico.TabbedPanel.prototype=Rico.extend(new Rico.ContentTransitionBase(),{initialize:function(d,l){d=Rico.$(d);
+l=l||{};
+if(typeof l.panelWidth=="number"){l.panelWidth+="px"
+}if(typeof l.panelHeight=="number"){l.panelHeight+="px"
+}d.className=l.tabClass||Rico.theme.tabPanel||"Rico_tabPanel";
+if(l.panelWidth){d.style.width=l.panelWidth
 }var g=[];
-var j=d.childNodes;
+var k=d.childNodes;
 for(var e=0;
-e<j.length;
-e++){if(j[e]&&j[e].tagName&&j[e].tagName.match(/^div|ul$/i)){g.push(j[e])
+e<k.length;
+e++){if(k[e]&&k[e].tagName&&k[e].tagName.match(/^div|ul$/i)){g.push(k[e])
 }}if(g.length<2){return
 }var c=g[0].tagName.toLowerCase()=="ul"?"li":"div";
-g[0].className=k.navContainerClass||Rico.theme.tabNavContainer||"Rico_tabNavContainer";
+g[0].className=l.navContainerClass||Rico.theme.tabNavContainer||"Rico_tabNavContainer";
 g[0].style.listStyle="none";
-g[1].className=k.contentContainerClass||Rico.theme.tabContentContainer||"Rico_tabContentContainer";
+g[1].className=l.contentContainerClass||Rico.theme.tabContentContainer||"Rico_tabContentContainer";
 var f=Rico.getDirectChildrenByTag(g[0],c);
 var b=Rico.getDirectChildrenByTag(g[1],"div");
-if(!k.corners){k.corners="top"
+var j=Rico.direction(d);
+if(!l.corners){l.corners="top"
 }for(var e=0;
 e<f.length;
-e++){f[e].className=k.titleClass||Rico.theme.tabTitle||"Rico_tabTitle";
+e++){if(j=="rtl"){Rico.setStyle(f[e],{"float":"right"})
+}f[e].className=l.titleClass||Rico.theme.tabTitle||"Rico_tabTitle";
 var h=Rico.wrapChildren(f[e],"","","a");
 h.href="javascript:void(0)";
-b[e].className=k.contentClass||Rico.theme.tabContent||"Rico_tabContent";
-if(k.panelHeight){b[e].style.overflow="auto"
-}if(k.corners!="none"){if(k.panelHdrWidth){f[e].style.width=k.panelHdrWidth
-}Rico.Corner.round(f[e],Rico.theme.tabCornerOptions||k)
-}}k.selectedClass=Rico.theme.tabSelected||"selected";
-this.initBase(f,b,k);
+b[e].className=l.contentClass||Rico.theme.tabContent||"Rico_tabContent";
+if(l.panelHeight){b[e].style.overflow="auto"
+}if(l.corners!="none"){if(l.panelHdrWidth){f[e].style.width=l.panelHdrWidth
+}Rico.Corner.round(f[e],Rico.theme.tabCornerOptions||l)
+}}l.selectedClass=Rico.theme.tabSelected||"selected";
+this.initBase(f,b,l);
 if(this.selected){this.transition(this.selected)
 }},transition:function(a){Rico.log("TabbedPanel#transition "+typeof(a));
 if(this.selected){Rico.hide(this.selected)
@@ -697,7 +1071,6 @@ this.close=this.closePopup;
 this.bPageLoaded=false;
 this.img=[];
 this.Holidays={};
-this.weekString=Rico.getPhraseById("calWeekHdg");
 this.re=/^\s*(\w+)(\W)(\w+)(\W)(\w+)/i;
 this.setDateFmt(this.options.dateFmt)
 },setDateFmt:function(a){this.dateFmt=(a=="rico")?Rico.dateFmt:a;
@@ -714,54 +1087,67 @@ if(d){this.setDiv(d)
 }else{this.createContainer();
 this.container.id=this.id
 }Rico.addClass(this.content,Rico.theme.calendar||"ricoCalContainer");
-this.content.style.display="block";
-this.heading=this.content.appendChild(document.createElement("div"));
-this.heading.className="RicoCalHeading";
-if(Rico.theme.calendarHeading){Rico.addClass(this.heading,Rico.theme.calendarHeading)
-}this.heading.appendChild(this._createTitleSection("Month"));
-this.heading.appendChild(this._createTitleSection("Year"));
-new Rico.HoverSet(this.heading.getElementsByTagName("a"));
-if(this.position=="absolute"){this.heading.appendChild(Rico.closeButton(Rico.eventHandle(this,"close")))
-}this.maintab=document.createElement("table");
+this.direction=Rico.direction(this.container);
+var b,k,g,f,h,p,m,q,e;
+this.colStart=this.options.showWeekNumber?1:0;
+var l=7+this.colStart;
+this.maintab=document.createElement("table");
 this.maintab.cellSpacing=2;
 this.maintab.cellPadding=0;
 this.maintab.border=0;
 this.maintab.style.borderCollapse="separate";
-this.maintab.className="ricoCalTab";
-if(Rico.theme.calendarTable){Rico.addClass(this.maintab,Rico.theme.calendarTable)
-}this.tbody=Rico.getTBody(this.maintab);
-var b,k,g,f,h,o,l,p,e;
-this.colStart=this.options.showWeekNumber?1:0;
+this.maintab.className=Rico.theme.calendarTable||"ricoCalTab";
+this.tbody=Rico.getTBody(this.maintab);
+this.tbody.className="ricoCalBody";
+this.thead=this.maintab.createTHead();
+b=this.thead.insertRow(-1);
+this.heading=b.insertCell(-1);
+this.heading.colSpan=l;
+this.content.style.display="block";
+if(this.position=="absolute"){this.content.style.width="auto";
+this.maintab.style.width="auto"
+}else{this.container.style.position="relative";
+this.heading.style.position="static";
+this.content.style.padding="0px";
+this.content.style.width="15em";
+this.maintab.style.width="100%"
+}this.heading.className="RicoCalHeading";
+if(Rico.theme.calendarHeading){Rico.addClass(this.heading,Rico.theme.calendarHeading)
+}this.navtab=this.heading.appendChild(document.createElement("table"));
+this.navrow=this.navtab.insertRow(-1);
+this._createTitleSection("Month");
+this.navrow.insertCell(-1).innerHTML="&nbsp;&nbsp;";
+this._createTitleSection("Year");
+new Rico.HoverSet(this.heading.getElementsByTagName("a"));
+if(this.position=="absolute"){this.heading.appendChild(Rico.closeButton(Rico.eventHandle(this,"close")))
+}this.styles=[];
 for(g=0;
 g<7;
 g++){b=this.tbody.insertRow(-1);
-b.className="row"+g;
-for(k=0;
-k<7+this.colStart;
-k++){b.insertCell(-1)
-}}b=this.tbody.rows[0];
-b.className="ricoCalDayNames";
-if(this.options.showWeekNumber){b.cells[0].innerHTML=this.weekString;
-for(g=0;
-g<7;
-g++){this.tbody.rows[g].cells[0].className="ricoCalWeekNum"
-}}this.styles=[];
-for(g=0;
-g<7;
-g++){o=(g+this.options.startAt)%7;
-b.cells[g+this.colStart].innerHTML=Rico.dayAbbr(o);
-this.styles[g]="ricoCal"+o
-}if(this.options.showToday){this.tfoot=this.maintab.createTFoot();
+b.className=g==0?"ricoCalDayNames":"row"+g;
+if(this.options.showWeekNumber){k=b.insertCell(-1);
+k.className="ricoCalWeekNum";
+if(g==0){k.innerHTML=Rico.getPhraseById("calWeekHdg")
+}}for(f=0;
+f<7;
+f++){k=b.insertCell(-1);
+if(g==0){p=(f+this.options.startAt)%7;
+k.innerHTML=Rico.dayAbbr(p);
+this.styles[f]="ricoCal"+p
+}else{k.className=this.styles[f];
+if(Rico.theme.calendarDay){Rico.addClass(k,Rico.theme.calendarDay)
+}}}}if(this.options.showToday){this.tfoot=this.maintab.createTFoot();
+this.tfoot.className="ricoCalFoot";
 b=this.tfoot.insertRow(-1);
 this.todayCell=b.insertCell(-1);
-this.todayCell.colSpan=7+this.colStart;
-if(Rico.theme.calendarFooter){Rico.addClass(this.todayCell,Rico.theme.calendarFooter)
-}Rico.eventBind(this.todayCell,"click",Rico.eventHandle(this,"selectNow"),false)
+this.todayCell.colSpan=l;
+this.todayCell.className=Rico.theme.calendarFooter||"ricoCalFoot";
+Rico.eventBind(this.todayCell,"click",Rico.eventHandle(this,"selectNow"),false)
 }this.content.appendChild(this.maintab);
 new Rico.HoverSet(this.tbody.getElementsByTagName("td"),{hoverNodes:function(a){return a.innerHTML.match(/^\d+$/)?[a]:[]
 }});
-this.monthPopup=new Rico.Popup(document.createElement("div"));
-this.monthPopup.closePopup();
+this.monthPopup=new Rico.Popup(document.createElement("div"),{shim:false,zIndex:10});
+this.monthPopup.content.className="ricoCalMonthPrompt";
 e=document.createElement("table");
 e.className="ricoCalMenu";
 if(Rico.theme.calendarPopdown){Rico.addClass(e,Rico.theme.calendarPopdown)
@@ -776,56 +1162,55 @@ g++){b=e.insertRow(-1);
 for(f=0;
 f<3;
 f++){k=b.insertCell(-1);
-l=document.createElement("a");
-l.innerHTML=Rico.monthAbbr(g*3+f);
-l.name=g*3+f;
-if(Rico.theme.calendarDay){Rico.addClass(l,Rico.theme.calendarDay)
-}k.appendChild(l);
-Rico.eventBind(l,"click",Rico.eventHandle(this,"selectMonth"),false)
+m=document.createElement("a");
+m.innerHTML=Rico.monthAbbr(g*3+f);
+m.name=g*3+f;
+if(Rico.theme.calendarDay){Rico.addClass(m,Rico.theme.calendarDay)
+}k.appendChild(m);
+Rico.eventBind(m,"click",Rico.eventHandle(this,"selectMonth"),false)
 }}new Rico.HoverSet(e.getElementsByTagName("a"));
 this.monthPopup.content.appendChild(e);
 this.container.appendChild(this.monthPopup.container);
-this.yearPopup=new Rico.Popup(document.createElement("div"));
-this.yearPopup.closePopup();
+this.monthPopup.closePopup();
+this.yearPopup=new Rico.Popup(document.createElement("div"),{shim:false,zIndex:10});
 this.yearPopup.content.className="ricoCalYearPrompt";
 if(Rico.theme.calendarPopdown){Rico.addClass(this.yearPopup.content,Rico.theme.calendarPopdown)
-}var n=document.createElement("p");
-n.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
-var m=document.createElement("p");
-this.yearInput=m.appendChild(document.createElement("input"));
+}var o=document.createElement("p");
+o.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
+var n=document.createElement("p");
+this.yearInput=n.appendChild(document.createElement("input"));
 this.yearInput.maxlength=4;
 this.yearInput.size=4;
 Rico.eventBind(this.yearInput,"keyup",Rico.eventHandle(this,"yearKey"),false);
-l=Rico.floatButton("Checkmark",Rico.eventHandle(this,"processPopUpYear"));
-m.appendChild(l);
-l=Rico.floatButton("Cancel",Rico.eventHandle(this,"popDownYear"));
-m.appendChild(l);
+m=Rico.floatButton("Checkmark",Rico.eventHandle(this,"processPopUpYear"));
+n.appendChild(m);
+m=Rico.floatButton("Cancel",Rico.eventHandle(this,"popDownYear"));
+n.appendChild(m);
+this.yearPopup.content.appendChild(o);
 this.yearPopup.content.appendChild(n);
-this.yearPopup.content.appendChild(m);
 this.container.appendChild(this.yearPopup.container);
-this.yearPopup.container.style.left="";
-this.yearPopup.container.style.right="5px";
-this.yearPopup.container.style.zIndex=10;
-l=this.content.getElementsByTagName("a");
+this.yearPopup.closePopup();
+m=this.content.getElementsByTagName("a");
 for(g=0;
-g<l.length;
-g++){l[g].href="javascript:void(0)"
+g<m.length;
+g++){m[g].href="javascript:void(0)"
 }Rico.eventBind(this.tbody,"click",Rico.eventHandle(this,"saveAndClose"));
 this.close();
 this.bPageLoaded=true
-},_createTitleSection:function(d){var c=document.createElement("span");
-c.className="RicoCal"+d+"Heading";
-if(Rico.theme.calendarSubheading){Rico.addClass(c,Rico.theme.calendarSubheading)
-}var b=c.appendChild(document.createElement("a"));
-b.className="Rico_leftArrow";
-b.appendChild(this.createNavArrow("dec"+d,"left"));
-var b=c.appendChild(document.createElement("a"));
-Rico.eventBind(b,"click",Rico.eventHandle(this,"popUp"+d),false);
-this["title"+d]=b;
-b=c.appendChild(document.createElement("a"));
-b.className="Rico_rightArrow";
-b.appendChild(this.createNavArrow("inc"+d,"right"));
-return c
+},_createTitleSection:function(e){var d=["left","right"];
+if(this.direction=="rtl"){d.reverse()
+}var f=this.navrow.insertCell(-1);
+var b=f.appendChild(document.createElement("a"));
+b.className="Rico_"+d[0]+"Arrow";
+b.appendChild(this.createNavArrow("dec"+e,d[0]));
+f=this.navrow.insertCell(-1);
+b=f.appendChild(document.createElement("a"));
+Rico.eventBind(b,"click",Rico.eventHandle(this,"popUp"+e),false);
+this["title"+e]=b;
+f=this.navrow.insertCell(-1);
+b=f.appendChild(document.createElement("a"));
+b.className="Rico_"+d[1]+"Arrow";
+b.appendChild(this.createNavArrow("inc"+e,d[1]))
 },selectNow:function(){var a=new Date();
 this.dateNow=a.getDate();
 this.monthNow=a.getMonth();
@@ -863,24 +1248,26 @@ this.constructCalendar()
 this.monthSelected=parseInt(a.name,10);
 this.constructCalendar();
 Rico.eventStop(b)
+},openYrMo:function(b,a){if(this.direction=="rtl"){a=1-a
+}b.openPopup();
+var c=a?this.content.offsetWidth-b.container.offsetWidth-5:3;
+b.move(c,this.heading.offsetHeight+2)
 },popUpMonth:function(a){Rico.eventStop(a);
 if(this.monthPopup.visible()){this.popDownMonth();
-return
+return false
 }this.popDownYear();
-if(Rico.isIE&&Rico.ieVersion<7){this.monthPopup.openPopup(null,this.heading.offsetHeight+2);
-this.monthPopup.container.style.left=""
-}else{this.monthPopup.openPopup(3,this.heading.offsetHeight+2)
-}return false
+this.openYrMo(this.monthPopup,0);
+return false
 },popDownMonth:function(){this.monthPopup.closePopup()
 },popDownYear:function(){this.yearPopup.closePopup();
 this.yearInput.disabled=true
 },popUpYear:function(b){Rico.eventStop(b);
 if(this.yearPopup.visible()){this.popDownYear();
-return
+return false
 }this.popDownMonth();
 this.yearInput.disabled=false;
 this.yearInput.value="";
-this.yearPopup.openPopup(null,this.heading.offsetHeight+2);
+this.openYrMo(this.yearPopup,1);
 var a=this;
 setTimeout(function(){a.yearInput.focus()
 },10);
@@ -949,6 +1336,7 @@ if(!g){g=this.Holidays[this.holidayKey(0,this.monthSelected,k)]
 }m.style.color=g?g.txtColor:"";
 m.style.backgroundColor=g?g.bgColor:"";
 m.title=g?g.desc:"";
+m.style.visibility="visible";
 if(b==6){a++
 }}while(n<42){b=n%7;
 this.resetCell(this.tbody.rows[a].cells[b+this.colStart]);
@@ -958,10 +1346,8 @@ if(b==6){a++
 this.titleYear.innerHTML=this.yearSelected;
 if(this.todayCell){this.todayCell.innerHTML=Rico.getPhraseById("calToday",this.dateNow,Rico.monthAbbr(this.monthNow),this.yearNow,this.monthNow+1)
 }},resetCell:function(a){a.innerHTML="&nbsp;";
-a.className="ricoCalEmpty";
-a.style.color="";
-a.style.backgroundColor="";
-a.title=""
+a.title="";
+a.style.visibility="hidden"
 },saveAndClose:function(g){Rico.eventStop(g);
 var f=Rico.eventElement(g);
 var c=f.innerHTML.replace(/&nbsp;/g,"");
@@ -1821,7 +2207,7 @@ d=e.appendChild(document.createElement("span"));
 d.innerHTML=b.displayName;
 Rico.eventBind(b.ChooserBox,"click",Rico.eventHandle(b,"chooseColumn"),false)
 }}Rico.log("opening columnChooser");
-this.columnChooser.openPopup(1,this.hdrHt);
+this.columnChooser.openPopup(3,this.hdrHt+3);
 for(a=0;
 a<this.columns.length;
 a++){this.columns[a].ChooserBox.checked=this.columns[a].visible;
@@ -1925,7 +2311,7 @@ a++){b.push(escape(c.filterValues[a]))
 }};
 Rico.ColumnConst={UNFILTERED:0,SYSTEMFILTER:1,USERFILTER:2,UNSORTED:0,SORT_ASC:"ASC",SORT_DESC:"DESC",MINWIDTH:10};
 Rico.TableColumnBase=function(){};
-Rico.TableColumnBase.prototype={baseInit:function(h,g,e,d){Rico.log("TableColumnBase.init index="+g+" tabIdx="+d);
+Rico.TableColumnBase.prototype={baseInit:function(h,g,e,d){Rico.log("TableColumnBase.baseInit index="+g+" tabIdx="+d);
 this.liveGrid=h;
 this.index=g;
 this.hideWidth=Rico.isKonqueror||Rico.isWebKit||h.headerRowCnt>1?5:2;
@@ -1945,15 +2331,13 @@ this.mouseDownHandler=Rico.eventHandle(this,"handleMouseDown");
 this.mouseMoveHandler=Rico.eventHandle(this,"handleMouseMove");
 this.mouseUpHandler=Rico.eventHandle(this,"handleMouseUp");
 this.mouseOutHandler=Rico.eventHandle(this,"handleMouseOut");
-this.fieldName="col"+this.index;
 this.format={type:"text"};
 var b=h.options.columnSpecs[g];
 if(typeof b=="object"){Rico.extend(this.format,b)
 }Rico.addClass(this.dataColDiv,this.colClassName());
 this.visible=true;
 if(typeof this.format.visible=="boolean"){this.visible=this.format.visible
-}Rico.log("TableColumn.init index="+g+" fieldName="+this.fieldName);
-this.sortable=typeof this.format.canSort=="boolean"?this.format.canSort:h.options.canSortDefault;
+}this.sortable=typeof this.format.canSort=="boolean"?this.format.canSort:h.options.canSortDefault;
 this.currentSort=Rico.ColumnConst.UNSORTED;
 this.filterable=typeof this.format.canFilter=="boolean"?this.format.canFilter:h.options.canFilterDefault;
 this.filterType=Rico.ColumnConst.UNFILTERED;
@@ -2009,7 +2393,7 @@ this.mousePluggedIn=false
 },handleMouseDown:function(b){this.resizeStart=Rico.eventClient(b).x;
 this.origWidth=parseInt(this.colWidth,10);
 var a=Rico.positionedOffset(this.hdrCell);
-if(this.liveGrid.direction=="rtl"){this.edge=a.left+this.liveGrid.options.scrollBarWidth;
+if(this.liveGrid.direction=="rtl"){this.edge=a.left;
 switch(this.tabIdx){case 0:this.edge+=this.liveGrid.innerDiv.offsetWidth;
 break;
 case 1:this.edge-=this.liveGrid.scrollDiv.scrollLeft;
@@ -2614,8 +2998,11 @@ if(this.options.offset&&this.options.offset<this.buffer.totalRows){Rico.runLater
 this.setHorizontalScroll();
 Rico.log("setHorizontalScroll done");
 if(this.options.windowResize){Rico.runLater(100,this,"pluginWindowResize")
-}Rico.log("initialize complete for "+this.tableId)
-}};
+}Rico.log("initialize complete for "+this.tableId);
+if(this.direction=="rtl"&&(!Rico.isWebKit||this.scrollDiv.clientLeft>0)){this.scrollTab.style.right="0px"
+}else{this.scrollTab.style.left="0px";
+Rico.setStyle(this.tabs[1],{"float":"left"})
+}}};
 Rico.LiveGridMethods={createHoverSet:function(){var a=[];
 for(var b=0;
 b<this.headerColCnt;
@@ -3270,28 +3657,24 @@ a++){this.columns[a].setImage()
 a<this.columns.length;
 a++){if(this.columns[a].isSorted()){return a
 }}return -1
-},findColumnName:function(a){for(var b=0;
-b<this.columns.length;
-b++){if(this.columns[b].fieldName==a){return b
-}}return -1
 },findColumnsBySpec:function(b,c){var a=[];
 for(var d=0;
 d<this.options.columnSpecs.length;
 d++){if(this.options.columnSpecs[d][b]==c){a.push(d)
 }}return a
-},setSortUI:function(b,c){Rico.log("setSortUI: "+b+" "+c);
+},setSortUI:function(c,b){Rico.log("setSortUI: "+c+" "+b);
 var a=this.findSortedColumn();
-if(a>=0){c=this.columns[a].getSortDirection()
-}else{if(typeof c!="string"){c=Rico.ColumnConst.SORT_ASC
-}else{c=c.toUpperCase();
-if(c!=Rico.ColumnConst.SORT_DESC){c=Rico.ColumnConst.SORT_ASC
-}}switch(typeof b){case"string":a=this.findColumnName(b);
+if(a>=0){b=this.columns[a].getSortDirection()
+}else{if(typeof b!="string"){b=Rico.ColumnConst.SORT_ASC
+}else{b=b.toUpperCase();
+if(b!=Rico.ColumnConst.SORT_DESC){b=Rico.ColumnConst.SORT_ASC
+}}switch(typeof c){case"string":a=this.findColumnsBySpec("id",c);
 break;
-case"number":a=b;
+case"number":a=c;
 break
 }}if(typeof(a)!="number"||a<0){return
 }this.clearSort();
-this.columns[a].setSorted(c);
+this.columns[a].setSorted(b);
 this.buffer.sortBuffer(a)
 },clearSort:function(){for(var a=0;
 a<this.columns.length;