var Rico={Version:"1.1-beta2"};
Rico.ArrayExtensions=new Array();
if(Object.prototype.extend){
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(dx){
if(isNaN(dx)||dx>this.length){
return false;
}
for(var i=0,n=0;i<this.length;i++){
if(i!=dx){
this[n++]=this[i];
}
}
this.length-=1;
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.remove;
}
if(!Array.prototype.removeItem){
Array.prototype.removeItem=function(_3){
for(var i=0;i<this.length;i++){
if(this[i]==_3){
this.remove(i);
break;
}
}
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.removeItem;
}
if(!Array.prototype.indices){
Array.prototype.indices=function(){
var _5=new Array();
for(index in this){
var _6=false;
for(var i=0;i<Rico.ArrayExtensions.length;i++){
if(this[index]==Rico.ArrayExtensions[i]){
_6=true;
break;
}
}
if(!_6){
_5[_5.length]=index;
}
}
return _5;
};
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(s){
var _9=(new DOMParser()).parseFromString(s,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild);
}
for(var i=0;i<_9.childNodes.length;i++){
this.appendChild(this.importNode(_9.childNodes[i],true));
}
};
}
Document.prototype.__defineGetter__("xml",function(){
return (new XMLSerializer()).serializeToString(this);
});
}
document.getElementsByTagAndClassName=function(_b,_c){
if(_b==null){
_b="*";
}
var _d=document.getElementsByTagName(_b)||document.all;
var _e=new Array();
if(_c==null){
return _d;
}
for(var i=0;i<_d.length;i++){
var _10=_d[i];
var _11=_10.className.split(" ");
for(var j=0;j<_11.length;j++){
if(_11[j]==_c){
_e.push(_10);
break;
}
}
}
return _e;
};
Rico.Color=Class.create();
Rico.Color.prototype={initialize:function(red,_14,_15){
this.rgb={r:red,g:_14,b:_15};
},setRed:function(r){
this.rgb.r=r;
},setGreen:function(g){
this.rgb.g=g;
},setBlue:function(b){
this.rgb.b=b;
},setHue:function(h){
var hsb=this.asHSB();
hsb.h=h;
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);
},setSaturation:function(s){
var hsb=this.asHSB();
hsb.s=s;
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);
},setBrightness:function(b){
var hsb=this.asHSB();
hsb.b=b;
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);
},darken:function(_1f){
var hsb=this.asHSB();
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-_1f,0));
},brighten:function(_21){
var hsb=this.asHSB();
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+_21,1));
},blend:function(_23){
this.rgb.r=Math.floor((this.rgb.r+_23.rgb.r)/2);
this.rgb.g=Math.floor((this.rgb.g+_23.rgb.g)/2);
this.rgb.b=Math.floor((this.rgb.b+_23.rgb.b)/2);
},isBright:function(){
var hsb=this.asHSB();
return this.asHSB().b>0.5;
},isDark:function(){
return !this.isBright();
},asRGB:function(){
return "rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")";
},asHex:function(){
return "#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart();
},asHSB:function(){
return Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);
},toString:function(){
return this.asHex();
}};
Rico.Color.createFromHex=function(_25){
if(_25.indexOf("#")==0){
_25=_25.substring(1);
}
var red=_25.substring(0,2);
var _27=_25.substring(2,4);
var _28=_25.substring(4,6);
return new Rico.Color(parseInt(red,16),parseInt(_27,16),parseInt(_28,16));
};
Rico.Color.createColorFromBackground=function(_29){
var _2a=RicoUtil.getElementsComputedStyle($(_29),"backgroundColor","background-color");
if(_2a=="transparent"&&_29.parent){
return Rico.Color.createColorFromBackground(_29.parent);
}
if(_2a==null){
return new Rico.Color(255,255,255);
}
if(_2a.indexOf("rgb(")==0){
var _2b=_2a.substring(4,_2a.length-1);
var _2c=_2b.split(",");
return new Rico.Color(parseInt(_2c[0]),parseInt(_2c[1]),parseInt(_2c[2]));
}else{
if(_2a.indexOf("#")==0){
var _2d=parseInt(_2a.substring(1,3),16);
var _2e=parseInt(_2a.substring(3,5),16);
var _2f=parseInt(_2a.substring(5),16);
return new Rico.Color(_2d,_2e,_2f);
}else{
return new Rico.Color(255,255,255);
}
}
};
Rico.Color.HSBtoRGB=function(hue,_31,_32){
var red=0;
var _34=0;
var _35=0;
if(_31==0){
red=parseInt(_32*255+0.5);
_34=red;
_35=red;
}else{
var h=(hue-Math.floor(hue))*6;
var f=h-Math.floor(h);
var p=_32*(1-_31);
var q=_32*(1-_31*f);
var t=_32*(1-(_31*(1-f)));
switch(parseInt(h)){
case 0:
red=(_32*255+0.5);
_34=(t*255+0.5);
_35=(p*255+0.5);
break;
case 1:
red=(q*255+0.5);
_34=(_32*255+0.5);
_35=(p*255+0.5);
break;
case 2:
red=(p*255+0.5);
_34=(_32*255+0.5);
_35=(t*255+0.5);
break;
case 3:
red=(p*255+0.5);
_34=(q*255+0.5);
_35=(_32*255+0.5);
break;
case 4:
red=(t*255+0.5);
_34=(p*255+0.5);
_35=(_32*255+0.5);
break;
case 5:
red=(_32*255+0.5);
_34=(p*255+0.5);
_35=(q*255+0.5);
break;
}
}
return {r:parseInt(red),g:parseInt(_34),b:parseInt(_35)};
};
Rico.Color.RGBtoHSB=function(r,g,b){
var hue;
var _3f;
var _40;
var _41=(r>g)?r:g;
if(b>_41){
_41=b;
}
var _42=(r<g)?r:g;
if(b<_42){
_42=b;
}
_40=_41/255;
if(_41!=0){
saturation=(_41-_42)/_41;
}else{
saturation=0;
}
if(saturation==0){
hue=0;
}else{
var _43=(_41-r)/(_41-_42);
var _44=(_41-g)/(_41-_42);
var _45=(_41-b)/(_41-_42);
if(r==_41){
hue=_45-_44;
}else{
if(g==_41){
hue=2+_43-_45;
}else{
hue=4+_44-_43;
}
}
hue=hue/6;
if(hue<0){
hue=hue+1;
}
}
return {h:hue,s:saturation,b:_40};
};
Rico.Corner={round:function(e,_47){
var e=$(e);
this._setOptions(_47);
var _48=this.options.color;
if(this.options.color=="fromElement"){
_48=this._background(e);
}
var _49=this.options.bgColor;
if(this.options.bgColor=="fromParent"){
_49=this._background(e.offsetParent);
}
this._roundCornersImpl(e,_48,_49);
},_roundCornersImpl:function(e,_4b,_4c){
if(this.options.border){
this._renderBorder(e,_4c);
}
if(this._isTopRounded()){
this._roundTopCorners(e,_4b,_4c);
}
if(this._isBottomRounded()){
this._roundBottomCorners(e,_4b,_4c);
}
},_renderBorder:function(el,_4e){
var _4f="1px solid "+this._borderColor(_4e);
var _50="border-left: "+_4f;
var _51="border-right: "+_4f;
var _52="style='"+_50+";"+_51+"'";
el.innerHTML="<div "+_52+">"+el.innerHTML+"</div>";
},_roundTopCorners:function(el,_54,_55){
var _56=this._createCorner(_55);
for(var i=0;i<this.options.numSlices;i++){
_56.appendChild(this._createCornerSlice(_54,_55,i,"top"));
}
el.style.paddingTop=0;
el.insertBefore(_56,el.firstChild);
},_roundBottomCorners:function(el,_59,_5a){
var _5b=this._createCorner(_5a);
for(var i=(this.options.numSlices-1);i>=0;i--){
_5b.appendChild(this._createCornerSlice(_59,_5a,i,"bottom"));
}
el.style.paddingBottom=0;
el.appendChild(_5b);
},_createCorner:function(_5d){
var _5e=document.createElement("div");
_5e.style.backgroundColor=(this._isTransparent()?"transparent":_5d);
return _5e;
},_createCornerSlice:function(_5f,_60,n,_62){
var _63=document.createElement("span");
var _64=_63.style;
_64.backgroundColor=_5f;
_64.display="block";
_64.height="1px";
_64.overflow="hidden";
_64.fontSize="1px";
var _65=this._borderColor(_5f,_60);
if(this.options.border&&n==0){
_64.borderTopStyle="solid";
_64.borderTopWidth="1px";
_64.borderLeftWidth="0px";
_64.borderRightWidth="0px";
_64.borderBottomWidth="0px";
_64.height="0px";
_64.borderColor=_65;
}else{
if(_65){
_64.borderColor=_65;
_64.borderStyle="solid";
_64.borderWidth="0px 1px";
}
}
if(!this.options.compact&&(n==(this.options.numSlices-1))){
_64.height="2px";
}
this._setMargin(_63,n,_62);
this._setBorder(_63,n,_62);
return _63;
},_setOptions:function(_66){
this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false}.extend(_66||{});
this.options.numSlices=this.options.compact?2:4;
if(this._isTransparent()){
this.options.blend=false;
}
},_whichSideTop:function(){
if(this._hasString(this.options.corners,"all","top")){
return "";
}
if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){
return "";
}
if(this.options.corners.indexOf("tl")>=0){
return "left";
}else{
if(this.options.corners.indexOf("tr")>=0){
return "right";
}
}
return "";
},_whichSideBottom:function(){
if(this._hasString(this.options.corners,"all","bottom")){
return "";
}
if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){
return "";
}
if(this.options.corners.indexOf("bl")>=0){
return "left";
}else{
if(this.options.corners.indexOf("br")>=0){
return "right";
}
}
return "";
},_borderColor:function(_67,_68){
if(_67=="transparent"){
return _68;
}else{
if(this.options.border){
return this.options.border;
}else{
if(this.options.blend){
return this._blend(_68,_67);
}else{
return "";
}
}
}
},_setMargin:function(el,n,_6b){
var _6c=this._marginSize(n);
var _6d=_6b=="top"?this._whichSideTop():this._whichSideBottom();
if(_6d=="left"){
el.style.marginLeft=_6c+"px";
el.style.marginRight="0px";
}else{
if(_6d=="right"){
el.style.marginRight=_6c+"px";
el.style.marginLeft="0px";
}else{
el.style.marginLeft=_6c+"px";
el.style.marginRight=_6c+"px";
}
}
},_setBorder:function(el,n,_70){
var _71=this._borderSize(n);
var _72=_70=="top"?this._whichSideTop():this._whichSideBottom();
if(_72=="left"){
el.style.borderLeftWidth=_71+"px";
el.style.borderRightWidth="0px";
}else{
if(_72=="right"){
el.style.borderRightWidth=_71+"px";
el.style.borderLeftWidth="0px";
}else{
el.style.borderLeftWidth=_71+"px";
el.style.borderRightWidth=_71+"px";
}
}
},_marginSize:function(n){
if(this._isTransparent()){
return 0;
}
var _74=[5,3,2,1];
var _75=[3,2,1,0];
var _76=[2,1];
var _77=[1,0];
if(this.options.compact&&this.options.blend){
return _77[n];
}else{
if(this.options.compact){
return _76[n];
}else{
if(this.options.blend){
return _75[n];
}else{
return _74[n];
}
}
}
},_borderSize:function(n){
var _79=[5,3,2,1];
var _7a=[2,1,1,1];
var _7b=[1,0];
var _7c=[0,2,0,0];
if(this.options.compact&&(this.options.blend||this._isTransparent())){
return 1;
}else{
if(this.options.compact){
return _7b[n];
}else{
if(this.options.blend){
return _7a[n];
}else{
if(this.options.border){
return _7c[n];
}else{
if(this._isTransparent()){
return _79[n];
}
}
}
}
}
return 0;
},_hasString:function(str){
for(var i=1;i<arguments.length;i++){
if(str.indexOf(arguments[i])>=0){
return true;
}
}
return false;
},_blend:function(c1,c2){
var cc1=Rico.Color.createFromHex(c1);
cc1.blend(Rico.Color.createFromHex(c2));
return cc1;
},_background:function(el){
try{
return Rico.Color.createColorFromBackground(el).asHex();
}
catch(err){
return "#ffffff";
}
},_isTransparent:function(){
return this.options.color=="transparent";
},_isTopRounded:function(){
return this._hasString(this.options.corners,"all","top","tl","tr");
},_isBottomRounded:function(){
return this._hasString(this.options.corners,"all","bottom","bl","br");
},_hasSingleTextChild:function(el){
return el.childNodes.length==1&&el.childNodes[0].nodeType==3;
}};
Rico.DragAndDrop=Class.create();
Rico.DragAndDrop.prototype={initialize:function(){
this.dropZones=new Array();
this.draggables=new Array();
this.currentDragObjects=new Array();
this.dragElement=null;
this.lastSelectedDraggable=null;
this.currentDragObjectVisible=false;
this.interestedInMotionEvents=false;
},registerDropZone:function(_84){
this.dropZones[this.dropZones.length]=_84;
},deregisterDropZone:function(_85){
var _86=new Array();
var j=0;
for(var i=0;i<this.dropZones.length;i++){
if(this.dropZones[i]!=_85){
_86[j++]=this.dropZones[i];
}
}
this.dropZones=_86;
},clearDropZones:function(){
this.dropZones=new Array();
},registerDraggable:function(_89){
this.draggables[this.draggables.length]=_89;
this._addMouseDownHandler(_89);
},clearSelection:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].deselect();
}
this.currentDragObjects=new Array();
this.lastSelectedDraggable=null;
},hasSelection:function(){
return this.currentDragObjects.length>0;
},setStartDragFromElement:function(e,_8c){
this.origPos=RicoUtil.toDocumentPosition(_8c);
this.startx=e.screenX-this.origPos.x;
this.starty=e.screenY-this.origPos.y;
this.interestedInMotionEvents=this.hasSelection();
this._terminateEvent(e);
},updateSelection:function(_8d,_8e){
if(!_8e){
this.clearSelection();
}
if(_8d.isSelected()){
this.currentDragObjects.removeItem(_8d);
_8d.deselect();
if(_8d==this.lastSelectedDraggable){
this.lastSelectedDraggable=null;
}
}else{
this.currentDragObjects[this.currentDragObjects.length]=_8d;
_8d.select();
this.lastSelectedDraggable=_8d;
}
},_mouseDownHandler:function(e){
if(arguments.length==0){
e=event;
}
var _90=e.which!=undefined;
if((_90&&e.which!=1)||(!_90&&e.button!=1)){
return;
}
var _91=e.target?e.target:e.srcElement;
var _92=_91.draggable;
var _93=_91;
while(_92==null&&_93.parentNode){
_93=_93.parentNode;
_92=_93.draggable;
}
if(_92==null){
return;
}
this.updateSelection(_92,e.ctrlKey);
if(this.hasSelection()){
for(var i=0;i<this.dropZones.length;i++){
this.dropZones[i].clearPositionCache();
}
}
this.setStartDragFromElement(e,_92.getMouseDownHTMLElement());
},_mouseMoveHandler:function(e){
var _96=e.which!=undefined;
if(!this.interestedInMotionEvents){
this._terminateEvent(e);
return;
}
if(!this.hasSelection()){
return;
}
if(!this.currentDragObjectVisible){
this._startDrag(e);
}
if(!this.activatedDropZones){
this._activateRegisteredDropZones();
}
this._updateDraggableLocation(e);
this._updateDropZonesHover(e);
this._terminateEvent(e);
},_makeDraggableObjectVisible:function(e){
if(!this.hasSelection()){
return;
}
var _98;
if(this.currentDragObjects.length>1){
_98=this.currentDragObjects[0].getMultiObjectDragGUI(this.currentDragObjects);
}else{
_98=this.currentDragObjects[0].getSingleObjectDragGUI();
}
if(RicoUtil.getElementsComputedStyle(_98,"position")!="absolute"){
_98.style.position="absolute";
}
if(_98.parentNode==null||_98.parentNode.nodeType==11){
document.body.appendChild(_98);
}
this.dragElement=_98;
this._updateDraggableLocation(e);
this.currentDragObjectVisible=true;
},_updateDraggableLocation:function(e){
var _9a=this.dragElement.style;
_9a.left=(e.screenX-this.startx)+"px";
_9a.top=(e.screenY-this.starty)+"px";
},_updateDropZonesHover:function(e){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
if(!this._mousePointInDropZone(e,this.dropZones[i])){
this.dropZones[i].hideHover();
}
}
for(var i=0;i<n;i++){
if(this._mousePointInDropZone(e,this.dropZones[i])){
if(this.dropZones[i].canAccept(this.currentDragObjects)){
this.dropZones[i].showHover();
}
}
}
},_startDrag:function(e){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].startDrag();
}
this._makeDraggableObjectVisible(e);
},_mouseUpHandler:function(e){
if(!this.hasSelection()){
return;
}
var _a1=e.which!=undefined;
if((_a1&&e.which!=1)||(!_a1&&e.button!=1)){
return;
}
this.interestedInMotionEvents=false;
if(this.dragElement==null){
this._terminateEvent(e);
return;
}
if(this._placeDraggableInDropZone(e)){
this._completeDropOperation(e);
}else{
this._terminateEvent(e);
new Effect.Position(this.dragElement,this.origPos.x,this.origPos.y,200,20,{complete:this._doCancelDragProcessing.bind(this)});
}
},_completeDropOperation:function(e){
if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()){
if(this.dragElement.parentNode!=null){
this.dragElement.parentNode.removeChild(this.dragElement);
}
}
this._deactivateRegisteredDropZones();
this._endDrag();
this.clearSelection();
this.dragElement=null;
this.currentDragObjectVisible=false;
this._terminateEvent(e);
},_doCancelDragProcessing:function(){
this._cancelDrag();
if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()){
if(this.dragElement.parentNode!=null){
this.dragElement.parentNode.removeChild(this.dragElement);
}
}
this._deactivateRegisteredDropZones();
this.dragElement=null;
this.currentDragObjectVisible=false;
},_placeDraggableInDropZone:function(e){
var _a4=false;
var n=this.dropZones.length;
for(var i=0;i<n;i++){
if(this._mousePointInDropZone(e,this.dropZones[i])){
if(this.dropZones[i].canAccept(this.currentDragObjects)){
this.dropZones[i].hideHover();
this.dropZones[i].accept(this.currentDragObjects);
_a4=true;
break;
}
}
}
return _a4;
},_cancelDrag:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].cancelDrag();
}
},_endDrag:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].endDrag();
}
},_mousePointInDropZone:function(e,_aa){
var _ab=_aa.getAbsoluteRect();
return e.clientX>_ab.left&&e.clientX<_ab.right&&e.clientY>_ab.top&&e.clientY<_ab.bottom;
},_addMouseDownHandler:function(_ac){
var _ad=_ac.getMouseDownHTMLElement();
if(_ad!=null){
_ad.draggable=_ac;
this._addMouseDownEvent(_ad);
}
},_activateRegisteredDropZones:function(){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
var _b0=this.dropZones[i];
if(_b0.canAccept(this.currentDragObjects)){
_b0.activate();
}
}
this.activatedDropZones=true;
},_deactivateRegisteredDropZones:function(){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
this.dropZones[i].deactivate();
}
this.activatedDropZones=false;
},_addMouseDownEvent:function(_b3){
if(typeof document.implementation!="undefined"&&document.implementation.hasFeature("HTML","1.0")&&document.implementation.hasFeature("Events","2.0")&&document.implementation.hasFeature("CSS","2.0")){
_b3.addEventListener("mousedown",this._mouseDownHandler.bindAsEventListener(this),false);
}else{
_b3.attachEvent("onmousedown",this._mouseDownHandler.bindAsEventListener(this));
}
},_terminateEvent:function(e){
if(e.stopPropagation!=undefined){
e.stopPropagation();
}else{
if(e.cancelBubble!=undefined){
e.cancelBubble=true;
}
}
if(e.preventDefault!=undefined){
e.preventDefault();
}else{
e.returnValue=false;
}
},initializeEventHandlers:function(){
if(typeof document.implementation!="undefined"&&document.implementation.hasFeature("HTML","1.0")&&document.implementation.hasFeature("Events","2.0")&&document.implementation.hasFeature("CSS","2.0")){
document.addEventListener("mouseup",this._mouseUpHandler.bindAsEventListener(this),false);
document.addEventListener("mousemove",this._mouseMoveHandler.bindAsEventListener(this),false);
}else{
document.attachEvent("onmouseup",this._mouseUpHandler.bindAsEventListener(this));
document.attachEvent("onmousemove",this._mouseMoveHandler.bindAsEventListener(this));
}
}};
var dndMgr=new Rico.DragAndDrop();
dndMgr.initializeEventHandlers();
Rico.Draggable=Class.create();
Rico.Draggable.prototype={initialize:function(_b5,_b6){
this.type=_b5;
this.htmlElement=$(_b6);
this.selected=false;
},getMouseDownHTMLElement:function(){
return this.htmlElement;
},select:function(){
this.selected=true;
if(this.showingSelected){
return;
}
var _b7=this.getMouseDownHTMLElement();
var _b8=Rico.Color.createColorFromBackground(_b7);
_b8.isBright()?_b8.darken(0.033):_b8.brighten(0.033);
this.saveBackground=RicoUtil.getElementsComputedStyle(_b7,"backgroundColor","background-color");
_b7.style.backgroundColor=_b8.asHex();
this.showingSelected=true;
},deselect:function(){
this.selected=false;
if(!this.showingSelected){
return;
}
var _b9=this.getMouseDownHTMLElement();
_b9.style.backgroundColor=this.saveBackground;
this.showingSelected=false;
},isSelected:function(){
return this.selected;
},startDrag:function(){
},cancelDrag:function(){
},endDrag:function(){
},getSingleObjectDragGUI:function(){
return this.htmlElement;
},getMultiObjectDragGUI:function(_ba){
return this.htmlElement;
},getDroppedGUI:function(){
return this.htmlElement;
},toString:function(){
return this.type+":"+this.htmlElement+":";
}};
Rico.Dropzone=Class.create();
Rico.Dropzone.prototype={initialize:function(_bb){
this.htmlElement=$(_bb);
this.absoluteRect=null;
},getHTMLElement:function(){
return this.htmlElement;
},clearPositionCache:function(){
this.absoluteRect=null;
},getAbsoluteRect:function(){
if(this.absoluteRect==null){
var _bc=this.getHTMLElement();
var pos=RicoUtil.toViewportPosition(_bc);
this.absoluteRect={top:pos.y,left:pos.x,bottom:pos.y+_bc.offsetHeight,right:pos.x+_bc.offsetWidth};
}
return this.absoluteRect;
},activate:function(){
var _be=this.getHTMLElement();
if(_be==null||this.showingActive){
return;
}
this.showingActive=true;
this.saveBackgroundColor=_be.style.backgroundColor;
var _bf="#ffea84";
var _c0=Rico.Color.createColorFromBackground(_be);
if(_c0==null){
_be.style.backgroundColor=_bf;
}else{
_c0.isBright()?_c0.darken(0.2):_c0.brighten(0.2);
_be.style.backgroundColor=_c0.asHex();
}
},deactivate:function(){
var _c1=this.getHTMLElement();
if(_c1==null||!this.showingActive){
return;
}
_c1.style.backgroundColor=this.saveBackgroundColor;
this.showingActive=false;
this.saveBackgroundColor=null;
},showHover:function(){
var _c2=this.getHTMLElement();
if(_c2==null||this.showingHover){
return;
}
this.saveBorderWidth=_c2.style.borderWidth;
this.saveBorderStyle=_c2.style.borderStyle;
this.saveBorderColor=_c2.style.borderColor;
this.showingHover=true;
_c2.style.borderWidth="1px";
_c2.style.borderStyle="solid";
_c2.style.borderColor="#ffff00";
},hideHover:function(){
var _c3=this.getHTMLElement();
if(_c3==null||!this.showingHover){
return;
}
_c3.style.borderWidth=this.saveBorderWidth;
_c3.style.borderStyle=this.saveBorderStyle;
_c3.style.borderColor=this.saveBorderColor;
this.showingHover=false;
},canAccept:function(_c4){
return true;
},accept:function(_c5){
var _c6=this.getHTMLElement();
if(_c6==null){
return;
}
n=_c5.length;
for(var i=0;i<n;i++){
var _c8=_c5[i].getDroppedGUI();
if(RicoUtil.getElementsComputedStyle(_c8,"position")=="absolute"){
_c8.style.position="static";
_c8.style.top="";
_c8.style.top="";
}
_c6.appendChild(_c8);
}
}};
if(window.Effect==undefined){
Effect={};
}
Effect.SizeAndPosition=Class.create();
Effect.SizeAndPosition.prototype={initialize:function(_c9,x,y,w,h,_ce,_cf,_d0){
this.element=$(_c9);
this.x=x;
this.y=y;
this.w=w;
this.h=h;
this.duration=_ce;
this.steps=_cf;
this.options=arguments[7]||{};
this.sizeAndPosition();
},sizeAndPosition:function(){
if(this.isFinished()){
if(this.options.complete){
this.options.complete(this);
}
return;
}
if(this.timer){
clearTimeout(this.timer);
}
var _d1=Math.round(this.duration/this.steps);
var _d2=this.element.offsetLeft;
var _d3=this.element.offsetTop;
var _d4=this.element.offsetWidth;
var _d5=this.element.offsetHeight;
this.x=(this.x)?this.x:_d2;
this.y=(this.y)?this.y:_d3;
this.w=(this.w)?this.w:_d4;
this.h=(this.h)?this.h:_d5;
var _d6=this.steps>0?(this.x-_d2)/this.steps:0;
var _d7=this.steps>0?(this.y-_d3)/this.steps:0;
var _d8=this.steps>0?(this.w-_d4)/this.steps:0;
var _d9=this.steps>0?(this.h-_d5)/this.steps:0;
this.moveBy(_d6,_d7);
this.resizeBy(_d8,_d9);
this.duration-=_d1;
this.steps--;
this.timer=setTimeout(this.sizeAndPosition.bind(this),_d1);
},isFinished:function(){
return this.steps<=0;
},moveBy:function(_da,_db){
var _dc=this.element.offsetLeft;
var _dd=this.element.offsetTop;
var _de=parseInt(_da);
var _df=parseInt(_db);
var _e0=this.element.style;
if(_de!=0){
_e0.left=(_dc+_de)+"px";
}
if(_df!=0){
_e0.top=(_dd+_df)+"px";
}
},resizeBy:function(_e1,_e2){
var _e3=this.element.offsetWidth;
var _e4=this.element.offsetHeight;
var _e5=parseInt(_e1);
var _e6=parseInt(_e2);
var _e7=this.element.style;
if(_e5!=0){
_e7.width=(_e3+_e5)+"px";
}
if(_e6!=0){
_e7.height=(_e4+_e6)+"px";
}
}};
Effect.Size=Class.create();
Effect.Size.prototype={initialize:function(_e8,w,h,_eb,_ec,_ed){
new Effect.SizeAndPosition(_e8,null,null,w,h,_eb,_ec,_ed);
}};
Effect.Position=Class.create();
Effect.Position.prototype={initialize:function(_ee,x,y,_f1,_f2,_f3){
new Effect.SizeAndPosition(_ee,x,y,null,null,_f1,_f2,_f3);
}};
Effect.Round=Class.create();
Effect.Round.prototype={initialize:function(_f4,_f5,_f6){
var _f7=document.getElementsByTagAndClassName(_f4,_f5);
for(var i=0;i<_f7.length;i++){
Rico.Corner.round(_f7[i],_f6);
}
}};
Effect.FadeTo=Class.create();
Effect.FadeTo.prototype={initialize:function(_f9,_fa,_fb,_fc,_fd){
this.element=$(_f9);
this.opacity=_fa;
this.duration=_fb;
this.steps=_fc;
this.options=arguments[4]||{};
this.fadeTo();
},fadeTo:function(){
if(this.isFinished()){
if(this.options.complete){
this.options.complete(this);
}
return;
}
if(this.timer){
clearTimeout(this.timer);
}
var _fe=Math.round(this.duration/this.steps);
var _ff=this.getElementOpacity();
var _100=this.steps>0?(this.opacity-_ff)/this.steps:0;
this.changeOpacityBy(_100);
this.duration-=_fe;
this.steps--;
this.timer=setTimeout(this.fadeTo.bind(this),_fe);
},changeOpacityBy:function(v){
var _102=this.getElementOpacity();
var _103=Math.max(0,Math.min(_102+v,1));
this.element.ricoOpacity=_103;
this.element.style.filter="alpha(opacity:"+Math.round(_103*100)+")";
this.element.style.opacity=_103;
},isFinished:function(){
return this.steps<=0;
},getElementOpacity:function(){
if(this.element.ricoOpacity==undefined){
var _104;
if(this.element.currentStyle){
_104=this.element.currentStyle.opacity;
}else{
if(document.defaultView.getComputedStyle!=undefined){
var _105=document.defaultView.getComputedStyle;
_104=_105(this.element,null).getPropertyValue("opacity");
}
}
this.element.ricoOpacity=_104!=undefined?_104:1;
}
return parseFloat(this.element.ricoOpacity);
}};
Effect.AccordionSize=Class.create();
Effect.AccordionSize.prototype={initialize:function(e1,e2,_108,end,_10a,_10b,_10c){
this.e1=$(e1);
this.e2=$(e2);
this.start=_108;
this.end=end;
this.duration=_10a;
this.steps=_10b;
this.options=arguments[6]||{};
this.accordionSize();
},accordionSize:function(){
if(this.isFinished()){
this.e1.style.height=this.start+"px";
this.e2.style.height=this.end+"px";
if(this.options.complete){
this.options.complete(this);
}
return;
}
if(this.timer){
clearTimeout(this.timer);
}
var _10d=Math.round(this.duration/this.steps);
var diff=this.steps>0?(parseInt(this.e1.offsetHeight)-this.start)/this.steps:0;
this.resizeBy(diff);
this.duration-=_10d;
this.steps--;
this.timer=setTimeout(this.accordionSize.bind(this),_10d);
},isFinished:function(){
return this.steps<=0;
},resizeBy:function(diff){
var _110=this.e1.offsetHeight;
var _111=this.e2.offsetHeight;
var _112=parseInt(diff);
if(diff!=0){
this.e1.style.height=(_110-_112)+"px";
this.e2.style.height=(_111+_112)+"px";
}
}};
var RicoUtil={getElementsComputedStyle:function(_113,_114,_115){
if(arguments.length==2){
_115=_114;
}
var el=$(_113);
if(el.currentStyle){
return el.currentStyle[_114];
}else{
return document.defaultView.getComputedStyle(el,null).getPropertyValue(_115);
}
},createXmlDocument:function(){
if(document.implementation&&document.implementation.createDocument){
var doc=document.implementation.createDocument("","",null);
if(doc.readyState==null){
doc.readyState=1;
doc.addEventListener("load",function(){
doc.readyState=4;
if(typeof doc.onreadystatechange=="function"){
doc.onreadystatechange();
}
},false);
}
return doc;
}
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;
},getContentAsString:function(_118){
return _118.xml!=undefined?this._getContentAsStringIE(_118):this._getContentAsStringMozilla(_118);
},_getContentAsStringIE:function(_119){
var _11a="";
for(var i=0;i<_119.childNodes.length;i++){
_11a+=_119.childNodes[i].xml;
}
return _11a;
},_getContentAsStringMozilla:function(_11c){
var _11d=new XMLSerializer();
var _11e="";
for(var i=0;i<_11c.childNodes.length;i++){
_11e+=_11d.serializeToString(_11c.childNodes[i]);
}
return _11e;
},toViewportPosition:function(_120){
return this._toAbsolute(_120,true);
},toDocumentPosition:function(_121){
return this._toAbsolute(_121,false);
},_toAbsolute:function(_122,_123){
if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){
return this._toAbsoluteMozilla(_122,_123);
}
var x=0;
var y=0;
var _126=_122;
while(_126){
var _127=0;
var _128=0;
if(_126!=_122){
var _127=parseInt(this.getElementsComputedStyle(_126,"borderLeftWidth"));
var _128=parseInt(this.getElementsComputedStyle(_126,"borderTopWidth"));
_127=isNaN(_127)?0:_127;
_128=isNaN(_128)?0:_128;
}
x+=_126.offsetLeft-_126.scrollLeft+_127;
y+=_126.offsetTop-_126.scrollTop+_128;
_126=_126.offsetParent;
}
if(_123){
x-=this.docScrollLeft();
y-=this.docScrollTop();
}
return {x:x,y:y};
},_toAbsoluteMozilla:function(_129,_12a){
var x=0;
var y=0;
var _12d=_129;
while(_12d){
x+=_12d.offsetLeft;
y+=_12d.offsetTop;
_12d=_12d.offsetParent;
}
_12d=_129;
while(_12d&&_12d!=document.body&&_12d!=document.documentElement){
if(_12d.scrollLeft){
x-=_12d.scrollLeft;
}
if(_12d.scrollTop){
y-=_12d.scrollTop;
}
_12d=_12d.parentNode;
}
if(_12a){
x-=this.docScrollLeft();
y-=this.docScrollTop();
}
return {x:x,y:y};
},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;
}
}
}
}};


