YAHOO.namespace("protoscript");YAHOO.protoscript.Behaviors=[{name:'Timer',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Click',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Blur',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Dblclick',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Focus',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Keydown',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Keypress',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Keyup',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Keydown',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Mousedown',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Mousemove',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Mouseover',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Mouseout',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Mouseup',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Resize',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'ToggleOpenClose',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'ToggleClass',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Fade',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Move',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Close',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Resize',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Animate',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Spotlight',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'SetClass',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'SetStyle',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'ReplaceClass',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Hide',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Show',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Script',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'ToggleShowHide',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Open',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'InnerHtml',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'FetchHtml',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'Popup',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]},{name:'DragDrop',attributes:[{name:'attr1',default:'val',type:'type'}],callbacks:[{name:'callback1'}]}];YAHOO.protoscript.Util=function(){return{handleAnimMoments:function(cfg,anim,currScope){if(cfg.onStart){anim.onStart.subscribe(function(){ProtoScript.Core.callBehaviors(cfg.onStart,currScope);});} if(cfg.onTween){anim.onTween.subscribe(function(){ProtoScript.Core.callBehaviors(cfg.onTween,currScope);});} if(cfg.onComplete){anim.onComplete.subscribe(function(){ProtoScript.Core.callBehaviors(cfg.onComplete,currScope);});}}}}();YAHOO.protoscript.Ajax=function(){this.timeout=60000;};YAHOO.protoscript.Ajax.prototype={get:function(url,data,callback,args){this.callback=callback;var that=this;this.showLoading();YAHOO.util.Connect.asyncRequest('GET',url,{success:that.onSuccess,failure:that.onFailure,argument:args,scope:that,timeout:this.timeout});},post:function(url,data,callback,args){this.callback=callback;var that=this;this.showLoading();YAHOO.util.Connect.asyncRequest('POST',url,{success:that.onSuccess,failure:that.onFailure,argument:args,scope:that,timeout:this.timeout},data);},formPost:function(url,frmId,callback,args){this.callback=callback;var that=this;if(!args||!args.noloading){this.showLoading();} YAHOO.util.Connect.setForm(frmId);YAHOO.util.Connect.asyncRequest('POST',url,{success:that.onSuccess,failure:that.onFailure,argument:args,scope:that,timeout:this.timeout});},showLoading:function(){},hideLoading:function(){},onFailure:function(req){var isCommunicationFailure=(req.status==0&&req.statusText=='communication failure')?true:false;var isAbort=(req.status==-1&&req.statusText=='transaction aborted')?true:false;var isFailure=(isCommunicationFailure||isAbort)?true:false;this.showLoading();},onSuccess:function(req){this.hideLoading();this.callback(req);}};YAHOO.protoscript.Timer=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Timer.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){var scopeElems=currScope.elems;var behaviorCfg=this.cfg;if(behaviorCfg['onTimer']){var onTimerElems=behaviorCfg['onTimer']._elems;for(var i=0;i0){setTimeout(function(){ProtoScript.Core.callBehaviors(behaviorCfg['on'+behaviorName],scope);},behaviorCfg.delay*1000);}else{ProtoScript.Core.callBehaviors(behaviorCfg['on'+behaviorName],scope);}}};}(i));}}};YAHOO.protoscript.Click=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Click.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'click');}};YAHOO.protoscript.Blur=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Blur.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'blur');}};YAHOO.protoscript.Dblclick=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Dblclick.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'dblclick');}};YAHOO.protoscript.Focus=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Focus.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'focus');}};YAHOO.protoscript.Keydown=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Keydown.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'keydown');}};YAHOO.protoscript.Keypress=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Keypress.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'keypress');}};YAHOO.protoscript.Keyup=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Keyup.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'keyup');}};YAHOO.protoscript.Keydown=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Keydown.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'keydown');}};YAHOO.protoscript.Mousedown=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Mousedown.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'mousedown');}};YAHOO.protoscript.Mousemove=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Mousemove.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'mousemove');}};YAHOO.protoscript.Mouseover=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Mouseover.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'mouseover');}};YAHOO.protoscript.Mouseout=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Mouseout.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'mouseout');}};YAHOO.protoscript.Mouseup=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.Mouseup.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){YAHOO.protoscript.Trigger(this.cfg,currScope,'mouseup');}};YAHOO.protoscript.ToggleOpenClose=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.ToggleOpenClose.prototype={defaultCfg:{},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);},action:function(currScope){var idx=currScope.idx;var scopeElems=currScope.elems;for(var i=0;i0){newContextCfg[0]=contextElems[idx];}} return newContextCfg;},getContent:function(contentCfg,idx){var elem=ProtoScript.Core.$(contentCfg);if(elem&&contentCfg!==''&&elem.length){return elem[idx].innerHTML;}else if(contentCfg.substring(0,7)==="http://"){if(/[.]gif$|[.]jpg$|[.]jpeg$|[.]png$/i.test(contentCfg)){return'mockup'}else{}}else{return contentCfg;}}};YAHOO.protoscript.DragDrop=function(behaviorName,behaviorCfg){this.init(behaviorName,behaviorCfg);};YAHOO.protoscript.DragDrop.prototype={interactionGroup:'bill',defaultCfg:{dropTarget:null},init:function(behaviorName,behaviorCfg){this.name=behaviorName;this.cfg=ProtoScript.Core.applyConfig(this.defaultCfg,behaviorCfg);var dropTargets=ProtoScript.Core.$(this.cfg.dropTarget);this.dropTargetDD=[];for(var i=0;i0){YAHOO.widget.ResizePanel.superclass.constructor.call(this,el,userConfig);}};YAHOO.widget.ResizePanel.CSS_PANEL_RESIZE="yui-resizepanel";YAHOO.widget.ResizePanel.CSS_RESIZE_HANDLE="resizehandle";YAHOO.extend(YAHOO.widget.ResizePanel,YAHOO.widget.Panel,{init:function(el,userConfig){YAHOO.widget.ResizePanel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.ResizePanel);var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,oInnerElement=this.innerElement,oResizeHandle=document.createElement("DIV"),sResizeHandleId=this.id+"_resizehandle";oResizeHandle.id=sResizeHandleId;oResizeHandle.className=YAHOO.widget.ResizePanel.CSS_RESIZE_HANDLE;Dom.addClass(oInnerElement,YAHOO.widget.ResizePanel.CSS_PANEL_RESIZE);this.resizeHandle=oResizeHandle;function initResizeFunctionality(){var me=this,oHeader=this.header,oBody=this.body,oFooter=this.footer,nStartWidth,nStartHeight,aStartPos,nBodyBorderTopWidth,nBodyBorderBottomWidth,nBodyTopPadding,nBodyBottomPadding,nBodyOffset;oInnerElement.appendChild(oResizeHandle);this.ddResize=new YAHOO.util.DragDrop(sResizeHandleId,this.id);this.ddResize.setHandleElId(sResizeHandleId);this.ddResize.onMouseDown=function(e){nStartWidth=oInnerElement.offsetWidth;nStartHeight=oInnerElement.offsetHeight;if(YAHOO.env.ua.ie&&document.compatMode=="BackCompat"){nBodyOffset=0;} else{nBodyBorderTopWidth=parseInt(Dom.getStyle(oBody,"borderTopWidth"),10),nBodyBorderBottomWidth=parseInt(Dom.getStyle(oBody,"borderBottomWidth"),10),nBodyTopPadding=parseInt(Dom.getStyle(oBody,"paddingTop"),10),nBodyBottomPadding=parseInt(Dom.getStyle(oBody,"paddingBottom"),10),nBodyOffset=nBodyBorderTopWidth+nBodyBorderBottomWidth+nBodyTopPadding+nBodyBottomPadding;} me.cfg.setProperty("width",nStartWidth+"px");aStartPos=[Event.getPageX(e),Event.getPageY(e)];};this.ddResize.onDrag=function(e){var aNewPos=[Event.getPageX(e),Event.getPageY(e)],nOffsetX=aNewPos[0]-aStartPos[0],nOffsetY=aNewPos[1]-aStartPos[1],nNewWidth=Math.max(nStartWidth+nOffsetX,10),nNewHeight=Math.max(nStartHeight+nOffsetY,10),nBodyHeight=(nNewHeight-(oFooter.offsetHeight+oHeader.offsetHeight+nBodyOffset));me.cfg.setProperty("width",nNewWidth+"px");if(nBodyHeight<0){nBodyHeight=0;} oBody.style.height=nBodyHeight+"px";};} function onBeforeShow(){initResizeFunctionality.call(this);this.unsubscribe("beforeShow",onBeforeShow);} function onBeforeRender(){if(!this.footer){this.setFooter("");} if(this.cfg.getProperty("visible")){initResizeFunctionality.call(this);} else{this.subscribe("beforeShow",onBeforeShow);} this.unsubscribe("beforeRender",onBeforeRender);} this.subscribe("beforeRender",onBeforeRender);if(userConfig){this.cfg.applyConfig(userConfig,true);} this.initEvent.fire(YAHOO.widget.ResizePanel);},toString:function(){return"ResizePanel "+this.id;}});