if(typeof YAHOO=="undefined"){var YAHOO={};} YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i-1){return true;}else{return YAHOO.lang.isObject(obj)&&obj.constructor==Array;}},isBoolean:function(obj){return typeof obj=='boolean';},isFunction:function(obj){return typeof obj=='function';},isNull:function(obj){return obj===null;},isNumber:function(obj){return typeof obj=='number'&&isFinite(obj);},isObject:function(obj){return obj&&(typeof obj=='object'||YAHOO.lang.isFunction(obj));},isString:function(obj){return typeof obj=='string';},isUndefined:function(obj){return typeof obj=='undefined';},hasOwnProperty:function(obj,prop){if(Object.prototype.hasOwnProperty){return obj.hasOwnProperty(prop);} return!YAHOO.lang.isUndefined(obj[prop])&&obj.constructor.prototype[prop]!==obj[prop];},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");} var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;} if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}},augment:function(r,s){if(!s||!r){throw new Error("YAHOO.lang.augment failed, please check that "+"all dependencies are included.");} var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i0){param=args[0];} ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);} if(false===ret){if(!this.silent){} return false;}}} return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i=0){cacheItem=listeners[index];} if(!el||!cacheItem){return false;} if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i0);} var notAvail=[];for(var i=0,len=onAvailStack.length;i0){for(var i=0,len=listeners.length;i0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);} j=j-1;} l=null;EU.clearCache();} for(i=0,len=legacyEvents.length;i-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;} if(propertyCache[property]){return propertyCache[property];} while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());} propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];} return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}} return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};} if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}} break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};} YAHOO.util.Dom={get:function(el){if(!el){return null;} if(typeof el!='string'&&!(el instanceof Array)){return el;} if(typeof el=='string'){return document.getElementById(el);} else{var collection=[];for(var i=0,len=el.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];} this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region(); YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=YAHOO.util.Dom.get(this.id);} return this._domRef;},getDragEl:function(){return YAHOO.util.Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);YAHOO.util.Event.addListener(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;YAHOO.util.Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;} var dx=diffX||0;var dy=diffY||0;var p=YAHOO.util.Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.deltaSetXY=null;this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||YAHOO.util.Dom.getXY(this.getEl());this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];} this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){YAHOO.util.Event.addListener(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);},unreg:function(){YAHOO.util.Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var EU=YAHOO.util.Event;var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;} if(this.isLocked()){return;} this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(EU.getPageX(e),EU.getPageY(e));if(this.DDM.isOverTarget(pt,this)){var srcEl=EU.getTarget(e);if(this.isValidHandleChild(srcEl)&&(this.id==this.handleElId||this.DDM.handleWasClicked(srcEl,this.id))){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}}},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}} for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}} this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}} for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}} this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=iLeft;this.rightConstraint=iRight;this.minX=this.initPageX-iLeft;this.maxX=this.initPageX+iRight;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);} this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=iUp;this.bottomConstraint=iDown;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+iDown;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);} this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();} if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);} if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}} return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=new function(){this.ids={};this.handleIds={};this.dragCurrent=null;this.dragOvers={};this.deltaX=0;this.deltaY=0;this.preventDefault=true;this.stopPropagation=true;this.initalized=false;this.locked=false;this.init=function(){this.initialized=true;};this.POINT=0;this.INTERSECT=1;this.mode=this.POINT;this._execOnAll=function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;} oDD[sMethod].apply(oDD,args);}}};this._onLoad=function(){this.init();var EU=YAHOO.util.Event;EU.on(document,"mouseup",this.handleMouseUp,this,true);EU.on(document,"mousemove",this.handleMouseMove,this,true);EU.on(window,"unload",this._onUnload,this,true);EU.on(window,"resize",this._onResize,this,true);};this._onResize=function(e){this._execOnAll("resetConstraints",[]);};this.lock=function(){this.locked=true;};this.unlock=function(){this.locked=false;};this.isLocked=function(){return this.locked;};this.locationCache={};this.useCache=true;this.clickPixelThresh=3;this.clickTimeThresh=1000;this.dragThreshMet=false;this.clickTimeout=null;this.startX=0;this.startY=0;this.regDragDrop=function(oDD,sGroup){if(!this.initialized){this.init();} if(!this.ids[sGroup]){this.ids[sGroup]={};} this.ids[sGroup][oDD.id]=oDD;};this.removeDDFromGroup=function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};} var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}};this._remove=function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}} delete this.handleIds[oDD.id];};this.regHandle=function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};} this.handleIds[sDDId][sHandleId]=sHandleId;};this.isDragDrop=function(id){return(this.getDDById(id))?true:false;};this.getRelated=function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;} if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}} return oDDs;};this.isLegalTarget=function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;ithis.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}} if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);} this.stopEvent(e);return true;};this.fireEvents=function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;} var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;} if(!this.isOverTarget(pt,ddo,this.mode)){outEvts.push(ddo);} oldOvers[i]=true;delete this.dragOvers[i];} for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;} for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;} if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);} this.dragOvers[oDD.id]=oDD;}}}}} if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);} if(enterEvts.length){dc.onDragEnter(e,enterEvts);} if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);} if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i1000){}else{var DDM=YAHOO.util.DDM;setTimeout(function(){DDM._addListeners();},10);if(document&&document.body){this._timeoutCount+=1;}}}};this.handleWasClicked=function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}} return false;};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();} YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop);YAHOO.util.DD.prototype.scroll=true;YAHOO.util.DD.prototype.autoOffset=function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);};YAHOO.util.DD.prototype.setDelta=function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;};YAHOO.util.DD.prototype.setDragElPos=function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);};YAHOO.util.DD.prototype.alignElWithMouse=function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");} this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);};YAHOO.util.DD.prototype.cachePosition=function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}};YAHOO.util.DD.prototype.autoScroll=function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot0&&y-stclientW&&toRight0&&x-slthis.maxX){x=this.maxX;}} if(this.constrainY){if(ythis.maxY){y=this.maxY;}} x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};};YAHOO.util.DD.prototype.applyConfig=function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);};YAHOO.util.DD.prototype.b4MouseDown=function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DD.prototype.b4Drag=function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DD.prototype.toString=function(){return("DD "+this.id);};YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD);YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.util.DDProxy.prototype.resizeFrame=true;YAHOO.util.DDProxy.prototype.centerFrame=false;YAHOO.util.DDProxy.prototype._previousSize=[-1,-1];YAHOO.util.DDProxy.prototype.createFrame=function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;} var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}};YAHOO.util.DDProxy.prototype.initFrame=function(){this.createFrame();};YAHOO.util.DDProxy.prototype.applyConfig=function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);};YAHOO.util.DDProxy.prototype.showFrame=function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));} this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");};YAHOO.util.DDProxy.prototype._resizeProxy=function(){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();if(this.resizeFrame){var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;} if(isNaN(br)){br=0;} if(isNaN(bb)){bb=0;} if(isNaN(bl)){bl=0;} var newWidth=el.offsetWidth-br-bl;var newHeight=el.offsetHeight-bt-bb;if(this._previousSize[0]!==newWidth&&this._previousSize[1]!==newHeight){DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");this._previousSize=[newWidth,newHeight];}}};YAHOO.util.DDProxy.prototype.b4MouseDown=function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);};YAHOO.util.DDProxy.prototype.b4StartDrag=function(x,y){this.showFrame(x,y);};YAHOO.util.DDProxy.prototype.b4EndDrag=function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");};YAHOO.util.DDProxy.prototype.endDrag=function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");};YAHOO.util.DDProxy.prototype.toString=function(){return("DDProxy "+this.id);};YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop);YAHOO.util.DDTarget.prototype.toString=function(){return("DDTarget "+this.id);}; YAHOO.widget.DateMath=new function(){this.DAY="D";this.WEEK="W";this.YEAR="Y";this.MONTH="M";this.ONE_DAY_MS=1000*60*60*24;this.add=function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}} d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;} return d;};this.subtract=function(date,field,amount){return this.add(date,field,(amount*-1));};this.before=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()ms){return true;}else{return false;}};this.between=function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}};this.getJan1=function(calendarYear){return new Date(calendarYear,0,1);};this.getDayOffset=function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;};this.getWeekNumber=function(date,calendarYear,weekStartsOn){date.setHours(12,0,0,0);if(!weekStartsOn){weekStartsOn=0;} if(!calendarYear){calendarYear=date.getFullYear();} var weekNum=-1;var jan1=this.getJan1(calendarYear);var jan1Offset=jan1.getDay()-weekStartsOn;var jan1DayOfWeek=(jan1Offset>=0?jan1Offset:(7+jan1Offset));var endOfWeek1=this.add(jan1,this.DAY,(6-jan1DayOfWeek));endOfWeek1.setHours(23,59,59,999);var month=date.getMonth();var day=date.getDate();var year=date.getFullYear();var dayOffset=this.getDayOffset(date,calendarYear);if(dayOffset<0||this.before(date,endOfWeek1)){weekNum=1;}else{weekNum=2;var weekBegin=new Date(endOfWeek1.getTime()+1);var weekEnd=this.add(weekBegin,this.WEEK,1);while(!this.between(date,weekBegin,weekEnd)){weekBegin=this.add(weekBegin,this.WEEK,1);weekEnd=this.add(weekEnd,this.WEEK,1);weekNum+=1;}} return weekNum;};this.isYearOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;} return overlaps;};this.isMonthOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;} return overlaps;};this.findMonthStart=function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;};this.findMonthEnd=function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;};this.clearTime=function(date){date.setHours(0,0,0,0);return date;};} YAHOO.widget.Calendar_Core=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}} YAHOO.widget.Calendar_Core.IMG_ROOT=(window.location.href.toLowerCase().indexOf("https")==0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");YAHOO.widget.Calendar_Core.DATE="D";YAHOO.widget.Calendar_Core.MONTH_DAY="MD";YAHOO.widget.Calendar_Core.WEEKDAY="WD";YAHOO.widget.Calendar_Core.RANGE="R";YAHOO.widget.Calendar_Core.MONTH="M";YAHOO.widget.Calendar_Core.DISPLAY_DAYS=42;YAHOO.widget.Calendar_Core.STOP_RENDER="S";YAHOO.widget.Calendar_Core.prototype={Config:null,parent:null,index:-1,cells:null,weekHeaderCells:null,weekFooterCells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,pageDate:null,_pageDate:null,minDate:null,maxDate:null,selectedDates:null,_selectedDates:null,shellRendered:false,table:null,headerCell:null};YAHOO.widget.Calendar_Core.prototype.init=function(id,containerId,monthyear,selected){this.setupConfig();this.id=id;this.cellDates=new Array();this.cells=new Array();this.renderStack=new Array();this._renderStack=new Array();this.oDomContainer=document.getElementById(containerId);this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);var month;var year;if(monthyear){var aMonthYear=monthyear.split(this.Locale.DATE_FIELD_DELIMITER);month=parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);year=parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);}else{month=this.today.getMonth()+1;year=this.today.getFullYear();} this.pageDate=new Date(year,month-1,1);this._pageDate=new Date(this.pageDate.getTime());if(selected){this.selectedDates=this._parseDates(selected);this._selectedDates=this.selectedDates.concat();}else{this.selectedDates=new Array();this._selectedDates=new Array();} this.wireDefaultEvents();this.wireCustomEvents();};YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents=function(){this.doSelectCell=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){if(cal.Options.MULTI_SELECT){var link=cell.getElementsByTagName("A")[0];link.blur();var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{var link=cell.getElementsByTagName("A")[0];link.blur() cal.selectCell(index);}}} this.doCellMouseOver=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){YAHOO.util.Dom.addClass(cell,cal.Style.CSS_CELL_HOVER);}} this.doCellMouseOut=function(e,cal){YAHOO.util.Dom.removeClass(this,cal.Style.CSS_CELL_HOVER);} this.doNextMonth=function(e,cal){cal.nextMonth();} this.doPreviousMonth=function(e,cal){cal.previousMonth();}} YAHOO.widget.Calendar_Core.prototype.wireCustomEvents=function(){} YAHOO.widget.Calendar_Core.prototype.setupConfig=function(){this.Config=new Object();this.Config.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_CONTAINER:"yui-calcontainer",CSS_2UPWRAPPER:"yui-cal2upwrapper",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};this.Style=this.Config.Style;this.Config.Locale={MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],MONTHS_LONG:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKDAYS_1CHAR:["S","M","T","W","T","F","S"],WEEKDAYS_SHORT:["Su","Mo","Tu","We","Th","Fr","Sa"],WEEKDAYS_MEDIUM:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],WEEKDAYS_LONG:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DATE_DELIMITER:",",DATE_FIELD_DELIMITER:"/",DATE_RANGE_DELIMITER:"-",MY_MONTH_POSITION:1,MY_YEAR_POSITION:2,MD_MONTH_POSITION:1,MD_DAY_POSITION:2,MDY_MONTH_POSITION:1,MDY_DAY_POSITION:2,MDY_YEAR_POSITION:3};this.Locale=this.Config.Locale;this.Config.Options={MULTI_SELECT:false,SHOW_WEEKDAYS:true,START_WEEKDAY:0,SHOW_WEEK_HEADER:false,SHOW_WEEK_FOOTER:false,HIDE_BLANK_WEEKS:false,NAV_ARROW_LEFT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/callt.gif",NAV_ARROW_RIGHT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/calrt.gif"};this.Options=this.Config.Options;this.customConfig();if(!this.Options.LOCALE_MONTHS){this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;} if(!this.Options.LOCALE_WEEKDAYS){this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;} if(this.Options.START_WEEKDAY>0){for(var w=0;w0){this.preMonthDays-=this.Options.START_WEEKDAY;} if(this.preMonthDays<0){this.preMonthDays+=7;} this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekRowIndex=0;for(var c=0;c=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(r,1);}} break;case YAHOO.widget.Calendar_Core.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];} break;case YAHOO.widget.Calendar_Core.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];} break;} if(renderer){cellRenderers[cellRenderers.length]=renderer;}}} if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=this.renderCellStyleSelected;} if(this.minDate){this.minDate=YAHOO.widget.DateMath.clearTime(this.minDate);} if(this.maxDate){this.maxDate=YAHOO.widget.DateMath.clearTime(this.maxDate);} if((this.minDate&&(workingDate.getTime()this.maxDate.getTime()))){cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=this.renderCellDefault;} for(var x=0;x=0&&c<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);} if((c%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);} if(((c+1)%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);} var postDays=this.postMonthDays;if(postDays>=7&&this.Options.HIDE_BLANK_WEEKS){var blankWeeks=Math.floor(postDays/7);for(var p=0;p=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}}};YAHOO.widget.Calendar_Core.prototype.renderFooter=function(){};YAHOO.widget.Calendar_Core.prototype._unload=function(e,cal){for(var c in cal.cells){c=null;} cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;} YAHOO.widget.Calendar_Core.prototype.renderRowHeader=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_HEADER);var useYear=this.pageDate.getFullYear();if(!YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)){useYear=workingDate.getFullYear();} var weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useYear,this.Options.START_WEEKDAY);cell.innerHTML=weekNum;if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderRowFooter=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_FOOTER);if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML="";var link=document.createElement("a");link.href="javascript:void(null);";link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));cell.appendChild(link);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.addMonths=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractMonths=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.addYears=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractYears=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar_Core.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar_Core.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar_Core.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar_Core.prototype.reset=function(){this.selectedDates.length=0;this.selectedDates=this._selectedDates.concat();this.pageDate=new Date(this._pageDate.getTime());this.onReset();};YAHOO.widget.Calendar_Core.prototype.clear=function(){this.selectedDates.length=0;this.pageDate=new Date(this.today.getTime());this.onClear();};YAHOO.widget.Calendar_Core.prototype.select=function(date){this.onBeforeSelect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a-1){if(this.pageDate.getMonth()==dCellDate.getMonth()&&this.pageDate.getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);} this.selectedDates.splice(cellDateIndex,1);} if(this.parent){this.parent.sync(this);} this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectAll=function(){this.onBeforeDeselect();var count=this.selectedDates.length;this.selectedDates.length=0;if(this.parent){this.parent.sync(this);} if(count>0){this.onDeselect();} return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype._toFieldArray=function(date){var returnDate=new Array();if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i0){this.init(id,containerId,monthyear,selected);}} YAHOO.widget.Calendar.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar.prototype.buildShell=function(){this.border=document.createElement("DIV");this.border.className=this.Style.CSS_CONTAINER;this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.border.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();};YAHOO.widget.Calendar.prototype.renderShell=function(){this.border.appendChild(this.table);this.oDomContainer.appendChild(this.border);this.shellRendered=true;};YAHOO.widget.Calendar.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.previousMonth);} this.linkLeft=document.createElement("A");this.linkLeft.innerHTML=" ";YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.previousMonth,this,true);this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.nextMonth);} this.linkRight=document.createElement("A");this.linkRight.innerHTML=" ";YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.nextMonth,this,true);this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;headerContainer.appendChild(this.linkLeft);headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));headerContainer.appendChild(this.linkRight);this.headerCell.appendChild(headerContainer);};YAHOO.widget.Cal=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(pageCount,id,containerId,monthyear,selected){if(arguments.length>0){this.init(pageCount,id,containerId,monthyear,selected);}} YAHOO.widget.CalendarGroup.prototype.init=function(pageCount,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p0) {year+=1;} cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){for(var p=0;p=0;--p) {var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p0) {this.init(id,containerId,monthyear,selected);}} YAHOO.widget.Calendar2up_Cal.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar2up_Cal.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.index==0){if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth);} this.linkLeft=document.createElement("A");this.linkLeft.innerHTML=" ";this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth,this.parent);headerContainer.appendChild(this.linkLeft);} headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));if(this.index==1){if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.parent.doNextMonth);} this.linkRight=document.createElement("A");this.linkRight.innerHTML=" ";this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.parent.doNextMonth,this.parent);headerContainer.appendChild(this.linkRight);} this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar2up=function(id,containerId,monthyear,selected){if(arguments.length>0) {this.buildWrapper(containerId);this.init(2,id,containerId,monthyear,selected);}} YAHOO.widget.Calendar2up.prototype=new YAHOO.widget.CalendarGroup();YAHOO.widget.Calendar2up.CSS_2UPWRAPPER="yui-cal2upwrapper";YAHOO.widget.Calendar2up.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.Calendar2up.CSS_2UPCONTAINER="cal2up";YAHOO.widget.Calendar2up.CSS_2UPTITLE="title";YAHOO.widget.Calendar2up.CSS_2UPCLOSE="close-icon";YAHOO.widget.Calendar2up.prototype.constructChild=function(id,containerId,monthyear,selected){var cal=new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);return cal;};YAHOO.widget.Calendar2up.prototype.buildWrapper=function(containerId){var outerContainer=document.getElementById(containerId);outerContainer.className=YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;var innerContainer=document.createElement("DIV");innerContainer.className=YAHOO.widget.Calendar2up.CSS_CONTAINER;innerContainer.id=containerId+"_inner";var cal1Container=document.createElement("DIV");cal1Container.id=containerId+"_0";cal1Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;cal1Container.style.marginRight="10px";var cal2Container=document.createElement("DIV");cal2Container.id=containerId+"_1";cal2Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;outerContainer.appendChild(innerContainer);innerContainer.appendChild(cal1Container);innerContainer.appendChild(cal2Container);this.innerContainer=innerContainer;this.outerContainer=outerContainer;} YAHOO.widget.Calendar2up.prototype.render=function(){this.renderHeader();YAHOO.widget.CalendarGroup.prototype.render.call(this);this.renderFooter();};YAHOO.widget.Calendar2up.prototype.renderHeader=function(){if(!this.title){this.title="";} if(!this.titleDiv) {this.titleDiv=document.createElement("DIV");if(this.title=="") {this.titleDiv.style.display="none";}} this.titleDiv.className=YAHOO.widget.Calendar2up.CSS_2UPTITLE;this.titleDiv.innerHTML=this.title;if(this.outerContainer.style.position=="absolute") {var linkClose=document.createElement("A");linkClose.href="javascript:void(null)";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this);var imgClose=document.createElement("IMG");imgClose.src=YAHOO.widget.Calendar_Core.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.Calendar2up.CSS_2UPCLOSE;linkClose.appendChild(imgClose);this.linkClose=linkClose;this.titleDiv.appendChild(linkClose);} this.innerContainer.insertBefore(this.titleDiv,this.innerContainer.firstChild);} YAHOO.widget.Calendar2up.prototype.hide=function(e,cal){if(!cal) {cal=this;} cal.outerContainer.style.display="none";} YAHOO.widget.Calendar2up.prototype.renderFooter=function(){} YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up; (function(){YAHOO.util.Lang={isArray:function(val){if(val.constructor&&val.constructor.toString().indexOf('Array')>-1){return true;}else{return YAHOO.util.Lang.isObject(val)&&val.constructor==Array;}},isBoolean:function(val){return typeof val=='boolean';},isFunction:function(val){return typeof val=='function';},isNull:function(val){return val===null;},isNumber:function(val){return!isNaN(val);},isObject:function(val){return typeof val=='object'||YAHOO.util.Lang.isFunction(val);},isString:function(val){return typeof val=='string';},isUndefined:function(val){return typeof val=='undefined';}};})();YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(value,silent){var beforeRetVal;var owner=this.owner;var name=this.name;var event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;} if(this.validator&&!this.validator.call(owner,value)){return false;} if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){return false;}} if(this.method){this.method.call(owner,value);} this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);} return true;},configure:function(map,init){map=map||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var key in map){if(key&&map.hasOwnProperty(key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){var configs=this._configs||{};var config=configs[key];if(!config){return undefined;} return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){return false;} return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(configs.hasOwnProperty(key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}} return keys;},setAttributes:function(map,silent){for(var key in map){if(map.hasOwnProperty(key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){var configs=this._configs||{};if(configs[key]){this.set(key,configs[key]._initialConfig.value,silent);return true;} return false;},refresh:function(key,silent){var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i1){if(index+1==tabCount){this.set('activeIndex',index-1);}else{this.set('activeIndex',index+1);}}} this._tabParent.removeChild(tab.get('element'));this._contentParent.removeChild(tab.get('contentEl'));this._configs.tabs.value.splice(index,1);};proto.toString=function(){var name=this.get('id')||this.get('tagName');return"TabView "+name;};proto.contentTransition=function(newTab,oldTab){newTab.set('contentVisible',true);oldTab.set('contentVisible',false);};proto.initAttributes=function(attr){YAHOO.widget.TabView.superclass.initAttributes.call(this,attr);if(!attr.orientation){attr.orientation='top';} var el=this.get('element');this.register('tabs',{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,'ul')[0]||_createTabParent.call(this);this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,'div')[0]||_createContentParent.call(this);this.register('orientation',{value:attr.orientation,method:function(value){var current=this.get('orientation');this.addClass('yui-navset-'+value);if(current!=value){this.removeClass('yui-navset-'+current);} switch(value){case'bottom':this.appendChild(this._tabParent);break;}}});this.register('activeIndex',{value:attr.activeIndex,method:function(value){this.set('activeTab',this.getTab(value));},validator:function(value){return!this.getTab(value).get('disabled');}});this.register('activeTab',{value:attr.activeTab,method:function(tab){var activeTab=this.get('activeTab');if(tab){tab.set('active',true);} if(activeTab&&activeTab!=tab){activeTab.set('active',false);} if(activeTab&&tab!=activeTab){this.contentTransition(tab,activeTab);}else if(tab){tab.set('contentVisible',true);}},validator:function(value){return!value.get('disabled');}});if(this._tabParent){_initTabs.call(this);} for(var type in this.DOM_EVENTS){if(this.DOM_EVENTS.hasOwnProperty(type)){this.addListener.call(this,type,this.DOMEventHandler);}}};var _initTabs=function(){var tab,attr,contentEl;var el=this.get('element');var tabs=_getChildNodes(this._tabParent);var contentElements=_getChildNodes(this._contentParent);for(var i=0,len=tabs.length;i0)?val:0;} YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);} var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;} return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';} return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;} start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);} tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);} this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;} else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);} return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);} return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.2.2",build:"204"}); var TrimPath;(function(){var PRESERVE_CR=false if('1'.replace(/1/,function(){return''})){String.prototype.__REPLACE_OLD__=String.prototype.replace;String.prototype.replace=function(re,arg){if(typeof arg=='function'){var text=this;var matches=text.match(re)||[];for(var i=1;i<65536;i++){var placeholder=String.fromCharCode(i);if(text.indexOf(placeholder)==-1)break;} text=text.__REPLACE_OLD__(re,placeholder);var dash=(placeholder!='-')?'-':'~';var parts=(dash+text+dash).split(placeholder);parts[0]=parts[0].substr(1);parts[parts.length-1]=parts[parts.length-1].substr(0,parts[parts.length-1].length-1);for(var i=0;i0;i--){var match=pieces[i].match(reParams);params=match[2]&&(','+match[2]);s1+='_MODIFIERS["'+match[1]+'"](';s2=params+')'+s2;} expressions[expressions.length]=s1+identifier+s2;}else{expressions[expressions.length]='_ECHO('+expression+');';} return'\x01';}) var reBlock=/\{(%?)((\/?[^\}\s]+)\s*([^\}]*))\1\}/g;var blocks=[];temp=temp.replace(reBlock,function($0,$1,$2,tag,expression){var tagFunc=tagFunctions[tag];if(tagFunc){blocks[blocks.length]=tagFunc(expression)||'';return'\x02';}else{return $0;}}) var reWhiteSpaceLeft=/([\r\n]*)([^\x01\x02]+)/g;temp=temp.replace(reWhiteSpaceLeft,'$1\x04$2');var reWhiteSpaceRight=/(\x04[^\x01\x02]*[\r\n])([\t ]+[\x02])/g;temp=temp.replace(reWhiteSpaceRight,'$1\x04$2');temp=encodeJS(temp);var reLiteral=/([^\x01\x02\x04]*)\x04([^\x01\x02\x04]+)\x04?([^\x01\x02\x04]*)/g;var literals=[];temp=temp.replace(reLiteral,function($0,whitespaceLeft,body,whitespaceRight){whitespaceLeft=whitespaceLeft&&('if(_FLAGS.keepWhitespace==true)_ECHO(\''+whitespaceLeft+'\');');body=body&&('_ECHO(\''+body+'\');');whitespaceRight=whitespaceRight&&('if(_FLAGS.keepWhitespace==true)_ECHO(\''+whitespaceRight+'\');');literals[literals.length]=whitespaceLeft+body+whitespaceRight;return'\x03';}) var i1=0,i2=0,i3=0;temp=temp.replace(/\x01/g,function(){return expressions[i1++]});temp=temp.replace(/\x02/g,function(){return blocks[i2++]});temp=temp.replace(/\x03/g,function(){return literals[i3++]});this.sourceFunc=['function defined(p){return (_CONTEXT[p]!=null);}','function __LENGTH_STACK_CONSTRUCTOR__(){this.level=-1;this.goUp=function(){this.level++;this[this.level]=0;};this.goDown=function(){this.level--;};this.increment=function(){this[this.level]++;};this.getCurrent=function(){return this[this.level];};}','var __LENGTH_STACK__= new __LENGTH_STACK_CONSTRUCTOR__();','with(_CONTEXT){',temp,'}'].join('');try{this.render=new Function('_CONTEXT','_ECHO','_FLAGS','_MODIFIERS',this.sourceFunc);}catch(e){this.render=function(_CONTEXT,_ECHO){_ECHO('Error parsing template. Use original TrimPath engine to debug.');}}} T.modifiers={'eat':function(){return''},'escape':function(s){return String(s).replace(/&/g,'&').replace(//g,'>')},'capitalize':function(s){return String(s).toUpperCase()},'default':function(s,d){return s!=null?s:d}};T.modifiers['h']=T.modifiers['escape'];var tagFunctions={'if':function(expression){return'if('+expression+'){'},'elseif':function(expression){return'}else if('+expression+'){'},'else':function(){return'}else{'},'/if':function(){return'}'},'for':function(expression){var match=expression.match(/^(\w+) in (.+)$/) if(match){var listName='__LIST__'+match[1] var indexName=match[1]+'_index' return['var ',listName,'=',match[2],';','__LENGTH_STACK__.goUp();','if (',listName,'!=null){','for(var ',indexName,' in ',listName,'){','if (typeof ',listName,'[',indexName,']==\'function\') continue;','__LENGTH_STACK__.increment();','var ',match[1],'=',listName,'[',indexName,'];'].join('')}},'forelse':function(){return'}}if(!__LENGTH_STACK__.getCurrent()){if(true){'},'/for':function(){return'}}__LENGTH_STACK__.goDown();'},'var':function(expression){return'var '+expression+';'},'macro':function(expression){var match=expression.match(/^(\w+)\s*\(([^\)]*)\)\s*$/) if(match){return['function ',match[1],'(',match[2],'){','var __LENGTH_STACK__= new __LENGTH_STACK_CONSTRUCTOR__();','var __OUT__=[];var _ECHO=function(s) {__OUT__[__OUT__.length]=s};',].join('')}},'/macro':function(){return'return __OUT__.join(\'\');}'},'eval':function(expression){return'eval(\''+encodeJS(expression.replace(/\x07/g,'}'))+'\');'},'cdata':function(expression){return'_ECHO(\''+encodeJS(expression.replace(/\x07/g,'}'))+'\');'}};T.prototype.process=function(context,flags,modifiers){if(!flags)flags={} if(!context)context={} if(context._MODIFIERS)modifiers=context._MODIFIERS if(!modifiers){modifiers=T.modifiers}else{for(var k in T.modifiers)if(!modifiers[k])modifiers[k]=T.modifiers[k]} var out=[] var echo=function(s){out[out.length]=s} try{this.render(context,echo,flags,modifiers)}catch(e){if(flags.throwExceptions)throw e var result=out.join('')+'[ERROR: '+e.toString()+(e.message?'; '+e.message:'')+']' result['exception']=e return result} return out.join('')};function encodeJS(s){return s.replace(/([\\'])/g,'\\$1').replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/\t/g,'\\t')} TP.Template=T;TP.parseTemplate=function(source){var template=new T(source);template.parse();return template;} TP.parseDOMTemplate=function(elementId,document){if(!document)document=window.document;content=elementId;content=content.replace(/</g,"<").replace(/>/g,">");return TP.parseTemplate(content);} TP.processDOMTemplate=function(elementId,context,flags,document){return TP.parseDOMTemplate(elementId,document).process(context,flags);}})() if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;} Date.prototype.asJSONString=function(key){return this.getUTCFullYear()+'-'+ f(this.getUTCMonth()+1)+'-'+ f(this.getUTCDate())+'T'+ f(this.getUTCHours())+':'+ f(this.getUTCMinutes())+':'+ f(this.getUTCSeconds())+'Z';};String.prototype.asJSONString=Number.prototype.asJSONString=Boolean.prototype.asJSONString=function(key){return this.valueOf();};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;} return'\\u'+('0000'+ (+(a.charCodeAt(0))).toString(16)).slice(-4);})+'"':'"'+string+'"';} function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.asJSONString==='function'){value=value.asJSONString(key);} if(typeof rep==='function'){value=rep.call(holder,key,value);} switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} gap+=indent;partial=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){length=value.length;for(i=0;i");} Log.consoleLogger=function(msg,level,obj){if(window.console){window.console.log(level+" - "+msg);}else{Log.popupLogger(msg,level,obj);}} Log.popupLogger=function(msg,level,obj){if(obj.popupBlocker){return;} if(!obj._window||!obj._window.document){obj._window=window.open("",'logger_popup_window','width=420,height=320,scrollbars=1,status=0,toolbars=0,resizeable=1');if(!obj._window){obj.popupBlocker=true;alert("You have a popup window manager blocking the log4js log popup display.\n\nThis must be disabled to properly see logged events.");return;} if(!obj._window.document.getElementById('loggerTable')){obj._window.document.writeln("
TimeMessage
");obj._window.document.close();}} var tbl=obj._window.document.getElementById("loggerTable");var row=tbl.insertRow(-1);var cell_1=row.insertCell(-1);var cell_2=row.insertCell(-1);var cell_3=row.insertCell(-1);var d=new Date();var h=d.getHours();if(h<10){h="0"+h;} var m=d.getMinutes();if(m<10){m="0"+m;} var s=d.getSeconds();if(s<10){s="0"+s;} var date=(d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear()+" - "+h+":"+m+":"+s;cell_1.style.fontSize="8pt";cell_1.style.fontWeight="bold";cell_1.style.paddingRight="6px";cell_2.style.fontSize="8pt";cell_3.style.fontSize="8pt";cell_3.style.whiteSpace="nowrap";cell_3.style.width="100%";if(tbl.rows.length%2==0){cell_1.style.backgroundColor="#eeeeee";cell_2.style.backgroundColor="#eeeeee";cell_3.style.backgroundColor="#eeeeee";} cell_1.innerHTML=date cell_2.innerHTML=level;cell_3.innerHTML=msg;} Log.dumpObject=function(obj,indent){if(!indent){indent="";} if(indent.length>20){return;} var s="{\n";for(var p in obj){s+=indent+p+":";var type=typeof(obj[p]);type=type.toLowerCase();if(type=='object'){s+=Log.dumpObject(obj[p],indent+"----");}else{s+=obj[p];} s+="\n";} s+=indent+"}";return s;} SweetDevRia.MessageHelper=function(){this._instance=null;};SweetDevRia.MessageHelper._instance=new SweetDevRia.MessageHelper();SweetDevRia.MessageHelper.getInstance=function(){return SweetDevRia.MessageHelper._instance;};SweetDevRia.MessageHelper.prototype.getMessage=function(message,param1,param2,param3,param4,param5){if(message!==null){message=this.completeAllParams(message,param1,param2,param3,param4,param5);} return message;};SweetDevRia.MessageHelper.prototype.completeAllParams=function(message,param1,param2,param3,param4,param5){message=this.completeParam(message,param1,0);message=this.completeParam(message,param2,1);message=this.completeParam(message,param3,2);message=this.completeParam(message,param4,3);message=this.completeParam(message,param5,4);return message;};SweetDevRia.MessageHelper.prototype.completeParam=function(message,param,index){if(param!==null){var strToFind="{"+index+"}";var idx=message.indexOf(strToFind);while(idx>-1){message=message.replace(strToFind,param);idx=message.indexOf(strToFind);}} return message;}; function SweetDevRiaLog(level,logger){this._log=new Log(level,logger,null);} SweetDevRiaLog.prototype.getMessage=SweetDevRiaLog_getMessage;SweetDevRiaLog.prototype.debug=SweetDevRiaLog_debug;SweetDevRiaLog.prototype.info=SweetDevRiaLog_info;SweetDevRiaLog.prototype.warn=SweetDevRiaLog_warn;SweetDevRiaLog.prototype.error=SweetDevRiaLog_error;SweetDevRiaLog.prototype.fatal=SweetDevRiaLog_fatal;function SweetDevRiaLog_getMessage(message,param1,param2,param3,param4,param5){var messageHelper=SweetDevRia.MessageHelper.getInstance();message=messageHelper.getMessage(message,param1,param2,param3,param4,param5);return message;} function SweetDevRiaLog_debug(message,param1,param2,param3,param4,param5){message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.debug(message);} function SweetDevRiaLog_info(message,param1,param2,param3,param4,param5){message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.info(message);} function SweetDevRiaLog_warn(message,param1,param2,param3,param4,param5){message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.warn(message);} function SweetDevRiaLog_error(message,param1,param2,param3,param4,param5){message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.error(message);} function SweetDevRiaLog_fatal(message,param1,param2,param3,param4,param5){message=this.getMessage(message,param1,param2,param3,param4,param5);this._log.fatal(message);} if(window.ria_timer==undefined||window.ria_timer==null){window.ria_timer={};} function RiaTimer(name,mode){if(mode==null){mode=RiaTimer.LAST;} this.mode=mode;this.name=name;this.value=[];this.startTime=null;window.ria_timer[name]=this;} RiaTimer.ALL=0;RiaTimer.LAST=1;RiaTimer.SUM=2;RiaTimer.prototype.start=function(){this.startTime=new Date();};RiaTimer.prototype.end=function(){this.setValue(new Date()-this.startTime);this.startTime=null;};RiaTimer.prototype.setValue=function(time){this.value[this.value.length]=time;};RiaTimer.prototype.display=function(){var res="";if(this.mode==RiaTimer.ALL){for(var i=0;i0){res+=", ";} res+=this.value[i];}} else if(this.mode==RiaTimer.SUM){var sum=0;for(var j=0;jmaxZIndex){maxZIndex=zindex;}}} this.topZIndex=maxZIndex;return this.topZIndex;};SweetDevRia.DisplayManager.prototype.getBlankPage=function(){if(SweetDevRIAHttpsMode){return SweetDevRIAJSPPath+"/blank.html";} else{return"about:blank";}}; SweetDevRia.DomHelper=function(){null;};SweetDevRia.DomHelper.get=function(elementId){return YAHOO.util.Dom.get(elementId);};SweetDevRia.DomHelper.getX=function(element){return YAHOO.util.Dom.getX(element);};SweetDevRia.DomHelper.getY=function(element){return YAHOO.util.Dom.getY(element);};SweetDevRia.DomHelper.getXY=function(element){return[SweetDevRia.DomHelper.getX(element),SweetDevRia.DomHelper.getY(element)];};SweetDevRia.DomHelper.setX=function(element,x){YAHOO.util.Dom.setX(element,x);};SweetDevRia.DomHelper.setY=function(element,y){YAHOO.util.Dom.setY(element,y);};SweetDevRia.DomHelper.setXY=function(element,xy){YAHOO.util.Dom.setXY(element,xy);};SweetDevRia.DomHelper.getStyle=function(element,propertyName){return YAHOO.util.Dom.getStyle(element,propertyName);};SweetDevRia.DomHelper.setStyle=function(element,propertyName,propertyValue){YAHOO.util.Dom.setStyle(element,propertyName,propertyValue);};SweetDevRia.DomHelper.getIntersect=function(elemId1,elemId2){var elem1=SweetDevRia.DomHelper.get(elemId1);var elem2=SweetDevRia.DomHelper.get(elemId2);var region1=YAHOO.util.Region.getRegion(elem1);var region2=YAHOO.util.Region.getRegion(elem2);var intersect=region1.intersect(region2);if(intersect!==null){var area=intersect.getArea();if(area&&area>0){return area;} else{return null;}} return null;};SweetDevRia.DomHelper.isIntersect=function(elemId1,elemId2){return(DomHelper_getIntersect(elemId1,elemId2)!==null);};SweetDevRia.DomHelper.removeChild=function(elem,childId){var child=SweetDevRia.DomHelper.getChild(elem,childId);if(child!==null){elem.removeChild(child);return true;} return false;};SweetDevRia.DomHelper.removeNode=function(elem){elem.parentNode.removeChild(elem);};SweetDevRia.DomHelper.removeChildren=function(elem){if(elem.childNodes!==null){while(elem.childNodes.length){SweetDevRia.DomHelper.removeNode(elem.childNodes[0]);}}};SweetDevRia.DomHelper.hasDocType=function(){var docType=document.body.parentNode.parentNode.childNodes[0].nodeValue;return((docType!=null)&&(docType.toLowerCase().indexOf("ctype html")>=0));};SweetDevRia.DomHelper.getTreePos=function(elem,childId,textNode){if(textNode===null){textNode=false;} var pos=0;var children=elem.children;for(var i=0;i=children.length){parentNode.appendChild(childtoAdd);} else{for(var i=0;i=0){value=value.substring(0,index);} value=parseInt(value,10);} return value;};SweetDevRia.DomHelper.parseEx=function(value){if(typeof(value)=="string"){value=value.toLowerCase();var index=value.indexOf("ex");if(index>=0){value=value.substring(0,index);} value=parseInt(value,10);} return value;};SweetDevRia.DomHelper.parsePercent=function(value){if(typeof(value)=="string"){value=value.toLowerCase();var index=value.indexOf("%");if(index>=0){value=value.substring(0,index);} value=parseInt(value,10);} return value;};SweetDevRia.DomHelper.addClassName=function(element,className){YAHOO.util.Dom.addClass(element,className);};SweetDevRia.DomHelper.removeClassName=function(element,className){YAHOO.util.Dom.removeClass(element,className);};SweetDevRia.DomHelper.hasClassName=function(element,className){return YAHOO.util.Dom.hasClass(element,className);};SweetDevRia.DomHelper.getElementsByClassName=function(className,tag,root){return YAHOO.util.Dom.getElementsByClassName(className,tag,root);};function getAllSheets(){if(document.getElementsByTagName){var Lt=document.getElementsByTagName('LINK');var St=document.getElementsByTagName('STYLE');}else{return[];} for(var x=0,os=[];Lt[x];x++){var rel=null;if(Lt[x].rel){rel=Lt[x].rel;}else if(Lt[x].getAttribute){rel=Lt[x].getAttribute('rel');}else{rel='';} if(typeof(rel)=='string'&&rel.toLowerCase().indexOf('style')+1){os[os.length]=Lt[x];}} for(var x2=0;St[x2];x2++){os[os.length]=St[x2];} return os;} document.cssStyles=null;SweetDevRia.DomHelper.indexCssStyles=function(){function isScreenMedia(styleSheets){var medias=styleSheets.media;if(medias.item){for(var i=0;i-1);} return false;} if(document.cssStyles===null){document.cssStyles={};var styleSheets=document.styleSheets;if(styleSheets===null){styleSheets=getAllSheets();} for(var i=0;i127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);} else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}} return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;} else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}} return string;}};SweetDevRia.Ajax.prepareParams=function(map){var argsStr=null;if(typeof(args)=="string"){argsStr=map;} else{argsStr="";var first=true;for(var i in map){if(i!=SweetDevRia.Ajax.SYNCHRO_CALL){if(!first){argsStr+="&";} argsStr+=encodeURIComponent(i)+"="+encodeURIComponent(map[i]);first=false;}}} return argsStr;};SweetDevRia.Ajax.prototype.post=function(url,param,synchroCall){return this.send("POST",url,param,synchroCall);};SweetDevRia.Ajax.prototype.get=function(url,synchroCall){return this.send("GET",url,"",synchroCall);};SweetDevRia.Ajax.prototype.setRequestHeader=function(name,value){if(this.xmlhttp){this.xmlhttp.setRequestHeader(name,value);}};SweetDevRia.Ajax.prototype.getResponseText=function(){return this.responseText;};SweetDevRia.Ajax.prototype.getResponseXML=function(){return this.responseXML;};SweetDevRia.Ajax.prototype.getStatus=function(){return this.status;};SweetDevRia.Ajax.prototype.setCallback=function(callback){this.callback=callback;var comHelper=SweetDevRia.ComHelper.getInstance();comHelper.callbackRepository[this.id]=callback;};SweetDevRia.Ajax.prototype.getCallback=function(){return this.callback;};SweetDevRia.Ajax.prototype.getReadyState=function(){return this.readyState;};SweetDevRia.Ajax.prototype.bindCallback=function(){if(this.xmlhttp){this.readyState=this.xmlhttp.readyState;if(this.readyState==4){this.responseText=this.xmlhttp.responseText;this.responseXML=this.xmlhttp.responseXML;SweetDevRia.Ajax.onReceiveResponse();try{this.status=this.xmlhttp.status;}catch(ex){this.onServerUnreachable(ex);return;} if((this.status==401)||(this.status==400)){this.onSessionTimeout(this.responseText);return;} if(this.status==12002||this.status==12029||this.status==12030||this.status==12031||this.status==12152){this.onServerUnreachable(null,this.status);return;} if(this.callback){if(this.responseText){var resultStr=this.responseText;try{var result=JSON.parse(resultStr);this.callback(result);}catch(ex){this.callback();}} else{this.callback();}} this.free=true;}}};SweetDevRia.Ajax.prototype.onServerUnreachable=function(ex,errorCode){SweetDevRia.log.error("The server is not responding. Exception thrown : "+ex+". Error Code : "+errorCode);};SweetDevRia.Ajax.prototype.onSessionTimeout=function(message){SweetDevRia.log.error(''+message);}; SweetDevRia.AjaxPooler=function(){this.pooler={};this.poolSize=0;};SweetDevRia.AjaxPooler._instance=new SweetDevRia.AjaxPooler();SweetDevRia.AjaxPooler.PREFIXE_ID="AjaxInstance_";SweetDevRia.AjaxPooler.getInstance=function(){var pooler=SweetDevRia.AjaxPooler._instance;for(var i in pooler.pooler){var ajax=pooler.pooler[i];if(ajax.readyState==4&&ajax.free){ajax.reset();ajax.free=false;return ajax;}} var newAjax=new SweetDevRia.Ajax(SweetDevRia.AjaxPooler.PREFIXE_ID+pooler.poolSize);pooler.pooler[newAjax.id]=newAjax;pooler.poolSize++;return newAjax;}; SweetDevRia.ComHelper=function(){this.callbackRepository={};this.globalStackSize=0;};SweetDevRia.ComHelper._instance=new SweetDevRia.ComHelper();SweetDevRia.ComHelper.getInstance=function(){return SweetDevRia.ComHelper._instance;};SweetDevRia.ComHelper.ID_PAGE="__RiaPageId";SweetDevRia.ComHelper.EVENT_XML_PARAM="eventXml";SweetDevRia.ComHelper.PROXY_URL=SweetDevRIAPath+"/RiaController";SweetDevRia.ComHelper.JSF_VIEW_ID="com.sun.faces.VIEW";SweetDevRia.ComHelper.isJsfPage=function(){return(document.getElementById(SweetDevRia.ComHelper.JSF_VIEW_ID)!=null);};SweetDevRia.ComHelper.parseXml=function(xmlStr){var parser=new DOMParser();var doc=parser.parseFromString(xmlStr,"text/xml");return doc;};SweetDevRia.ComHelper.stackEvent=function(evt,skipsend){var portletContext=SweetDevRia.PortletContextManager.getInstance().getContextByPt(SweetDevRia.$(evt.idSrc).portletId);portletContext.eventStack.push(evt);SweetDevRia.ComHelper.getInstance().globalStackSize++;if(!skipsend&&SweetDevRia.SYNCHRO_EVENTS!=null&&SweetDevRia.ComHelper.getInstance().globalStackSize>=SweetDevRia.SYNCHRO_EVENTS){SweetDevRia.ComHelper.fireEvent();}};SweetDevRia.ComHelper.flushEvents=function(){SweetDevRia.ComHelper.fireEvent(null,true);};SweetDevRia.ComHelper.fireEvent=function(evt,synchroCall,callback){var comHelper=SweetDevRia.ComHelper.getInstance();if(evt){SweetDevRia.ComHelper.stackEvent(evt,true);} var portletContext=null;for(var i=0;i0);} return false;};SweetDevRia.MultiSelect.addSelected=function(id){var selectedObjs=SweetDevRia.MultiSelect.selectedObjects;if(selectedObjs===null){SweetDevRia.MultiSelect.selectedObjects=[];selectedObjs=SweetDevRia.MultiSelect.selectedObjects;} var selectedObj=YAHOO.util.DragDropMgr.getDDById(id);SweetDevRia.DomHelper.setStyle(selectedObj.getEl(),"border","1px solid");SweetDevRia.DomHelper.setStyle(selectedObj.getEl(),"borderColor","blue");selectedObjs[selectedObjs.length]=selectedObj;};SweetDevRia.MultiSelect.removeSelected=function(id){var selectedObjs=SweetDevRia.MultiSelect.selectedObjects;if(selectedObjs){var res=[];for(var i=0;i=0){this.version=parseFloat(ua.substr(i+s.length));this.isIE=true;} s="netscape6/";if((i=ua.indexOf(s))>=0){this.version=parseFloat(ua.substr(i+s.length));} s="safari";if(ua.indexOf(s)>=0){this.isSafari=true;} s="opera";if(ua.indexOf(s)>=0){this.isOpera=true;} s="gecko";if(!this.isSafari&&!this.isOpera&&(ua.indexOf(s)>=0)){this.version=6.1;this.isGecko=true;s="firefox";if((i=ua.indexOf(s))>=0){this.isFF=true;this.version=parseFloat(ua.substr(i+s.length+1,i+s.length+2));}}};var browser=new SweetDevRia.Browser(); window.RIA_ACTIVE_LOG;SweetDevRia.LOG_ACTION;function initLogBench(){var action="com.ideo.sweetdevria.servlet.SendParameterLogBench";var result=SweetDevRia.ComHelper.synchCallIAction(action);SweetDevRia.LOG_ACTION=result.data["SweetDevRia_LOG_ACTION"];window.RIA_ACTIVE_LOG=result.data["window_RIA_ACTIVE_LOG"];} function extendsClass(childClass){var parents=arguments;for(var i=1;i0&&(parentComponentId.lastIndexOf("_panel")+"_panel".length-parentComponentId.length)==0){parentComponentId=name.substring(0,"_panel".length);SweetDevRia.container=SweetDevRia.parentWin.SweetDevRia.$(parentComponentId);SweetDevRia.toInit=SweetDevRia.parentWin.SweetDevRia.isInit;}}}catch(err){}}} SweetDevRia.init=function(){if(this.toInit){this.initCompNotInitialized();this.isInit=true;} else if(SweetDevRia.container){SweetDevRia.container.reload=true;} if(SweetDevRIASynchro==SweetDevRia.SYNCHRO_DEFAULT){return;} if(SweetDevRIASynchro.indexOf('e')!=-1){SweetDevRia.SYNCHRO_EVENTS=parseInt(SweetDevRIASynchro.substring(0,SweetDevRIASynchro.length-1),10);}else if(SweetDevRIASynchro.indexOf('s')!=-1){SweetDevRia.SYNCHRO_DELAY=parseInt(SweetDevRIASynchro.substring(0,SweetDevRIASynchro.length-1),10)*1000;}else{throw("Malformed synchro propriety :"+SweetDevRIASynchro);} if(SweetDevRia.SYNCHRO_DELAY!=null){SweetDevRia.SYNCHRO_DELAY_TIMER=window.setInterval("SweetDevRia.ComHelper.fireEvent()",SweetDevRia.SYNCHRO_DELAY);}};SweetDevRia.startLog=function(key,comp,logType){var myId;if(logType==null){logType=RiaTimer.LAST;} if(window.RIA_ACTIVE_LOG){if(!SweetDevRia.logs){SweetDevRia.logs={};} if(comp!=null){myId=comp.id;if(!SweetDevRia.logs[myId]){SweetDevRia.logs[myId]=[comp.className,null,null];}} startTimer(key,logType);}};SweetDevRia.endLog=function(key,comp,index){if(window.RIA_ACTIVE_LOG){endTimer(key);if(comp==null){SweetDevRia.logs[key]=getTimer(key).display();} else{if(key=="Log.BeforeGrid"){SweetDevRia.logs[key]=getTimer(key).display();} else{SweetDevRia.logs[comp.id][index]=getTimer(key).display();}}}};SweetDevRia.sendLogs=function(){if(window.RIA_ACTIVE_LOG){SweetDevRia.logs["Log.Resources"]=RIA_RESOURCES_END-RIA_RESOURCES_START;SweetDevRia.logs["Log.Global"]=window.RIA_GLOBAL_END-RIA_GLOBAL_START;if(SweetDevRia.LOG_ACTION){SweetDevRia.ComHelper.asyncCallIAction(SweetDevRia.LOG_ACTION,{"logs":SweetDevRia.logs,"navigator":navigator.appCodeName+navigator.userAgent});} else{alert(SweetDevRia.dp(SweetDevRia.logs));}}};SweetDevRia.initCompNotInitialized=function(){var proxy=SweetDevRiaProxy.getInstance();var evt=new this.RiaEvent(this.RiaEvent.INIT_TYPE,proxy.id);if(this.toInitialize){while(this.toInitialize.length>0){var id=this.toInitialize[0];do{null;}while(this.toInitialize.remove(id));var comp=this.getComponent(id);if(comp&&comp.isInitialized!=true){SweetDevRia.startLog("Log.InitComp_"+id,comp);proxy.sendEvent(comp,evt);SweetDevRia.endLog("Log.InitComp_"+id,comp,2);}}}};function SweetDevRia_register(component){SweetDevRia.set(component.id,SweetDevRia.COMPONENTS_REPOSITORY,component);SweetDevRia.setInstance(component.className,component.id);SweetDevRia.setToContext(component.contextId,component.id);} function SweetDevRia_unregister(component){SweetDevRia.remove(component.id,SweetDevRia.COMPONENTS_REPOSITORY);SweetDevRia.removeInstance(component.className,component.id);SweetDevRia.removeFromContext(component.contextId,component.id);} function SweetDevRia_unregisterContext(contextId){var instance=SweetDevRia.getInstance();var repository=instance.repository[contextId+SweetDevRia.CONTEXT_SUFFIXE];if(!repository){SweetDevRia.log.info("Cannot unregister the unknown context :"+contextId);return;} var compId=null;while(repository.length>0){compId=repository[0];var comp=SweetDevRia.$(compId);if(comp){comp.destroy();SweetDevRia.unregister(comp);}}} function SweetDevRia_setToContext(contextId,componentId){var instance=SweetDevRia.getInstance();var repositoryKey=contextId+SweetDevRia.CONTEXT_SUFFIXE;var repository=instance.repository[repositoryKey];if(!repository){instance.repository[repositoryKey]=[];repository=instance.repository[repositoryKey];} repository[repository.length]=componentId;} function SweetDevRia_removeFromContext(contextId,componentId){var instance=SweetDevRia.getInstance();var repositoryKey=contextId+SweetDevRia.CONTEXT_SUFFIXE;var repository=instance.repository[repositoryKey];if(!repository){return;} repository.remove(componentId);} function SweetDevRia_getComponent(componentId){return SweetDevRia.get(componentId,SweetDevRia.COMPONENTS_REPOSITORY);} function SweetDevRia_get(key,repositoryKey){var instance=SweetDevRia.getInstance();var repository=instance.repository;if((repositoryKey!==null)&&(repositoryKey!==undefined)){repository=instance.repository[repositoryKey];} if(repository){return repository[key];} else{return null;}} function SweetDevRia_set(key,repositoryKey,value){var instance=SweetDevRia.getInstance();var repository=instance.repository;if(repositoryKey==null){throw("Cannot set the component id : '"+key+"' into an unknown repository.");} repository=instance.repository[repositoryKey];if((repository===null)||(repository==undefined)){instance.repository[repositoryKey]={};repository=instance.repository[repositoryKey];} repository[key]=value;} function SweetDevRia_remove(key,repositoryKey){var instance=SweetDevRia.getInstance();var repository=instance.repository;if(repositoryKey!==null){repository=instance.repository[repositoryKey];} if(repository!==null){repository[key]=null;}} function SweetDevRia_getInstances(className){var repository=SweetDevRia.getInstance().repository;return repository[className+SweetDevRia.CLASSNAME_SUFFIXE];} function SweetDevRia_setInstance(className,componentId){var repository=SweetDevRia.getInstance().repository;var instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];if((instancesRepo===null)||(instancesRepo==undefined)){repository[className+SweetDevRia.CLASSNAME_SUFFIXE]=[];instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];} instancesRepo[instancesRepo.length]=componentId;} function SweetDevRia_removeInstance(className,componentId){var repository=SweetDevRia.getInstance().repository;var instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];if((instancesRepo!==null)&&(instancesRepo!==undefined)){instancesRepo.remove(componentId);}} function SweetDevRia_size(className){var repository=SweetDevRia.getInstance().repository;var instancesRepo=repository[className+SweetDevRia.CLASSNAME_SUFFIXE];if((instancesRepo!==null)&&(instancesRepo!==undefined)){return instancesRepo.length;} return 0;} function SweetDevRia_displayProperties(obj){var rep="";for(var i in obj){if(typeof(i)=="function"){rep+=i+" :: (function)\n";} else{rep+=i+" :: "+obj[i]+"\n";}} return rep;} function SweetDevRia_getUrlParams(){var params={};var location=window.location+"";var index=location.indexOf("?");if(index>0){location=location.substring(index+1);var tab=location.split("&");for(var i=0;i0){var name=tab[i].substring(0,equalIndex);var value=tab[i].substring(equalIndex+1);params[name]=value;}}} return params;} function SweetDevRia_addUrlParam(name,value){var location=window.location+"";var index=location.indexOf("?");if(index>0){location+="&";} else{location+="?";} location+=name+"="+value;window.location=location;} SweetDevRia.addListener=function(comp,eventType,handler,param){if(comp.isRiaComponent){var id=comp.id;var ria=SweetDevRia.getInstance();if(!ria.listeners[id]){ria.listeners[id]={};} if(!ria.listeners[id][eventType]){ria.listeners[id][eventType]=[];} ria.listeners[id][eventType].add([handler,param]);return true;} return false;};SweetDevRia.removeListener=function(comp,eventType){if(comp.isRiaComponent){var id=comp.id;var ria=SweetDevRia.getInstance();if(ria.listeners[id]){ria.listeners[id][eventType]=[];} return true;} return false;};SweetDevRia.EventHelper.addListener(window,"load",function(){SweetDevRia.startLog("Log.Onload");SweetDevRia.init();SweetDevRia.endLog("Log.Onload");});SweetDevRia.addBeforeUnload=function(func){SweetDevRia.getInstance().beforeUnloadListeners.push(func);};SweetDevRia.EventHelper.addListener(window,"beforeunload",function(){var arrayFunc=SweetDevRia.getInstance().beforeUnloadListeners;for(var i=0;i0){var index=0;var childId=this.hookedIds[index];var child=null;while(childId!=null){if(childId==compId){return true;} child=SweetDevRia.$(childId);if(child.hookedIds&&child.hookedIds.length>0){if(child.hasHookedComp(compId)){return true;}} index=index+1;childId=this.hookedIds[index];if(!childId){return false;}}} return false;};SweetDevRia.Hooker=function(){this.hookedIds=new Array();};SweetDevRia.Hooker.prototype.hook=function(id){this.hookedIds.push(id);};SweetDevRia.Hooker.prototype.isHooked=function(id){var res=this.hookedIds.contains(id);if(!res){for(var i=0;i {if iconClass}{/if} ${label} {if removable}\"${tabLayout.i18n.remove}\"{/if} ";SweetDevRia.TabContent.prototype.templateDynamicContent=" "; SweetDevRia.FrameNude=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.FrameNude");};SweetDevRia.FrameNude.prototype.refreshBorders=function(){};SweetDevRia.FrameNude.prototype.isNude=function(){return true;};extendsClass(SweetDevRia.FrameNude,SweetDevRia.RiaComponent);SweetDevRia.FrameNude.prototype.isVisible=function(){return false;}; SweetDevRia.Frame=function(id){superClass(this,SweetDevRia.DD,id);this.contentId=null;this.showBorderOnOver=false;this.resizeMode=SweetDevRia.Frame.RESIZE_MODE_NONE;this.borderMode=SweetDevRia.Frame.BORDER_MODE_ALL;this.cssClassBase="ideo-bdr-";this.borderType=SweetDevRia.Frame.BORDER_TYPE;this.dragId=id+"_border";this.displayIcon=false;this.hideDuringDrag=true;this.canDrag=false;this.allowDocumentDrop=true;SweetDevRia.unregister(this);this.className="SweetDevRia.Frame";SweetDevRia.register(this);this.minHeight=null;this.maxHeight=null;this.minWidth=null;this.maxWidth=null;this.constraintId=null;this.height=0;this.width=0;this.maskId=this.id+'_mask';};extendsClass(SweetDevRia.Frame,SweetDevRia.DD);extendsClass(SweetDevRia.Frame,SweetDevRia.FrameNude);SweetDevRia.Frame.BORDER_TYPE="fine";SweetDevRia.Frame.RESIZE_MODE_NONE=0;SweetDevRia.Frame.RESIZE_MODE_ALL=1;SweetDevRia.Frame.RESIZE_MODE_SE=2;SweetDevRia.Frame.BORDER_MODE_NONE=0;SweetDevRia.Frame.BORDER_MODE_ALL=1;SweetDevRia.Frame.BORDER_MODE_SE=2;SweetDevRia.Frame.BORDER_IDS={"north":"N","south":"S","east":"E","west":"W","southwest":"SW","southeast":"SE","northwest":"NW","northeast":"NE"};SweetDevRia.Frame.FRAME_SUFFIX="_frame";SweetDevRia.Frame.reloadAllFrames=function(){var frames=SweetDevRia.getInstances("SweetDevRia.Frame");if(frames){for(var i=0;i=0){var content=document.getElementById(this.contentId);content.style.width=width+"px";document.getElementById(this.id+"_scrollBorder").style.width=width+"px";document.getElementById(this.id+"_border").style.width=width+"px";this.width=width;return true;} return false;};SweetDevRia.Frame.prototype.setHeight=function(height){if(height>=0){var content=document.getElementById(this.contentId);content.style.height=height+"px";this.height=height;return true;} return false;};SweetDevRia.Frame.prototype.getWidth=function(width){return this.width;};SweetDevRia.Frame.prototype.getHeight=function(height){return this.height;};SweetDevRia.Frame.prototype.getMain=function(){return document.getElementById(this.getMainAbsoluteId());};SweetDevRia.Frame.prototype.getMainAbsoluteId=function(){return this.id+"_border";};SweetDevRia.Frame.prototype.isNude=function(){return false;};SweetDevRia.Frame.prototype.getMinHeight=function(){return this.minHeight;};SweetDevRia.Frame.prototype.getMaxHeight=function(){return this.maxHeight;};SweetDevRia.Frame.prototype.getMinWidth=function(){return this.minWidth;};SweetDevRia.Frame.prototype.getMaxWidth=function(){return this.maxWidth;};SweetDevRia.Frame.prototype.superInitialize=SweetDevRia.DD.prototype.initialize;SweetDevRia.Frame.prototype.initialize=function(){var border=this;function startDragAction(){var borderElem=document.getElementById(border.getMainAbsoluteId());this.startX=SweetDevRia.DomHelper.getX(borderElem);this.startY=SweetDevRia.DomHelper.getY(borderElem);this.startHeight=SweetDevRia.DomHelper.getHeight(borderElem);this.startWidth=SweetDevRia.DomHelper.getWidth(borderElem);border.blockHiding=true;border.beforeResizing();} function endDragAction(){this.startX=0;this.startY=0;this.isInit=false;border.blockHiding=false;this.fireEventListener(SweetDevRia.Frame.RESIZE_EVENT);border.afterResizing();} function dragAction(){this.specificDragAction();border.refreshBorders();YAHOO.util.DragDropMgr.locationCache={};border.showBorders();border.onResize();border.blockHiding=true;} function createBorderDrag(borderId,constraintType,specificDragAction){var borderElem=document.getElementById(border.contentId+"_"+borderId);if(borderElem){var borderDrag=new SweetDevRia.DD(border.id+"drag"+borderId);if(border.canDrag){borderDrag.getIFrameObjIdUnder=function(){return border.getMainAbsoluteId();};} borderDrag.setDragId(border.contentId+"_"+borderId);borderDrag.setFakeMode(SweetDevRia.DD.NONE);borderDrag.constraintType=constraintType;borderDrag.onStartDrag=startDragAction;borderDrag.onEndDrag=endDragAction;borderDrag.onDrag=dragAction;borderDrag.specificDragAction=specificDragAction;return borderDrag;} return null;} this.createBorder();var borderSize=0-this.borderSize;var cadreScroll=document.getElementById(this.id+"_scrollBorder");this.superInitialize();if(!this.canDrag){var item=SweetDevRia.DomHelper.get(this.dragId);if(this.handleId!=null){item=SweetDevRia.DomHelper.get(this.handleId);} if(item){item.onselectstart=null;item.onselect=null;item.ondblclick=null;}} if(this.resizeMode!=SweetDevRia.Frame.RESIZE_MODE_NONE){var aBorder=null;aBorder=createBorderDrag("east",SweetDevRia.DD.HORIZONTAL,function(){var newX=SweetDevRia.DomHelper.getX(this.objDD.getDragEl());var borderElem=document.getElementById(border.getMainAbsoluteId());if(document.all&&borderElem.style.position!="absolute"){border.setWidth(newX-this.startX-(2*border.borderSize))+"px";} else{border.setWidth(newX-this.startX+borderSize)+"px";}});aBorder.getMinX=function(){var size=border.getMinWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+size;}};aBorder.getMaxX=function(){var size=border.getMaxWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+size;}};aBorder=createBorderDrag("south",SweetDevRia.DD.VERTICAL,function(){var newY=SweetDevRia.DomHelper.getY(this.objDD.getDragEl());border.setHeight(newY-this.startY+borderSize);});aBorder.getMinY=function(){var size=border.getMinHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+size;}};aBorder.getMaxY=function(){var size=border.getMaxHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+size;}};aBorder=createBorderDrag("southeast",SweetDevRia.DD.NONE,function(){var newX=SweetDevRia.DomHelper.getX(this.objDD.getDragEl());var newY=SweetDevRia.DomHelper.getY(this.objDD.getDragEl());border.setHeight(newY-this.startY+borderSize);var borderElem=document.getElementById(border.getMainAbsoluteId());if(document.all&&borderElem.style.position!="absolute"){border.setWidth(newX-this.startX-(2*border.borderSize))+"px";} else{border.setWidth(newX-this.startX+borderSize);}});aBorder.getMinX=function(){var size=border.getMinWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+size;}};aBorder.getMaxX=function(){var size=border.getMaxWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+size;}};aBorder.getMinY=function(){var size=border.getMinHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+size;}};aBorder.getMaxY=function(){var size=border.getMaxHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+size;}};if(this.resizeMode==SweetDevRia.Frame.RESIZE_MODE_ALL){aBorder=createBorderDrag("north",SweetDevRia.DD.VERTICAL,function(){var borderElem=document.getElementById(border.getMainAbsoluteId());var newY=SweetDevRia.DomHelper.getY(this.objDD.getDragEl());if(newY<0){newY=0;} var ex=border.setHeight(this.startHeight+this.startY-newY-(border.borderSize*2));if(ex){SweetDevRia.DomHelper.setY(borderElem,newY);}});aBorder.getMinY=function(){var size=border.getMaxHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+SweetDevRia.DomHelper.getHeight(cadreScroll)-size+border.borderSize;}};aBorder.getMaxY=function(){var size=border.getMinHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+SweetDevRia.DomHelper.getHeight(cadreScroll)-size+border.borderSize;}};aBorder=createBorderDrag("west",SweetDevRia.DD.HORIZONTAL,function(){var borderElem=document.getElementById(border.getMainAbsoluteId());var newX=SweetDevRia.DomHelper.getX(this.objDD.getDragEl());var ex=border.setWidth(this.startWidth+this.startX-newX-(border.borderSize*2));if(ex){SweetDevRia.DomHelper.setX(borderElem,newX);}});aBorder.getMinX=function(){var size=border.getMaxWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+SweetDevRia.DomHelper.getWidth(cadreScroll)-size+border.borderSize;}};aBorder.getMaxX=function(){var size=border.getMinWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+SweetDevRia.DomHelper.getWidth(cadreScroll)-size+border.borderSize;}};aBorder=createBorderDrag("northeast",SweetDevRia.DD.NONE,function(){var borderElem=document.getElementById(border.getMainAbsoluteId());var newX=SweetDevRia.DomHelper.getX(this.objDD.getDragEl());var newY=SweetDevRia.DomHelper.getY(this.objDD.getDragEl());if(newY<0){newY=0;} border.setWidth(newX-this.startX+borderSize);var ex=border.setHeight(this.startHeight+this.startY-newY);if(ex){SweetDevRia.DomHelper.setY(borderElem,newY);}});aBorder.getMinY=function(){var size=border.getMaxHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+SweetDevRia.DomHelper.getHeight(cadreScroll)-size+border.borderSize;}};aBorder.getMaxY=function(){var size=border.getMinHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+SweetDevRia.DomHelper.getHeight(cadreScroll)-size+border.borderSize;}};aBorder.getMinX=function(){var size=border.getMinWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+size;}};aBorder.getMaxX=function(){var size=border.getMaxWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+size;}};aBorder=createBorderDrag("northwest",SweetDevRia.DD.NONE,function(){var borderElem=document.getElementById(border.getMainAbsoluteId());var newX=SweetDevRia.DomHelper.getX(this.objDD.getDragEl());var newY=SweetDevRia.DomHelper.getY(this.objDD.getDragEl());if(newY<0){newY=0;} var ex=border.setWidth(this.startWidth+this.startX-newX);if(ex){SweetDevRia.DomHelper.setX(borderElem,newX);} var ex=border.setHeight(this.startHeight+this.startY-newY);if(ex){SweetDevRia.DomHelper.setY(borderElem,newY);}});aBorder.getMinY=function(){var size=border.getMaxHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+SweetDevRia.DomHelper.getHeight(cadreScroll)-size+border.borderSize;}};aBorder.getMaxY=function(){var size=border.getMinHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+SweetDevRia.DomHelper.getHeight(cadreScroll)-size+border.borderSize;}};aBorder.getMinX=function(){var size=border.getMaxWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+SweetDevRia.DomHelper.getWidth(cadreScroll)-size+border.borderSize;}};aBorder.getMaxX=function(){var size=border.getMinWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+SweetDevRia.DomHelper.getWidth(cadreScroll)-size+border.borderSize;}};aBorder=createBorderDrag("southwest",SweetDevRia.DD.NONE,function(){var borderElem=document.getElementById(border.getMainAbsoluteId());var newX=SweetDevRia.DomHelper.getX(this.objDD.getDragEl());var newY=SweetDevRia.DomHelper.getY(this.objDD.getDragEl());border.setHeight(newY-this.startY+borderSize);var ex=border.setWidth(this.startWidth+this.startX-newX);if(ex){SweetDevRia.DomHelper.setX(borderElem,newX);}});aBorder.getMinY=function(){var size=border.getMinHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+size;}};aBorder.getMaxY=function(){var size=border.getMaxHeight();if(size==null){return null;}else{return SweetDevRia.DomHelper.getY(cadreScroll)+size;}};aBorder.getMaxWidth=function(){var size=border.getMaxWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+SweetDevRia.DomHelper.getWidth(cadreScroll)-size+border.borderSize;}};aBorder.getMaxX=function(){var size=border.getMinWidth();if(size==null){return null;}else{return SweetDevRia.DomHelper.getX(cadreScroll)+SweetDevRia.DomHelper.getWidth(cadreScroll)-size+border.borderSize;}};}} if(this.constraintId){for(var id in SweetDevRia.Frame.BORDER_IDS){if(SweetDevRia.$(this.id+"drag"+id)){SweetDevRia.$(this.id+"drag"+id).constraintId=this.constraintId;}}} this.initialized=true;};SweetDevRia.Frame.prototype.setConstraintId=function(constraintId){this.constraintId=constraintId;};SweetDevRia.Frame.prototype.refreshBorder=function(id,width,height,top,left){var border=document.getElementById(this.contentId+"_"+id);if(border&&width!=null&&height!=null){border.style.width=width+"px";border.style.height=height+"px";border.style.top=top+"px";border.style.left=left+"px";this.refreshIframeMask();}};SweetDevRia.Frame.prototype.refreshBorders=function(grid){var content=document.getElementById(this.contentId);var width=SweetDevRia.DomHelper.getWidth(content);var height=0;if(!grid){height=SweetDevRia.DomHelper.getHeight(content);} else{height=content.scrollHeight;} this.refreshBorder("north",width,this.borderSize,0,this.borderSize);this.refreshBorder("south",width,this.borderSize,height+this.borderSize,this.borderSize);this.refreshBorder("east",this.borderSize,height,this.borderSize,width+this.borderSize);this.refreshBorder("west",this.borderSize,height,this.borderSize,0);this.refreshBorder("southwest",this.borderSize,this.borderSize,height+this.borderSize,0);this.refreshBorder("southeast",this.borderSize,this.borderSize,height+this.borderSize,width+this.borderSize);this.refreshBorder("northwest",this.borderSize,this.borderSize,0,0);this.refreshBorder("northeast",this.borderSize,this.borderSize,0,width+this.borderSize);if(document.getElementById(this.id+"_border")!=null){document.getElementById(this.id+"_border").style.height=document.getElementById(this.contentId).scrollHeight+"px";}};SweetDevRia.Frame.prototype.showBorder=function(id){var border=document.getElementById(this.contentId+"_"+id);if(border){SweetDevRia.DomHelper.addClassName(border,this.cssClassBase+this.borderType+SweetDevRia.Frame.BORDER_IDS[id]);border.style.display="";}};SweetDevRia.Frame.prototype.showBorders=function(){for(var id in SweetDevRia.Frame.BORDER_IDS){if(id!="toJSONString"){this.showBorder(id);}} var cadre=document.getElementById(this.id+"_border");if(cadre){cadre.style.padding=this.borderSize+"px";}};SweetDevRia.Frame.prototype.hideBorder=function(id){if(this.blockHiding){return;} var border=document.getElementById(this.contentId+"_"+id);if(border){SweetDevRia.DomHelper.removeClassName(border,this.cssClassBase+this.borderType+SweetDevRia.Frame.BORDER_IDS[id]);border.style.display="none";}};SweetDevRia.Frame.prototype.hideBorders=function(){if(this.blockHiding){return;} for(var id in SweetDevRia.Frame.BORDER_IDS){if(id!="toJSONString"){this.hideBorder(id);}} var cadre=document.getElementById(this.id+"_border");if(cadre){cadre.style.padding="0px";}};SweetDevRia.Frame.prototype.isVisible=function(){var visible=false;for(var id in SweetDevRia.Frame.BORDER_IDS){var border=document.getElementById(this.contentId+"_"+id);if(border){visible=visible||(border.style.display!="none");}} return visible;};SweetDevRia.Frame.prototype.createBorder=function(){function createDiv(divParent,divId,divClass){var div=document.createElement("div");div.id=divId;div.style.position="absolute";div.className=divClass;div.innerHTML=" ";divParent.appendChild(div);return div;} var content=document.getElementById(this.contentId);if(!content){SweetDevRia.log.error('The id provided as content of the Frame is invalid :'+this.contentId);return;} var cadre=document.createElement("div");cadre.id=this.id+"_border";var cadreScroll=document.createElement("div");cadreScroll.id=this.id+"_scrollBorder";cadre.style.position=content.style.position;if(content.style.position==""){cadre.style.position="relative";} cadre.style.top=content.style.top;cadre.style.left=content.style.left;cadre.style.zIndex=content.style.zIndex;content.parentNode.insertBefore(cadre,content);content.style.position="relative";content.style.top="0px";content.style.left="0px";cadreScroll=cadre.appendChild(cadreScroll);content=cadreScroll.appendChild(content);for(var id in SweetDevRia.Frame.BORDER_IDS){if(id!="toJSONString"){if((this.borderMode==SweetDevRia.Frame.BORDER_MODE_ALL)||(this.borderMode==SweetDevRia.Frame.BORDER_MODE_SE&&(id=="south"||id=="east"||id=="southeast"))){var cssClass="ideo-bdr-main ";if((this.resizeMode==SweetDevRia.Frame.RESIZE_MODE_ALL)||(this.resizeMode==SweetDevRia.Frame.RESIZE_MODE_SE&&(id=="south"||id=="east"||id=="southeast"))){cssClass+="ideo-bdr-"+id;} var div=createDiv(cadre,this.contentId+"_"+id,cssClass);if(this.showBorderOnOver){var border=this;SweetDevRia.EventHelper.addListener(div,"mouseover",function(){border.showBorders();});SweetDevRia.EventHelper.addListener(div,"mouseout",function(){border.hideBorders();});}}}} if(!this.showBorderOnOver){this.showBorders();} cadre.style.padding=this.borderSize+"px";cadre.style.zoom="1";cadre.className="ideo-bdr-borders";if(browser.isIE&&(browser.version<7||!SweetDevRia.DomHelper.hasDocType())){null;} var contentWidth=content.style.width;cadre.style.width=contentWidth;if(contentWidth.indexOf("%")>0){content.style.width="100%";} var contentHeight=content.style.height;if(contentHeight==""){cadre.style.height=content.clientHeight+"px";} else{cadre.style.height=contentHeight;} if(contentHeight.indexOf("%")>0){content.style.height="100%";} if(content.style.display=="inline"||content.nodeName.toLowerCase()=="span"){cadre.style.display="inline";cadreScroll.style.display="inline";} this.refreshBorders();}; SweetDevRia.Button=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.Button");this.contentId=null;};extendsClass(SweetDevRia.Button,SweetDevRia.RiaComponent);SweetDevRia.Button.prototype.initialize=function(){var content=document.getElementById(this.contentId);if(content){var button=document.createElement("span");button.id=this.id;SweetDevRia.DomHelper.addClassName(button,"ideo-but-main");content.parentNode.insertBefore(button,content);var left=document.createElement("span");SweetDevRia.DomHelper.addClassName(left,"ideo-but-left");var center=document.createElement("span");SweetDevRia.DomHelper.addClassName(center,"ideo-but-center");if(!browser.isIE){SweetDevRia.DomHelper.addClassName(center,"ideo-but-center-FF");} var right=document.createElement("span");SweetDevRia.DomHelper.addClassName(right,"ideo-but-right");if(!browser.isIE){SweetDevRia.DomHelper.addClassName(right,"ideo-but-right-FF");} center.appendChild(content);right.appendChild(center);left.appendChild(right);button.appendChild(left);}}; SweetDevRia.DateFormat=function(){null;};SweetDevRia.DateFormat.pattern="MM/DD/YYYY";SweetDevRia.DateFormat.separator="-";SweetDevRia.DateFormat.multiDateSeparator=",";SweetDevRia.DateFormat.getDateFromPattern=function(year,month,day,pattern,separator){if(pattern==null){pattern=SweetDevRia.DateFormat.pattern;} if(separator==null){separator=SweetDevRia.DateFormat.separator;} if(!pattern||!day||!month||!year){SweetDevRia.log.error("Pattern or argument(s) is/are null");return"";} try{year=Number(year);month=Number(month);day=Number(day);var result=pattern,day2Num=(day<10)?"0"+day:day,month2Num=(month<10)?"0"+month:month,year4Num=year,year2Num=((year%1000)<10)?"0"+(year%1000):year%1000;result=result.replace(/DD/,day2Num);result=result.replace(/MM/,month2Num);result=result.replace(/YYYY/,year4Num);result=result.replace(/YY/,year2Num);result=result.replace(/\//g,separator);}catch(e){SweetDevRia.log.warn("Error on parsing date ["+e+"]");} return result;};SweetDevRia.DateFormat.formatDate=function(date,pattern,separator){return SweetDevRia.DateFormat.getDateFromPattern(1900+date.getYear(),date.getMonth()+1,date.getDate(),pattern,separator);};SweetDevRia.DateFormat.getDay=function(day){if(!day){SweetDevRia.log.error("Argument is null");return"";} day=Number(day);return String((day<10)?"0"+day:day);};SweetDevRia.DateFormat.getMonth=function(month){if(!month){SweetDevRia.log.error("Argument is null");return"";} month=Number(month);return String((month<10)?"0"+month:month);};SweetDevRia.DateFormat.getYear=function(year){if(!year){SweetDevRia.log.error("Argument is null");return"";} year=Number(year);if(SweetDevRia.DateFormat.pattern.indexOf("YYYY")!=-1){return String(year);}else{return String(((year%1000)<10)?"0"+(year%1000):(year%1000));}};SweetDevRia.DateFormat.getDate=function(year,month,day){year=parseInt(year,10);month=parseInt(month,10)-1;day=parseInt(day,10);var dat=new Date(year,month,day);if(dat.getDate()==day&&dat.getMonth()==month&&dat.getFullYear()==year){return dat;} return null;};SweetDevRia.DateFormat.prepareDateField=function(formField){if(formField&&formField.value.length>0){var sep="";var separatorRegEx=new RegExp(SweetDevRia.DateFormat.separator+"+","g");formField.value=formField.value.replace(separatorRegEx,SweetDevRia.DateFormat.separator);formField.value=formField.value.replace(/[A-Z]+/ig,"");var tabDate=formField.value.split(SweetDevRia.DateFormat.separator);if(tabDate){formField.value="";for(var i=0;i=0){day=value.substring(posDay,posDay+2);var posMonth=format.indexOf("MM");if(posMonth>=0){month=value.substring(posMonth,posMonth+2);var posYear=format.indexOf("YYYY");if(posYear==-1){posYear=format.indexOf("YY");yearPattern=2;} if(posYear>=0){year=value.substring(posYear,posYear+yearPattern);if(yearPattern==2){year="20"+year;} var t=/^[0-9]*$/;if(t.test(year)&&t.test(month)&&t.test(day)){year=parseInt(year,10);month=parseInt(month,10)-1;day=parseInt(day,10);var dat=new Date(year,month,day);if(dat.getDate()==day&&dat.getMonth()==month&&dat.getFullYear()==year){return dat;}}}}} return null;};function dateToIsoDateString(date){var year=new String(date.getFullYear());var month=new String(date.getMonth()+1);if(month.length==1){month="0"+month;} var day=new String(date.getDate());if(day.length==1){day="0"+day;} return"RIA_TYPE_DATE_ISO("+year+month+day+")";} Array.prototype.copy=function(array){this.length=0;for(var i=0;ithis.length){index=this.length;} var copy=[];copy.copy(this);this[index]=value;for(var i=index;i0){str+=", ";} if(tab[i]&&tab[i].reverse){str+=displayTab(tab[i]);} else{str+=tab[i];}} str+="]";} return str;} SweetDevRia.ContextManager=function(){if(SweetDevRia.ContextManager.instance!=null){throw("Cannot instanciate the SweetDevRia.ContextManager object. This singleton has already been created.");} this.stack=[];};SweetDevRia.ContextManager.instance=null;SweetDevRia.ContextManager.getInstance=function(){if(SweetDevRia.ContextManager.instance==null){SweetDevRia.ContextManager.instance=new SweetDevRia.ContextManager();} return SweetDevRia.ContextManager.instance;};SweetDevRia.ContextManager.prototype.pushContext=function(contextId){this.stack.push(contextId);};SweetDevRia.ContextManager.prototype.popContext=function(contextId){context=this.stack[this.stack.length-1];if(contextId&&context!=contextId){SweetDevRia.log.error("Popped context doesnt correspond to the required one");return;} this.stack.pop();};SweetDevRia.ContextManager.prototype.getActiveContext=function(){if(this.stack.length==0){return __RiaPageId;} return this.stack[this.stack.length-1];};SweetDevRia.PortletContext=function(id,contextId){this.id=id;this.contextId=(contextId?contextId:id);if(window.PTIncluder&&PTPortlet.getPortletByID(id)){this.proxyUrl=PTPortlet.getPortletByID(id).transformURL(SweetDevRIAPath+"/RiaController");this.contextPath=PTPortlet.getPortletByID(id).transformURL(SweetDevRIAPath);}else{this.proxyUrl=SweetDevRIAPath+"/RiaController";this.contextPath=SweetDevRIAPath;} this.idPage=__RiaPageId;this.eventStack=[];};SweetDevRia.PortletContextManager=function(){if(SweetDevRia.PortletContextManager.instance!=null){throw("Cannot instanciate the SweetDevRia.PortletContextManager object. This singleton has already been created.");} this.repository=[];this.registerContext(new SweetDevRia.PortletContext(__RiaPageId));};SweetDevRia.PortletContextManager.instance=null;SweetDevRia.PortletContextManager.getInstance=function(){if(SweetDevRia.PortletContextManager.instance==null){SweetDevRia.PortletContextManager.instance=new SweetDevRia.PortletContextManager();} return SweetDevRia.PortletContextManager.instance;};SweetDevRia.PortletContextManager.prototype.registerContext=function(ctx){this.repository.push(ctx);};SweetDevRia.PortletContextManager.prototype.getContexts=function(){return this.repository;};SweetDevRia.PortletContextManager.prototype.unregisterContext=function(ctxId){for(var i=0;i
 
{/if}
{if header != null} ${header} {/if}
{if bodyContent} ${bodyContent}{/if}
{if renderFrame}
{/if}"; SweetDevRia.CollapseManager=function(id){superClass(this,SweetDevRia.RiaComponent,id,"CollapseManager");this.collapseIds=[];};extendsClass(SweetDevRia.CollapseManager,SweetDevRia.RiaComponent);SweetDevRia.CollapseManager.prototype.initialize=function(){for(var i=0;i=6){return;} var visibility=(visible==true)?'':'hidden',selects=el.getElementsByTagName('SELECT');for(var e=0;e=7){return;} var iframe=SweetDevRia.DomHelper.get(id+'-iframe-mask');if(!iframe){iframe=document.createElement('iframe');iframe.setAttribute('id',id+'-iframe-mask');iframe.setAttribute('src',SweetDevRia.DisplayManager.getInstance().getBlankPage());iframe.setAttribute('scrolling','no');iframe.setAttribute('frameBorder','0');iframe.style.position='absolute';iframe.style.display='none';iframe.style.filter='alpha(opacity=0)';if(obj!=document.body){obj.parentNode.appendChild(iframe);}else{document.body.appendChild(iframe);}} this.moveIFrame(id,obj);this.setIFrameZIndex(id,obj);iframe.style.display="block";},removeTransparentIFrame:function(id,obj){if(!browser.isIE||browser.version>=7){return;} var iframe=SweetDevRia.DomHelper.get(id+'-iframe-mask');if(iframe){iframe.style.display="none";}},hideTransparentIFrame:function(id){if(!browser.isIE||browser.version>=7){return;} var iframe=SweetDevRia.DomHelper.get(id+'-iframe-mask');if(iframe){iframe.style.display='none';}},restoreTransparentIFrame:function(id){if(!browser.isIE||browser.version>=7){return;} var iframe=SweetDevRia.DomHelper.get(id+'-iframe-mask');if(iframe){iframe.style.display='';}},moveIFrame:function(id,obj){if(!browser.isIE||browser.version>=7){return;} var iframe=SweetDevRia.DomHelper.get(id+'-iframe-mask');if(iframe){iframe.style.width=obj.offsetWidth;iframe.style.height=obj.offsetHeight;if(SweetDevRia.DomHelper.isVisible(obj)&&obj!=document.body){iframe.style.top=(SweetDevRia.DomHelper.getY(obj)+"px");iframe.style.left=(SweetDevRia.DomHelper.getX(obj)+"px");}}},setIFrameZIndex:function(id,obj){if(!browser.isIE){return;} var iframe=SweetDevRia.DomHelper.get(id+'-iframe-mask');if(iframe){var zi=obj.style.zIndex-1;if(zi<=0){zi=1;obj.style.zIndex=2;} iframe.style.zIndex=zi;}},moveNodeTo:function(moveId,toElement){var elementToMove=SweetDevRia.DomHelper.get(moveId);if(!elementToMove){throw("Cannot move the element id:"+moveId+". Element not found");} if(SweetDevRia.DomHelper.get(moveId+SweetDevRia.LayoutManager.MOVE_REF_SUFFIX)){SweetDevRia.log.debug("Reference node not created, already existing.");} var referenceNode=document.createElement("div");referenceNode.id=moveId+SweetDevRia.LayoutManager.MOVE_REF_SUFFIX;referenceNode.style.display='none';elementToMove.parentNode.insertBefore(referenceNode,elementToMove);toElement.appendChild(elementToMove);},restoreMovedNode:function(moveId){var nodeMoved=SweetDevRia.DomHelper.get(moveId);if(!nodeMoved){throw("Cannot restore the element id:"+moveId+". Element not found");} var referenceNode=SweetDevRia.DomHelper.get(moveId+SweetDevRia.LayoutManager.MOVE_REF_SUFFIX);if(!referenceNode){throw("Cannot restore the element id:"+moveId+". Reference node not found");} referenceNode.parentNode.insertBefore(nodeMoved,referenceNode);nodeMoved.parentNode.removeChild(referenceNode);}};SweetDevRia.LayoutManager.MOVE_REF_SUFFIX="_REF"; SweetDevRia.PopupManager=function(){this.registeredComp=["SweetDevRia.Menu","SweetDevRia.Suggest","SweetDevRia.Editable","SweetDevRia.ClickToOpen"];SweetDevRia.EventHelper.addListener(document,"click",SweetDevRia.PopupManager.hideAllComponents,this,true);};SweetDevRia.PopupManager.getInstance=function(){return SweetDevRia.PopupManager._instance;};SweetDevRia.PopupManager.prototype.registerPopupComponent=function(componentId){this.registeredComp[this.registeredComp.length]=componentId;};SweetDevRia.PopupManager.hideAllComponents=function(e){e=SweetDevRia.EventHelper.getEvent(e);for(var i in this.registeredComp){var comps=SweetDevRia.getInstances(this.registeredComp[i]);for(var j in comps){if(SweetDevRia.$(comps[j])){SweetDevRia.$(comps[j]).closePopup(e.src);}}}};SweetDevRia.PopupManager._instance=new SweetDevRia.PopupManager(); SweetDevRia.ClickToOpen=function(id,shiftX,shiftY){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.ClickToOpen");superClass(this,SweetDevRia.Hookable,id);superClass(this,SweetDevRia.Hooker,id);this.frame=SweetDevRia.DomHelper.get(id);this.shiftX=shiftX;this.shiftY=shiftY;this.opened=false;this.useFixedZIndex=false;this.zIndex=0;this.autoClose=true;this.refererTimerChecker=0;this.refererPosX=null;this.refererPosY=null;if(browser.isGecko){if(this.frame.parentNode&&this.frame.parentNode.nodeName){var parentNode=this.frame.parentNode.nodeName;if(parentNode=="TD"){var body=document.getElementsByTagName("BODY")[0];body.appendChild(this.frame);}}}};extendsClass(SweetDevRia.ClickToOpen,SweetDevRia.RiaComponent);extendsClass(SweetDevRia.ClickToOpen,SweetDevRia.Hookable);extendsClass(SweetDevRia.ClickToOpen,SweetDevRia.Hooker);SweetDevRia.ClickToOpen.prototype.beforeOpen=function(aLink){return true;};SweetDevRia.ClickToOpen.prototype.afterOpen=function(aLink){};SweetDevRia.ClickToOpen.prototype.beforeClose=function(){return true;};SweetDevRia.ClickToOpen.prototype.afterClose=function(){};SweetDevRia.ClickToOpen.OPEN_EVENT="open";SweetDevRia.ClickToOpen.CLOSE_EVENT="close";SweetDevRia.ClickToOpen.prototype.initialize=function(){var hookerId=SweetDevRia.HookedComp.getInstance().getHooker(this.id);if(hookerId){this.hookerId=hookerId;SweetDevRia.$(this.hookerId).hook(this.id);}};SweetDevRia.ClickToOpen.prototype.open=function(aLink){if(this.opened){this.close();return false;} if(this.beforeOpen(aLink)){this.tryHooking();SweetDevRia.LayoutManager.moveNodeTo(this.frame.id,document.body);if(this.frame.parentNode!=document.body){document.body.appendChild(this.frame);} var top=parseInt(SweetDevRia.DomHelper.getY(aLink),10);var left=parseInt(SweetDevRia.DomHelper.getX(aLink),10);var topScroll=top-SweetDevRia.DomHelper.getScrolledTop();var leftScroll=left-SweetDevRia.DomHelper.getScrolledLeft();var smartPosition=true;if(!isNaN(this.shiftY)&&(parseInt(this.shiftY,10)!==0)){top+=parseInt(this.shiftY,10);smartPosition=false;} if(!isNaN(this.shiftX)&&(parseInt(this.shiftX,10)!==0)){left+=parseInt(this.shiftX,10);smartPosition=false;} document.body.appendChild(this.frame);this.frame.style.display='block';if(smartPosition){var frameWidth=YAHOO.util.Dom.getClientWidth();var frameHeight=YAHOO.util.Dom.getClientHeight();var element=document.getElementById(this.id+"_table");if(element===null){element=document.getElementById(this.id);} var tooltipWidth=parseInt(SweetDevRia.DomHelper.getWidth(element),10);var tooltipHeight=parseInt(SweetDevRia.DomHelper.getHeight(this.frame),10)-(this.getFrame()?this.getFrame().borderSize*2:0);if(this.getFrame()){this.getFrame().setWidth(tooltipWidth);this.getFrame().setHeight(tooltipHeight);} var offsetRight=frameWidth-(leftScroll+tooltipWidth),offsetLeft=(leftScroll+aLink.offsetWidth-tooltipWidth),offsetBottom=frameHeight-(topScroll+aLink.offsetHeight+tooltipHeight),offsetTop=(topScroll-tooltipHeight);if(offsetRight>0){null;} else if(offsetLeft>offsetRight){left-=tooltipWidth-aLink.scrollWidth;} if(offsetBottom>0){top+=aLink.scrollHeight+2;}else if(offsetTop>offsetBottom){top-=tooltipHeight;}else{top+=aLink.scrollHeight+2;}} if(browser.isGecko){var parentScrollTop=0;var parent=this.frame.parentNode;while(parent!==null&&parent!=document.body){parentScrollTop+=parent.scrollTop;parent=parent.parentNode;}} SweetDevRia.DomHelper.setY(this.frame,top);SweetDevRia.DomHelper.setX(this.frame,left);if(this.useFixedZIndex){this.frame.style.zIndex=this.zIndex;}else{var zindex=SweetDevRia.DisplayManager.getInstance().getTopZIndex(true);this.frame.style.zIndex=zindex;} this.setActive(true);this.opened=true;SweetDevRia.LayoutManager.changeSelectVisibility(document,false);SweetDevRia.LayoutManager.addMaskIFrame(this.id,this.frame);if(this.autoClose){this.refererTimerChecker=window.setInterval("checkReferer('"+this.id+"','"+aLink.id+"',"+parseInt(SweetDevRia.DomHelper.getY(aLink),10)+","+parseInt(SweetDevRia.DomHelper.getX(aLink),10)+")",500);} if(this.getFrame()){this.getFrame().refreshBorders();} this.fireEventListener(SweetDevRia.ClickToOpen.OPEN_EVENT);this.afterOpen(aLink);} return true;};function checkReferer(tooltip,refererLink,oldTop,oldLeft){var top=parseInt(SweetDevRia.DomHelper.getY(refererLink),10);var left=parseInt(SweetDevRia.DomHelper.getX(refererLink),10);if(oldTop!=top||oldLeft!=left){SweetDevRia.getComponent(tooltip).close();}} SweetDevRia.ClickToOpen.prototype.doClose=function(e,tooltip){tooltip.close();return false;};SweetDevRia.ClickToOpen.prototype.onContainerMove=function(dx,dy){SweetDevRia.DomHelper.setX(this.frame,SweetDevRia.DomHelper.getX(this.frame)+dx);SweetDevRia.DomHelper.setY(this.frame,SweetDevRia.DomHelper.getY(this.frame)+dy);};SweetDevRia.ClickToOpen.prototype.closePopup=function(originalTarget){var original=SweetDevRia.DomHelper.getAncestorCompId(originalTarget);var hooker=SweetDevRia.HookedComp.getInstance();if(originalTarget&&(((originalTarget.id!="tooltipLink"+this.id)&&(originalTarget.parentNode.id!="openCalendarTooltip"+this.id.substring(0,this.id.length-7))&&(!SweetDevRia.DomHelper.hasAncestor(originalTarget,this.id))&&(!original||!this.isHooked(original.id)))||(originalTarget==document.body))){this.close();}};SweetDevRia.ClickToOpen.prototype.close=function(){if(!this.opened){return false;} if(this.beforeClose()){this.closeHooked();this.frame.style.zIndex=0;this.frame.style.display='none';this.opened=false;this.setActive(false);if(navigator.userAgent.indexOf("Firefox/1.0")!=-1){SweetDevRia.DomHelper.get('closeLinkCTO'+this.id).onmouseout();} SweetDevRia.LayoutManager.changeSelectVisibility(document,true);SweetDevRia.LayoutManager.removeTransparentIFrame(this.id,this.frame);if(this.autoClose){window.clearInterval(this.refererTimerChecker);this.refererTimerChecker=0;} SweetDevRia.LayoutManager.restoreMovedNode(this.frame.id);this.fireEventListener(SweetDevRia.ClickToOpen.CLOSE_EVENT);this.afterClose();} return true;};SweetDevRia.ClickToOpen.prototype.setFixedZIndex=function(zIndex){this.useFixedZIndex=true;this.zIndex=zIndex;};SweetDevRia.ClickToOpen.prototype.handleEvent=function(evt){if(!this.isActive()){return true;} if(evt&&evt.type){if(evt.type==SweetDevRia.RiaEvent.KEYBOARD_TYPE){if(evt.keyCode==SweetDevRia.KeyListener.ESCAPE_KEY){this.close();SweetDevRia.EventHelper.stopPropagation(evt.srcEvent);SweetDevRia.EventHelper.preventDefault(evt.srcEvent);return false;}}}};SweetDevRia.ClickToOpen.prototype.destroy=function(){this.close();}; SweetDevRia.EditableText=function(id){if(id){superClass(this,SweetDevRia.RiaComponent,id,"EditableText");this.elements={};this.activeElement=null;}};extendsClass(SweetDevRia.EditableText,SweetDevRia.RiaComponent);SweetDevRia.EditableText.ID="__EditableText";SweetDevRia.EditableText.EDIT_ZONE="_editZone";SweetDevRia.EditableText.EMPTY_VALUE="          ";SweetDevRia.EditableText.beforeValid=function(){return true;};SweetDevRia.EditableText.afterValid=function(){};SweetDevRia.EditableText.beforeClose=function(){return true;};SweetDevRia.EditableText.afterClose=function(){};SweetDevRia.EditableText.beforeActive=function(elem){return true;};SweetDevRia.EditableText.afterActive=function(elem){};SweetDevRia.EditableText._instance=new SweetDevRia.EditableText(SweetDevRia.EditableText.ID);SweetDevRia.EditableText.getInstance=function(){return SweetDevRia.EditableText._instance;};SweetDevRia.EditableText.prototype.exist=function(id){return(this.elements[id]!==null&&this.elements[id]!==undefined);};SweetDevRia.EditableText.prototype.initialize=function(){var editableText=SweetDevRia.EditableText.getInstance();for(var id in editableText.elements){if(id!="toJSONString"){var elem=SweetDevRia.DomHelper.get(editableText.elements[id][0]);editableText.initElement(elem,editableText.elements[id][4]);}}};SweetDevRia.EditableText.prototype.initElement=function(elem,listenersId){var editableText=SweetDevRia.EditableText.getInstance();if(elem!=null&&elem.isInitialized!=true){SweetDevRia.EventHelper.addListener(elem,"dblclick",SweetDevRia.EditableText.dblClickHandler);if(listenersId){for(var i=0;i");comp.focus();} else if(type==SweetDevRia.Form.TEXTAREA_TYPE){comp.value=value;comp.focus();} else if(type==SweetDevRia.Form.RADIO_TYPE){for(var i=0;i",">");};SweetDevRia.EditableText.addEditCompEvent=function(elem){var comp=elem.editComp;var type=elem.type;if(type==SweetDevRia.Form.INPUT_TYPE){SweetDevRia.EventHelper.addListener(comp,"blur",SweetDevRia.EditableText.blurHandler);} else if(type==SweetDevRia.Form.TEXTAREA_TYPE){SweetDevRia.EventHelper.addListener(comp,"blur",SweetDevRia.EditableText.blurHandler);} else if(type==SweetDevRia.Form.RADIO_TYPE){for(var i=0;i1){this.createPageBar();} if(browser.isIE&&browser.version<7){SweetDevRia.EventHelper.addListener(document.getElementById(this.id+'_container'),'mouseover',this.onMouseover,this,true);SweetDevRia.EventHelper.addListener(document.getElementById(this.id+'_container'),'mouseout',this.onMouseout,this,true);}};SweetDevRia.List.prototype.onMouseover=function(e){var li=SweetDevRia.DomHelper.getAncestorByType(e.toElement,'LI');if(li){li.firstChild.style.backgroundColor='buttonface';}};SweetDevRia.List.prototype.onMouseout=function(e){var li=SweetDevRia.DomHelper.getAncestorByType(e.fromElement,'LI');if(li){li.firstChild.style.backgroundColor='white';}};SweetDevRia.List.prototype.listAfterRender=function(){if(this.canOrder){for(var i=0;imax){max=list.childNodes[i].offsetWidth;}}} SweetDevRia.DomHelper.get(this.id+"_list").style.width=max+"px";};SweetDevRia.List.prototype.generateMenu=function(){if(!this.canAdd&&!this.canModify&&!this.canDelete){return;} var menu=new SweetDevRia.ContextMenu(this.id+"Menu");menu.targetId=this.id+"_ul";var list=this;menu.beforeShow=function(e){e=SweetDevRia.EventHelper.getEvent(e);var src=e.src;while(!SweetDevRia.DomHelper.hasClassName(src,"ideo-lst-item")&&src!=document.body){src=src.parentNode;} menu.clickedItem=SweetDevRia.DomHelper.getDomPos(list.getListUL(),src.parentNode.id,false);SweetDevRia.EventHelper.stopPropagation(e);return true;};if(this.canAdd){var menuAddItem=new SweetDevRia.MenuItem(this.id+"menuAddItem");menuAddItem.label=this.getMessage("addItem");menuAddItem.checkbox=false;menuAddItem.checked=false;menuAddItem.disabled=false;menuAddItem.image=null;menuAddItem.onclick=function(){list.addItem();};menuAddItem.oncheck=function(){};menuAddItem.onuncheck=function(){};menu.addItem(menuAddItem);} if(this.canModify){var menuModifyItem=new SweetDevRia.MenuItem(this.id+"menuModifyItem");menuModifyItem.label=this.getMessage("modifyItem");menuModifyItem.checkbox=false;menuModifyItem.checked=false;menuModifyItem.disabled=false;menuModifyItem.image=null;menuModifyItem.onclick=function(){list.modifyItem(menu.clickedItem);};menuModifyItem.oncheck=function(){};menuModifyItem.onuncheck=function(){};menu.addItem(menuModifyItem);} if(this.canDelete){var menuDeleteItem=new SweetDevRia.MenuItem(this.id+"menuDeleteItem");menuDeleteItem.label=this.getMessage("deleteItem");menuDeleteItem.checkbox=false;menuDeleteItem.checked=false;menuDeleteItem.disabled=false;menuDeleteItem.image=null;menuDeleteItem.onclick=function(){if(!list.deleteConfirmationAlert){var myalert=new SweetDevRia.Alert(list.id+"_delete_confirm_alert");myalert.setModal(true);myalert.setType(SweetDevRia.Alert.PLAIN);myalert.setActionType(SweetDevRia.Alert.YES_NO);myalert.i18n={};myalert.i18n["buttonYes"]="Oui";myalert.i18n["buttonNo"]="Non";myalert.onYes=function(){list.deleteItem(menu.clickedItem);};myalert.onNo=function(){};list.deleteConfirmationAlert=myalert;} list.deleteConfirmationAlert.show();};menuDeleteItem.oncheck=function(){};menuDeleteItem.onuncheck=function(){};menu.addItem(menuDeleteItem);} menu.render();menu.initialize();if(this.canAdd){var menu=new SweetDevRia.ContextMenu(this.id+"AddMenu");menu.targetId=this.id+"_list";var list=this;var menuAddItem=new SweetDevRia.MenuItem(this.id+"menuAddItem_only");menuAddItem.label=this.getMessage("addItem");menuAddItem.checkbox=false;menuAddItem.checked=false;menuAddItem.disabled=false;menuAddItem.image=null;menuAddItem.onclick=function(){list.addItem();};menuAddItem.oncheck=function(){};menuAddItem.onuncheck=function(){};menu.addItem(menuAddItem);menu.render();menu.initialize();}};SweetDevRia.List.prototype.formatData=function(data){return data;};SweetDevRia.List.prototype.createItem=function(data){var itemId=null;if(data&&data.id){itemId=data.id;} else{var itemId=this.itemCount;while(this.existItemId(itemId)){itemId=itemId+1;}} var item=new SweetDevRia.ListItem(itemId,this,data);this.itemCount++;return item;};SweetDevRia.List.prototype.existItemId=function(itemId){for(var i=0;i=y){return child;}}} return null;} drop.onDrop=function(dragObject,dragPosition){if(dragObject.isDropped==true){return;} var ul=list.getListUL();var posY=dragPosition[1]+SweetDevRia.DomHelper.getY(ul);var hover=getHoverNode(ul,posY);if(hover==null){var oldPos=dragObject.listItem.position;var dropPos=list.listItems.length-1;if(oldPos!=dropPos){var node=dragObject.getEl();var parent=node.parentNode;parent.appendChild(node);list.listItems.splice(oldPos,1);list.listItems.insertAt(dragObject.listItem,dropPos);var params={"oldIndex":oldPos,"newIndex":dropPos};var riaEvent=new SweetDevRia.RiaEvent("move",list.id,params);if(this.isStateful){SweetDevRia.ComHelper.stackEvent(riaEvent);} list.fireEventListener(SweetDevRia.List.MOVE_EVENT,[oldPos,dropPos]);}}};if(this.hasBeenInitialized){drop.initialize();}};SweetDevRia.List.prototype.addDataAction=function(evt){if(this.canAdd){var form=document.getElementById(this.formId);var res=SweetDevRia.Mandatory.testFormMandatory(this.formId);if(res){var data=SweetDevRia.Form.getFormData(form,this.mapping);this.insertData(data);return this.closeWindow(evt);}}};SweetDevRia.List.prototype.deleteData=function(index){if(this.beforeDeleteData(index)){if(this.canDelete){this.listItems.splice(index,1);var params={"index":index};var riaEvent=new SweetDevRia.RiaEvent("delete",this.id,params);if(this.isStateful){SweetDevRia.ComHelper.stackEvent(riaEvent);}} this.fireEventListener(SweetDevRia.List.DELETE_EVENT,index);this.afterDeleteData(index);}};SweetDevRia.List.prototype.resetForm=function(){this.moveWindow();var form=document.getElementById(this.formId);for(var i=0;i
";SweetDevRia.List.prototype.template="
    ${getListRender()}
1}block{else}none{/if};\"\ class=\"ideo-pgb-pagebar\"> 
${i18n.deleteConfirmation}
";SweetDevRia.ListItem.prototype.template="
  • ${getDataFormatted()}
  • "; SweetDevRia.Reader=function(id){superClass(this,SweetDevRia.RiaComponent,id,"Reader");this.groupIndex=0;this.exclusive=false;this.managerIds={};};extendsClass(SweetDevRia.Reader,SweetDevRia.RiaComponent);SweetDevRia.Reader.prototype.initialize=function(){if(this.pageNumber>1){this.createPageBar();}};SweetDevRia.Reader.prototype.setData=function(data){this.data=data;};SweetDevRia.Reader.prototype.goToPage=function(pageNumber){this.actualPage=pageNumber;var params={};params["actualPage"]=this.actualPage;SweetDevRia.ComHelper.fireEvent(new SweetDevRia.RiaEvent("pagin",this.id,params));};SweetDevRia.Reader.prototype.createPageBar=function(){var pagebar=new SweetDevRia.PageBar("pagebar_"+this.id);pagebar.setPageNumber(this.pageNumber);pagebar.actualPage=1;pagebar.linkedId=this.id;pagebar.showFirstLast=false;pagebar.renderFrame=false;pagebar.displayPageMode=SweetDevRia.PageBar.RESUME_MODE;pagebar.render();};SweetDevRia.Reader.prototype.onPagin=function(evt){if(this.exclusive){for(var id in reader.managerIds){SweetDevRia.unregister(reader.managerIds[id]);}} this.data=JSON.parse(evt.data);this.render();SweetDevRia.Frame.reloadAllFrames();};SweetDevRia.Reader.prototype.getItemRender=function(itemData,groupIndex){var res="";var itemId=itemData.id;var header=itemData.label;var content=itemData.content?itemData.content:itemData.children;var collapse=new SweetDevRia.Collapse(this.id+"_"+itemId);collapse.header=header;collapse.renderFrame=false;if(this.exclusive){var collapseManager=SweetDevRia.$(this.id+"_manager_"+groupIndex);if(collapseManager==null){collapseManager=new SweetDevRia.CollapseManager(this.id+"_manager_"+groupIndex);this.managerIds[collapseManager.id]=collapseManager;} collapseManager.addCollapse(collapse.id);} var reader=this;SweetDevRia.addListener(collapse,SweetDevRia.Collapse.SWAP_EVENT,SweetDevRia.Frame.reloadAllFrames,this);if(content==null){collapse.beforeExpand=function(){var params={};params["itemId"]=itemId;SweetDevRia.ComHelper.fireEvent(new SweetDevRia.RiaEvent("getItem",reader.id,params));};} else{if(typeof(content)=="string"){collapse.bodyContent=content;} else{var bodyContent="";for(var i=0;i-1&&!stop;i--){var evt=this.events['timestamp_'+this.eventsBeginDates[i]];if(evt&&evt.constructor==Array){for(var j=evt.length-1;j>-1;j--,i--){var subEvt=evt[j];if(subEvt.id==event.id){passed=true;continue;} if(subEvt.isMultiple()){continue;} else if(this.eventsBeginDates>rangeUp.getTime()){continue;} else if(subEvt.getEnd().getTime()rangeUp.getTime()){continue;} else if(evt.getEnd().getTime()rangeUp.getTime()){continue;} else if(subEvt.getEnd().getTime()rangeUp.getTime()){continue;} else if(evt.getEnd().getTime()1?unitWidth-splitterWidth:unitWidth);};SweetDevRia.Schedule.prototype.getPrecedingEvents=function(event){if(event.isMultiple()){SweetDevRia.log.error("Can't calculate preceding event of a multiple event.");} var rangeDown=this.grid.getBegin();var rangeUp=this.grid.getEnd();var shiftX=0;var stop=false;var passed=false;for(var i=this.eventsBeginDates.length-1;i>-1&&!stop;i--){var evt=this.events['timestamp_'+this.eventsBeginDates[i]];if(evt&&evt.constructor==Array){for(var j=evt.length-1;j>-1;j--,i--){var subEvt=evt[j];if(subEvt.id==event.id){passed=true;continue;} if(subEvt.isMultiple()){continue;} else if(this.eventsBeginDates>rangeUp.getTime()){continue;} else if(subEvt.getEnd().getTime()rangeUp.getTime()){continue;} else if(evt.getEnd().getTime()-1&&!stop;i--){var evt=this.events['timestamp_'+this.eventsBeginDates[i]];if(evt&&evt.constructor==Array){for(var j=evt.length-1;j>-1;j--,i--){var subEvt=evt[j];if(subEvt.id==event.id){passed=true;continue;} if(!subEvt.isMultiple()){continue;} else if(this.eventsBeginDates>rangeUp.getTime()){continue;} else if(subEvt.getEnd().getTime()rangeUp.getTime()){continue;} else if(evt.getEnd().getTime()(0.84*SweetDevRia.DomHelper.get(this.id+'_container').clientHeight)){height=(0.84*SweetDevRia.DomHelper.get(this.id+'_container').clientHeight);} return height;};SweetDevRia.ScheduleGrid.prototype.rowNumber=function(){var number=SweetDevRia.$(this.scheduleId).getTimeDivision();if(number>SweetDevRia.Schedule.QUARTER){number=4;} return number;};SweetDevRia.ScheduleGrid.prototype.getRowsArray=function(){if(this.rowNumber()==1){return null;} var array=[];for(var i=0;i'+(i<10?('0'+i):i)+'h'+(min<10?'0'+min:min)+'';}}} return this.allHoursOption;};SweetDevRia.ScheduleGrid.prototype.adaptHourEnd=function(){var index=document.getElementById(this.id+"_addEventHourBegin").selectedIndex;var length=document.getElementById(this.id+"_addEventHourBegin").options.length;if(index>=0){for(var i=0;i<=index;i++){document.getElementById(this.id+"_addEventHourEnd").options[i].disabled=true;} for(var i=index+1;i

     de  a 
     au 




    ";SweetDevRia.ScheduleGrid.prototype.headerTemplate="{var height = SweetDevRia.Schedule.HEADER_HEIGHT}
    < Semaine Pr\u00e9c\u00e9dente
    Semaine Suivante >
    {var cpt = 0;} {for d in daysList} {var left = calculateVSplitLeft(cpt)} {var leftNext = calculateVSplitLeft(cpt+1)} {if cpt!=0}
    {/if}
    ${d}
    {var cpt = cpt + 1;} {/for}
    ";SweetDevRia.ScheduleGrid.prototype.template="${getRenderString (headerTemplate)}
    alertMessage
    {var cpt = 0;}
    0h
    {var number = rowNumber()} {for h in hoursTab} {var top = calculateHSplitTop(cpt)} {for row in getRowsArray()}
    {if row!=number-2}
    {else}
    {if h!=23}
    ${h+1}h
    {/if} {/if} {forelse}
    ${h+1}h
    {/for} {var cpt = cpt + 1;} {/for} {var cpt = 0;} {for d in daysList} {if cpt!=0} {var left = calculateVSplitLeft(cpt)}
    {/if} {var cpt = cpt + 1;} {/for}
    {var cpt = 0;} {for d in daysList} {if cpt!=0} {var left = calculateVSplitLeft(cpt)}
    {/if} {var cpt = cpt + 1;} {/for}
    "; SweetDevRia.ScheduleEvent=function(id){superClass(this,SweetDevRia.RiaComponent,id,"ScheduleEvent");this.scheduleId=null;this.data=null;this.multiple=false;this.date=null;this.duration=null;this.dragEvent=null;this.tooltipShown=false;this.scrollTopInterval=0;this.scrollBottomInterval=0;this.nextTimeout=0;this.previousTimeout=0;this.height=0;this.width=0;};extendsClass(SweetDevRia.ScheduleEvent,SweetDevRia.RiaComponent);SweetDevRia.ScheduleEvent.prototype.getEventId=function(){return this.id;};SweetDevRia.ScheduleEvent.prototype.setDuration=function(duration){this.duration=duration;if(this.duraction<=0){this.duration=1;}};SweetDevRia.ScheduleEvent.prototype.addDuration=function(duration){this.duration+=duration;if(this.duration<=0){this.duration=1;}};SweetDevRia.ScheduleEvent.prototype.setHourDuration=function(hour){this.setDuration(hour*SweetDevRia.$(this.scheduleId).getTimeDivision());};SweetDevRia.ScheduleEvent.prototype.getDuration=function(){return this.duration;};SweetDevRia.ScheduleEvent.prototype.setScheduleId=function(scheduleId){this.scheduleId=scheduleId;};SweetDevRia.ScheduleEvent.prototype.setDate=function(date){this.date=new Date(date);};SweetDevRia.ScheduleEvent.prototype.getBegin=function(){return this.date;};SweetDevRia.ScheduleEvent.prototype.getEnd=function(){if(!this.isMultiple()){return new Date(this.date.getTime()+(SweetDevRia.$(this.scheduleId).getMilliTimeUnit()*this.duration));} else{var end=new Date(this.date);end.setDate(end.getDate()+this.duration);return end;}};SweetDevRia.ScheduleEvent.prototype.setData=function(data){this.data=data;};SweetDevRia.ScheduleEvent.prototype.getData=function(){return this.data;};SweetDevRia.ScheduleEvent.prototype.setMultipleDay=function(isMultiple){this.multiple=isMultiple;};SweetDevRia.ScheduleEvent.prototype.isMultiple=function(){return this.multiple;};SweetDevRia.ScheduleEvent.prototype.isDraggable=function(){return SweetDevRia.$(this.scheduleId).isDraggable();};SweetDevRia.ScheduleEvent.prototype.isResizable=function(){return SweetDevRia.$(this.scheduleId).isResizable();};SweetDevRia.ScheduleEvent.prototype.getTopDistance=function(){var timeUnit=60/SweetDevRia.$(this.scheduleId).getTimeDivision();var tempDate=new Date(this.date);var nbTimeUnit=0;var lastHour=tempDate.getHours();while(tempDate.getHours()>=0&&tempDate.getHours()<=lastHour){lastHour=tempDate.getHours();tempDate.setMinutes(tempDate.getMinutes()-timeUnit);if(tempDate.getHours()>=0&&tempDate.getDate()==this.date.getDate()){nbTimeUnit++;}} return nbTimeUnit;};SweetDevRia.ScheduleEvent.prototype.getTimeUnitHeight=function(){return SweetDevRia.$(this.scheduleId).getTimeUnitHeight();};SweetDevRia.ScheduleEvent.prototype.getHeight=function(){if(this.isMultiple()){return SweetDevRia.Schedule.MULTIPLE_HEIGHT;} return(SweetDevRia.$(this.scheduleId).getHourHeight()/SweetDevRia.$(this.scheduleId).getTimeDivision())*this.duration;};SweetDevRia.ScheduleEvent.prototype.getHeightPx=function(){if(this.height==0){this.height=document.getElementById(this.id).clientHeight;} return this.height;};SweetDevRia.ScheduleEvent.prototype.getWidth=function(){return SweetDevRia.$(this.scheduleId).getEventWidth(this);};SweetDevRia.ScheduleEvent.prototype.getWidthPx=function(){if(this.width==0){this.width=document.getElementById(this.id).clientWidth;} return this.width;};SweetDevRia.ScheduleEvent.prototype.getTop=function(){if(this.isMultiple()){return SweetDevRia.$(this.scheduleId).getMultipleEventTop(this)*SweetDevRia.Schedule.MULTIPLE_HEIGHT;} return this.getTimeUnitHeight()*this.getTopDistance();};SweetDevRia.ScheduleEvent.prototype.getLeft=function(){return SweetDevRia.$(this.scheduleId).getEventLeft(this);};SweetDevRia.ScheduleEvent.prototype.setDragDate=function(newX,newY){return SweetDevRia.$(this.scheduleId).getEventLeft(this);};SweetDevRia.ScheduleEvent.prototype.formatData=function(data){return SweetDevRia.$(this.scheduleId).formatData(data);};SweetDevRia.ScheduleEvent.prototype.formatPopupData=function(data){return SweetDevRia.$(this.scheduleId).formatPopupData(data);};SweetDevRia.ScheduleEvent.prototype.attachDragEvent=function(){if(SweetDevRia.$(this.scheduleId).isDraggable()){this.dragEvent=new SweetDevRia.DD(this.id+'_drag');this.dragEvent.setDragId(this.id);this.dragEvent.setFakeMode(SweetDevRia.DD.FAKE);this.dragEvent.delta=false;this.dragEvent.displayIcon=false;this.dragEvent.insertMode=SweetDevRia.DD.NONE_INSERT;if(!this.isMultiple()){this.dragEvent.constraintId=SweetDevRia.$(this.scheduleId).getGridId();} else{this.dragEvent.constraintId=SweetDevRia.$('mySchedule').getGridId()+'_multipleDayContainer';} this.dragEvent.eventId=this.id;this.dragEvent.onEndDrag=function(dropZone,dropPosition){var div=SweetDevRia.DomHelper.get(this.dragId);var container=SweetDevRia.DomHelper.get(SweetDevRia.$(SweetDevRia.$(this.dragId).scheduleId).getGridId());var schedule=SweetDevRia.$(SweetDevRia.$(this.dragId).scheduleId);var event=SweetDevRia.$(this.dragId);var offset=event.getOffsetXY(container);var scrollTop=container.scrollTop;var shiftedX=(this.objDD.lastPageX-offset.x)+(event.isMultiple()?0:this.objDD.deltaX);var shiftedY=this.objDD.lastPageY+scrollTop-offset.y;var oldBegin=new Date(event.getBegin());var oldEnd=new Date(event.getEnd());event.setDate(schedule.getDateFromCoord(shiftedX,(event.isMultiple()?0:shiftedY),event.isMultiple()));schedule.updateEvent(event,oldBegin,oldEnd);var div=SweetDevRia.DomHelper.get(schedule.getGridId()+'_tooltip');div.style.display='none';div.style.zIndex=0;window.clearInterval(this.scrollBottomInterval);window.clearInterval(this.scrollTopInterval);};this.dragEvent.onDrag=this.onDrag;this.dragEvent.onStartDrag=this.onStartDrag;}};SweetDevRia.ScheduleEvent.prototype.attachVerticalResizeEvent=function(){if(SweetDevRia.$(this.scheduleId).isResizable()){this.resizeEventTop=new SweetDevRia.DD(this.id+'_resizeTop');this.resizeEventTop.setDragId(this.id+'_topResizer');this.resizeEventTop.setFakeMode(SweetDevRia.DD.FAKE);this.resizeEventTop.delta=false;this.resizeEventTop.displayIcon=false;this.resizeEventTop.insertMode=SweetDevRia.DD.NONE_INSERT;this.resizeEventTop.constraintType=SweetDevRia.DD.VERTICAL;this.resizeEventTop.constraintId=SweetDevRia.$('mySchedule').getGridId();this.resizeEventTop.eventId=this.id;this.resizeEventTop.onEndDrag=function(dropZone,dropPosition){var div=SweetDevRia.DomHelper.get(this.eventId);var container=SweetDevRia.DomHelper.get(SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId).getGridId());var schedule=SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId);var event=SweetDevRia.$(this.eventId);var offset=event.getOffsetXY(container);var scrollTop=container.scrollTop;var newY=this.objDD.lastPageY+scrollTop-offset.y;var delta=schedule.getTimeUnitDifferences(parseInt(div.style.top.split("ex")[0],10),newY);var delta=schedule.getTimeUnitDifferences(div.offsetTop,newY);var oldBegin=new Date(event.getBegin());var oldEnd=new Date(event.getEnd());event.addDuration(delta);var date=event.getBegin();date.setMinutes(date.getMinutes()-(delta*(60/schedule.getTimeDivision())));event.setDate(date);schedule.updateEvent(event,oldBegin,oldEnd);var div=SweetDevRia.DomHelper.get(schedule.getGridId()+'_tooltip');div.style.display='none';div.style.zIndex=0;this.height=document.getElementById(this.id).clientHeight;window.clearInterval(this.scrollBottomInterval);window.clearInterval(this.scrollTopInterval);};this.resizeEventTop.onDrag=this.onDrag;this.resizeEventTop.onStartDrag=this.onStartDrag;this.resizeEventBottom=new SweetDevRia.DD(this.id+'_resizeBottom');this.resizeEventBottom.setDragId(this.id+'_bottomResizer');this.resizeEventBottom.setFakeMode(SweetDevRia.DD.FAKE);this.resizeEventBottom.delta=false;this.resizeEventBottom.displayIcon=false;this.resizeEventBottom.insertMode=SweetDevRia.DD.NONE_INSERT;this.resizeEventBottom.constraintType=SweetDevRia.DD.VERTICAL;this.resizeEventBottom.constraintId=SweetDevRia.$('mySchedule').getGridId();this.resizeEventBottom.eventId=this.id;this.resizeEventBottom.onEndDrag=function(dropZone,dropPosition){var div=SweetDevRia.DomHelper.get(this.eventId);var container=SweetDevRia.DomHelper.get(SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId).getGridId());var schedule=SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId);var event=SweetDevRia.$(this.eventId);var offset=event.getOffsetXY(container);var scrollTop=container.scrollTop;var newY=this.objDD.lastPageY+scrollTop-offset.y;var delta=schedule.getTimeUnitDifferences(newY,div.offsetTop+div.clientHeight);var oldBegin=new Date(event.getBegin());var oldEnd=new Date(event.getEnd());event.addDuration(delta-1);schedule.updateEvent(event,oldBegin,oldEnd);var div=SweetDevRia.DomHelper.get(schedule.getGridId()+'_tooltip');div.style.display='none';div.style.zIndex=0;};this.resizeEventBottom.onDrag=this.onDrag;this.resizeEventBottom.onStartDrag=this.onStartDrag;}};SweetDevRia.ScheduleEvent.prototype.attachHorizontalResizeEvent=function(){if(SweetDevRia.$(this.scheduleId).isResizable()){this.resizeEventLeft=new SweetDevRia.DD(this.id+'_resizeLeft');this.resizeEventLeft.setDragId(this.id+'_leftResizer');this.resizeEventLeft.setFakeMode(SweetDevRia.DD.FAKE);this.resizeEventLeft.delta=false;this.resizeEventLeft.displayIcon=false;this.resizeEventLeft.insertMode=SweetDevRia.DD.NONE_INSERT;this.resizeEventLeft.constraintType=SweetDevRia.DD.HORIZONTAL;this.resizeEventLeft.constraintId=SweetDevRia.$('mySchedule').getGridId()+'_multipleDayContainer';this.resizeEventLeft.eventId=this.id;this.resizeEventLeft.onEndDrag=function(dropZone,dropPosition){var div=SweetDevRia.DomHelper.get(this.eventId);var container=SweetDevRia.DomHelper.get(SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId).getGridId());var schedule=SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId);var event=SweetDevRia.$(this.eventId);var offset=event.getOffsetXY(container);var scrollTop=container.scrollTop;var shiftedX=(this.objDD.lastPageX-offset.x)+this.objDD.deltaX;var oldBegin=new Date(event.getBegin());var oldEnd=new Date(event.getEnd());event.setDate(schedule.getDateFromCoord(shiftedX,0,true));event.addDuration(Math.round((oldBegin.getTime()-event.getBegin().getTime())/(1000*60*60*24)));schedule.updateEvent(event,oldBegin,oldEnd);var div=SweetDevRia.DomHelper.get(schedule.getGridId()+'_tooltip');div.style.display='none';div.style.zIndex=0;event.width=document.getElementById(event.id).clientWidth;};this.resizeEventLeft.onDrag=this.onDrag;this.resizeEventLeft.onStartDrag=this.onStartDrag;this.resizeEventRight=new SweetDevRia.DD(this.id+'_resizeRight');this.resizeEventRight.setDragId(this.id+'_rightResizer');this.resizeEventRight.setFakeMode(SweetDevRia.DD.FAKE);this.resizeEventRight.delta=false;this.resizeEventRight.displayIcon=false;this.resizeEventRight.insertMode=SweetDevRia.DD.NONE_INSERT;this.resizeEventRight.constraintType=SweetDevRia.DD.HORIZONTAL;this.resizeEventRight.constraintId=SweetDevRia.$('mySchedule').getGridId()+'_multipleDayContainer';this.resizeEventRight.eventId=this.id;this.resizeEventRight.onEndDrag=function(dropZone,dropPosition){var div=SweetDevRia.DomHelper.get(this.eventId);var container=SweetDevRia.DomHelper.get(SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId).getGridId());var schedule=SweetDevRia.$(SweetDevRia.$(this.eventId).scheduleId);var event=SweetDevRia.$(this.eventId);var scrollTop=container.scrollTop;var offset=event.getOffsetXY(container);var shiftedX=(this.objDD.lastPageX-offset.x)+this.objDD.deltaX;var oldBegin=new Date(event.getBegin());var oldEnd=new Date(event.getEnd());var newEnd=schedule.getDateFromCoord(shiftedX,0,true);event.addDuration(Math.round((newEnd.getTime()-oldEnd.getTime())/(1000*60*60*24)));schedule.updateEvent(event,oldBegin,oldEnd);var div=SweetDevRia.DomHelper.get(schedule.getGridId()+'_tooltip');div.style.display='none';div.style.zIndex=0;event.width=document.getElementById(event.id).clientWidth;};this.resizeEventRight.onDrag=this.onDrag;this.resizeEventRight.onStartDrag=this.onStartDrag;}};SweetDevRia.ScheduleEvent.prototype.scrollTop=function(){var container=SweetDevRia.DomHelper.get(SweetDevRia.$(SweetDevRia.$(this.id).scheduleId).getGridId());if(container.scrollTop>10){container.scrollTop-=20;} else{container.scrollTop=0;window.clearInterval(this.scrollTopInterval);}};SweetDevRia.ScheduleEvent.prototype.scrollBottom=function(){var container=SweetDevRia.DomHelper.get(SweetDevRia.$(SweetDevRia.$(this.id).scheduleId).getGridId());if(container.scrollTop+container.clientHeight {if !isMultiple()} {if isResizable()}
    {/if}
    ${formatData(getData())}
    {if isResizable()}
    {/if} {else} {if isResizable()}
    {/if}
    ${formatData(getData())}
    {if isResizable()}
    {/if} {/if}";SweetDevRia.ScheduleEvent.prototype.getOffsetXY=function FindXY(obj){var x=0,y=0;while(obj!=null){x+=obj.offsetLeft;y+=obj.offsetTop;obj=obj.offsetParent;} return{x:x,y:y};}; SweetDevRia.Control=function(id){superClass(this,SweetDevRia.RiaComponent,id,"Control");this.srcIds=null;this.actions=[];this.actionsElse=[];this.test=null;this.testClass=null;this.handler=null;this.canBeEmpty=true;this.allowChar=null;this.applyErrorClass=false;this.applyLabelErrorClass=false;this.triggers=[];this.triggers[SweetDevRia.Form.INPUT_TYPE]="keyup";this.triggers[SweetDevRia.Form.TEXTAREA_TYPE]="keyup";this.triggers[SweetDevRia.Form.SELECT_TYPE]="change";this.triggers[SweetDevRia.Form.RADIO_TYPE]="click";this.triggers[SweetDevRia.Form.CHECKBOX_TYPE]="click";this.triggers[SweetDevRia.Form.RIA_CALENDAR_TYPE]="change";this.triggers[SweetDevRia.Form.RIA_SUGGEST_TYPE]="change";this.triggers[SweetDevRia.Form.RIA_EDITABLE_TYPE]=SweetDevRia.Editable.CHANGE_EVENT;this.allowTriggers=[];this.allowTriggers[SweetDevRia.Form.INPUT_TYPE]="keypress";this.allowTriggers[SweetDevRia.Form.TEXTAREA_TYPE]="keypress";this.allowTriggers[SweetDevRia.Form.RIA_EDITABLE_TYPE]="keypress";};extendsClass(SweetDevRia.Control,SweetDevRia.RiaComponent);SweetDevRia.Control.SHOW_ACTION=0;SweetDevRia.Control.HIDE_ACTION=1;SweetDevRia.Control.DISABLE_ACTION=2;SweetDevRia.Control.ENABLE_ACTION=3;SweetDevRia.Control.LOADDATA_ACTION=4;SweetDevRia.Control.RESET_ACTION=5;SweetDevRia.Control.SETVALUE_ACTION=6;SweetDevRia.Control.HANDLER_ACTION=7;SweetDevRia.Control.EMPTY_MASK="(^$)|";SweetDevRia.Control.prototype.beforeLoadData=function(comp,data){return true;};SweetDevRia.Control.prototype.afterLoadData=function(comp,data){};SweetDevRia.Control.prototype.beforeSetValue=function(comp,value){return true;};SweetDevRia.Control.prototype.afterSetValue=function(comp,value){};SweetDevRia.Control.prototype.beforeTestValue=function(id,value){return true;};SweetDevRia.Control.prototype.afterTestValue=function(id,value){};SweetDevRia.Control.prototype.beforeSetErrorMode=function(id,errorMode){return true;};SweetDevRia.Control.prototype.afterSetErrorMode=function(id,errorMode){};SweetDevRia.Control.prototype.beforeSetComponentDisable=function(comp,disable){return true;};SweetDevRia.Control.prototype.afterSetComponentDisable=function(comp,disable){};SweetDevRia.Control.prototype.beforeSetComponentVisibility=function(comp,visibility){return true;};SweetDevRia.Control.prototype.afterSetComponentVisibility=function(comp,visibility){};SweetDevRia.Control.prototype.beforeResetComponent=function(comp){return true;};SweetDevRia.Control.prototype.afterResetComponent=function(comp){};SweetDevRia.Control.prototype.beforeExecuteActions=function(id,value,actions){return true;};SweetDevRia.Control.prototype.afterExecuteActions=function(id,value,actions){};SweetDevRia.Control.prototype.initialize=function(){this.addOnChangeHandler();};SweetDevRia.Control.prototype.destroy=function(){this.removeOnChangeHandler();};SweetDevRia.Control.prototype.setEventTrigger=function(formType,event){this.triggers[formType]=event;};SweetDevRia.Control.prototype.updateEventTrigger=function(formType,event,remove){if(remove!=false){remove=true;} var srcs=SweetDevRia.Form.getComponents(this.srcIds);for(var i=0;i=65&&keycode<=90)){keycode=keycode+32;} if((keycode==null)||(keycode==8)){return true;} var key=String.fromCharCode(keycode);var result=reg.test(key);var srcId=event.src.name;if(!result){control.setErrorMode(srcId,true,[[control.charMessageType,control.charMessage]]);SweetDevRia.EventHelper.stopPropagation(evt);SweetDevRia.EventHelper.preventDefault(evt);} else{control.setErrorMode(srcId,false,[[control.charMessageType,control.charMessage]]);}}} return null;};SweetDevRia.Control.prototype.testValue=function(id,value){var testResult=[true,null,null];if(this.beforeTestValue(id,value)){if(this.test){var regexpr=this.test[0];if(this.canBeEmpty&®expr!=SweetDevRia.Control.NOTNULL_MASK){regexpr=SweetDevRia.Control.EMPTY_MASK+regexpr;} var reg=new RegExp(regexpr);testResult=[reg.test(value),this.test[1]];} if(testResult[0]&&this.functionTest){var functionTest=this.functionTest[0];var result=functionTest.call(this,value);testResult=[result,this.functionTest[1]];} if(testResult[0]&&this.testClass){var data=this.synchCallIAction(this.testClass[0],{"srcId":id,"value":value});testResult=[data["data"],this.testClass[1]];} this.afterTestValue(id,value);} return testResult;};SweetDevRia.Control.onRiaControl=function(control){return control.control(this.id);};SweetDevRia.Control.prototype.onControl=function(evt,control){evt=SweetDevRia.EventHelper.getEvent(evt);var srcId=evt.src.name;return control.control(srcId);};SweetDevRia.Control.prototype.control=function(targetId){var value=SweetDevRia.Form.getValue(targetId);var testResult=this.testValue(targetId,value);if(testResult[0]){this.executeActions(targetId,value,this.actions);} else{this.executeActions(targetId,value,this.actionsElse);} this.setErrorMode(targetId,!testResult[0],testResult[1]);return testResult[0];};SweetDevRia.Control.prototype.controlAll=function(){var ids=this.srcIds.split(",");for(var i=0;i0){SweetDevRia.Messenger.sendMessage(this.messageConf,true,null);} else{SweetDevRia.Messenger.sendMessage(this.messageConf,null,null);}};SweetDevRia.Mandatory.prototype.clearErrors=function(){SweetDevRia.Messenger.sendMessage(this.messageConf,null,null);};SweetDevRia.Mandatory.prototype.onControl=function(){var errorIds=[];var or=false;for(var id in this.ids){if(id!="toJSONString"){var control=SweetDevRia.$(id);if(control){if(!control.controlAll()){errorIds.add(id);} else{if(this.type==SweetDevRia.Mandatory.OR_TYPE){or=true;}}}else{SweetDevRia.log.error('The control id :'+id+' does not exist.');}}} if(or){errorIds=[];} this.displayErrors(errorIds);return(errorIds.length==0);};SweetDevRia.Mandatory.prototype.addMandatoryId=function(id,messageConf){this.ids[id]=messageConf;};SweetDevRia.Mandatory.prototype.addMessage=function(messageConf){this.messageConf=messageConf;}; SweetDevRia.Messenger=function(id){superClass(this,SweetDevRia.RiaComponent,id,"Messenger");this.messageTypes=[];this.displayIcon=true;this.displayMessage=true;};extendsClass(SweetDevRia.Messenger,SweetDevRia.RiaComponent);SweetDevRia.Messenger.prototype.addMessageType=function(messageType){this.messageTypes.add(messageType);};SweetDevRia.Messenger.sendMessage=function(messageConf,errorMode,srcId){if(messageConf){for(var i=0;iheight/3){return"ideo-tre-dropOnFolder";} else{if(node.parentNode&&node.id==node.parentNode.children[0].id){return"ideo-tre-dropAtFirst";} else{return"ideo-tre-dropBetween";}}} else{if(position[1]height/3){if(node.getChildren()==null){node.expand();} tree.pasteNode(node);node.expand();} else{if(node.parentNode&&node.id==node.parentNode.children[0].id){tree.pasteNode(node.parentNode,0);} else{tree.pasteNode(node.parentNode,pos);}}} else{if(position[1]1){var nodeId=nodeData[0];var nodeLabel=nodeData[1];var nodeType=nodeData[2];var expanded=nodeData[3];var information=nodeData[4];var iconStyle=nodeData[5];var style=nodeData[6];var styleClass=nodeData[7];var selected=nodeData[8];var checked=nodeData[9];var childrenData=nodeData[10];var node=new SweetDevRia.TreeNode(nodeId,nodeLabel,parentNode,this.getNodeType(nodeType),position);node.isOpen=expanded;node.information=information;node.iconStyle=iconStyle;node.style=style;node.styleClass=styleClass;node.selected=selected;node.checked=checked;if(node.selected){this.newSelectNode=node;} this.parseTreeNodeChildren(childrenData,node);return node;} return null;};SweetDevRia.Tree.prototype.parseTreeNodeChildren=function(childrenData,parentNode){if(childrenData){if(!parentNode.children){parentNode.children=[];} for(var i=0;ipos){position--;}} this.deleteNode(cuttedId);this.parseTreeNode(this.cutNodeData,parentNode,position);var params={"nodeId":this.cutNodeData[0],"nodeParentId":parentNode.id,"position":position};var riaEvent=new SweetDevRia.RiaEvent("cutPaste",this.id,params);SweetDevRia.ComHelper.stackEvent(riaEvent);parentNode.drawChildren(true);} parentNode.refreshLastIndentationClass();parentNode.isOpen=false;parentNode.expand();} this.cutNodeData=null;this.copiedNodeData=null;this.fireEventListener(SweetDevRia.Tree.PASTE_EVENT,[parentNode,position]);this.afterPasteNode(parentNode,position);}};SweetDevRia.Tree.prototype.deleteNode=function(nodeId){if(this.beforeDeleteNode(nodeId)){var node=this.nodes[nodeId];if(node&&!node.isRoot){this.deleteChildNodes(nodeId);var previousNode=node.getPreviousNode();var nextNode=node.getNextNode();var isLastTreeNode=node.isLastTreeNode();this.unregister(node);var parentNode=node.parentNode;if(parentNode){parentNode.children.remove(node);} var li=document.getElementById(this.id+"_"+node.id+"_li");if(li){SweetDevRia.DomHelper.removeNode(li);} if(!parentNode.hasChildren()){parentNode.refreshLastIndentationClass();var ul=document.getElementById(this.id+"_"+parentNode.id+"_children");ul.style.display="none";} if(previousNode){previousNode.refreshLastIndentationClass();} if(nextNode){nextNode.refreshLastIndentationClass();} if(isLastTreeNode&&parentNode){parentNode.refreshIndentationImages(true);}} this.fireEventListener(SweetDevRia.Tree.DELETE_EVENT,nodeId);this.afterDeleteNode(nodeId);}};SweetDevRia.Tree.prototype.deleteChildNodes=function(nodeId){var node=this.nodes[nodeId];if(node&&node.hasChildren()&&(node.children!=null)){while(node.children.length>0){var child=node.children[0];this.deleteNode(child.id);} node.refreshLastIndentationClass();}};SweetDevRia.Tree.prototype.getAppendice=function(nodeSrcId){var cpt=0;var str=nodeSrcId+"_"+cpt;while(this.getNode(str)){cpt++;str=nodeSrcId+"_"+cpt;} return"_"+cpt;};SweetDevRia.Tree.prototype.generateCopiedNodeId=function(nodeSrcId){return nodeSrcId+this.getAppendice(nodeSrcId);};SweetDevRia.Tree.prototype.generateNewNodeId=function(parentNodeId){return this.generateCopiedNodeId("NewNode");};SweetDevRia.Tree.prototype.addNodeAction=function(){if(this.canAdd){var menu=SweetDevRia.$(this.id+"Menu");var parentNodeId=menu.clickedItem;var parentNode=this.nodes[parentNodeId];if(parentNode&&!parentNode.isLeaf()){var win=SweetDevRia.$(this.id+"_addWin");if(win==null){win=this.generateAddWindow();} win.parentNode=parentNode;SweetDevRia.Form.resetComponent(document.getElementById(this.id+"_addNodeId"));SweetDevRia.Form.resetComponent(document.getElementById(this.id+"_addType"));win.open();}}else{SweetDevRia.log.warn("The node addition is not allowed.");}};SweetDevRia.Tree.prototype.deleteNodeAction=function(){if(this.canDelete){var menu=SweetDevRia.$(this.id+"Menu");var nodeId=menu.clickedItem;if(this.nodes[nodeId]&&this.nodes[nodeId].isRoot){return;} this.deleteNode(nodeId);var params={"nodeId":nodeId};var riaEvent=new SweetDevRia.RiaEvent("delete",this.id,params);SweetDevRia.ComHelper.stackEvent(riaEvent);}else{SweetDevRia.log.warn("The node suppression is not allowed.");}};SweetDevRia.Tree.prototype.modifyNodeAction=function(){if(this.canModify){var menu=SweetDevRia.$(this.id+"Menu");var parentNodeId=menu.clickedItem;var parentNode=this.nodes[parentNodeId];var win=SweetDevRia.$(this.id+"_modifyWin");if(win==null){win=this.generateModifyWindow();} win.parentNode=parentNode;var selectNode=document.getElementById(this.id+"_modifyType");selectNode.options.length=0;selectNode.style.display="none";document.getElementById(this.id+"_modifyTypeLabel").style.display="none";var groupId=parentNode.getNodeType().groupId;if(groupId&&this.nodeTypeGroups[groupId].length>1){selectNode.style.display="";document.getElementById(this.id+"_modifyTypeLabel").style.display="";for(var i=0;i${getMessage('labelLabel')} :
    ${getMessage('typeLabel')} :

    ";SweetDevRia.Tree.prototype.templateModifyWindow="
    ${getMessage('labelLabel')} :
    ${getMessage('typeLabel')} :

    ";SweetDevRia.Tree.prototype.template="
    ${root.render()}
    "; SweetDevRia.TreeNode=function(id,label,parentNode,nodeType,position){this.id=id;this.label=label;this.parentNode=parentNode;this.nodeType=nodeType;if(!nodeType){SweetDevRia.log.error('Incorrect NodeType for TreeNode id:'+id);throw('Incorrect NodeType for TreeNode id:'+id);} this.isOpen=false;this.loading=false;this.children=null;this.information=null;this.iconStyle=null;this.style=null;this.styleClass=null;this.selected=false;if(this.parentNode){this.isRoot=false;this.parentNode.addChild(this,position);this.level=parentNode.level+1;this.displayNode=true;} else{this.isRoot=true;this.level=0;} this.checked=false;};SweetDevRia.TreeNode.DIV_SUFFIXE="_div";SweetDevRia.TreeNode.LASTINDENT_SUFFIXE="_lastIndent";SweetDevRia.TreeNode.ICON_SUFFIXE="_icon";SweetDevRia.TreeNode.CHECK_SUFFIXE="_check";SweetDevRia.TreeNode.LABEL_SUFFIXE="_label";SweetDevRia.TreeNode.LABEL_A_SUFFIXE="_a_label";SweetDevRia.TreeNode.prototype.beforeSelect=function(notify){return true;};SweetDevRia.TreeNode.prototype.afterSelect=function(notify){};SweetDevRia.TreeNode.prototype.beforeUnselect=function(){return true;};SweetDevRia.TreeNode.prototype.afterUnselect=function(){};SweetDevRia.TreeNode.prototype.beforeCollapse=function(){return true;};SweetDevRia.TreeNode.prototype.afterCollapse=function(){};SweetDevRia.TreeNode.prototype.beforeExpand=function(){return true;};SweetDevRia.TreeNode.prototype.afterExpand=function(){};SweetDevRia.TreeNode.prototype.beforeCheck=function(){return true;};SweetDevRia.TreeNode.prototype.afterCheck=function(){};SweetDevRia.TreeNode.prototype.beforeUncheck=function(){return true;};SweetDevRia.TreeNode.prototype.afterUncheck=function(){};SweetDevRia.TreeNode.prototype.afterInitialize=function(){};SweetDevRia.TreeNode.prototype.getId=function(){return this.id;};SweetDevRia.TreeNode.prototype.getLabel=function(){return this.label;};SweetDevRia.TreeNode.prototype.getChildren=function(){return this.children;};SweetDevRia.TreeNode.prototype.addChild=function(child,position){if(!this.isLeaf()){if(this.children==null){this.children=[];} if(position==null){this.children.add(child);} else{this.children.insertAt(child,position);} child.initTree(this.tree);}};SweetDevRia.TreeNode.prototype.hasChildren=function(){return(!this.isLeaf()&&(this.children==null||this.children.length>0));};SweetDevRia.TreeNode.prototype.getChild=function(nodeId){if(!this.isLeaf()&&this.children&&this.children.length>0){for(var i=0;ithis.level){var rowId=nextNode.rowId;var row=SweetDevRia.DomHelper.get(this.tree.gridId+"_tr_"+rowId);swapVisibility(row);var detail=SweetDevRia.DomHelper.get(this.tree.gridId+"_tr_detail_"+rowId);swapVisibility(detail);if(!nextNode.isLastChild()||nextBrother!=null){nextNode=nextNode.getNextNode();}else if(nextNode.isLastChild()&&(nextNode.level>(this.level+1)||nextNode.hasChildren())){nextNode=nextNode.getNextNode();} else{nextNode=null;}}} else{children.style.display="none";} this.isOpen=false;var params={"nodeId":this.id,"expanded":false};var riaEvent=new SweetDevRia.RiaEvent("swap",this.tree.id,params);SweetDevRia.ComHelper.stackEvent(riaEvent);SweetDevRia.DomHelper.addClassName(lastIndent,this.getLastIndentationClass());this.afterCollapse();}};SweetDevRia.TreeNode.prototype.expandAll=function(){if(!this.isLeaf()&&this.children){this.expand();for(var i=0;ithis.level){var rowId=nextNode.rowId;var row=SweetDevRia.DomHelper.get(this.tree.gridId+"_tr_"+rowId);swapVisibility(row);var detail=SweetDevRia.DomHelper.get(this.tree.gridId+"_tr_detail_"+rowId);swapVisibility(detail);if(!nextNode.isLastChild()||nextBrother!=null){nextNode=nextNode.getNextNode();}else if(nextNode.isLastChild()&&(nextNode.level>(this.level+1)||nextNode.hasChildren())){nextNode=nextNode.getNextNode();}else{nextNode=null;}}} else if(this.children.length>0){children.style.display="block";} if(this.tree.newSelectNode&&!this.tree.selectNode&&this.isParent(this.tree.newSelectNode)){this.tree.newSelectNode.select(false);this.tree.newSelectNode=null;} var params={"nodeId":this.id,"expanded":true};var riaEvent=new SweetDevRia.RiaEvent("swap",this.tree.id,params);SweetDevRia.ComHelper.stackEvent(riaEvent);SweetDevRia.DomHelper.addClassName(lastIndent,this.getLastIndentationClass());} this.afterExpand();}};SweetDevRia.TreeNode.prototype.swapCollapse=function(){if(this.isOpen){this.collapse();} else{this.expand();}};SweetDevRia.TreeNode.prototype.iconAction=function(){};SweetDevRia.TreeNode.prototype.labelAction=function(){};SweetDevRia.TreeNode.prototype.getIndentationArray=function(){var arr=[];if(this.level>=1){arr=new Array();var parent=this.parentNode;for(var i=this.level-1;i>=0;i--){arr.add(!parent.isLastChild());parent=parent.parentNode;}} return arr.reverse();};SweetDevRia.TreeNode.prototype.refreshIndentationImages=function(recursiv){var indentArray=this.getIndentationArray();for(var i=0;i${renderContent()}";SweetDevRia.TreeNode.prototype.templateContent="
    {if level > 0} {var arr = getIndentationArray();} {for indent in arr} {/for} {/if} {if nodeType.displayCheckbox} {/if} ${label}
    ";SweetDevRia.TreeNode.prototype.templateChildren=" {if isLeaf() == false}
      ${getChildrenRender()}
    {if tree.displayRoot == false && isRoot}
     
    {/if} {/if}"; SweetDevRia.PageBar=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.PageBar");this.pageNumber=null;this.visiblePageNumberArray=[];this.showPreviousNext=true;this.showFirstLast=true;this.visiblePageNumber=9;this.actualPage=null;this.linkedId=null;this.displayPageMode=SweetDevRia.PageBar.ALL_PAGES_MODE;this.renderFrame=true;};SweetDevRia.PageBar.ALL_PAGES_MODE=0;SweetDevRia.PageBar.RESUME_MODE=1;extendsClass(SweetDevRia.PageBar,SweetDevRia.RiaComponent);SweetDevRia.PageBar.prototype.initialize=function(){if(this.renderFrame){var button=new SweetDevRia.Button(this.id+"_button");button.contentId=this.id+"_container";button.initialize();button.initialized=true;} else{var div=document.createElement("div");var container=document.getElementById(this.id+"_container");container.parentNode.insertBefore(div,container);div.appendChild(container);} this.initialized=true;};SweetDevRia.PageBar.prototype.refresh=function(){var button=document.getElementById(this.id+"_button");if(button!=null){var span=document.createElement("span");span.id=this.id+"_container";SweetDevRia.DomHelper.addClassName(span,"ideo-pgb-pagebar");button.parentNode.insertBefore(span,button);SweetDevRia.DomHelper.removeNode(button);} this.render();this.initialize();};SweetDevRia.PageBar.prototype.setVisibility=function(visible){SweetDevRia.DomHelper.setVisibility(this.id+"_button",visible);};SweetDevRia.PageBar.prototype.beforeSetPageNumber=function(pageNumber){return true;};SweetDevRia.PageBar.prototype.afterSetPageNumber=function(pageNumber){};SweetDevRia.PageBar.prototype.beforeSetActualPage=function(actualPage){return true;};SweetDevRia.PageBar.prototype.afterSetActualPage=function(actualPage){};SweetDevRia.PageBar.prototype.beforeGoToPage=function(pageNumber){return true;};SweetDevRia.PageBar.prototype.afterGoToPage=function(pageNumber){};SweetDevRia.PageBar.GO_PAGE_EVENT="goPage";SweetDevRia.PageBar.prototype.setPageNumber=function(pageNumber){if(this.beforeSetPageNumber(pageNumber)){this.pageNumber=pageNumber;this.visiblePageNumberArray=[];for(var i=0;ithis.pageNumber){start=this.pageNumber-this.visiblePageNumber+1;} if(start<=0){start=1;} var end=start+this.visiblePageNumber-1;if(end>this.pageNumber){end=this.pageNumber;} for(var i=start;i<=end;i++){this.visiblePageNumberArray.add(i);} this.afterSetActualPage(actualPage);}};SweetDevRia.PageBar.prototype.goToPageEvt=function(evt,pageNumber){SweetDevRia.EventHelper.preventDefault(evt);SweetDevRia.EventHelper.stopPropagation(evt);this.goToPage(pageNumber);};SweetDevRia.PageBar.prototype.goToPage=function(pageNumber){if(this.beforeGoToPage(pageNumber)){if(pageNumber>=1&&pageNumber<=this.pageNumber){this.setActualPage(pageNumber);var linkedComp=SweetDevRia.$(this.linkedId);if(linkedComp&&linkedComp.goToPage){linkedComp.goToPage(pageNumber);} this.render();var container=document.getElementById(this.id+"_container");var tagsA=container.firstChild.childNodes;var width=0;for(var i=0;i {if actualPage > 1} {if showFirstLast == true}
     
    {/if} {if showPreviousNext == true}
     
    {/if} {else} {if showFirstLast == true}
     
    {/if} {if showPreviousNext == true}
     
    {/if} {/if} {if displayPageMode == SweetDevRia.PageBar.ALL_PAGES_MODE} {for num in visiblePageNumberArray}  ${formatPageNumber(num)}  {/for} {else} ${actualPage}/${pageNumber} {/if} {if actualPage < pageNumber} {if showPreviousNext == true}
     
    {/if} {if showFirstLast == true}
     
    {/if} {else} {if showPreviousNext == true}
     
    {/if} {if showFirstLast == true}
     
    {/if} {/if}"; SweetDevRia.Grid=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.Grid");this.columns={};this.columnsAtPosition=new Array();this.columnNumber=0;this.visibleColumnNumber=0;this.width=null;this.columnSizeSum=0;this.centPercent=0;this.toRecalculate=true;this.toCalculate=false;this.checkboxColWidth=30;this.minColumnWidth=30;this.draggableColumns=true;this.resizable=true;this.selectionMode=SweetDevRia.Grid.prototype.NO_SELECTION;this.selection=null;this.displayCheckbox=false;this.checkedRows=[];this.checkedGroupRows=[];this.lastSelectionAdded=null;this.groupingDataDescr=null;this.rowPerPage=10;this.actualPage=1;this.pageNumber=1;this.totalDataNumber=6;this.innerExportId=null;this.heightHeader=0;this.heightRow=null;this.height=null;this.adjustedColumnId=null;this.isInitialized=false;this.listMenuItems=[];this.sortPropertiesDeep=3;this.groupingPropertiesDeep=3;this.headPrefix=this.id+"_"+SweetDevRia.Grid.HEAD_COLUMN;this.spliterPrefix=this.id+"_"+SweetDevRia.Grid.HEAD_COLUMN_SPLITER;this.headBeforePrefix=this.id+"_"+SweetDevRia.Grid.HEAD_COLUMN_BEFORE;this.ddArrowId=this.id+"_"+SweetDevRia.Grid.DD_ARROW;this.theadId=this.id+"_"+SweetDevRia.Grid.THEAD;this.tbodyId=this.id+"_"+SweetDevRia.Grid.TBODY;this.pageBarId=this.id+"_"+SweetDevRia.Grid.PAGEBAR;this.sortPropertiesWindowId=this.id+"_"+SweetDevRia.Grid.SORT_PROPERTIES;this.groupingPropertiesWindowId=this.id+"_"+SweetDevRia.Grid.GROUPING_PROPERTIES;this.excelPropertiesWindowId=this.id+"_"+SweetDevRia.Grid.EXCEL_PROPERTIES;this.gridPropertiesWindowId=this.id+"_"+SweetDevRia.Grid.GRID_PROPERTIES;this.tableBody=null;this.tableHead=null;this.spliters=[];this.headerDDs={};this.ddArrow=null;this.groupBy=null;this.groupedData={};this.data=[];this.renderNode=null;this.isTreeGrid=false;this.treeModelId=null;this.minHeight=null;this.maxHeight=null;this.minWidth=null;this.maxWidth=null;this.editable=false;this.constraintId=null;this.groups={};this.maxGroupDepth=0;this.hasHeaderGroup=false;};extendsClass(SweetDevRia.Grid,SweetDevRia.RiaComponent);SweetDevRia.Grid.NO_SELECTION=0;SweetDevRia.Grid.ROW_SELECTION=1;SweetDevRia.Grid.ROWS_SELECTION=2;SweetDevRia.Grid.CELL_SELECTION=3;SweetDevRia.Grid.CELLS_SELECTION=4;SweetDevRia.Grid.WYSIWYG_EXPORT=1;SweetDevRia.Grid.MODEL_EXPORT=2;SweetDevRia.Grid.HEAD="head";SweetDevRia.Grid.THEAD="thead";SweetDevRia.Grid.BODY="body";SweetDevRia.Grid.TBODY="tbody";SweetDevRia.Grid.FOOT="foot";SweetDevRia.Grid.TFOOT="tfoot";SweetDevRia.Grid.HEAD_COLUMN="headColumn";SweetDevRia.Grid.HEAD_COLUMN_SPLITER="headColumnSpliter";SweetDevRia.Grid.HEAD_COLUMN_BEFORE="headColumnBefore";SweetDevRia.Grid.PAGEBAR="pageBar";SweetDevRia.Grid.DD_ARROW="ddArrow";SweetDevRia.Grid.BODY_TABLE="bodyTable";SweetDevRia.Grid.HEAD_TABLE="headTable";SweetDevRia.Grid.SORT_PROPERTIES="sortPropertiesWindow";SweetDevRia.Grid.GROUPING_PROPERTIES="groupingPropertiesWindow";SweetDevRia.Grid.EXCEL_PROPERTIES="excelPropertiesWindow";SweetDevRia.Grid.GRID_PROPERTIES="gridPropertiesWindow";SweetDevRia.Grid.SPLITER_SIZE=2;SweetDevRia.Grid.WINDOW_WIDTH=500;SweetDevRia.Grid.WINDOW_HEIGHT=320;SweetDevRia.Grid.prototype.beforeSetTooltips=function(tooltips){return true;};SweetDevRia.Grid.prototype.afterSetTooltips=function(tooltips){};SweetDevRia.Grid.prototype.beforeSetData=function(data){return true;};SweetDevRia.Grid.prototype.afterSetData=function(data){};SweetDevRia.Grid.prototype.beforeAddColumn=function(id,header,size,ascendant,visible,resizable,sortable,hideable,editable){return true;};SweetDevRia.Grid.prototype.afterAddColumn=function(id,header,size,ascendant,visible,resizable,sortable,hideable,editable){};SweetDevRia.Grid.prototype.beforeSetColumnVisibility=function(colId,visibility){return true;};SweetDevRia.Grid.prototype.afterSetColumnVisibility=function(colId,visibility){};SweetDevRia.Grid.prototype.beforeInitialize=function(){return true;};SweetDevRia.Grid.prototype.afterInitialize=function(){};SweetDevRia.Grid.prototype.beforeSetCheckboxAll=function(select){return true;};SweetDevRia.Grid.prototype.afterSetCheckboxAll=function(select){};SweetDevRia.Grid.prototype.beforeSetCheckbox=function(rowId,select,testAll){return true;};SweetDevRia.Grid.prototype.afterSetCheckbox=function(rowId,select,testAll){};SweetDevRia.Grid.prototype.beforeSetWidth=function(width){return true;};SweetDevRia.Grid.prototype.afterSetWidth=function(width){};SweetDevRia.Grid.prototype.beforeSetHeight=function(height){return true;};SweetDevRia.Grid.prototype.afterSetHeight=function(height){};SweetDevRia.Grid.prototype.beforeSetSize=function(width,height){return true;};SweetDevRia.Grid.prototype.afterSetSize=function(){};SweetDevRia.Grid.prototype.beforeResizing=function(){};SweetDevRia.Grid.prototype.afterResizing=function(){};SweetDevRia.Grid.prototype.beforeSetSelectionMode=function(mode){return true;};SweetDevRia.Grid.prototype.afterSetSelectionMode=function(mode){};SweetDevRia.Grid.prototype.beforeSetTotalDataNumber=function(total){return true;};SweetDevRia.Grid.prototype.afterSetTotalDataNumber=function(total){};SweetDevRia.Grid.prototype.beforeSetRowSelection=function(rowId,select){return true;};SweetDevRia.Grid.prototype.afterSetRowSelection=function(rowId,select){};SweetDevRia.Grid.prototype.beforeSetCellSelection=function(rowId,columnId,select){return true;};SweetDevRia.Grid.prototype.afterSetCellSelection=function(rowId,columnId,select){};SweetDevRia.Grid.prototype.beforeClearSelection=function(){return true;};SweetDevRia.Grid.prototype.afterClearSelection=function(){};SweetDevRia.Grid.prototype.beforeSetColumnResizable=function(colId,resizable){return true;};SweetDevRia.Grid.prototype.afterSetColumnResizable=function(colId,resizable){};SweetDevRia.Grid.prototype.beforeSetDraggableColumns=function(draggable){return true;};SweetDevRia.Grid.prototype.afterSetDraggableColumns=function(draggable){};SweetDevRia.Grid.prototype.beforeSetColumnSortable=function(colId,sortable){return true;};SweetDevRia.Grid.prototype.afterSetColumnSortable=function(colId,sortable){};SweetDevRia.Grid.prototype.beforeSetColumnSize=function(colId,size){return true;};SweetDevRia.Grid.prototype.afterSetColumnSize=function(colId,size){};SweetDevRia.Grid.prototype.beforeSetColumnPosition=function(colId,position){return true;};SweetDevRia.Grid.prototype.afterSetColumnPosition=function(colId,position){};SweetDevRia.Grid.prototype.beforeSortColumn=function(colId,ascendant){return true;};SweetDevRia.Grid.prototype.afterSortColumn=function(colId,ascendant){};SweetDevRia.Grid.prototype.beforeMultipleColumnSort=function(columnsOrder){return true;};SweetDevRia.Grid.prototype.afterMultipleColumnSort=function(columnsOrder){};SweetDevRia.Grid.prototype.beforeGroupingBy=function(grouping){return true;};SweetDevRia.Grid.prototype.afterGroupingBy=function(grouping){};SweetDevRia.Grid.prototype.beforeExcelExport=function(exportMode,exportdRowIds,exportId){return true;};SweetDevRia.Grid.prototype.afterExcelExport=function(exportMode,exportdRowIds,exportId){};SweetDevRia.Grid.prototype.beforeGoToPage=function(actualPage){return true;};SweetDevRia.Grid.prototype.afterGoToPage=function(actualPage){};SweetDevRia.Grid.prototype.beforeSetResizable=function(resizable){return true;};SweetDevRia.Grid.prototype.afterSetResizable=function(resizable){};SweetDevRia.Grid.prototype.beforeShowGridProperties=function(){return true;};SweetDevRia.Grid.prototype.afterShowGridProperties=function(){};SweetDevRia.Grid.SORT_EVENT="sort";SweetDevRia.Grid.SELECT_ROW_EVENT="selectRow";SweetDevRia.Grid.UNSELECT_ROW_EVENT="unselectRow";SweetDevRia.Grid.SELECT_CELL_EVENT="selectCell";SweetDevRia.Grid.UNSELECT_CELL_EVENT="unselectCell";SweetDevRia.Grid.SET_DATA_EVENT="setData";SweetDevRia.Grid.SHOW_COL_EVENT="showCol";SweetDevRia.Grid.HIDE_COL_EVENT="hideCol";SweetDevRia.Grid.CHECK_ROW_EVENT="checkRow";SweetDevRia.Grid.UNCHECK_ROW_EVENT="uncheckRow";SweetDevRia.Grid.RESIZE_EVENT="resize";SweetDevRia.Grid.MOVE_COL_EVENT="moveCol";SweetDevRia.Grid.CHANGE_PAGE_EVENT="changePage";SweetDevRia.Grid.ADD_ROW_EVENT="addRow";SweetDevRia.Grid.DELETE_ROW_EVENT="deleteRow";SweetDevRia.Grid.UPDATE_CELL_EVENT="updateCell";SweetDevRia.Grid.prototype.onSortColumn=null;SweetDevRia.Grid.prototype.onSelectRow=null;SweetDevRia.Grid.prototype.onUnselectRow=null;SweetDevRia.Grid.prototype.onSelectCell=null;SweetDevRia.Grid.prototype.onUnselectCell=null;SweetDevRia.Grid.prototype.onSetData=null;SweetDevRia.Grid.prototype.onShowColumn=null;SweetDevRia.Grid.prototype.onHideColumn=null;SweetDevRia.Grid.prototype.onCheckRow=null;SweetDevRia.Grid.prototype.onUncheckRow=null;SweetDevRia.Grid.prototype.onResize=null;SweetDevRia.Grid.prototype.onMoveColumn=null;SweetDevRia.Grid.prototype.onChangePage=null;SweetDevRia.Grid.prototype.onAddRow=null;SweetDevRia.Grid.prototype.onUpdateCell=null;SweetDevRia.Grid.prototype.onDeleteRow=null;SweetDevRia.Grid.prototype.setGroupBy=function(groupBy){for(var i=0;isize){tab=oldTab;}}}} return tabAll;};SweetDevRia.Grid.prototype.getBlocHeaderHtml=function(blocDescr){var str=[];for(var i=0;i0&&this.groupingDataDescr){var sum=0;for(var i=0;i0&&this.groupingDataDescr){var blocDescr=this.groupingDataDescr[blocDescrIndex];var dataGroup=this.data;for(var i=0;i0&&this.groupingDataDescr){var str=[];this.blocDescrIndex=blocDescrIndex;var blocDescr=this.groupingDataDescr[blocDescrIndex];str.push(this.veloGrouping());var dataGroup=this.getRowsForBloc(blocDescrIndex);var oldData=this.data;this.data=dataGroup;str.push(this.veloData());this.data=oldData;this.blocDescrIndex=null;return str.join('');} return null;};SweetDevRia.Grid.prototype.veloGroupHead=function(){var text=[];var indexEmptyCols=this.createIndexEmptyCols();for(var i=indexEmptyCols.length-1;i>=0;i--){var headersRowIndex=indexEmptyCols[i];text.push('');if(this.displayCheckbox){text.push(' ');text.push(' ');} for(var j=0;j ');text.push(' ');} else if(typeof(groupId)=="number"){text.push(' ');j+=groupId-1;} else{var group=this.getGroup(groupId);text.push('0){text.push(' style="height : ',this.heightHeader,'px"');} text.push('>',group.label,'');text.push('');j+=group.colspan-1;} if(j!=headersRowIndex.length-1){text.push('0){text.push('style="height : ',this.heightHeader,'px"');} text.push('> ');}} text.push('');} return text.join("");};SweetDevRia.Grid.prototype.colHasParent=function(group){return((group.parentGroupId!=null)&&(group.parentGroupId!='undefined'));};SweetDevRia.Grid.prototype.createIndexEmptyCols=function(){var indexEmptyCols=[];for(var j=0;j');for(var i=0;i');text.push('
    ');text.push('
    ');text.push('
    ');text.push('');text.push('');text.push('');if(this.displayCheckbox){text.push('');text.push('');} for(var i=0;i');text.push('');if(column!=this.getLastColumn()){text.push('');} temp.push('');temp.push('');if(column!=this.getLastColumn()){temp.push('');}} text.push('');text.push(this.veloGroupHead());text.push('');if(this.displayCheckbox){text.push('');text.push('');} text.push(temp.join(''));text.push('');text.push('');text.push('
     ',column.header,'');temp.push('
       
    ');temp.push('
       
    0){temp.push('style="height : ',this.heightHeader,'px"');} temp.push('> 
     
    ');text.push('
    ');text.push('
    ');text.push('
    ');text.push('
    ');text.push(' ');if(this.showPropertyButton){text.push('',this.getMessage('gridProperties'),'');} text.push('
    ');text.push('');text.push('');if(this.showPropertyButton){text.push('');} text.push('');text.push('');text.push(' ');text.push('
    ');return text.join('');};SweetDevRia.Grid.prototype.veloGrouping=function(){var text=[];text.push('
    ');if(this.displayCheckbox){text.push('');} text.push('\"\"/');text.push(this.getBlocHeaderHtml(this.groupingDataDescr[this.blocDescrIndex]));text.push('
    ');return text.join('');};SweetDevRia.Grid.prototype.veloData=function(){var context=this;var text=[];var colSizes=[];var firstPass=true;var nrow=0;if(this.groupBy==null||this.groupBy.length==0){text.push('
    ');text.push('
    ');} for(var row_index=0;row_index0&&this.groupingDataDescr!=null){var dataRow=[];dataRow[0]=rowId;var blocDescr=this.groupingDataDescr[this.blocDescrIndex];if(blocDescr){for(var iindex=0;iindex=this.getFirstVisibleIndex()&&row_index<=this.getLastVisibleIndex()){text.push("
    ");text.push("");text.push("");if(this.displayCheckbox==true){var tooltips=this.tooltips[rowId];var disabledCheck=this.tooltips[rowId][tooltips.length-1];text.push("");text.push("");} var cpt=0;for(var iindex=0;iindex0){if(this.isTreeGrid&&cpt==1){text.push("");if(cpt!=(row.length-2)){text.push("");}} else{if(cpt!=(row.length-1)){if(firstPass){colSizes[columnId]=this.getColumnSize(curcol);if(this.temporaryResizeColId==columnId&&this.temporarySize){colSizes[columnId]=this.temporarySize;}} text.push("");if(cpt!=(row.length-2)){text.push("");}} else{text.push("");if(cell!=null){text.push("");text.push("");} text.push("");}}} cpt=cpt+1;} text.push("
    ");if(this.rowWrap==false){text.push("");} text.push(this.renderTreeNode(rowId));if(this.rowWrap==false){text.push("");} text.push(" ");if(this.rowWrap==false){text.push("");} var rowData=row[this.getColumnAtPosition(''+(parseInt(cpt,10)-1)).initialPosition+1];if(!rowData){text.push(" ");} else{if(curcol.formater!=null){var curData=window[curcol.formater](rowData);text.push(curData);} else{text.push(rowData);}} if(this.rowWrap==false){text.push("");} text.push("
    ");if(cell!=null){text.push("
     
    ");text.push("
     
    ");text.push("
     
    ");text.push("
    ");text.push(cell);text.push("
    ");} text.push("
    ");firstPass=false;} nrow=nrow+1;} if(this.groupBy==null||this.groupBy.length==0){text.push('
    ');text.push('
    ');} return text.join("");};SweetDevRia.Grid.selectCell=function(event){var originalTarget=YAHOO.util.Event.getTarget(event);var cellTD;if(originalTarget.nodeName=="TD"){cellTD=originalTarget;}else{cellTD=originalTarget.parentNode;} var myGrid=SweetDevRia.$(cellTD.id.split("_cell_")[0]);if(myGrid){var rowId=myGrid.getRowBusinessId(cellTD);var columnId=myGrid.getColBusinessId(cellTD);myGrid.fireEventListener(SweetDevRia.Grid.SELECT_CELL_EVENT,[event,rowId,columnId]);myGrid.onSelectCellEvt(event,rowId,columnId);} else{null;}};SweetDevRia.Grid.prototype.getRowBusinessId=function(node){var tab=node.parentNode.id.split("_tr_");return tab[tab.length-1];};SweetDevRia.Grid.prototype.getColBusinessId=function(node){var rowId=this.getRowBusinessId(node);var split=node.id.split(this.id+"_cell_"+rowId+"_");return split[split.length-1];};SweetDevRia.Grid.prototype.setTooltips=function(tooltips){if(this.beforeSetTooltips(tooltips)){this.tooltips=tooltips;this.afterSetTooltips(tooltips);}};SweetDevRia.Grid.prototype.setMinHeight=function(minHeight){this.minHeight=parseInt(minHeight,10);};SweetDevRia.Grid.prototype.setMaxHeight=function(maxHeight){this.maxHeight=parseInt(maxHeight,10);};SweetDevRia.Grid.prototype.setMinWidth=function(minWidth){this.minWidth=parseInt(minWidth,10);};SweetDevRia.Grid.prototype.setMaxWidth=function(maxWidth){this.maxWidth=parseInt(maxWidth,10);};SweetDevRia.Grid.prototype.setConstraintId=function(constraintId){this.constraintId=constraintId;};SweetDevRia.Grid.prototype.render=function(){SweetDevRia.startLog("Log.Render_"+this.id,this);this.isInitialized=true;var container=this.getContainer();if(container){container.innerHTML=this.veloHead();} this.isInitialized=false;SweetDevRia.endLog("Log.Render_"+this.id,this,1);};SweetDevRia.Grid.prototype.setData=function(data){if(this.beforeSetData(data)){this.data=data;this.groupedData={};this.listRows=[];if(this.initialized){var str=this.getDataStr();var divBody=SweetDevRia.DomHelper.get(this.id+"_bodyDiv");divBody.innerHTML=str;this.tableBody=SweetDevRia.DomHelper.get(this.id+"_"+SweetDevRia.Grid.BODY_TABLE);var pageBarContainer=document.getElementById(this.pageBarId+"_container");if(!this.isTreeGrid){this.pageNumber=Math.ceil(this.totalDataNumber/this.rowPerPage);if(this.pageNumber>1){var pageBar=SweetDevRia.$(this.pageBarId);if(pageBar==null){this.createPageBar();} else{pageBar.setVisibility(true);pageBar.setPageNumber(this.pageNumber);pageBar.setActualPage(this.actualPage);pageBar.refresh();}} else{this.deletePageBar();}} var rowId=this.getRowIdByIndex(this.getFirstVisibleIndex());this.setCheckbox(rowId,this.checkedRows.contains(rowId),true);this.synchronizeHeader();SweetDevRia_Zone_evalJS(divBody);SweetDevRia.initCompNotInitialized();this.updateEditable();if(this.containsData()){var idTable=document.getElementById(this.id+"_"+SweetDevRia.Grid.BODY_TABLE);this.rowsTable=idTable.getElementsByTagName("tr");} var frame=this.getFrame();if(frame){frame.refreshBorders();}} this.fireEventListener(SweetDevRia.Grid.SET_DATA_EVENT,data);this.afterSetData(data);var item=document.getElementById(this.id+"_frame_border");item.onselectstart=null;item.onselect=null;item.ondblclick=null;if(this.onSetData){this.onSetData.call(this,data);}}};SweetDevRia.Grid.prototype.getDataStr=function(){var str=null;if(this.containsData()){if(this.groupBy&&this.groupBy.length>0){this.groupingDataDescr=this.initGroupingData(this.data);str=[];str.push('
    ');str.push('
    ');for(var i=0;i');str.push('
    ');str=str.join('');} else{str=this.veloData();}} return str;};SweetDevRia.Grid.prototype.getColumnNumber=function(){return this.columnNumber;};SweetDevRia.Grid.prototype.getVisibleColumnNumber=function(){return this.visibleColumnNumber;};SweetDevRia.Grid.prototype.getVisibleColumnByPos=function(pos){if(pos<0||pos>=this.visibleColumnNumber){return null;} var col=this.getFirstVisibleColumn();for(i=1;i<=pos;i++){col=this.getNextVisibleColumn(col);} return col;};SweetDevRia.Grid.prototype.getVisibleIndexById=function(colId){var col=this.getFirstVisibleColumn();for(i=0;i0){if(!this.isTreeGrid){return Math.min(this.getVisibleRowNumber()-1,this.rowPerPage);} else{return this.getVisibleRowNumber()-1;}} else{if(!this.isTreeGrid){return Math.min(this.data.length-1,this.rowPerPage);} else{return this.data.length-1;}}};SweetDevRia.Grid.prototype.getHeaderText=function(colId){var res=null;var col=this.getColumn(colId);return col.header;};SweetDevRia.Grid.prototype.addColumn=function(id,header,size,ascendant,sortOrder,visible,resizable,sortable,hideable,editable){if(this.beforeAddColumn(id,header,size,ascendant,sortOrder,visible,resizable,sortable,hideable)){this.addColumnAtPosition(id,header,size,ascendant,sortOrder,visible,resizable,sortable,hideable,editable,this.columnNumber,this.columnNumber);this.afterAddColumn(id,header,size,ascendant,sortOrder,visible,resizable,sortable,hideable);}};SweetDevRia.Grid.prototype.addColumnAtPosition=function(id,header,size,ascendant,sortOrder,visible,resizable,sortable,hideable,editable,initialPosition,position,formater,styleClass,style){if(visible==null){visible=true;} if(!hideable){visible=true;} if(this.isTreeGrid){sortable=false;} if(this.groupBy&&this.groupBy.contains(id)){visible=false;} var widthInPercent=false;if(size.indexOf("%")>=0){widthInPercent=true;} if(size.indexOf("px")>=0||size.indexOf("%")==-1){size=SweetDevRia.DomHelper.parsePx(size);} var column={"id":id,"header":header,"position":position,"initialPosition":initialPosition,"visible":visible,"size":size,"ascendant":ascendant,"sortOrder":sortOrder,"editable":editable,"sortable":sortable,"resizable":resizable,"hideable":hideable,"widthInPercent":widthInPercent,"formater":formater,"styleClass":styleClass,"style":style};this.columns[id]=column;this.columnsAtPosition.insertAt(column,position);if(visible){this.visibleColumnNumber++;} this.columnNumber++;};SweetDevRia.Grid.prototype.setEditableProperties=function(colId,type,maskPattern,charPattern,maskMessage,charMessage,maskMessageType,charMessageType,formatter,listOptions){var editProp={};editProp.type=type;editProp.maskPattern=maskPattern;editProp.charPattern=charPattern;editProp.maskMessage=maskMessage;editProp.charMessage=charMessage;editProp.maskMessageType=maskMessageType;editProp.charMessageType=charMessageType;editProp.formatter=formatter;editProp.listOptions=listOptions;var col=this.columns[colId];col.editProp=editProp;};SweetDevRia.Grid.prototype.getColumnIdAtPosition=function(position){var column=this.columnsAtPosition[position];if(!column||column=="undefined"||(typeof(column)+"").toLowerCase()=="function"){return null;} return column.id;};SweetDevRia.Grid.prototype.getColumnAtPosition=function(position){var colId=this.getColumnIdAtPosition(position);return this.getColumn(colId);};SweetDevRia.Grid.prototype.getVisibleColumnByIndex=function(position){var col=this.getFirstVisibleColumn();for(var i=0;i=0&&!this.getColumnAtPosition(position).visible){null;} return position;};SweetDevRia.Grid.prototype.getCellIndexFromPosition=function(position){this.tableHead=SweetDevRia.DomHelper.get(this.id+"_"+SweetDevRia.Grid.HEAD_TABLE);var cells=this.tableHead.rows[this.maxGroupDepth].cells;var result=-1;var start=1;if(this.displayCheckbox){start=3;} for(var i=start;i=0;i--){var row=this.rowsTable[i];if(YAHOO.util.Dom.hasClass(row,"ideo-ndg-row")&&row.style.display!="none"){return row;}} return null;};SweetDevRia.Grid.prototype.getColumn=function(colId){var column=this.columns[colId];if(!column||column=="undefined"||(typeof(column)+"").toLowerCase()=="function"){column=null;} return column;};SweetDevRia.Grid.prototype.getColumnPosition=function(colId){var column=this.getColumn(colId);if(column){return column.position;} return null;};SweetDevRia.Grid.prototype.getColumnSize=function(colId){var column=this.getColumn(colId);if(column){return column.size;} return null;};SweetDevRia.Grid.prototype.getColumnVisibility=function(colId){var column=this.getColumn(colId);if(column){return column.visible;} return null;};SweetDevRia.Grid.prototype.swapColumnVisibility=function(colId){var visibility=this.getColumnVisibility(colId);this.setColumnVisibility(colId,!visibility);};SweetDevRia.Grid.prototype.refreshColumnVisibilities=function(){for(var colId in this.columns){var column=this.getColumn(colId);if(column){this.setColumnVisibility(column.id,column.visible);}}};SweetDevRia.Grid.prototype.setColumnVisibility=function(colId,visibility){if(visibility&&this.groupBy&&this.groupBy.contains(colId)){return;} if(this.beforeSetColumnVisibility(colId,visibility)){var col=this.getColumn(colId);if(col==null){return;} if(!visibility&&!col.hideable){return;} var oldVisibility=col.visible;if(oldVisibility!=visibility){var menuItem=SweetDevRia.$(this.id+"MenuItem"+colId);if(!visibility&&this.visibleColumnNumber==1){menuItem.setChecked(true);return;} if(menuItem&&menuItem.setChecked&&!menuItem.disabled){if(visibility){SweetDevRia.DomHelper.addClassName(menuItem.view(),"ideo-mnu-check");} else{SweetDevRia.DomHelper.removeClassName(menuItem.view(),"ideo-mnu-check");}} if(visibility){this.visibleColumnNumber++;} else{this.visibleColumnNumber--;} col.visible=visibility;if(document.all){this.setColumnElementsVisibility(colId,visibility);} else{setTimeout("SweetDevRia.$ (\""+this.id+"\").setColumnElementsVisibility(\""+colId+"\", "+visibility+")",10);}} this.toRecalculate=true;this.afterSetColumnVisibility(colId,visibility);if(visibility){this.fireEventListener(SweetDevRia.Grid.SHOW_COL_EVENT,colId);if(this.onShowColumn){this.onShowColumn.call(this,colId);}} else{this.fireEventListener(SweetDevRia.Grid.HIDE_COL_EVENT,colId);if(this.onHideColumn){this.onHideColumn.call(this,colId);}}}};SweetDevRia.Grid.prototype.createSpliter=function(colId){var spliterId=this.spliterPrefix+colId;var spliter=new SweetDevRia.VSpliter(spliterId,this.minColumnWidth);spliter.shift=true;spliter.onSplit=this.resizingColumn(this);spliter.onSplitStart=this.beforeResizingColumn(this);spliter.onSplitEnd=this.afterResizingColumn(this);spliter.onMouseUp=function(e){this.onSplitEnd();};spliter.width=SweetDevRia.Grid.SPLITER_SIZE;spliter.getPreviousNode=this.getPreviousNode(this);this.spliters.push(spliter);};SweetDevRia.Grid.prototype.resetSpliters=function(){for(var i=0;i1){this.createPageBar();}} var border=this.createFrame();if(!border.isNude()){border.contentId=this.id;border.resizeMode=(this.resizable==true)?SweetDevRia.Frame.RESIZE_MODE_SE:SweetDevRia.Frame.RESIZE_MODE_NONE;border.borderMode=SweetDevRia.Frame.BORDER_MODE_ALL;border.showBorderOnOver=false;border.constraintId=this.constraintId;var table=this;border.getMinHeight=function(){return table.getMinHeight();};border.getMaxHeight=function(){return table.getMaxHeight();};border.getMinWidth=function(){return table.getMinWidth();};border.getMaxWidth=function(){return table.getMaxWidth();};var table=this;border.setWidth=function(width){if(width>=0){table.setWidth(width);return true;} return false;};border.setHeight=function(height){if(height>=0){table.setHeight(height);return true;} return false;};border.beforeResizing=function(){table.beforeResizing();};border.afterResizing=function(){table.afterResizing();};} if(this.displayCheckbox){this.columnSizeSum+=this.checkboxColWidth+SweetDevRia.Grid.SPLITER_SIZE;} this.setSelectionMode(this.selectionMode);var centPercent=this.getCentPercent();var colNum=this.getColumnNumber();for(var i=0;i0){this.columnSizeSum+=SweetDevRia.Grid.SPLITER_SIZE;}} var headerDD=new YAHOO.util.DragDrop(this.headPrefix+column.id,this.id+"headers");if(!this.isTreeGrid||i>0){headerDD.onDragDrop=this.dropColumn(this);headerDD.onDragOver=this.onDragColumn(this);} this.headerDDs[column.id]=headerDD;this.setColumnSortable(column.id,column.sortable);this.setColumnSize(column.id,column.size,true);} this.setDraggableColumns(this.draggableColumns);this.setWidth(this.width);this.setHeight(this.height);this.updateEditable();var grid=this;SweetDevRia.addBeforeUnload(function(){grid.updateServerModel();});this.initializing=false;var frame=this.getFrame();if(frame){frame.refreshBorders();} this.afterInitialize();this.isInitialized=true;} return true;};SweetDevRia.Grid.prototype.setWidth=function(width){if(this.beforeSetWidth(width)){if(this.isInitialized&&!this.resizable){return;} if(width==null){var divBody=SweetDevRia.DomHelper.get(this.id+"_bodyDiv");var scrollerWidth=SweetDevRia.DomHelper.getScrollerWidth(divBody);width=(this.columnSizeSum+scrollerWidth);} if(width&&width.indexOf&&(width.indexOf("%")>0||width.indexOf("px")>0)){this.width=width;} else{this.width=width+"px";} if(this.initialized){var table=SweetDevRia.DomHelper.get(this.id);table.style.width=this.width;var frame=this.getFrame();if(frame&&!frame.isNude()){var border=frame.getMain();if(border){if(border.style.width&&border.style.width.indexOf("%")>0){if(width&&(!width.indexOf||width.indexOf("%")==-1)){var centPercent=SweetDevRia.DomHelper.getWidth(this.id+"_container");width=SweetDevRia.DomHelper.parsePx(width);this.width=(width*100/centPercent)+"%";table.style.width="100%";}} border.style.width=this.width;}} this.updateColumnsSize();this.setResizable(this.resizable);if(this.containsData()){var adjustedDiv=SweetDevRia.DomHelper.get(this.id+"_noScrollDiv");adjustedDiv.style.width=this.tableBody.clientWidth!=0?this.tableBody.clientWidth+"px":"";}} this.toRecalculate=true;this.afterSetWidth(width);this.fireEventListener(SweetDevRia.Grid.RESIZE_EVENT,[width,null]);if(this.onResize){this.onResize.call(this,width,null);}}};SweetDevRia.Grid.prototype.getPageBarHeight=function(){var pageBar=SweetDevRia.DomHelper.get(this.pageBarId+"_button");var pageBarHeight=0;if(pageBar!=null){pageBarHeight=SweetDevRia.DomHelper.getHeight(pageBar);} return pageBarHeight;};SweetDevRia.Grid.prototype.getBodyHeight=function(){if(this.height){if(this.height&&(this.height+"").indexOf("%")>0){this.height=SweetDevRia.DomHelper.getHeight(this.id);} var height=SweetDevRia.DomHelper.parsePx(this.height);height=height-this.getHeightHeader()-this.getBottomHeight();return height;} return null;};SweetDevRia.Grid.prototype.setHeight=function(height){if(this.beforeSetHeight(height)){if(!this.resizable){return;} SweetDevRia.log.debug("0 this.height :: "+this.height);this.height=height;SweetDevRia.log.debug("1 this.height :: "+this.height);if(this.initialized){var frame=this.getFrame();if(frame&&!frame.isNude()){var border=frame.getMain();if(border){if(border.style.height&&border.style.height.indexOf("%")>0){if(height&&(!height.indexOf||height.indexOf("%")==-1)){var centPercent=SweetDevRia.DomHelper.getHeight(this.id+"_container");height=SweetDevRia.DomHelper.parsePx(height);this.height=(height*100/centPercent)+"%";}} border.style.height=this.height;}} var table=SweetDevRia.DomHelper.get(this.id);if(this.height!==null&&this.height!=='undefined'){table.style.height=this.height+"px";} var divBody=SweetDevRia.DomHelper.get(this.id+"_bodyDiv");var bodyHeight=this.getBodyHeight();if(bodyHeight){divBody.style.height=bodyHeight+"px";} this.updateLastColumnSize();this.setResizable(this.resizable);if(this.containsData()){var adjustedDiv=SweetDevRia.DomHelper.get(this.id+"_noScrollDiv");adjustedDiv.style.width=this.tableBody.clientWidth!=0?this.tableBody.clientWidth+"px":"";adjustedDiv.style.height=this.tableBody.clientHeight!=0?this.tableBody.clientHeight+"px":"";}} this.fireEventListener(SweetDevRia.Grid.RESIZE_EVENT,[null,height]);this.afterSetHeight(height);if(this.onResize){this.onResize.call(this,null,height);}}};SweetDevRia.Grid.prototype.setSize=function(width,height){if(this.beforeSetSize(width,height)){if(!this.resizable){return;} this.setHeight(height);this.setWidth(width);this.afterSetSize();}};SweetDevRia.Grid.prototype.getHeight=function(){return this.height;};SweetDevRia.Grid.prototype.getBottomHeight=function(){if(this.pageNumber>1||this.showPropertyButton){return 24;} return 0;};SweetDevRia.Grid.prototype.getWidth=function(){return this.width;};SweetDevRia.Grid.prototype.getMinColumnWidth=function(){return this.minColumnWidth;};SweetDevRia.Grid.prototype.setMinColumnWidth=function(minColumnWidth){this.minColumnWidth=minColumnWidth;};SweetDevRia.Grid.prototype.getGridSize=function(){return[this.width,this.height];};SweetDevRia.Grid.prototype.getHeaderFromX=function(x){var previous=this.getFirstVisibleColumn();if(this.isTreeGrid){previous=this.getNextVisibleColumn(previous);} var previousHeader=SweetDevRia.DomHelper.get(this.headPrefix+previous.id);for(var i=0;ix){return previousHeader;} else{previousHeader=headerCol;previous=column;}}} return previousHeader;};SweetDevRia.Grid.prototype.onDragColumn=function(table){return function(e,id){var node=this.getEl();var target=SweetDevRia.DomHelper.get(id);var x=YAHOO.util.Event.getPageX(e);if(id=="#document"){target=table.getHeaderFromX(x);} if(table.isTreeGrid&&id==table.id+"_headColumn"+table.treeModelId){return;} if(target){SweetDevRia.DomHelper.addClassName(SweetDevRia.DomHelper.get(table.id+"_headTable"),"ideo-ndg-headDrag");var width=target.offsetWidth;var targetX=SweetDevRia.DomHelper.getX(target);var offsetX=x-targetX;table.ddArrow.style.display="block";table.ddArrow.style.top="-"+SweetDevRia.DomHelper.getHeight(table.ddArrow)+"px";var divBody=SweetDevRia.DomHelper.get(table.id+"_bodyDiv");if(offsetX=width/2){position++;}} if(movedPosition0){return td.parentNode.cells[td.cellIndex-1];} else{return null;}};SweetDevRia.Grid.prototype.getSelectionMode=function(){return this.selectionMode;};SweetDevRia.Grid.prototype.setSelectionMode=function(mode){if(this.beforeSetSelectionMode(mode)){if(!this.initialized){this.selectionMode=mode;} else{this.clearSelection();this.selectionMode=mode;if(this.selectionMode==SweetDevRia.Grid.ROW_SELECTION||this.selectionMode==SweetDevRia.Grid.CELL_SELECTION){this.selection=null;} else if(this.selectionMode==SweetDevRia.Grid.ROWS_SELECTION||this.selectionMode==SweetDevRia.Grid.CELLS_SELECTION){this.selection=[];}} this.afterSetSelectionMode(mode);}};SweetDevRia.Grid.prototype.getSelectionMode=function(){return this.totalDataNumber;};SweetDevRia.Grid.prototype.getTotalDataNumber=function(){return this.totalDataNumber;};SweetDevRia.Grid.prototype.setTotalDataNumber=function(total){if(this.beforeSetTotalDataNumber(total)){this.totalDataNumber=total;this.afterSetTotalDataNumber(total);}};SweetDevRia.Grid.prototype.getDisplayCheckbox=function(){return this.displayCheckbox;};SweetDevRia.Grid.prototype.setDisplayCheckbox=function(displayCheckbox){this.displayCheckbox=displayCheckbox;};SweetDevRia.Grid.prototype.getCheckboxAll=function(){var checkboxAll=SweetDevRia.DomHelper.get(this.id+"_col_checkboxAll");if(checkboxAll){return checkboxAll.checked;} return null;};SweetDevRia.Grid.prototype.getCheckbox=function(rowId){var checkbox=SweetDevRia.DomHelper.get(this.id+"_col_"+rowId+"_checkbox");if(checkbox){return checkbox.checked;} return null;};SweetDevRia.Grid.prototype.setCheckboxAll=function(select){if(this.beforeSetCheckboxAll(select)){if(!this.displayCheckbox){return;} var checkboxAll=SweetDevRia.DomHelper.get(this.id+"_col_checkboxAll");checkboxAll.checked=select;for(var i=this.getFirstVisibleIndex();i<=this.getLastVisibleIndex();i++){var rowId=this.getRowIdByIndex(i);this.setCheckbox(rowId,select,false);} if(this.groupBy){for(var i=0;i0){var dataGroupingId=this.getDataGroupingId(rowId);var data2=this.data[dataGroupingId][1];var checkGroupRow=true;for(var i=0;i0){for(var i=0;i0&&this.groupingDataDescr){var pos=0;for(var i=0;irowIndex){var rows=this.getRowsForBloc(i);var row=rows[pos+number-rowIndex-1];return row[0];} else{pos+=number;}}} else{var row=this.data[rowIndex];if(row){return row[0];}} return null;};SweetDevRia.Grid.prototype.updateRowDataWithForm=function(rowId,formId,mapping){var myForm=document.getElementById(formId);var rowData=SweetDevRia.Form.getFormData(myForm,mapping);this.updateRowData(rowId,rowData);};SweetDevRia.Grid.prototype.updateRowData=function(rowId,rowData){this.updateServerModel();var params={};params["gridId"]=this.id;params["rowId"]=rowId;params["rowData"]=rowData;SweetDevRia.showWaitingMessage(this.getMessage("updateRowWaiting"),"ideo-ndg-waitingMessage");SweetDevRia.ComHelper.fireEvent(new SweetDevRia.RiaEvent("updateRowData",this.id,params));SweetDevRia.ComHelper.flushEvents();};SweetDevRia.Grid.prototype.onUpdateRowData=function(evt){var rowId=evt.rowId;var rowData=evt.data;for(var colId in this.columns){var col=this.columns[colId];var cellValue=rowData[col.initialPosition+1];this.updateCell(rowId,colId,cellValue);} SweetDevRia.hideWaitingMessage();return true;};SweetDevRia.Grid.prototype.updateCellData=function(rowId,colId,cellData){this.updateServerModel();var params={};params["gridId"]=this.id;params["rowId"]=rowId;params["colId"]=colId;params["cellData"]=cellData;SweetDevRia.showWaitingMessage(this.getMessage("updateCellWaiting"),"ideo-ndg-waitingMessage");SweetDevRia.ComHelper.fireEvent(new SweetDevRia.RiaEvent("updateCellData",this.id,params));SweetDevRia.ComHelper.flushEvents();};SweetDevRia.Grid.prototype.onUpdateCellData=function(evt){var rowId=evt.rowId;var colId=evt.colId;var cellData=evt.cellData;this.updateCell(rowId,colId,cellData);SweetDevRia.hideWaitingMessage();this.fireEventListener(SweetDevRia.Grid.UPDATE_CELL_EVENT,[rowId,colId,cellData]);if(this.onUpdateCell){this.onUpdateCell(rowId,colId,cellData);} return true;};SweetDevRia.Grid.prototype.getDisplayedCellValue=function(rowId,columnId,cellValue){var cellId=this.id+"_cell_"+rowId+"_"+columnId;var formattedValue=cellValue;var editCell=SweetDevRia.$(cellId+"_edit");if(editCell){formattedValue=editCell.formatEditValue(formattedValue);} return formattedValue;};SweetDevRia.Grid.prototype.updateCell=function(rowId,columnId,cellValue){var cellId=this.id+"_cell_"+rowId+"_"+columnId;var cell=document.getElementById(cellId);if(cell){var formattedValue=this.getDisplayedCellValue(rowId,columnId,cellValue);if(this.rowWrap==false){cell.innerHTML="";var nobr=document.createElement("nobr");nobr.innerHTML=formattedValue;cell.appendChild(nobr);} else{cell.innerHTML=formattedValue;}} var rowData=this.groupedData[rowId];var col=this.getColumn(columnId);rowData[col.initialPosition+1]=cellValue;this.groupedData[rowId]=rowData;for(var i=0;imax){max=column.position;previousCol=column;}} return previousCol;};SweetDevRia.Grid.prototype.getLastColumn=function(){var lastCol=null;var max=-1;for(var colId in this.columns){var column=this.columns[colId];if(column&&column.position>max){max=column.position;lastCol=column;}} return lastCol;};SweetDevRia.Grid.prototype.getFirstColumn=function(){var firstCol=null;var min=this.columnNumber;for(var colId in this.columns){var column=this.columns[colId];if(column&&column.positionmax){max=column.position;lastCol=column;}} return lastCol;};SweetDevRia.Grid.prototype.getFirstVisibleColumn=function(){var firstCol=null;var min=this.columnNumber;for(var colId in this.columns){var column=this.columns[colId];if(column&&column.visible&&column.positionposition){for(var i=oldPosition;i>=position;i--){var col=this.getColumnAtPosition(i);col.position++;} column.position=position;} this.shiftColumnsPosition(column.position,oldPosition);this.dropDataColumn(this.id+"_bodyTable",colId,separatorId,targetId,isLastPosition);var node=SweetDevRia.DomHelper.get(this.headPrefix+colId);var separator=SweetDevRia.DomHelper.get(this.spliterPrefix+colId);var beforeNode=SweetDevRia.DomHelper.get(this.headBeforePrefix+colId);if(!isLastPosition){var targetNode=SweetDevRia.DomHelper.get(this.headBeforePrefix+targetCol.id);targetNode.parentNode.insertBefore(beforeNode.parentNode.removeChild(beforeNode),targetNode);targetNode.parentNode.insertBefore(node.parentNode.removeChild(node),targetNode);targetNode.parentNode.insertBefore(separator.parentNode.removeChild(separator),targetNode);} else{var parentNode=separator.parentNode;var sep=this.renameSeparator(colId,lastVisibleCol.id);parentNode.appendChild(sep);node.parentNode.appendChild(beforeNode.parentNode.removeChild(beforeNode));node.parentNode.appendChild(node.parentNode.removeChild(node));} this.updateColumnsSize(column);this.afterSetColumnPosition(colId,position);this.fireEventListener(SweetDevRia.Grid.MOVE_COL_EVENT,[colId,position]);if(this.onMoveColumn){this.onMoveColumn.call(this,colId,position);}}};SweetDevRia.Grid.prototype.excelExport=function(exportMode,exportRowIds,exportId){if(this.beforeExcelExport(exportMode,exportRowIds,exportId)){this.updateServerModel();SweetDevRia_exportExcel(exportId,exportMode,exportRowIds);this.afterExcelExport(exportMode,exportRowIds,exportId);}};SweetDevRia.Grid.prototype.groupingBy=function(grouping){if(this.beforeGroupingBy(grouping)){SweetDevRia.showWaitingMessage(this.getMessage("groupingWaiting"),"ideo-ndg-waitingMessage");SweetDevRia.centerWaitingMessage(SweetDevRia.DomHelper.get(this.id));this.updateServerModel();var params={"gridId":this.id,"grouping":grouping};SweetDevRia.ComHelper.fireEvent(new SweetDevRia.RiaEvent("grouping",this.id,params));this.afterGroupingBy(grouping);}};SweetDevRia.Grid.prototype.multipleColumnSort=function(columnsOrder){if(this.beforeMultipleColumnSort(columnsOrder)){this.resetAllColumnSortClass();var orders=[];if(columnsOrder.length==0){SweetDevRia.log.error('No columns have been selected for multiple sort.');return;} for(var i=0;i0){for(var i=this.groupBy.length-1;i>=0;i--){var colId=this.groupBy[0];var col=this.getColumn(colId);var menuItem=SweetDevRia.$(this.id+"MenuItem"+colId);if(menuItem){menuItem.setDisabled(false);} col.grouped=false;this.groupBy.remove(colId);this.setColumnVisibility(colId,true);}} this.groupBy=evt.grouping;for(var i=0;i0){list.deleteItem(0);} var columnsOrder=[];for(var i=0;ioldPos){newPos++;} if(newPos0){check.checked=true;check.disabled=false;} else{check.checked=false;check.disabled=true;}} SweetDevRia.$(this.excelPropertiesWindowId).open();};SweetDevRia.Grid.prototype.createSortProperties=function(){new SweetDevRia.Window(this.sortPropertiesWindowId,-1,-1,SweetDevRia.Grid.WINDOW_WIDTH,SweetDevRia.Grid.WINDOW_HEIGHT,200,100,2000,2000,null,true,false,true);var win=SweetDevRia.$(this.sortPropertiesWindowId);win.title=this.getMessage("multipleSortProperties");win.message=null;win.canMaximize=false;win.canMinimize=false;win.showTitleIcon=false;win.showCorner=false;win.isResizable=false;var index=this.sortPropertiesDeep;this.sortPropertiesDeep=[];for(var i=0;i=lastVisibleCellIndex){spliterPosition=this.getPreviousVisibleSpliterPosition(spliterPosition);var previousCol=this.getPreviousVisibleColumn(column);if(previousCol){prevColId=previousCol.id;}} var length=this.getVisibleRowNumber();for(var i=0;i-1;i--){var spliter=SweetDevRia.DomHelper.get(this.id+'_head_spliter_'+i);if(spliter){var size=spliter.style.width;if(size==(SweetDevRia.Grid.SPLITER_SIZE+"px")){return i;}} else{return null;}} return null;};SweetDevRia.Grid.prototype.setElemVisibility=function(elem,visibility,size){if(elem){elem.style.width=size?(size+"px"):"auto";if(visibility){elem.style.display="";} else{elem.style.display="none";} return null;} else{var style='';style+="width:"+(size?(size+'px;'):'auto;');if(!visibility){style+=' display:none;';} return style;}};SweetDevRia.Grid.prototype.setElementVisibility=function(elem,visibility,size){var style='';if(elem){if(typeof ActiveXObject!="undefined"){if(visibility){elem.style.width=size?(size+"px"):"auto";elem.style.display="block";} else{elem.style.width="0px";elem.style.display="none";}} else{if(visibility){elem.style.width=size?(size+"px"):"auto";elem.style.visibility="visible";} else{elem.style.width="0px";elem.style.visibility="collapse";}} return null;}else{if(typeof ActiveXObject!="undefined"){if(visibility){style='width:'+(size?(size+'px'):'auto')+';display:block;';} else{style='width:0px;display:none;';}} else{if(visibility){style='width:'+(size?(size+'px'):'auto')+';visibility:visible;';} else{style='width:0px;visibility:collapse;';}} return style;}};SweetDevRia.Grid.prototype.testElementVisibility=function(elem){if(elem){if(typeof ActiveXObject!="undefined"){return(elem.style.display!="none");} else{return(elem.style.visibility=="visible"||elem.style.visibility=="");}} return null;};function swapVisibility(elem){if(!elem){return;} if(elem.style.display=="none"){elem.style.display="";} else{elem.style.display="none";}} SweetDevRia.Grid.prototype.getNextVisibleRow=function(rows,rowIndex){var next=rows[rowIndex+2];var next=rows[rowIndex+1];while(!YAHOO.util.Dom.hasClass(next,"ideo-ndg-row")||next.style.display=="none"){if(next.rowIndex==rows.length-1){next=rows[rowIndex];break;} next=rows[next.rowIndex+1];} return next;};SweetDevRia.Grid.prototype.getPreviousVisibleRow=function(rows,rowIndex){var previous=rows[rowIndex-1];while(!YAHOO.util.Dom.hasClass(previous,"ideo-ndg-row")||previous.style.display=="none"){if(previous.rowIndex==0){previous=rows[rowIndex];break;} previous=rows[previous.rowIndex-1];} return previous;};SweetDevRia.Grid.prototype.getNextRowSelection=function(lastSelection,evt){var nextSelectionNode=null;var keyCode=evt.keyCode;var ctrl=evt.ctrl;var rowNode=document.getElementById(this.id+"_tr_"+lastSelection);var rows=this.rowsTable;if(keyCode==SweetDevRia.KeyListener.ARROW_DOWN_KEY){if(ctrl){nextSelectionNode=this.getLastVisibleRow();} else{var rowIndexT=this.getRowIndex(rows,rowNode);if(rowIndexT0){nextSelectionNode=this.getPreviousVisibleRow(rows,rowIndexT);} else{nextSelectionNode=rowNode;}}} if(nextSelectionNode!=null){var nextSelection=nextSelectionNode.id.substring((this.id+"_tr_").length);return nextSelection;} return null;};SweetDevRia.Grid.prototype.getNextEditableCell=function(lastSelection,evt,swapRow){var next=this.getNextCellSelection(lastSelection,evt,swapRow);var ref=lastSelection;while((next[0]!=ref[0]||next[1]!=ref[1])&&!this.getColumn(next[1]).editable){ref=next;next=this.getNextCellSelection(next,evt,swapRow);} return next;};SweetDevRia.Grid.prototype.getNextCellSelection=function(lastSelection,evt,swapRow){if(swapRow==null){swapRow=true;} var keyCode=evt.keyCode;var ctrl=evt.ctrl;var column=this.getColumn(lastSelection[1]);var nextColumn=null;var rowNode=document.getElementById(this.id+"_tr_"+lastSelection[0]);var rows=this.rowsTable;if(keyCode==SweetDevRia.KeyListener.ARROW_LEFT_KEY){if(ctrl){nextColumn=this.getFirstVisibleColumn();} else{nextColumn=this.getPreviousVisibleColumn(column);if(nextColumn==null&&swapRow){var rowIndexT=this.getRowIndex(rows,rowNode);var firstVisibleT=this.getRowIndex(rows,this.getFirstVisibleRow());if(rowIndexT>firstVisibleT){rowNode=this.getPreviousVisibleRow(rows,rowIndexT);nextColumn=this.getLastVisibleColumn();} else{nextColumn=column;}}}} else if(keyCode==SweetDevRia.KeyListener.ARROW_RIGHT_KEY){if(ctrl){nextColumn=this.getLastVisibleColumn();} else{nextColumn=this.getNextVisibleColumn(column);if(nextColumn==null&&swapRow){var rowIndexT=this.getRowIndex(rows,rowNode);var lastVisibleT=this.getRowIndex(rows,this.getLastVisibleRow());if(rowIndexTfirstVisibleT){rowNode=this.getPreviousVisibleRow(rows,rowIndexT);}}} if(nextColumn&&rowNode){var nextRowId=rowNode.id.substring((this.id+"_tr_").length);return[nextRowId,nextColumn.id];} return null;};SweetDevRia.Grid.prototype.synchronizeScrollers=function(selection){var divBody=SweetDevRia.DomHelper.get(this.id+"_bodyDiv");var top=selection.offsetTop;var tdHeight=selection.offsetHeight;var height=SweetDevRia.DomHelper.parsePx(divBody.style.height);var scrollerHeight=SweetDevRia.DomHelper.getScrollerHeight(divBody);if(divBody.scrollTop+height-scrollerHeighttop){divBody.scrollTop=top;} var left=selection.offsetLeft;var tdWidth=selection.offsetWidth;var width=SweetDevRia.DomHelper.parsePx(divBody.style.width);if(divBody.scrollLeft+widthleft){divBody.scrollLeft=left;}};SweetDevRia.Grid.prototype.checkSelection=function(){var selection=this.getSelection();if(this.selectionMode==SweetDevRia.Grid.ROW_SELECTION){var rowId=selection;this.setCheckbox(rowId,!this.getCheckbox(rowId));} else if(this.selectionMode==SweetDevRia.Grid.ROWS_SELECTION){for(var i=0;ithis.minHeight){return pageBarHeight;}} return this.minHeight;};SweetDevRia.Grid.prototype.getMaxHeight=function(){return this.maxHeight;};SweetDevRia.Grid.prototype.getMinWidth=function(){var pageBarContainer=document.getElementById(this.id+"_"+SweetDevRia.Grid.PAGEBAR+"_button");if(pageBarContainer){var pageBarWidth=SweetDevRia.DomHelper.getWidth(pageBarContainer);if(pageBarWidth>this.minWidth){return pageBarWidth;}} return this.minWidth;};SweetDevRia.Grid.prototype.getMaxWidth=function(){return this.maxWidth;};SweetDevRia.Grid.prototype.handleEvent=function(evt){if(this.isActive()){if(evt.type==SweetDevRia.RiaEvent.KEYBOARD_TYPE){var keyCode=evt.keyCode;switch(keyCode){case SweetDevRia.KeyListener.ARROW_LEFT_KEY:case SweetDevRia.KeyListener.ARROW_RIGHT_KEY:case SweetDevRia.KeyListener.ARROW_UP_KEY:case SweetDevRia.KeyListener.ARROW_DOWN_KEY:this.keySelection(evt);SweetDevRia.EventHelper.stopPropagation(evt.srcEvent);SweetDevRia.EventHelper.preventDefault(evt.srcEvent);break;case SweetDevRia.KeyListener.SPACE_KEY:this.checkSelection();SweetDevRia.EventHelper.stopPropagation(evt.srcEvent);SweetDevRia.EventHelper.preventDefault(evt.srcEvent);break;default:break;}} if(evt.type==SweetDevRia.RiaEvent.SELECT_ALL){this.selectAll();SweetDevRia.EventHelper.stopPropagation(evt.srcEvent);SweetDevRia.EventHelper.preventDefault(evt.srcEvent);}}};SweetDevRia.Grid.prototype.setDataAsync=function(params){if(params){var data=params["data"];var grid=SweetDevRia.$(data.id);grid.actualPage=data.actualPage;grid.totalDataNumber=data.totalNumber;grid.setData(data.data);}};SweetDevRia.Grid.prototype.templateExcelProperties="
    ${getMessage('exportMode')}

    {if displayCheckbox}
    ${getMessage('rowExportMode')}
    {/if}
    ";SweetDevRia.Grid.prototype.templateSortProperties="
    {for i in sortPropertiesDeep} {if i != null}
    {if i == 0} ${getMessage('sortBy')} {else} ${getMessage('sortAndBy')} {/if}
    {/if}{/for}
    ";SweetDevRia.Grid.prototype.templateGridProperties="
    ${getMessage('visibilityMenu')}
      ${getMessage('gridPropertiesOrder')}



      ";SweetDevRia.Grid.prototype.templateGroupingProperties="{for i in groupingPropertiesDeep}
      {if i == 0} ${getMessage('groupBy')} {else} ${getMessage('groupAndBy')} {/if}
      {/for}
      "; SweetDevRia.Grid.prototype.beforeResizingColumn=function(grid){return function(){var cellIndex,column;cellIndex=this.getNode().cellIndex;column=grid.getColumnWithCellIndex(cellIndex+2);column=grid.getPreviousVisibleColumn(column);grid.columnResized=column;if(column.widthInPercent){column.size=grid.convertToPx(column.size);}};};SweetDevRia.Grid.prototype.afterResizingColumn=function(grid){return function(){var column=grid.columnResized;if(column&&column.widthInPercent){column.size=grid.convertToPercent(column.size)+"%";} grid.columnResized=null;};};SweetDevRia.Grid.prototype.resizingColumn=function(grid){return function(){var column=grid.columnResized;column.size=this.getPreviousNode().offsetWidth;grid.updateColumnsSize();};};SweetDevRia.Grid.prototype.convertToPx=function(size){if(size&&size.indexOf&&size.indexOf('%')!==-1){return parseFloat(size.split("%")[0])*this.getCentPercent()/100;} else if(size&&size.indexOf&&size.indexOf('px')!==-1){return parseFloat(size.split("px")[0],10);} else{return size;}};SweetDevRia.Grid.prototype.convertToPercent=function(size){if(size&&size.indexOf&&size.indexOf('px')!==-1){return parseFloat(size.split("px")[0],10)*100/this.getCentPercent();} else if(size&&size.indexOf&&size.indexOf('%')!==-1){return parseFloat(size.split("%")[0]);} else{return size*100/this.getCentPercent();}};SweetDevRia.Grid.prototype.updateColumnSize=function(column,newSize){var index,newSizePx,sizePx,body,length,i;newSizePx=this.getSize((newSize?newSize:column.size));sizePx=this.getColumnSize(column);this.columnSizeSum=this.columnSizeSum-sizePx+newSizePx;column.size=newSizePx;if(this.containsData()){var body=SweetDevRia.DomHelper.get(this.id+"_"+SweetDevRia.Grid.BODY_TABLE);var length=body.childNodes.length;index=this.getColumnIndex(column);for(var j=0;j=this.visibleColumnNumber){break;}} this.columnSizeSum=sum;};SweetDevRia.Grid.prototype.updateLastColumnSize=function(){var column,index,width,newSize,scrollerWidth,divBody,body,length,i;width=SweetDevRia.DomHelper.getWidth(this.id+'_bodyDiv');this.updateSizeSum();scrollerWidth=0;var modifScroll=false;if(this.containsData()){divBody=SweetDevRia.DomHelper.get(this.id+'_bodyDiv');scrollerWidth=SweetDevRia.DomHelper.getScrollerWidth(divBody);var hasScroll=(scrollerWidth>0);modifScroll=(this.hasScroll!=hasScroll);this.hasScroll=hasScroll;} if(this.columnSizeSum<=width||modifScroll){column=this.getLastVisibleColumn();newSize=this.getColumnSize(column);var spliterSize=(this.visibleColumnNumber-1)*SweetDevRia.Grid.SPLITER_SIZE;if(this.displayCheckbox){spliterSize+=SweetDevRia.Grid.SPLITER_SIZE+1;} if(this.columnSizeSum<=width){newSize=width-this.getFixedSizeSum()-spliterSize-scrollerWidth;} else{newSize=newSize-scrollerWidth;} if(this.temporaryResizeColId&&this.temporaryResizeColId!=column.id){var col=this.getColumn(this.temporaryResizeColId);this.updateColumnSize(col);} this.temporaryResizeColId=column.id;this.temporarySize=newSize;if(this.containsData()){var body=SweetDevRia.DomHelper.get(this.id+"_"+SweetDevRia.Grid.BODY_TABLE);length=body.childNodes.length;index=this.getColumnIndex(column);for(var j=0;j=this.visibleColumnNumber){break;}} if(this.displayCheckbox){sumPx+=this.checkboxColWidth;} return this.getSize(sum+"%")+sumPx;};SweetDevRia.Grid.prototype.getColumnSize=function(column){return this.getSize(column.size);};SweetDevRia.Grid.prototype.getSize=function(size){if(size&&size.indexOf&&size.indexOf('%')!==-1){var px=parseFloat(size.split("%")[0])*this.getCentPercent()/100;return(px>=1?px:1);} else if(size&&size.indexOf&&size.indexOf('px')!==-1){return parseInt(size.split("px")[0],10);} else{return parseInt(size,10);}};SweetDevRia.Grid.prototype.getGridWidth=function(){if(this.width&&this.width.indexOf&&this.width.indexOf('%')!==-1){return parseInt(this.width.split("%")[0],10)*this.getCentPercent()/100;} else if(this.width&&this.width.indexOf&&this.width.indexOf('px')!==-1){return parseInt(this.width.split("px")[0],10);} else{return this.width;}}; SweetDevRia_exportExcel=function(exportId,exportMode,exportRowIds,contextId){var params={"exportMode":exportMode,"exportId":exportId};if(exportRowIds!=null&&exportRowIds.length>0){params["exportRowIds"]=exportRowIds.join();} SweetDevRia.ComHelper.callAction(exportId,"com.ideo.sweetdevria.taglib.grid.export.action.GridExportAction",params,contextId);}; SweetDevRia_downloadResource=function(path,name,contentType,contextId){SweetDevRia.ComHelper.callAction(null,"com.ideo.sweetdevria.taglib.fileUpload.action.FileuploadAction",{"path":encodeURI(path),"name":name,"contentType":contentType},contextId);}; SweetDevRia.ModalPanel=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.ModalPanel");this.panel=null;this.iframe=null;};extendsClass(SweetDevRia.ModalPanel,SweetDevRia.RiaComponent);SweetDevRia.ModalPanel.MODAL_PANEL_ID="__SweetDEV_modalPanel";SweetDevRia.ModalPanel._instance=new SweetDevRia.ModalPanel(SweetDevRia.ModalPanel.SWEETDEV_RIA_PROXY_ID);SweetDevRia.ModalPanel.getInstance=function(){return SweetDevRia.ModalPanel._instance;};SweetDevRia.ModalPanel.beforeShowModalPanel=function(zindex){return true;};SweetDevRia.ModalPanel.afterShowModalPanel=function(zindex){};SweetDevRia.ModalPanel.beforeHideModalPanel=function(){return true;};SweetDevRia.ModalPanel.afterHideModalPanel=function(){};SweetDevRia.ModalPanel.SHOW_EVENT="show";SweetDevRia.ModalPanel.HIDE_EVENT="hide";SweetDevRia.ModalPanel.prototype.resize=function(){if(this.panel){this.panel.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.panel.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";} if(this.iframe){this.iframe.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.iframe.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}};SweetDevRia.ModalPanel.showModalPanel=function(zindex){if(SweetDevRia.ModalPanel.beforeShowModalPanel(zindex)){SweetDevRia.ModalPanel.getInstance().show(zindex);SweetDevRia.ModalPanel.afterShowModalPanel(zindex);}};SweetDevRia.ModalPanel.hideModalPanel=function(){if(SweetDevRia.ModalPanel.beforeHideModalPanel()){SweetDevRia.ModalPanel.getInstance().hide();SweetDevRia.ModalPanel.afterHideModalPanel();}};SweetDevRia.ModalPanel.isVisible=function(){return SweetDevRia.ModalPanel.getInstance().isVisible();};SweetDevRia.ModalPanel.prototype.show=function(zindex){if(!this.panel){this.create();} if(zindex==null){SweetDevRia.DisplayManager.getInstance()._getMaxZindex();zindex=SweetDevRia.DisplayManager.getInstance().getTopZIndex();} this.panel.style.zIndex=zindex+1;this.resize();this.panel.style.display="block";if(this.iframe){this.iframe.style.display="block";this.iframe.style.zIndex=zindex;} this.fireEventListener(SweetDevRia.ModalPanel.SHOW_EVENT);};SweetDevRia.ModalPanel.prototype.isVisible=function(){if(this.panel){return(this.panel.style.display=="block");} return false;};SweetDevRia.ModalPanel.prototype.hide=function(){if(this.panel){this.panel.style.display="none";} if(this.iframe){this.iframe.style.display="none";} this.fireEventListener(SweetDevRia.ModalPanel.HIDE_EVENT);};SweetDevRia.ModalPanel.prototype.create=function(){var displayIframe=browser.isIE&&(browser.version<7);if(displayIframe){this.iframe=document.createElement("iframe");this.iframe.setAttribute("frameborder",0);this.iframe.setAttribute("src",SweetDevRIAJSPPath+"/blank.html");this.iframe.className="ideo-mp-iframe";this.iframe.style.position="absolute";this.iframe.style.top="0px";this.iframe.style.left="0px";this.iframe.width=YAHOO.util.Dom.getDocumentWidth()+"px";this.iframe.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.iframe.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";this.iframe.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.iframe.style.zIndex=SweetDevRia.DisplayManager.getInstance().getTopZIndex(true);this.iframe.style.display="none";} this.panel=document.createElement("div");this.panel.style.position="absolute";this.panel.style.top="0px";this.panel.style.left="0px";this.panel.style.zIndex=SweetDevRia.DisplayManager.getInstance().getTopZIndex(!displayIframe);this.panel.className="ideo-mp-main";this.panel.style.display="none";document.body.appendChild(this.panel);if(this.iframe){document.body.appendChild(this.iframe);} var modalPanel=this;SweetDevRia.EventHelper.addListener(window,"resize",function(){modalPanel.resize();});SweetDevRia.EventHelper.addListener(window,"scroll",function(){modalPanel.resize();});}; SweetDevRia.WaitingMessage=function(id,message,css,modal){if(modal==null){modal=true;} if(message==null){message="";} if(css==null){css="";} superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.WaitingMessage");this.message=message;this.css=css;this.modal=modal;this.isShown=false;};extendsClass(SweetDevRia.WaitingMessage,SweetDevRia.RiaComponent);SweetDevRia.WaitingMessage.UNIQUE_ID="SweetDevRia_WaitMessage";SweetDevRia.WaitingMessage.prototype.setMessage=function(message){this.message=message;};SweetDevRia.WaitingMessage.prototype.createMessageDiv=function(){var div=document.createElement("div");div.setAttribute('id',this.id);div.setAttribute('class','ideo-ndg-waitingMessage '+this.css);return document.body.appendChild(div);};SweetDevRia.WaitingMessage.prototype.show=function(){if(this.isShown){return;} var div=document.getElementById(this.id);if(div==null){div=this.createMessageDiv();} if(div){div.style.position="absolute";div.innerHTML=TrimPath.processDOMTemplate(this.templateMessage,this);if(this.modal){SweetDevRia.ModalPanel.getInstance().show();} var x=SweetDevRia.DomHelper.getScrolledLeft()+((document.body.clientWidth-div.offsetWidth)/2);var y=SweetDevRia.DomHelper.getScrolledTop()+((document.body.clientHeight-div.offsetHeight)/2);div.style.left=x;div.style.top=y;var zindex=SweetDevRia.DisplayManager.getInstance().getTopZIndex();div.style.zIndex=zindex;div.style.display="block";SweetDevRia.DomHelper.addClassName(div,"ideo-ndg-waitingMessage");SweetDevRia.DomHelper.addClassName(div,this.css);this.isShown=true;}};SweetDevRia.WaitingMessage.prototype.hide=function(){var div=document.getElementById(this.id);if(div!=null&this.isShown){div.style.display="none";if(this.modal){SweetDevRia.ModalPanel.getInstance().hide();} this.isShown=false;}};SweetDevRia.WaitingMessage.prototype.templateMessage=" ${message}";SweetDevRia.showWaitingMessage=function(message,cssClass,modal){var waitingMessage=SweetDevRia.$(SweetDevRia.WaitingMessage.UNIQUE_ID);if(waitingMessage==null){waitingMessage=new SweetDevRia.WaitingMessage(SweetDevRia.WaitingMessage.UNIQUE_ID,message,cssClass,modal);} else if(!waitingMessage.isShown){waitingMessage.message=message;waitingMessage.css=cssClass;waitingMessage.modal=modal;} waitingMessage.show();};SweetDevRia.centerWaitingMessage=function(element){var x=SweetDevRia.DomHelper.getX(element);var y=SweetDevRia.DomHelper.getY(element);var width=SweetDevRia.DomHelper.getWidth(element);var height=SweetDevRia.DomHelper.getHeight(element);var waitingMessage=SweetDevRia.$(SweetDevRia.WaitingMessage.UNIQUE_ID);if(waitingMessage){var waitingDiv=SweetDevRia.DomHelper.get(waitingMessage.id);SweetDevRia.DomHelper.setX(waitingDiv,x+width/2-SweetDevRia.DomHelper.getWidth(waitingDiv)/2);SweetDevRia.DomHelper.setY(waitingDiv,y+height/2-SweetDevRia.DomHelper.getHeight(waitingDiv)/2);waitingDiv.style.zIndex=SweetDevRia.DisplayManager.getInstance().getTopZIndex(true);}};SweetDevRia.hideWaitingMessage=function(){var waitingMessage=SweetDevRia.$(SweetDevRia.WaitingMessage.UNIQUE_ID);if(waitingMessage){waitingMessage.hide();}}; SweetDevRia.Alert=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.Alert");this.message=null;this.type=SweetDevRia.Alert.PLAIN;this.actionType=SweetDevRia.Alert.NONE;this.modal=false;};extendsClass(SweetDevRia.Alert,SweetDevRia.RiaComponent);SweetDevRia.Alert.PLAIN="plain";SweetDevRia.Alert.INFO="info";SweetDevRia.Alert.WARN="warn";SweetDevRia.Alert.ERROR="error";SweetDevRia.Alert.NONE="none";SweetDevRia.Alert.OK="ok";SweetDevRia.Alert.OK_CANCEL="ok_cancel";SweetDevRia.Alert.YES_NO="yes_no";SweetDevRia.Alert.YES_NO_CANCEL="yes_no_cancel";SweetDevRia.Alert.CLOSE="close";SweetDevRia.Alert.prototype.beforeShow=function(){return true;};SweetDevRia.Alert.prototype.afterShow=function(){};SweetDevRia.Alert.prototype.beforeHide=function(){return true;};SweetDevRia.Alert.prototype.afterHide=function(){};SweetDevRia.Alert.SHOW_EVENT="show";SweetDevRia.Alert.HIDE_EVENT="hide";SweetDevRia.Alert.prototype.setMessage=function(message){this.message=message;};SweetDevRia.Alert.prototype.setModal=function(modal){this.modal=modal;};SweetDevRia.Alert.prototype.setType=function(type){this.type=type;};SweetDevRia.Alert.prototype.setActionType=function(actionType){this.actionType=actionType;};SweetDevRia.Alert.prototype.getCssClass=function(){if(this.type==SweetDevRia.Alert.PLAIN){return"ideo-alt-plain";} else if(this.type==SweetDevRia.Alert.INFO){return"ideo-alt-info";} else if(this.type==SweetDevRia.Alert.WARN){return"ideo-alt-warn";} else if(this.type==SweetDevRia.Alert.ERROR){return"ideo-alt-error";} return"ideo-alt-"+this.type;};SweetDevRia.Alert.prototype.getCssIconClass=function(){return this.getCssClass()+"Icon";};SweetDevRia.Alert.prototype.onYes=function(){SweetDevRia.log.debug("onYes pressed.");};SweetDevRia.Alert.prototype.onNo=function(){SweetDevRia.log.debug("onNo pressed.");};SweetDevRia.Alert.prototype.onOk=function(){SweetDevRia.log.debug("onOk pressed.");};SweetDevRia.Alert.prototype.onCancel=function(){SweetDevRia.log.debug("onCancel pressed.");};SweetDevRia.Alert.prototype.onClose=function(){SweetDevRia.log.debug("onClose pressed.");};SweetDevRia.Alert.prototype.createButton=function(text,methodName){var button=document.createElement("input");button.setAttribute('type',"button");button.setAttribute('value',text);button.className="ideo-alt-button";var myalert=this;SweetDevRia.EventHelper.addListener(button,"click",function(){myalert[methodName].call(myalert);myalert.hide();},this);return button;};SweetDevRia.Alert.prototype.createAlertDiv=function(){var div=document.createElement("div");div.setAttribute('id',this.id);div.className="ideo-alt-zoneMain";var divButton=document.createElement("div");divButton.className="ideo-alt-buttonBar";if(this.actionType==SweetDevRia.Alert.OK){divButton.appendChild(this.createButton(this.getMessage("buttonOk"),"onOk"));} else if(this.actionType==SweetDevRia.Alert.OK_CANCEL){divButton.appendChild(this.createButton(this.getMessage("buttonOk"),"onOk"));divButton.appendChild(this.createButton(this.getMessage("buttonCancel"),"onCancel"));} else if(this.actionType==SweetDevRia.Alert.YES_NO){divButton.appendChild(this.createButton(this.getMessage("buttonYes"),"onYes"));divButton.appendChild(this.createButton(this.getMessage("buttonNo"),"onNo"));} else if(this.actionType==SweetDevRia.Alert.YES_NO_CANCEL){divButton.appendChild(this.createButton(this.getMessage("buttonYes"),"onYes"));divButton.appendChild(this.createButton(this.getMessage("buttonNo"),"onNo"));divButton.appendChild(this.createButton(this.getMessage("buttonCancel"),"onCancel"));} else if(this.actionType==SweetDevRia.Alert.CLOSE){divButton.appendChild(this.createButton(this.getMessage("buttonClose"),"onClose"));} var divMessage=document.getElementById(this.id+"_message");divMessage.className="ideo-alt-message";divMessage.style.display="";var divIcon=document.createElement("div");divIcon.className="ideo-alt-icon "+this.getCssIconClass();divIcon.innerHTML=" ";var divPanel=document.createElement("div");divPanel.setAttribute('id',this.id+'_panel');divPanel.className='ideo-alt-zone '+this.getCssClass();div.appendChild(divPanel);divPanel.appendChild(divIcon);divPanel.appendChild(divMessage);divPanel.appendChild(divButton);document.body.appendChild(div);return div;};SweetDevRia.Alert.prototype.show=function(){if(this.beforeShow()){var div=document.getElementById(this.id);if(div==null){div=this.createAlertDiv();this.createFrame();if(!this.getFrame().isNude()){this.getFrame().contentId=this.id+"_panel";this.getFrame().resizeMode=SweetDevRia.Frame.RESIZE_MODE_NONE;this.getFrame().borderMode=SweetDevRia.Frame.BORDER_MODE_ALL;this.getFrame().canDrag=false;this.getFrame().showBorderOnOver=false;SweetDevRia.init();}} if(div){if(this.modal){SweetDevRia.ModalPanel.getInstance().show();} div.style.display="block";var clientHeight=SweetDevRia.DomHelper.getClientHeight();var height=parseInt(SweetDevRia.DomHelper.getHeight(div),10);div.style.top=SweetDevRia.DomHelper.getScrolledTop()+((clientHeight-height)/2)+"px";var clientWidth=SweetDevRia.DomHelper.getClientWidth();var width=parseInt(SweetDevRia.DomHelper.getWidth(document.getElementById(this.id+"_panel")),10);div.style.left=SweetDevRia.DomHelper.getScrolledLeft()+((clientWidth-width)/2)+"px";var zindex=SweetDevRia.DisplayManager.getInstance().getTopZIndex();div.style.zIndex=zindex+1;this.getFrame().refreshBorders();} if(this.message!=null){var content=document.getElementById(this.id+"_message");content.innerHTML=this.message;} this.fireEventListener(SweetDevRia.Alert.SHOW_EVENT);this.afterShow();}};SweetDevRia.Alert.prototype.hide=function(){if(this.beforeHide()){var div=document.getElementById(this.id);if(div){div.style.display="none";if(this.modal){SweetDevRia.ModalPanel.getInstance().hide();}} this.fireEventListener(SweetDevRia.Alert.HIDE_EVENT);this.afterHide();}};SweetDevRia.Alert.prototype.destroy=function(){var view=document.getElementById(this.id);if(view){SweetDevRia.DomHelper.removeChild(view.parentNode,this.id);}}; SweetDevRia.BaseCalendar=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);superClass(this,SweetDevRia.RiaComponent,id,"CalendarBase");superClass(this,SweetDevRia.Hookable,id,"CalendarBase");} this.tooltip=null;this.mustBeRendered=false;this.acronymCounter=0;this.acronymDates=null;this.acronymList=null;this.acronymCss=null;this.enabled=true;};extendsClass(SweetDevRia.BaseCalendar,SweetDevRia.RiaComponent,YAHOO.widget.Calendar);extendsClass(SweetDevRia.BaseCalendar,SweetDevRia.Hookable);SweetDevRia.BaseCalendar.prototype._unload=function(e,cal){if(!cal){return;} for(var c in cal.cells){c=null;} cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};SweetDevRia.BaseCalendar.prototype.render=function(){SweetDevRia.startLog("Log.Render_"+this.id,this);if(this.beforeRender()){if(this.tooltip&&!this.tooltip.opened){this.mustBeRendered=true;return;} if(!this.shellRendered){this.table=SweetDevRia.DomHelper.get(this.id+"table");this.tbody=SweetDevRia.DomHelper.get(this.id+"tbody");this.headerCell=SweetDevRia.DomHelper.get(this.id+"header");SweetDevRia.EventHelper.addListener(window,"unload",this._unload,this);this.addCells(this.tbody);this.shellRendered=true;this.buildShellFooter();} this.resetRenderers();this.acronymCounter=0;this.cellDates.length=0;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.pageDate);this.renderHeader();this.renderBody(workingDate);this.renderFooter();this.onRender();this.fireEventListener(SweetDevRia.RiaComponent.RENDER_EVENT);this.afterRender();} SweetDevRia.endLog("Log.Render_"+this.id,this,1);};SweetDevRia.BaseCalendar.prototype.addCells=function(node){if(node&&node.childNodes&&node.childNodes.length>0){for(var i=0;i0){this.addCells(node.childNodes[i]);}}}}};SweetDevRia.BaseCalendar.prototype.renderHeader=function(){if(!this.linkMonthLeft){this.linkMonthLeft=SweetDevRia.DomHelper.get(this.id+"navMonthLeft");if(this.linkMonthLeft){this.addListenerPrevionsMonth(this.linkMonthLeft);}} if(!this.linkYearLeft){this.linkYearLeft=SweetDevRia.DomHelper.get(this.id+"navYearLeft");if(this.linkYearLeft){this.addListenerPrevionsYear(this.linkYearLeft);}} if(!this.linkMonthRight){this.linkMonthRight=SweetDevRia.DomHelper.get(this.id+"navMonthRight");if(this.linkMonthRight){this.addListenerNextMonth(this.linkMonthRight);}} if(!this.linkYearRight){this.linkYearRight=SweetDevRia.DomHelper.get(this.id+"navYearRight");if(this.linkYearRight){this.addListenerNextYear(this.linkYearRight);}} if(!this.labelMonth){this.labelMonth=SweetDevRia.DomHelper.get(this.id+"Month");} if(this.labelMonth){this.labelMonth.innerHTML=this.buildMonthLabel();}};SweetDevRia.BaseCalendar.prototype.addListenerPrevionsMonth=function(link){if(this.parent){SweetDevRia.EventHelper.addListener(link,"mousedown",this.parent.doPreviousMonth,this.parent);}else{SweetDevRia.EventHelper.addListener(link,"mousedown",this.previousMonth,this,true);}};SweetDevRia.BaseCalendar.prototype.addListenerPrevionsYear=function(link){if(this.parent){SweetDevRia.EventHelper.addListener(link,"mousedown",this.parent.doPreviousYear,this.parent);}else{SweetDevRia.EventHelper.addListener(link,"mousedown",this.previousYear,this,true);}};SweetDevRia.BaseCalendar.prototype.addListenerNextMonth=function(link){if(this.parent){SweetDevRia.EventHelper.addListener(link,"mousedown",this.parent.doNextMonth,this.parent);}else{SweetDevRia.EventHelper.addListener(link,"mousedown",this.nextMonth,this,true);}};SweetDevRia.BaseCalendar.prototype.addListenerNextYear=function(link){if(this.parent){SweetDevRia.EventHelper.addListener(link,"mousedown",this.parent.doNextYear,this.parent);}else{SweetDevRia.EventHelper.addListener(link,"mousedown",this.nextYear,this,true);}};SweetDevRia.BaseCalendar.prototype.buildShellFooter=function(){if(!this.linkToday){this.linkToday=SweetDevRia.DomHelper.get(this.id+"Today");this.addListenerGoOnToday(this.linkToday);} if(!this.linkClear){this.linkClear=SweetDevRia.DomHelper.get(this.id+"Clear");this.addListenerClear(this.linkClear);} if(!this.linkClose){this.linkClose=SweetDevRia.DomHelper.get(this.id+"Close");this.addListenerClose(this.linkClose);}};SweetDevRia.BaseCalendar.prototype.addListenerGoOnToday=function(link){if(this.parent){SweetDevRia.EventHelper.addListener(link,"mousedown",this.parent.doGoOnToday,this.parent);}else{SweetDevRia.EventHelper.addListener(link,"mousedown",this.goOnToday,this,true);}};SweetDevRia.BaseCalendar.prototype.addListenerClear=function(link){if(this.parent){SweetDevRia.EventHelper.addListener(link,"mousedown",this.parent.doResetCalendar,this.parent);}else{SweetDevRia.EventHelper.addListener(link,"mousedown",this.resetCalendar,this,true);}};SweetDevRia.BaseCalendar.prototype.addListenerClose=function(link){SweetDevRia.EventHelper.addListener(link,"mousedown",this.close,this,true);};SweetDevRia.BaseCalendar.prototype.goOnToday=function(){if(!this.enabled){return;} var now=new Date();this.setMonth(now.getMonth());this.setYear(now.getFullYear());this.render();};SweetDevRia.BaseCalendar.prototype.focus=function(){if(this.selectedDates.length===0){this.goOnToday();} if(this.setActive){this.setActive(true);}};SweetDevRia.BaseCalendar.prototype.addAcronymRender=function(dateList,acronymList,cssStyleClass){this.acronymDates=this._parseDates(dateList);this.acronymList=acronymList;this.acronymCss=cssStyleClass;this.render();};SweetDevRia.BaseCalendar.prototype.renderCellDefault=function(workingDate,cell){var acronymAndCss=null;cell.innerHTML="";if((this.acronymDates&&this.acronymDates.length!==0)&&(this.acronymCounter0) {this.init(id,containerId,monthyear,selected);superClass(this,SweetDevRia.BaseCalendar,id,"CalendarSimple");} this.singleDateField=null;this.dateDayField=null;this.dateMonthField=null;this.dateYearField=null;this.hiddenDateField=null;this.CssBadFormat="ideo-cal-inputFieldBadFormat";};extendsClass(SweetDevRia.SimpleCalendar,SweetDevRia.BaseCalendar);SweetDevRia.SimpleCalendar.prototype.isSelectedDateValid=function(){if(this.dateMonthField){return!SweetDevRia.DomHelper.hasClassName(this.dateMonthField,this.CssBadFormat);} if(this.singleDateField){return!SweetDevRia.DomHelper.hasClassName(this.singleDateField,this.CssBadFormat);}};SweetDevRia.SimpleCalendar.prototype.addSingleDateField=function(singleDateFieldId){this.singleDateField=SweetDevRia.DomHelper.get(singleDateFieldId);this.singleDateField.calInstance=this;SweetDevRia.EventHelper.addListener(this.singleDateField,"blur",this.onblur,this);SweetDevRia.EventHelper.addListener(this.singleDateField,"focus",this.deactivate,this);SweetDevRia.EventHelper.addListener(this.singleDateField,"keydown",this.handleInputEvent,this);};SweetDevRia.SimpleCalendar.prototype.handleInputEvent=function(event){SweetDevRia.EventHelper.stopPropagation(event);return true;};SweetDevRia.SimpleCalendar.prototype.deactivate=function(){if(this.calInstance){this.calInstance.close();}};SweetDevRia.SimpleCalendar.prototype.onblur=function(){if(this.calInstance){this.calInstance.acceptDate();this.calInstance.deactivate();}};SweetDevRia.SimpleCalendar.prototype.addExplodedDateField=function(yearFieldId,monthFieldId,dayFieldId){this.dateYearField=SweetDevRia.DomHelper.get(yearFieldId);this.dateMonthField=SweetDevRia.DomHelper.get(monthFieldId);this.dateDayField=SweetDevRia.DomHelper.get(dayFieldId);this.dateYearField.calInstance=this;this.dateMonthField.calInstance=this;this.dateDayField.calInstance=this;SweetDevRia.EventHelper.addListener(this.dateYearField,"blur",this.onblur,this);SweetDevRia.EventHelper.addListener(this.dateMonthField,"blur",this.onblur,this);SweetDevRia.EventHelper.addListener(this.dateDayField,"blur",this.onblur,this);SweetDevRia.EventHelper.addListener(this.dateYearField,"focus",this.deactivate,this);SweetDevRia.EventHelper.addListener(this.dateMonthField,"focus",this.deactivate,this);SweetDevRia.EventHelper.addListener(this.dateDayField,"focus",this.deactivate,this);SweetDevRia.EventHelper.addListener(this.dateYearField,"keydown",this.handleInputEvent,this);SweetDevRia.EventHelper.addListener(this.dateMonthField,"keydown",this.handleInputEvent,this);SweetDevRia.EventHelper.addListener(this.dateDayField,"keydown",this.handleInputEvent,this);};SweetDevRia.SimpleCalendar.prototype.addHiddenDateField=function(hiddenDateFieldId){this.hiddenDateField=SweetDevRia.DomHelper.get(hiddenDateFieldId);};SweetDevRia.SimpleCalendar.prototype.clearBadFormat=function(){SweetDevRia.DomHelper.removeClassName(this.singleDateField,this.CssBadFormat);SweetDevRia.DomHelper.removeClassName(this.dateYearField,this.CssBadFormat);SweetDevRia.DomHelper.removeClassName(this.dateMonthField,this.CssBadFormat);SweetDevRia.DomHelper.removeClassName(this.dateDayField,this.CssBadFormat);};SweetDevRia.SimpleCalendar.prototype.acceptDate=function(){if(!this||!this.calInstance){SweetDevRia.log.error("acceptDate : 'this' is null !");return false;} if((this.parent&&((this.parent.tooltip&&this.parent.tooltip.opened)||!this.parent.tooltip))||!this.tooltip||(this.tooltip&&this.tooltip.opened)){this.calInstance.setActive(true);} SweetDevRia.DomHelper.removeClassName(this,this.CssBadFormat);this.calInstance.clearBadFormat();this.calInstance.deselectAll();var verif,dateValue;try{if(this.calInstance.singleDateField==this){var datePattern="^"+SweetDevRia.DateFormat.pattern.toUpperCase()+"$";datePattern=datePattern.replace("YYYY","[0-9]{4,4}").replace("YY","[0-9]{1,2}").replace("DD","[0-9]{1,2}").replace("MM","[0-9]{1,2}").replace(/\//g,SweetDevRia.DateFormat.separator);verif=new RegExp(datePattern);if(verif.test(this.value)){SweetDevRia.DateFormat.prepareDateField(this);dateValue=SweetDevRia.DateFormat.parseDate(this.value);if(dateValue===null){throw("BadDateException");}}else{throw("BadFormatException");}}else{if(this==this.calInstance.dateYearField&&SweetDevRia.DateFormat.pattern.toUpperCase().indexOf("YYYY")!==-1){verif=new RegExp("^[0-9]{4,4}$");}else{verif=new RegExp("^[0-9]{1,2}$");} if(verif.test(this.value)){SweetDevRia.DateFormat.prepareDateField(this);if(this.calInstance.dateDayField.value.length>0&&this.calInstance.dateMonthField.value.length>0&&this.calInstance.dateYearField.value.length>0){dateValue=SweetDevRia.DateFormat.getDate(this.calInstance.dateYearField.value,this.calInstance.dateMonthField.value,this.calInstance.dateDayField.value);if(dateValue===null){throw("BadDateException");}}}else{throw("BadFormatException");}} if(dateValue){if(this.calInstance.minDate){if(YAHOO.widget.DateMath.before(dateValue,this.calInstance.minDate)){throw("UnauthorizedDateException");}} if(this.calInstance.maxDate){if(YAHOO.widget.DateMath.after(dateValue,this.calInstance.maxDate)){throw("UnauthorizedDateException");}} if(this.calInstance.disabledDays){var ddArray=this.calInstance.disabledDays;for(var dd=0;dd0)?SweetDevRia.DateFormat.multiDateSeparator:"")+SweetDevRia.DateFormat.getDateFromPattern(this.getSelDates()[i][0],this.getSelDates()[i][1],this.getSelDates()[i][2]);}}} this.fireEventListener("change");}};SweetDevRia.SimpleCalendar.prototype.getSelDates=function(){if(this.parent){return this.parent.selectedDates;}else{return this.selectedDates;}};SweetDevRia.SimpleCalendar.prototype.emptyDatefields=function(){this.clearBadFormat();if(this.singleDateField!==null){this.singleDateField.value="";} if(this.hiddenDateField!==null){this.hiddenDateField.value="";} if(this.dateDayField!==null){this.dateDayField.value="";} if(this.dateMonthField!==null){this.dateMonthField.value="";} if(this.dateYearField!==null){this.dateYearField.value="";}};SweetDevRia.SimpleCalendar.prototype.handleEvent=function(evt){if(!this.isActive()){return true;} var handleEvent=true;if(this.tooltip){if(document.getElementById(this.id+"tooltip").style.display==="none"){handleEvent=false;}} if(evt&&evt.type&&handleEvent){if(evt.type==SweetDevRia.RiaEvent.KEYBOARD_TYPE){var dat=null,keyCode=evt.keyCode;if(this.getSelDates().length==1){dat=new Date(this.getSelDates()[0][0],this.getSelDates()[0][1]-1,this.getSelDates()[0][2]);} switch(keyCode){case SweetDevRia.KeyListener.ARROW_UP_KEY:if(dat){dat=YAHOO.widget.DateMath.subtract(dat,YAHOO.widget.DateMath.DAY,7);} break;case SweetDevRia.KeyListener.ARROW_LEFT_KEY:if(dat){dat=YAHOO.widget.DateMath.subtract(dat,YAHOO.widget.DateMath.DAY,1);} break;case SweetDevRia.KeyListener.ARROW_DOWN_KEY:if(dat){dat=YAHOO.widget.DateMath.add(dat,YAHOO.widget.DateMath.DAY,7);} break;case SweetDevRia.KeyListener.ARROW_RIGHT_KEY:if(dat){dat=YAHOO.widget.DateMath.add(dat,YAHOO.widget.DateMath.DAY,1);} break;case SweetDevRia.KeyListener.ESCAPE_KEY:this.resetCalendar();break;case SweetDevRia.KeyListener.ENTER_KEY:case SweetDevRia.KeyListener.SPACE_KEY:SweetDevRia.EventHelper.stopPropagation(evt.srcEvent);SweetDevRia.EventHelper.preventDefault(evt.srcEvent);this.close();this.setActive(false);return false;default:break;} if(this.Options.MULTI_SELECT){SweetDevRia.log.warn("No keyboard support for multidate calendar !");SweetDevRia.EventHelper.stopPropagation(evt.srcEvent);SweetDevRia.EventHelper.preventDefault(evt.srcEvent);return true;} while(this.isRestrictedDate(dat)){switch(keyCode){case SweetDevRia.KeyListener.ARROW_UP_KEY:case SweetDevRia.KeyListener.ARROW_LEFT_KEY:if(dat){dat=YAHOO.widget.DateMath.subtract(dat,YAHOO.widget.DateMath.DAY,1);} break;case SweetDevRia.KeyListener.ARROW_DOWN_KEY:case SweetDevRia.KeyListener.ARROW_RIGHT_KEY:if(dat){dat=YAHOO.widget.DateMath.add(dat,YAHOO.widget.DateMath.DAY,1);} break;default:break;}} this.setNewDateAndFillDateInFields(dat);SweetDevRia.EventHelper.stopPropagation(evt.srcEvent);SweetDevRia.EventHelper.preventDefault(evt.srcEvent);return false;}}};SweetDevRia.SimpleCalendar.prototype.isRestrictedDate=function(dat){for(var r=0;r-1){cal.deselectCell(index);}else{cal.selectCell(index);cal.onSelectDate(date);}}else{link=cell.getElementsByTagName("A")[0];link.blur();cal.selectCell(index);cal.onSelectDate(date);cal.close();}} cal.fillDateInfields();SweetDevRia.EventHelper.stopPropagation(e);if(cal.singleDateField!==null){cal.singleDateField.focus();}};};SweetDevRia.SimpleCalendar.prototype.onSelectDate=function(date){}; SweetDevRia.StandAloneCalendar=function(id,containerId,monthyear,selected){this.standalone=true;if(arguments.length>0) {this.init(id,containerId,monthyear,selected);} superClass(this,SweetDevRia.BaseCalendar,id,"CalendarStandAlone");};extendsClass(SweetDevRia.StandAloneCalendar,SweetDevRia.BaseCalendar);SweetDevRia.StandAloneCalendar.prototype.select=null;SweetDevRia.StandAloneCalendar.prototype.setActive=null;SweetDevRia.StandAloneCalendar.prototype.focus=null;SweetDevRia.StandAloneCalendar.prototype.wireCustomEvents=function(){this.doSelectCell=function(e,cal){null;};this.doCellMouseOver=function(e,cal){null;};this.doCellMouseOut=function(e,cal){null;};}; SweetDevRia.DateRangeCalendar=function(id,containerId,monthyear,selected){if(arguments.length>0) {this.init(id,containerId,monthyear,selected);superClass(this,SweetDevRia.SimpleCalendar,id,"CalendarSimple");this.Options.MULTI_SELECT=true;this._renderStack=new Array();} this.oldRenderStack=new Array();};extendsClass(SweetDevRia.DateRangeCalendar,SweetDevRia.SimpleCalendar);SweetDevRia.DateRangeCalendar.prototype.selectCell=function(cellIndex){return this.doSelectCellIfRange(SweetDevRia.BaseCalendar.prototype.selectCell,cellIndex);};SweetDevRia.DateRangeCalendar.prototype.select=function(date){return this.doSelectCellIfRange(YAHOO.widget.Calendar_Core.prototype.select,date);};SweetDevRia.DateRangeCalendar.prototype.doSelectCellIfRange=function(fct,arg){var ret;if(this.getSelDates().length>=2){ret=false;}else{ret=fct.call(this,arg);if(this.getSelDates().length==2){this.highlightPeriod();} this.fillDateInfields();} return ret;};SweetDevRia.DateRangeCalendar.prototype.onDeselect=function(){if(this.getSelDates().length==1){if(this.parent&&this.parent.clearPeriodDateRange){this.parent.clearPeriodDateRange();this.parent.render();}else{this._renderStack.copy(this.oldRenderStack);this.render();}} if(this.getSelDates().length===0){this.emptyDatefields();}else{this.fillDateInfields();}};SweetDevRia.DateRangeCalendar.prototype.resetCalendar=function(){if(!this.enabled){return;} this._renderStack.copy(this.oldRenderStack);SweetDevRia.SimpleCalendar.prototype.resetCalendar.call(this);};SweetDevRia.DateRangeCalendar.prototype.goOnToday=function(){if(!this.enabled){return;} this._renderStack.copy(this.oldRenderStack);SweetDevRia.SimpleCalendar.prototype.goOnToday.call(this);};SweetDevRia.DateRangeCalendar.prototype.highlightPeriod=function(){if(this.getSelDates().length!=2){return;} if(this.parent){for(var p=0;p0){this.buildWrapper(containerId);this.init(nbMonth,childCalClass,id,containerId,monthyear,selected);superClass(this,SweetDevRia.RiaComponent,id,"MultiCalendar");} this.tooltip=null;this.mustBeRendered=false;this.singleDateField=null;this.dateDayField=null;this.dateMonthField=null;this.dateYearField=null;this.hiddenDateField=null;this.CssBadFormat="ideo-cal-inputFieldBadFormat";this.Options=new Array();this.Options.MULTI_SELECT=false;this.enabled=true;};extendsClass(SweetDevRia.MultiCalendar,SweetDevRia.RiaComponent,YAHOO.widget.CalendarGroup);SweetDevRia.MultiCalendar.prototype.init=function(pageCount,childCalClass,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p"+evt.data+"";} document.getElementById(this.id).innerHTML=evt.data;SweetDevRia_Zone_evalJS(document.getElementById(this.id));this.cancelAsContext();SweetDevRia.init();this.fireEventListener(SweetDevRia.Zone.REFRESH_EVENT);this.afterOnCallServer(evt);if(this.refreshDelay!=0){SweetDevRia.Zone.launchTimer(this);}} return true;};SweetDevRia.Zone.prototype.getContextId=function(){return this.id;};SweetDevRia.Zone.prototype.setAsContext=function(){SweetDevRia.ContextManager.getInstance().pushContext(this.getContextId());};SweetDevRia.Zone.prototype.cancelAsContext=function(){SweetDevRia.ContextManager.getInstance().popContext(this.getContextId());};SweetDevRia.Zone.prototype.formatInputParams=function(){if(this.addInputs==null||this.addInputs==""){return"";} var params="";var nextSeparator='';var inputs=this.addInputs.split(",");for(var i=0;i','');if(window.execScript){window.execScript(strExec);} else{try{window.eval(strExec);}catch(e){throw"Script evaluation failed :\n"+strExec;}}}} SweetDevRia.Zone.prototype.garbageCollector=function(){SweetDevRia.unregisterContext(this.getContextId());}; SweetDevRia.Accordion=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.Accordion");this.id=id;this.items={};this.openedItem=undefined;this.isOpening=false;};extendsClass(SweetDevRia.Accordion,SweetDevRia.RiaComponent);SweetDevRia.Accordion.prototype.beforeOpen=function(accordionItemId){return true;};SweetDevRia.Accordion.prototype.afterOpen=function(accordionItemId){};SweetDevRia.Accordion.OPEN_EVENT="open";SweetDevRia.Accordion.prototype.initialize=function(){if(this.openAtStartupId){this.open(this.openAtStartupId);} return true;};SweetDevRia.Accordion.prototype.addItem=function(accordionItem){this.items[accordionItem.id]=accordionItem;SweetDevRia.Accordion.hide(accordionItem.id);};SweetDevRia.Accordion.prototype.getItem=function(accordionItemId){return this.items[accordionItemId];};SweetDevRia.Accordion.prototype.open=function(accordionItemId){if(this.isOpening){return;} if(this.beforeOpen(accordionItemId)){if(this.getOpenedItem()!=undefined){if(this.getOpenedItem()==this.items[accordionItemId]){this.closeActive();return;} else{this.isOpening=true;this.closeActive();}} this.isOpening=true;this.items[accordionItemId].open(this);this.openedItem=this.items[accordionItemId];this.fireEventListener(SweetDevRia.Accordion.OPEN_EVENT,accordionItemId);this.afterOpen(accordionItemId);}};SweetDevRia.Accordion.prototype.close=function(accordionItem){if(this.getOpenedItem()==accordionItem){accordionItem.close(this,!this.isOpening);this.openedItem=undefined;}};SweetDevRia.Accordion.prototype.closeActive=function(){this.close(this.getOpenedItem());};SweetDevRia.Accordion.prototype.getOpenedItem=function(){return this.openedItem;};SweetDevRia.Accordion.prototype.isOpen=function(accordionItemId){return this.items[accordionItemId].isOpen();};SweetDevRia.AccordionItem=function(id,title){this.id=id;this.title=title;this.isOpen=false;};SweetDevRia.AccordionItem.prototype.isOpen=function(){return this.isOpen;};SweetDevRia.AccordionItem.prototype.open=function(acc){var itemContent=SweetDevRia.DomHelper.get(this.id);var frame=SweetDevRia.$(acc.id).getFrame();SweetDevRia.DomHelper.verticalShow(itemContent,0.4,function(){itemContent.style.height="";acc.isOpening=false;frame.refreshBorders();},function(){frame.refreshBorders();});SweetDevRia.DomHelper.addClassName(SweetDevRia.DomHelper.get(this.id+"_header"),"ideo-acc-openedHeader");SweetDevRia.DomHelper.addClassName(SweetDevRia.DomHelper.get(this.id),"ideo-acc-openedContent");};SweetDevRia.AccordionItem.prototype.close=function(acc,refresh){var frame=SweetDevRia.$(acc.id).getFrame();if(refresh){SweetDevRia.DomHelper.verticalHide(SweetDevRia.DomHelper.get(this.id),0.4,function(){frame.refreshBorders();},function(){frame.refreshBorders();});}else{SweetDevRia.DomHelper.verticalHide(SweetDevRia.DomHelper.get(this.id),0.4);} SweetDevRia.DomHelper.removeClassName(SweetDevRia.DomHelper.get(this.id+"_header"),"ideo-acc-openedHeader");SweetDevRia.DomHelper.removeClassName(SweetDevRia.DomHelper.get(this.id),"ideo-acc-openedContent");};SweetDevRia.Accordion.show=function(id){var comp=document.getElementById(id);if(comp){comp.style.display="block";}};SweetDevRia.Accordion.hide=function(id){var comp=document.getElementById(id);if(comp){comp.style.display="none";}}; SweetDevRia.FileUpload=function(id){if(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.FileUpload");} this.simpleFilter=null;this.regexpFilter=null;};SweetDevRia.FileUpload.LINK="_link";extendsClass(SweetDevRia.FileUpload,SweetDevRia.RiaComponent);SweetDevRia.FileUpload.prototype.beforeUpload=function(){return true;};SweetDevRia.FileUpload.prototype.afterUpload=function(){};SweetDevRia.FileUpload.prototype.beforeDelete=function(){return true;};SweetDevRia.FileUpload.prototype.afterDelete=function(){};SweetDevRia.FileUpload.prototype.getInputFile=function(){return document.getElementById(this.id);};SweetDevRia.FileUpload.prototype.getInputFileValue=function(){return this.getInputFile().value;};SweetDevRia.FileUpload.prototype.getInputFileText=function(){return document.getElementById(this.id+"_text");};SweetDevRia.FileUpload.prototype.getLink=function(){return document.getElementById(this.id+SweetDevRia.FileUpload.LINK);};SweetDevRia.FileUpload.prototype.accept=function(filename){var cutfilename=SweetDevRia.FileUpload.extractFileName(filename);if(this.simpleFilter){if(!this.simpleFilterRegexp.test(cutfilename)){SweetDevRia.log.error("Chosen file:"+filename+" does not match the filter:"+this.simpleFilter);return false;}} if(this.regexpFilter){if(!this.regexpFilterRegexp.test(cutfilename)){SweetDevRia.log.error("Chosen file:"+filename+" does not match the filter:"+this.regexpFilter);return false;}} return true;};SweetDevRia.FileUpload.extractFileName=function(filename){var lastSlash=filename.lastIndexOf("\\");if(lastSlash==-1){lastSlash=filename.lastIndexOf("/");} if(lastSlash==-1){return filename;} return filename.substring(lastSlash+1,filename.length);};SweetDevRia.FileUpload.prototype.setSimpleFilter=function(filter){var convert="^";for(var i=0;i0)?form.action+="&":form.action+="?";form.action+=SweetDevRia.ComHelper.ID_PAGE+"="+window[SweetDevRia.ComHelper.ID_PAGE];form.submit();var filename=this.getInputFileValue();var stillUploadingText=this.stillUploadingText;window.onbeforeunload=function(){return stillUploadingText+" "+filename;};if(actionbkp){form.action=actionbkp;} if(enctypebkp){form.enctype=enctypebkp;} if(targetbkp){form.target=targetbkp;} if(methodbkp){form.method=methodbkp;}} this.afterUpload();}};SweetDevRia.FileUpload.prototype.loaded=function(index,name){window.onbeforeunload=null;this.index=index;this.name=name;this.getInputFile().disabled=true;document.getElementById(this.id+"_text_container").style.display="";this.getInputFile().style.display="none";this.getInputFileText().value=this.getInputFile().value;this.updateServerModel("value",this.getInputFile().value.replace(/\\/g,"\\\\\\\\"));this.updateServerModel("index",this.index);this.updateServerModel("name",this.name);};SweetDevRia.FileUpload.prototype.isUploaded=function(){return(this.index!=null);};SweetDevRia.FileUpload.prototype.deleteFile=function(){if(this.beforeDelete()){document.getElementById(this.id+"_text_container").style.display="none";SweetDevRia.ComHelper.fireEvent(new SweetDevRia.RiaEvent("deleteFile",this.id,{"sendServer":true,"index":this.index,"name":this.name}),false);this.getInputFile().form.reset();this.getInputFile().disabled=false;this.getInputFile().style.display="";this.getInputFileText().value="";this.index=null;this.name=null;this.afterDelete();}};SweetDevRia.FileUpload.prototype.onDeleteFile=function(){}; SweetDevRia.Menu=function(id){if(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.Menu");this.items=[];this.itemsMap={};this.parentItem=null;this.parentMenu=this;}};extendsClass(SweetDevRia.Menu,SweetDevRia.RiaComponent);SweetDevRia.Menu.DELAY=500;SweetDevRia.Menu.prototype.beforeShowItem=function(itemId){return true;};SweetDevRia.Menu.prototype.afterShowItem=function(itemId){};SweetDevRia.Menu.prototype.beforeHide=function(){return true;};SweetDevRia.Menu.prototype.afterHide=function(){};SweetDevRia.Menu.prototype.beforeHideItem=function(itemId){return true;};SweetDevRia.Menu.prototype.afterHideItem=function(itemId){};SweetDevRia.Menu.SHOW_ITEM_EVENT="showItem";SweetDevRia.Menu.HIDE_ITEM_EVENT="hideItem";SweetDevRia.Menu.HIDE_EVENT="hide";SweetDevRia.Menu.prototype.initialize=function(){this.init();};SweetDevRia.Menu.prototype.init=function(){if(document.getElementById(this.id)){this.initItemsWithChildren();var maxZindex=SweetDevRia.DisplayManager.getInstance().topZIndex+2;this.initZIndexes(this.items,maxZindex);}};SweetDevRia.Menu.prototype.initZIndexes=function(items,zIndex){for(var i=0;i0;};SweetDevRia.Menu.prototype.isOpen=function(){var subItems=SweetDevRia.DomHelper.get(this.id+"_subItems");return this.hasItems()&&subItems&&subItems.style.display=="inline";};SweetDevRia.Menu.prototype.destroy=function(){if(this.view()){SweetDevRia.DomHelper.removeChild(this.view().parentNode,this.view().id);}};SweetDevRia.Menu.prototype.template="
        ${getItems()}
      ";SweetDevRia.MenuBar=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.MenuBar");superClass(this,SweetDevRia.Menu,id);this.isOpened=false;};extendsClass(SweetDevRia.MenuBar,SweetDevRia.RiaComponent,SweetDevRia.Menu);SweetDevRia.MenuBar.prototype.initialize=function(){this.init();};SweetDevRia.MenuBar.prototype.getItems=function(){var str="";for(var i=0;i ${label} {if hasItems() == true}
        ${getItems()}
      {/if}";SweetDevRia.MenuBar.prototype.template="
        ${getItems()}
      ";SweetDevRia.ContextMenu=function(id){superClass(this,SweetDevRia.Menu,id);this.containerId=this.id+"_container";this.str=null;this.targetId=null;};extendsClass(SweetDevRia.ContextMenu,SweetDevRia.RiaComponent,SweetDevRia.Menu);SweetDevRia.ContextMenu.prototype.beforeShow=function(e){return true;};SweetDevRia.ContextMenu.prototype.afterShow=function(){};SweetDevRia.ContextMenu.prototype.initFrame=function(){this.createFrame();if(!this.getFrame().isNude()){this.getFrame().contentId=this.id;this.getFrame().resizeMode=SweetDevRia.Frame.RESIZE_MODE_NONE;this.getFrame().borderMode=SweetDevRia.Frame.BORDER_MODE_ALL;this.getFrame().canDrag=false;this.getFrame().showBorderOnOver=false;SweetDevRia.init();}};SweetDevRia.ContextMenu.HIDE_EVENT="hide";SweetDevRia.ContextMenu.SHWO_EVENT="show";SweetDevRia.ContextMenu.prototype.initialize=function(){var menu=this;var target=document.getElementById(this.targetId);if(target){target.oncontextmenu=function(e){return menu.show(e);};} this.init();};SweetDevRia.ContextMenu.prototype.hide=function(){if(this.beforeHide()){var view=this.view();if(view){var lis=view.getElementsByTagName("LI");for(var i=0;i ${getItems()}";SweetDevRia.MenuItem=function(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.MenuItem");this.id=id;this.items=[];this.label="";};extendsClass(SweetDevRia.MenuItem,SweetDevRia.Menu);SweetDevRia.MenuItem.prototype.checkbox=false;SweetDevRia.MenuItem.prototype.checked=false;SweetDevRia.MenuItem.prototype.disabled=false;SweetDevRia.MenuItem.prototype.image=null;SweetDevRia.MenuItem.prototype.onclick=function(){};SweetDevRia.MenuItem.prototype.oncheck=function(){};SweetDevRia.MenuItem.prototype.onuncheck=function(){};SweetDevRia.MenuItem.prototype.beforeClick=function(e){return true;};SweetDevRia.MenuItem.prototype.afterClick=function(){};SweetDevRia.MenuItem.prototype.beforeSetDisabled=function(disabled){return true;};SweetDevRia.MenuItem.prototype.afterSetDisabled=function(){};SweetDevRia.MenuItem.prototype.beforeSetVisible=function(visible){return true;};SweetDevRia.MenuItem.prototype.afterSetVisible=function(){};SweetDevRia.MenuItem.prototype.beforeSetChecked=function(checked){return true;};SweetDevRia.MenuItem.prototype.afterSetChecked=function(){};SweetDevRia.MenuItem.prototype.beforeSetImage=function(image){return true;};SweetDevRia.MenuItem.prototype.afterSetImage=function(){};SweetDevRia.MenuItem.CLICK_EVENT="click";SweetDevRia.MenuItem.DISABLE_EVENT="disable";SweetDevRia.MenuItem.ENABLE_EVENT="enable";SweetDevRia.MenuItem.SHOW_EVENT="show";SweetDevRia.MenuItem.HIDE_EVENT="hide";SweetDevRia.MenuItem.CHECK_EVENT="check";SweetDevRia.MenuItem.UNCHECK_EVENT="uncheck";SweetDevRia.MenuItem.IMAGE_EVENT="image";SweetDevRia.MenuItem.prototype._onclick=function(e){if(this.beforeClick(e)){if(this.disabled){SweetDevRia.EventHelper.stopPropagation(e);return false;} if(!this.hasItems()){if(this.checkbox){this.setChecked(!this.checked);SweetDevRia.EventHelper.stopPropagation(e);return false;} this.onclick();if(this.parentMenu&&this.parentMenu.hide){this.parentMenu.hide();}} else{this.parentMenu.hasHover=false;this.parentMenu.hoverId=null;this.parentMenu.showSubItemsAction(this);} SweetDevRia.EventHelper.stopPropagation(e);this.fireEventListener(SweetDevRia.MenuItem.CLICK_EVENT,e);this.afterClick();return false;}};SweetDevRia.MenuItem.prototype.setDisabled=function(disabled){if(this.beforeSetDisabled(disabled)){this.disabled=disabled;if(this.disabled){this.view().style.color="gray";} else{this.view().style.color="";} if(disabled){this.fireEventListener(SweetDevRia.MenuItem.DISABLE_EVENT);} else{this.fireEventListener(SweetDevRia.MenuItem.ENABLE_EVENT);} this.afterSetDisabled();}};SweetDevRia.MenuItem.prototype.setChecked=function(checked){if(this.beforeSetChecked(checked)){this.checked=checked;if(this.checked){SweetDevRia.DomHelper.addClassName(this.iconView(),"ideo-mnu-check");/*@cc_on;SweetDevRia.DomHelper.addClassName(this.iconView(),"ideo-mnu-checkover");@*/this.oncheck();} else{SweetDevRia.DomHelper.removeClassName(this.iconView(),"ideo-mnu-check");/*@cc_on;SweetDevRia.DomHelper.removeClassName(this.iconView(),"ideo-mnu-checkover");@*/this.onuncheck();} if(checked){this.fireEventListener(SweetDevRia.MenuItem.CHECK_EVENT);} else{this.fireEventListener(SweetDevRia.MenuItem.UNCHECK_EVENT);} this.afterSetChecked();}};SweetDevRia.MenuItem.prototype.setImage=function(image){if(this.beforeSetImage(image)){this.image=image;this.iconView().style.backgroundImage="url("+this.image+")";this.fireEventListener(SweetDevRia.MenuItem.IMAGE_EVENT,image);this.afterSetImage();}};SweetDevRia.MenuItem.prototype.initialize=function(){if(this.image){this.iconView().style.backgroundImage="url("+this.image+")";}};SweetDevRia.MenuItem.prototype.setVisible=function(visible){if(this.beforeSetVisible(visible)){this.visible=visible;if(this.visible){this.view().style.display="inline";} else{this.view().style.display="none";} if(visible){this.fireEventListener(SweetDevRia.MenuItem.SHOW_EVENT);} else{this.fireEventListener(SweetDevRia.MenuItem.HIDE_EVENT);} this.afterSetVisible();}};SweetDevRia.MenuItem.prototype.destroy=function(){};SweetDevRia.MenuItem.prototype.template="
    • ${label} {if hasItems() == true}
       
        ${getItems()}
      {/if}
    • ";SweetDevRia.MenuItem.updateZindex=function(id){var menu=SweetDevRia.$(id);};function menubar_ieHover(id){SweetDevRia.MenuItem.updateZindex(id);} SweetDevRia.Suggest=function(id,preselectedValue,itemPerPage,triggerLength,filterMode,bufferSize,multiSelect,multiField,caseSensitive,stackSelection,forceSelection,paginable,maxPopupHeight){if(id){superClass(this,SweetDevRia.RiaComponent,id,"SweetDevRia.Suggest");this.preselectedValue=preselectedValue;this.itemPerPage=itemPerPage;this.triggerLength=triggerLength;this.filterMode=filterMode;this.bufferSize=bufferSize;this.multiSelect=multiSelect;this.multiField=multiField;this.caseSensitive=caseSensitive;this.stackSelection=stackSelection;this.forceSelection=forceSelection;this.paginable=paginable;this.data=null;this.buffer=new SweetDevRia.SuggestBuffer(this,bufferSize);this.viewManager=new SweetDevRia.SuggestItemViewManager();this.highlightenedItem;this.selectedItemsIds=[];this.selectedItemsModels={};this.selectedIdsInputAssociation=[];this.isRetrievingValue=false;this.viewMode=SweetDevRia.Suggest.SUGGEST_MODE;this.buttonState=new Array();this.buttonState.push("ideo-sug-buttonOut");if(paginable){this.createPageBar();} this.disabledIds=[];this.hiddenIds=[];this.enable=null;this.enabledInput=true;this.visible=true;this.renderFrame=false;this.preload=false;if(maxPopupHeight){this.maxPopupHeight=maxPopupHeight;}else{this.maxPopupHeight=SweetDevRia.Suggest.DEFAULT_POPUP_MAX_HEIGHT;}}};SweetDevRia.Suggest.prototype=new SweetDevRia.RiaComponent;SweetDevRia.Suggest.POPUP_BORDERS_SIZE=2;SweetDevRia.Suggest.DEFAULT_POPUP_MAX_HEIGHT=0;SweetDevRia.Suggest.STARTSWITH=0;SweetDevRia.Suggest.CONTAINS=1;SweetDevRia.Suggest.ENDSWITH=2;SweetDevRia.Suggest.REGEXP=3;SweetDevRia.Suggest.SIMPLE_REGEXP=4;SweetDevRia.Suggest.CUSTOM=5;SweetDevRia.Suggest.SUGGEST_MODE=0;SweetDevRia.Suggest.SELECTION_MODE=1;SweetDevRia.Suggest.SEPARATOR=";";SweetDevRia.Suggest.PAGEBAR_NUMBER=3;SweetDevRia.Suggest.prototype.beforeRestoreInputValue=function(){return true;};SweetDevRia.Suggest.prototype.afterRestoreInputValue=function(){};SweetDevRia.Suggest.prototype.beforeUpdateSelectionOnBlur=function(){return true;};SweetDevRia.Suggest.prototype.afterUpdateSelectionOnBlur=function(){};SweetDevRia.Suggest.prototype.beforeUpdateInputRender=function(){return true;};SweetDevRia.Suggest.prototype.afterUpdateInputRender=function(){};SweetDevRia.Suggest.prototype.beforeClearHTMLItems=function(){return true;};SweetDevRia.Suggest.prototype.afterClearHTMLItems=function(){};SweetDevRia.Suggest.prototype.beforeHighlightItem=function(item){return true;};SweetDevRia.Suggest.prototype.afterHighlightItem=function(item){};SweetDevRia.Suggest.prototype.beforeUnhighlightItem=function(item){return true;};SweetDevRia.Suggest.prototype.afterUnhighlightItem=function(item){};SweetDevRia.Suggest.prototype.beforeDrawSelectedValues=function(){return true;};SweetDevRia.Suggest.prototype.afterDrawSelectedValues=function(){};SweetDevRia.Suggest.prototype.beforeDrawHeader=function(){return true;};SweetDevRia.Suggest.prototype.afterDrawHeader=function(){};SweetDevRia.Suggest.prototype.beforeDrawFooter=function(){return true;};SweetDevRia.Suggest.prototype.afterDrawFooter=function(){};SweetDevRia.Suggest.prototype.beforeShowSuggestPopup=function(){return true;};SweetDevRia.Suggest.prototype.afterShowSuggestPopup=function(){};SweetDevRia.Suggest.prototype.beforeHideSuggestPopup=function(){return true;};SweetDevRia.Suggest.prototype.afterHideSuggestPopup=function(){};SweetDevRia.Suggest.prototype.beforeOnSwitchViewModeAction=function(){return true;};SweetDevRia.Suggest.prototype.afterOnSwitchViewModeAction=function(){};SweetDevRia.Suggest.prototype.beforeSwitchViewMode=function(viewMode){return true;};SweetDevRia.Suggest.prototype.afterSwitchViewMode=function(viewMode){};SweetDevRia.Suggest.prototype.beforeSwitchSuggestPopupVisibility=function(){return true;};SweetDevRia.Suggest.prototype.afterSwitchSuggestPopupVisibility=function(){};SweetDevRia.Suggest.prototype.beforeProcessInputValue=function(newInputValue,pageNumber){return true;};SweetDevRia.Suggest.prototype.afterProcessInputValue=function(newInputValue,pageNumber){};SweetDevRia.Suggest.prototype.beforeUpdateSelection=function(newInputValue){return true;};SweetDevRia.Suggest.prototype.afterUpdateSelection=function(newInputValue){};SweetDevRia.Suggest.prototype.beforeOnInputKeyStroke=function(evt){return true;};SweetDevRia.Suggest.prototype.afterOnInputKeyStroke=function(evt){};SweetDevRia.Suggest.prototype.beforeOnItemKeyStroke=function(evt,item){return true;};SweetDevRia.Suggest.prototype.afterOnItemKeyStroke=function(evt,item){};SweetDevRia.Suggest.prototype.beforeOnSwitchItemSelectionAction=function(item){return true;};SweetDevRia.Suggest.prototype.afterOnSwitchItemSelectionAction=function(item){};SweetDevRia.Suggest.prototype.beforeUpdateClass=function(item){return true;};SweetDevRia.Suggest.prototype.afterUpdateClass=function(item){};SweetDevRia.Suggest.prototype.beforeRetrieveValues=function(value,pageNumber){return true;};SweetDevRia.Suggest.prototype.afterRetrieveValues=function(value,pageNumber){};SweetDevRia.Suggest.prototype.beforeOnRetrieveValues=function(evt){return true;};SweetDevRia.Suggest.prototype.afterOnRetrieveValues=function(evt){};SweetDevRia.Suggest.prototype.beforeRenderButton=function(){return true;};SweetDevRia.Suggest.prototype.afterRenderButton=function(){};SweetDevRia.Suggest.prototype.getHeaderHtmlCode=function(){return null;};SweetDevRia.Suggest.prototype.getItemHtmlCode=function(item){return item.value;};SweetDevRia.Suggest.prototype.getFooterHtmlCode=function(){if(this.multiSelect){return"
      ";} else{return"";}};SweetDevRia.Suggest.prototype.onSelect=function(){};SweetDevRia.Suggest.prototype.onUnSelect=function(){};SweetDevRia.Suggest.prototype.initialize=function(){if(!browser.isIE){var center=document.getElementById(this.id+"_center");SweetDevRia.DomHelper.addClassName(center,"ideo-but-center-FF");var right=document.getElementById(this.id+"_right");SweetDevRia.DomHelper.addClassName(right,"ideo-but-right-FF");} this.setEnable(this.initenable,true);this.setVisible(this.initvisible,true);if(this.initenable==true){this.setInputEnable(this.initenabledInput);} this.afterInitialize();};SweetDevRia.Suggest.prototype.afterInitialize=function(){};SweetDevRia.Suggest.prototype.getHeaderSelectionLink=function(){var linkLabel="";switch(this.getViewMode()){case SweetDevRia.Suggest.SUGGEST_MODE:linkLabel=this.i18n.showSelectionButton;break;case SweetDevRia.Suggest.SELECTION_MODE:linkLabel=this.i18n.showSuggestionButton;break;default:throw("CurrentViewModeException : the viewMode :"+this.getViewMode()+" is not available.");} return""+linkLabel+"";};SweetDevRia.Suggest.prototype.getMultiSelectInputRender=function(){return this.getSelectedItemsNumber()+" items selected";};SweetDevRia.Suggest.prototype.getSingleSelectInputRender=function(){return this.getSingleSelectedItem().value;};SweetDevRia.Suggest.prototype.createPageBar=function(){this.pageBar=new SweetDevRia.PageBar(this.id+"_pageBar");this.pageBar.visiblePageNumber=SweetDevRia.Suggest.PAGEBAR_NUMBER;var suggest=this;this.pageBar.afterSetPageNumber=function(pageNumber){var input=suggest.getInput();input.focus();};};SweetDevRia.Suggest.prototype.getPageBarId=function(){if(this.paginable){return this.pageBar.id+"_container";} return null;};SweetDevRia.Suggest.prototype.getPageBarWrapId=function(){if(this.pageBar){return this.pageBar.id+"_wrap";} return null;};SweetDevRia.Suggest.prototype.showPageBar=function(actualPage,totalPageNumber){if(this.paginable){this.pageBar.setPageNumber(totalPageNumber);this.pageBar.setActualPage(actualPage);this.pageBar.setLinkedId(this.id);this.pageBar.render();SweetDevRia.DomHelper.show(this.getPageBarWrapId());this.pageBar.ajustContainerWidth();this.resizePopupHeight();this.resizePopupWidth();}};SweetDevRia.Suggest.prototype.hidePageBar=function(){if(this.paginable){SweetDevRia.DomHelper.hide(this.getPageBarWrapId());this.resizePopupHeight();this.resizePopupWidth();}};SweetDevRia.Suggest.prototype.goToPage=function(pageNumber){this.pageBar.ajustContainerWidth();if(this.preload){this.data.pageNumber=pageNumber;this.processData(this.data);} else{this.processInputValue(this.data.inputValue,pageNumber);}};SweetDevRia.Suggest.prototype.restoreInputValue=function(){if(this.toBlur){window.clearTimeout(this.toBlur);this.toBlur=null;return;} if(this.beforeRestoreInputValue()){if(!this.multiSelect){return;} if(!this.multiSelect&&this.getSelectedItemsNumber()==1){this.updateInputRender();}else{if(!this.data){return;}else{this.getInput().value=this.data.inputValue;var position=this.data.inputValue.length;SweetDevRia.DomHelper.setSelectionRange(this.getInput(),position,position);}} this.afterRestoreInputValue();}};SweetDevRia.Suggest.prototype.updateSelectionOnBlur=function(){if(!this.toBlur){this.toBlur=window.setTimeout("SweetDevRia.$('"+this.id+"').updateSelectionOnBlur()",50);return;} else{this.toBlur=null;} if(this.beforeUpdateSelectionOnBlur()){if(!this.multiSelect){var val=this.getInputValue();if(this.getSelectedItemsNumber()!=0){var itemSelected=this.getSingleSelectedItem();if(itemSelected&&itemSelected.value!=val){this.switchItemSelection({"value":val,"id":"","information":null},true);}}else{this.switchItemSelection({"value":val,"id":"","information":null},true);}} this.updateInputRender();this.afterUpdateSelectionOnBlur();}};SweetDevRia.Suggest.prototype.updateInputRender=function(){if(this.beforeUpdateInputRender()){var input=this.getInput();if(!this.multiSelect){if(this.getSelectedItemsNumber()!=0){if(this.getSingleSelectedItem()&&this.getSingleSelectedItem().id!=""){input.value=this.getSingleSelectInputRender();} else if(this.forceSelection){input.value="";this.selectedItemsIds=[];}} else{null;}}else{input.value=this.getMultiSelectInputRender();} this.afterUpdateInputRender();}};SweetDevRia.Suggest.prototype.clearHTMLItems=function(){if(this.beforeClearHTMLItems()){var suggestUl=this.getItemsList();suggestUl.innerHTML="";suggestUl.style.width="";suggestUl.style.height="";var popupOptionDiv=SweetDevRia.DomHelper.get(this.id+"_suggestDiv");popupOptionDiv.style.width="";popupOptionDiv.style.height="";this.highlightenedItem=null;SweetDevRia.DomHelper.hide(this.id+"_suggest");this.hidePageBar();this.viewManager.reset();this.afterClearHTMLItems();}};SweetDevRia.Suggest.prototype.highlightItem=function(item){if(this.beforeHighlightItem(item)){if(!this.viewManager.containsItem(item)){return;} var a=SweetDevRia.DomHelper.get(this.viewManager.getViewForItem(item));if(a){if(this.highlightenedItem!=null){this.unhighlightItem(this.highlightenedItem);} this.highlightenedItem=item;this.updateClass(item);if(!this.multiSelect){var input=this.getInput();input.value=item.value;input.focus();} else{a.focus();}} this.afterHighlightItem(item);}};SweetDevRia.Suggest.prototype.unhighlightItem=function(item){if(this.beforeUnhighlightItem(item)){var a=SweetDevRia.DomHelper.get(this.viewManager.getViewForItem(item));if(a){this.highlightenedItem=null;if(!this.multiSelect){a.focus();} this.updateClass(item);} this.afterUnhighlightItem(item);}};SweetDevRia.Suggest.prototype.createHTMLItem=function(item,index){var ul=this.getItemsList();var li=document.createElement("li");var a=document.createElement("a");var aId=this.getHTMLId(index);a.setAttribute("id",aId);a.setAttribute("href","#");a.setAttribute("onclick","return false;");this.viewManager.add(item,aId);SweetDevRia.DomHelper.addClassName(a,"ideo-sug-item");SweetDevRia.DomHelper.addClassName(li,"ideo-sug-enabledItem");li.appendChild(a);a.innerHTML=this.getItemHtmlCode(item);ul.appendChild(li);SweetDevRia.EventHelper.addListener(a,"click",this.callSwitchItemSelectionAction,this);SweetDevRia.EventHelper.addListener(a,"keyup",this.callItemKeyStroke,this);SweetDevRia.DomHelper.show(this.id+"_suggest");this.updateClass(item);};SweetDevRia.Suggest.prototype.setHTMLItems=function(items){this.clearHTMLItems();this.drawHeader();this.viewManager.reset();if(items&&items.length>0){var start=0;var end=items.length;if(this.paginable){start=(this.data.pageNumber-1)*this.itemPerPage;start=0;end=Math.min(start+this.itemPerPage,items.length);} for(var i=start;i0)||(this.getViewMode()==SweetDevRia.Suggest.SELECTION_MODE)){finalHeaderHtmlCode=finalHeaderHtmlCode+this.getHeaderSelectionLink();}} if(finalHeaderHtmlCode!=""){header.innerHTML=finalHeaderHtmlCode;SweetDevRia.DomHelper.show(header.id);} else{if(header){SweetDevRia.DomHelper.hide(header.id);}} this.afterDrawHeader();}};SweetDevRia.Suggest.prototype.drawFooter=function(){if(this.beforeDrawFooter()){var footer=this.getFooter();if(footer){var footerHtmlCode=this.getFooterHtmlCode();if(footerHtmlCode!=null){footer.innerHTML=footerHtmlCode;SweetDevRia.DomHelper.show(footer.id);} else{SweetDevRia.DomHelper.hide(footer.id);}} this.afterDrawFooter();}};SweetDevRia.Suggest.prototype.itemsAreVisible=function(){if(!this.getSuggestPopup()){return false;} return SweetDevRia.DomHelper.isVisible(this.getSuggestPopup().id);};SweetDevRia.Suggest.prototype.showSuggestPopup=function(){if(this.beforeShowSuggestPopup()){var popup=this.getSuggestPopup();document.body.appendChild(popup);popup.style.zIndex=SweetDevRia.DisplayManager.prototype._getMaxZindex();if(!this.itemsAreVisible()){var input=this.getInput();if(this.data&&this.data.inputValue){input.value=this.data.inputValue;} popup.style.zIndex=SweetDevRia.DisplayManager.getInstance().getTopZIndex(true);SweetDevRia.LayoutManager.changeSelectVisibility(document,false);this.resizePopupWidth();this.resizePopupHeight();this.setPopupPosition();SweetDevRia.LayoutManager.addMaskIFrame(this.id+"_iframe",popup);SweetDevRia.DomHelper.hide(popup.id);popup._suggestId=this.id;SweetDevRia.DomHelper.verticalShow(popup,0.2,function(){SweetDevRia.$(popup._suggestId).resizePopupHeight();SweetDevRia.$(popup._suggestId).resizePopupWidth();SweetDevRia.$(popup._suggestId).setPopupPosition();});this.setButtonClassName("ideo-sug-buttonDown");} if(this.getSelectedItemsNumber()<=0&&this.viewManager.length()<=0){this.getHeader().innerHTML=this.i18n.nothingToDisplay;SweetDevRia.DomHelper.show(this.getHeader().id);SweetDevRia.DomHelper.hide(this.id+"_suggest");} else{SweetDevRia.DomHelper.show(this.id+"_suggest");} this.drawHeader();this.drawFooter();SweetDevRia.DomHelper.setStyle(popup,"visibility","visible");this.afterShowSuggestPopup();}};SweetDevRia.Suggest.prototype.setPopupPosition=function(){var aLink=SweetDevRia.DomHelper.get(this.id+"_mainA");var frame=this.getSuggestPopup();SweetDevRia.DomHelper.show(frame.id);var tooltipWidth=parseInt(SweetDevRia.DomHelper.getWidth(frame),10);var tooltipHeight=parseInt(SweetDevRia.DomHelper.getHeight(frame),10);if(this.maxPopupHeight>0&&tooltipHeight>this.maxPopupHeight){tooltipHeight=this.maxPopupHeight;} var top=parseInt(SweetDevRia.DomHelper.getY(aLink),10);var left=parseInt(SweetDevRia.DomHelper.getX(aLink),10);var topScroll=top-SweetDevRia.DomHelper.getScrolledTop();var leftScroll=left-SweetDevRia.DomHelper.getScrolledLeft();var frameWidth=YAHOO.util.Dom.getClientWidth();var frameHeight=YAHOO.util.Dom.getClientHeight();var offsetRight=frameWidth-(leftScroll+tooltipWidth),offsetLeft=(leftScroll+aLink.offsetWidth-tooltipWidth),offsetBottom=frameHeight-(topScroll+aLink.offsetHeight+tooltipHeight),offsetTop=(topScroll-tooltipHeight);if(offsetRight>0){null;} else if(offsetLeft>offsetRight){left-=tooltipWidth-aLink.scrollWidth;} if(offsetBottom>0){top+=aLink.scrollHeight+2;}else if(offsetTop>offsetBottom){top-=tooltipHeight;}else{top+=aLink.scrollHeight+2;} SweetDevRia.DomHelper.setY(frame,top);SweetDevRia.DomHelper.setX(frame,left);};SweetDevRia.Suggest.prototype.resizePopupWidth=function(){var popup=this.getSuggestPopup();var mainA=SweetDevRia.DomHelper.get(this.id+"_mainA");var pageBar=SweetDevRia.DomHelper.get(this.id+"_pageBar_button");var size=SweetDevRia.DomHelper.getWidth(mainA);var selectUL=SweetDevRia.DomHelper.get(this.id+"_suggest");var selectLIs=selectUL.getElementsByTagName("li");if(selectLIs&&selectLIs.length){for(i=0;i0)&&(totalPopupHeight>this.maxPopupHeight)){var newPopupHeight=popupOptionHeigth-(totalPopupHeight-this.maxPopupHeight);SweetDevRia.DomHelper.setStyle(popupOptionDiv,"height",newPopupHeight+"px");SweetDevRia.DomHelper.setStyle(popupOptionDiv,"overflow","auto");totalPopupHeight=this.maxPopupHeight;}else{SweetDevRia.DomHelper.setStyle(popupOptionDiv,"height",popupOptionHeigth+"px");SweetDevRia.DomHelper.setStyle(popupOptionDiv,"overflow","visible");} SweetDevRia.DomHelper.setStyle(popup,"height",(totalPopupHeight+(SweetDevRia.Suggest.POPUP_BORDERS_SIZE*2))+"px");if(popup_iframe){SweetDevRia.DomHelper.setStyle(popup_iframe,"height",(totalPopupHeight+(SweetDevRia.Suggest.POPUP_BORDERS_SIZE*2))+"px");} popup.style.opacity="1.0";popup.style.filter="alpha( opacity = 100 )";};SweetDevRia.Suggest.prototype.closePopup=function(originalTarget){if(!SweetDevRia.DomHelper.hasAncestor(originalTarget,this.id+"_container")){this.hideSuggestPopup();}};SweetDevRia.Suggest.prototype.hideSuggestPopup=function(){if(this.beforeHideSuggestPopup()){if(this.itemsAreVisible()){var popup=this.getSuggestPopup();var suggest=this;SweetDevRia.DomHelper.verticalHide(popup,0.2,function(){SweetDevRia.LayoutManager.changeSelectVisibility(document,true);SweetDevRia.LayoutManager.removeTransparentIFrame(suggest.id+"_iframe",popup);});if(this.getInput().disabled){this.updateInputRender();} this.removeButtonClassName("ideo-sug-buttonDown");} this.afterHideSuggestPopup();}};SweetDevRia.Suggest.prototype.onSwitchViewModeAction=function(event){if(this.beforeOnSwitchViewModeAction()){var toViewMode;switch(this.getViewMode()){case SweetDevRia.Suggest.SUGGEST_MODE:toViewMode=SweetDevRia.Suggest.SELECTION_MODE;break;case SweetDevRia.Suggest.SELECTION_MODE:toViewMode=SweetDevRia.Suggest.SUGGEST_MODE;break;default:throw("CurrentViewModeException : the viewMode :"+this.getViewMode()+" is not available.");} this.switchViewMode(toViewMode);this.afterOnSwitchViewModeAction();} if(event){SweetDevRia.EventHelper.stopPropagation(event);SweetDevRia.EventHelper.preventDefault(event);}};SweetDevRia.Suggest.prototype.switchViewMode=function(viewMode){if(this.beforeSwitchViewMode(viewMode)){this.viewMode=viewMode;switch(this.getViewMode()){case SweetDevRia.Suggest.SUGGEST_MODE:this.processData(this.data);break;case SweetDevRia.Suggest.SELECTION_MODE:this.drawSelectedValues();break;default:throw("CurrentViewModeException : the viewMode :"+this.getViewMode()+" is not available.");} this.resizePopupHeight();this.setPopupPosition();this.afterSwitchViewMode(viewMode);}};SweetDevRia.Suggest.prototype.switchSuggestPopupVisibility=function(event,suggest){if(suggest.beforeSwitchSuggestPopupVisibility()){if(!suggest.itemsAreVisible()){suggest.showSuggestPopup();}else{suggest.hideSuggestPopup();} if(event){SweetDevRia.EventHelper.stopPropagation(event);SweetDevRia.EventHelper.preventDefault(event);} suggest.afterSwitchSuggestPopupVisibility();}};SweetDevRia.Suggest.createSuggestData=function(inputValue,items,truncated,pageNumber){if(!pageNumber){pageNumber=1;} return{"inputValue":inputValue,"items":items,"truncated":truncated,"pageNumber":pageNumber};};SweetDevRia.Suggest.prototype.processInputValue=function(newInputValue,pageNumber){if(this.beforeProcessInputValue(newInputValue,pageNumber)){var newSuggestData=null;if(this.isRetrievingValue){SweetDevRia.log.debug("Multiple Ajax request avoided, retrieving has been aborted.");this.resizePopupHeight();this.resizePopupWidth();return;} if(newInputValue.length0){if(autoShowItems&&suggestData.items.length>0){this.showSuggestPopup();}} else{this.hideSuggestPopup();} if(this.paginable==true){if((suggestData.truncated==true)||(suggestData.pageNumber!=1)){this.showPageBar(suggestData.pageNumber,Math.ceil(suggestData.totalItemNumber/this.itemPerPage));}else{this.hidePageBar();}}}else{this.clearHTMLItems();this.hideSuggestPopup();} this.resizePopupHeight();this.resizePopupWidth();this.updateSelection((suggestData)?suggestData.inputValue:"");};SweetDevRia.Suggest.prototype.updateSelection=function(newInputValue){if(this.beforeUpdateSelection(newInputValue)){if(this.stackSelection){return;} if(!this.caseSensitive){newInputValue=newInputValue.toLowerCase();} for(var i=0;i0){var item=this.viewManager.getItemAt(0);if(this.highlightenedItem){var oldIndex=this.viewManager.getItemIndex(this.highlightenedItem.id);if(oldIndex0){var item=this.viewManager.getItemAt(this.data.items.length-1);if(this.highlightenedItem){var oldIndex=this.viewManager.getItemIndex(this.highlightenedItem.id);var oldIndex=this.viewManager.getItemIndex(this.highlightenedItem.id);if(oldIndex>0){item=this.viewManager.getItemAt(oldIndex-1);} else if(oldIndex==0){item=null;}} if(item!=null){this.highlightItem(item);} else{if(this.highlightenedItem!=null){this.unhighlightItem(this.highlightenedItem);} var input=this.getInput();input.value=this.data.inputValue;input.focus();}}}} else if(evt.keyCode!=SweetDevRia.KeyListener.ARROW_LEFT_KEY&&evt.keyCode!=SweetDevRia.KeyListener.ARROW_RIGHT_KEY&&evt.keyCode!=SweetDevRia.KeyListener.ARROW_HOME_KEY&&evt.keyCode!=SweetDevRia.KeyListener.ARROW_END_KEY){var inputValue=evt.src.value;if(!this.data||!this.testEquality(this.data.inputValue,inputValue)){this.processInputValue(inputValue);}} this.afterOnInputKeyStroke(evt);}};SweetDevRia.Suggest.prototype.callItemKeyStroke=function(evt,suggest){var itemId=suggest.viewManager.getItemIdForA(this.id);var item=suggest.viewManager.getItem(itemId);return suggest.onItemKeyStroke(evt,item);};SweetDevRia.Suggest.prototype.onItemKeyStroke=function(evt,item){evt=SweetDevRia.EventHelper.getEvent(evt);if(this.beforeOnItemKeyStroke(evt,item)){if(evt.keyCode==SweetDevRia.KeyListener.ESCAPE_KEY){this.hideSuggestPopup();} else{var aId=evt.src.id;var nb=this.extractHTMLIndex(aId);if(nb>=0){if(evt.keyCode==SweetDevRia.KeyListener.ARROW_DOWN_KEY){if(nb==this.data.items.length-1){null;} else{nb++;var newItem=this.viewManager.getItemAt(nb);while(newItem&&(this.viewManager.isDisabledItem(newItem)||this.viewManager.isHiddenItem(newItem))){newItem=this.viewManager.getItemAt(++nb);} if(newItem){this.highlightItem(newItem);}}} else if(evt.keyCode==SweetDevRia.KeyListener.ARROW_UP_KEY){if(nb==0){this.unhighlightItem(this.viewManager.getItemAt(0));this.getInput().focus();} else{nb--;var newItem=this.viewManager.getItemAt(nb);while(newItem&&(this.viewManager.isDisabledItem(newItem)||this.viewManager.isHiddenItem(newItem))){newItem=this.viewManager.getItemAt(--nb);} if(newItem){this.highlightItem(newItem);}}}}} this.afterOnItemKeyStroke(evt,item);} return false;};SweetDevRia.Suggest.prototype.getSelectedItemsNumber=function(){return this.selectedItemsIds.length;};SweetDevRia.Suggest.prototype.isItemSelected=function(item){if(!item||item.id==""){return false;} return this.selectedItemsIds.contains(item.id);};SweetDevRia.Suggest.prototype.addIdToSelection=function(item){this.selectedItemsIds.push(item.id);this.selectedItemsModels[item.id]=item;};SweetDevRia.Suggest.prototype.removeIdFromSelection=function(item){this.selectedItemsIds.remove(item.id);this.selectedItemsModels[item.id]=null;};SweetDevRia.Suggest.prototype.addItemToSelection=function(item){this.addIdToSelection(item);this.addInputToSelection(item);};SweetDevRia.Suggest.prototype.removeItemFromSelection=function(item){this.removeIdFromSelection(item);this.removeInputFromSelection(item);};SweetDevRia.Suggest.prototype.setItemSelected=function(item){if(!this.isItemSelected(item)){this.switchItemSelection(this.getSelectedItemFromId(item.id),true);}};SweetDevRia.Suggest.prototype.setItemUnselected=function(item){if(this.isItemSelected(item)){this.switchItemSelection(this.getSelectedItemFromId(item.id),true);}};SweetDevRia.Suggest.prototype.setItemEnableByIndex=function(itemIndex,enable){var item=this.viewManager.getItemAt(itemIndex);if(item){this.setItemEnable(item.id,enable);}};SweetDevRia.Suggest.prototype.setItemVisibleByIndex=function(itemIndex,visible){var item=this.viewManager.getItemAt(itemIndex);if(item){this.setItemVisible(item.id,visible);}};SweetDevRia.Suggest.prototype.setItemEnable=function(itemId,enable){var item=this.getViewManager().getItem(itemId);if(item){var itemViewId=this.viewManager.getViewForItem(item);if(itemViewId){var itemView=document.getElementById(itemViewId);if(!enable){if(this.viewManager.isDisabledItem(item)){return;} if(this.isItemSelected(item)){this.removeItemFromSelection(item);this.updateClass(item);this.updateInputRender();} SweetDevRia.EventHelper.removeListener(itemView,"click",this.callSwitchItemSelectionAction);SweetDevRia.EventHelper.removeListener(itemView,"keyup",this.callItemKeyStroke);SweetDevRia.DomHelper.addClassName(itemView.parentNode,"ideo-sug-disabledItem");SweetDevRia.DomHelper.removeClassName(itemView.parentNode,"ideo-sug-enabledItem");if(!this.disabledIds.contains(itemId)){this.disabledIds.add(itemId);}} else{if(!this.disabledIds.contains(itemId)){return;} SweetDevRia.EventHelper.addListener(itemView,"click",this.callSwitchItemSelectionAction,this);SweetDevRia.EventHelper.addListener(itemView,"keyup",this.callItemKeyStroke,this);SweetDevRia.DomHelper.addClassName(itemView.parentNode,"ideo-sug-enabledItem");SweetDevRia.DomHelper.removeClassName(itemView.parentNode,"ideo-sug-disabledItem");this.disabledIds.remove(itemId);} var params={"enabled":enable,"itemId":itemId};var riaEvent=new SweetDevRia.RiaEvent("enableItem",this.id,params);SweetDevRia.ComHelper.stackEvent(riaEvent);}}};SweetDevRia.Suggest.prototype.setItemVisible=function(itemId,visible){var item=this.getViewManager().getItem(itemId);if(item){var itemViewId=this.viewManager.getViewForItem(item);if(itemViewId){var itemView=document.getElementById(itemViewId);if(!visible){if(SweetDevRia.DomHelper.hasClassName(itemView.parentNode,"ideo-sug-hiddenItem")){return;} if(this.isItemSelected(item)){this.removeItemFromSelection(item);this.updateClass(item);this.updateInputRender();} if(!this.hiddenIds.contains(itemId)){this.hiddenIds.add(itemId);} SweetDevRia.DomHelper.addClassName(itemView.parentNode,"ideo-sug-hiddenItem");} else{if(!SweetDevRia.DomHelper.hasClassName(itemView.parentNode,"ideo-sug-hiddenItem")){return;} this.hiddenIds.remove(itemId);SweetDevRia.DomHelper.removeClassName(itemView.parentNode,"ideo-sug-hiddenItem");} var params={"visible":visible,"itemId":itemId};var riaEvent=new SweetDevRia.RiaEvent("showItem",this.id,params);SweetDevRia.ComHelper.stackEvent(riaEvent);}}};SweetDevRia.Suggest.prototype.unselectAll=function(){while(this.selectedItemsIds.length>0){this.switchItemSelection(this.getSelectedItemFromId(this.selectedItemsIds[0]),true);}};SweetDevRia.Suggest.prototype.callSwitchItemSelectionAction=function(evt,suggest){var itemId=suggest.viewManager.getItemIdForA(this.id);var item=suggest.viewManager.getItem(itemId);if(evt){SweetDevRia.EventHelper.stopPropagation(evt);SweetDevRia.EventHelper.preventDefault(evt);} return suggest.onSwitchItemSelectionAction(item);};SweetDevRia.Suggest.prototype.onSwitchItemSelectionAction=function(item,keepOpen){if(this.beforeOnSwitchItemSelectionAction(item)){var selected=this.switchItemSelection(item,keepOpen);if(selected){this.onSelect(item);} else{this.onUnSelect(item);} this.afterOnSwitchItemSelectionAction(item);} return false;};SweetDevRia.Suggest.prototype.switchItemSelection=function(item,keepOpen,keepFocus){if(this.isItemSelected(item)){if(!this.multiSelect){return null;} this.removeItemFromSelection(item);} else{if(!this.multiSelect){if(this.getSelectedItemsNumber()==1){this.removeItemFromSelection(this.getSingleSelectedItem());}} this.addItemToSelection(item);if(!this.multiSelect&&!keepOpen){this.hideSuggestPopup();}} if(this.viewManager.containsItem(item)){this.updateClass(item);} if(!keepFocus){this.updateInputRender();} if(this.multiSelect){this.drawHeader();this.drawFooter();} return this.isItemSelected(item);};SweetDevRia.Suggest.prototype.updateClass=function(item){if(this.beforeUpdateClass(item)){var aId=this.viewManager.getViewForItem(item);if(!aId){return;} var a=SweetDevRia.DomHelper.get(aId);if(!a){return;} if(this.multiSelect){if(this.isItemSelected(item)){SweetDevRia.DomHelper.removeClassName(a,"ideo-sug-unselectedItem");SweetDevRia.DomHelper.addClassName(a,"ideo-sug-selectedItem");}else{SweetDevRia.DomHelper.removeClassName(a,"ideo-sug-selectedItem");SweetDevRia.DomHelper.addClassName(a,"ideo-sug-unselectedItem");}} else{SweetDevRia.DomHelper.removeClassName(a,"ideo-sug-selectedItem");SweetDevRia.DomHelper.addClassName(a,"ideo-sug-unselectedItem");} if(this.highlightenedItem&&this.highlightenedItem.id==item.id){SweetDevRia.DomHelper.addClassName(a,"ideo-sug-highlightenedItem");} else{SweetDevRia.DomHelper.removeClassName(a,"ideo-sug-highlightenedItem");} this.afterUpdateClass(item);}};SweetDevRia.Suggest.prototype.getServerModelUpdate=function(){var params={};params["filterMode"]=this.filterMode;params["stackSelection"]=this.stackSelection;var selectedModels=new Array();for(var m in this.selectedItemsModels){if(this.selectedItemsModels[m]!=null){selectedModels.push(this.selectedItemsModels[m]);}} params["selectedItemModels"]=selectedModels;params["caseSensitive"]=this.caseSensitive;return params;};SweetDevRia.Suggest.prototype.retrieveValues=function(value,pageNumber){if(this.beforeRetrieveValues(value,pageNumber)){this.isRetrievingValue=true;if(!pageNumber){pageNumber=1;} var params={};params["updateModel"]=this.getServerModelUpdate();params["value"]=value;params["pageNumber"]=pageNumber;this.setButtonClassName("ideo-sug-buttonLoading");SweetDevRia.ComHelper.fireEvent(new SweetDevRia.RiaEvent("retrieveValues",this.id,params));this.afterRetrieveValues(value,pageNumber);}};SweetDevRia.Suggest.prototype.onRetrieveValues=function(evt){if(this.beforeOnRetrieveValues(evt)){this.removeButtonClassName("ideo-sug-buttonLoading");this.updateItemsSpecificities(evt.data.items);this.processData(evt.data,true);this.isRetrievingValue=false;this.afterOnRetrieveValues(evt);}};SweetDevRia.Suggest.prototype.updateItemsSpecificities=function(items){if(items&&items.length>0){for(var i=0;i
      "; SweetDevRia.WindowDocking=function(id){this.columns=[];this.spliters=[];this.windowIds=[];superClass(this,SweetDevRia.RiaComponent,id,SweetDevRia.Window.prototype.className);};extendsClass(SweetDevRia.WindowDocking,SweetDevRia.RiaComponent);SweetDevRia.WindowDocking.prototype.className="SweetDevRia.WindowDocking";SweetDevRia.WindowDocking.prototype.refreshWindowsBorders=function(){for(var j=0;j