/**** include dragdrop_1.2.0.js event_1.0.1.js PageTime.js position_1.1.0.js TextCheck.js ****/ /****************** dragdrop_1.2.0.js *********************/ ygDD.prototype=new ygDragDrop();function ygDD(id,_2){if(id){this.init(id,_2);}}ygDD.prototype.scroll=true;ygDD.prototype.autoOffset=function(_3,_4){var el=this.getEl();var _6=ygPos.getPos(el);var x=_3-_6[0];var y=_4-_6[1];this.setDelta(x,y);};ygDD.prototype.setDelta=function(_9,_10){this.deltaX=_9;this.deltaY=_10;};ygDD.prototype.setDragElPos=function(_11,_12){this.alignElWithMouse(this.getDragEl(),_11,_12);};ygDD.prototype.alignElWithMouse=function(el,_13,_14){var _15=this.getTargetCoord(_13,_14);var _16=[_15.x,_15.y];ygPos.setPos(el,_16);this.cachePosition(_15.x,_15.y);this.autoScroll(_15.x,_15.y,el.offsetHeight,el.offsetWidth);};ygDD.prototype.cachePosition=function(_17,_18){if(_17){this.lastPageX=_17;this.lastPageY=_18;}else{var _19=ygPos.getPos(this.getEl());this.lastPageX=_19[0];this.lastPageY=_19[1];}};ygDD.prototype.autoScroll=function(x,y,h,w){if(this.scroll){var _22=ygDDM.getClientHeight();var _23=ygDDM.getClientWidth();var st=ygDDM.getScrollTop();var sl=ygDDM.getScrollLeft();var bot=h+y;var _27=w+x;var _28=(_22+st-y-this.deltaY);var _29=(_23+sl-x-this.deltaX);var _30=40;var _31=(document.all)?80:30;if(bot>_22&&_28<_30){window.scrollTo(sl,st+_31);}if(y0&&y-st<_30){window.scrollTo(sl,st-_31);}if(_27>_23&&_29<_30){window.scrollTo(sl+_31,st);}if(x0&&x-sl<_30){window.scrollTo(sl-_31,st);}}};ygDD.prototype.getTargetCoord=function(_32,_33){var x=_32-this.deltaX;var y=_33-this.deltaY;if(this.constrainX){if(xthis.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};};ygDD.prototype.b4MouseDown=function(e){this.autoOffset(yui.Event.getPageX(e),yui.Event.getPageY(e));};ygDD.prototype.b4Drag=function(e){this.setDragElPos(yui.Event.getPageX(e),yui.Event.getPageY(e));};ygDD.prototype.startDrag=function(x,y){};ygDD.prototype.onDrag=function(e){};ygDD.prototype.onDragEnter=function(e,id){};ygDD.prototype.onDragOver=function(e,id){};ygDD.prototype.onDragOut=function(e,id){};ygDD.prototype.onDragDrop=function(e,id){};ygDD.prototype.endDrag=function(e){};ygDDFramed.prototype=new ygDD();function ygDDFramed(id,_35){if(id){this.init(id,_35);this.initFrame();}}ygDDFramed.frameDiv=null;ygDDFramed.dragElId="ygddfdiv";ygDDFramed.prototype.borderWidth=2;ygDDFramed.prototype.resizeFrame=true;ygDDFramed.prototype.centerFrame=false;ygDDFramed.createFrame=function(){if(!document||!document.body){setTimeout(ygDDFramed.createFrame,50);return;}if(!ygDDFramed.frameDiv){ygDDFramed.frameDiv=document.createElement("div");ygDDFramed.frameDiv.id=ygDDFramed.dragElId;var s=ygDDFramed.frameDiv.style;s.position="absolute";s.display="none";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;document.body.appendChild(ygDDFramed.frameDiv);}};ygDDFramed.prototype.initFrame=function(){ygDDFramed.createFrame();this.setDragElId(ygDDFramed.dragElId);this.useAbsMath=true;};ygDDFramed.prototype.showFrame=function(_37,_38){var el=this.getEl();var s=this.getDragEl().style;if(this.resizeFrame){s.width=(parseInt(el.offsetWidth)-(2*this.borderWidth))+"px";s.height=(parseInt(el.offsetHeight)-(2*this.borderWidth))+"px";}if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width)/2),Math.round(parseInt(s.width)/2));}this.setDragElPos(_37,_38);s.display="";};ygDDFramed.prototype.b4MouseDown=function(e){var x=yui.Event.getPageX(e);var y=yui.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);};ygDDFramed.prototype.b4StartDrag=function(x,y){this.showFrame(x,y);};ygDDFramed.prototype.b4EndDrag=function(e){this.getDragEl().style.display="none";};ygDDFramed.prototype.endDrag=function(e){var lel=this.getEl();var del=this.getDragEl();del.style.display="";lel.style.visibility="hidden";ygDDM.moveToEl(lel,del);del.style.display="none";lel.style.visibility="";};ygDDTarget.prototype=new ygDragDrop();function ygDDTarget(id,_41){if(id){this.initTarget(id,_41);}}function ygDragDrop(id,_42){if(id){this.init(id,_42);}}ygDragDrop.prototype.id=null;ygDragDrop.prototype.dragElId=null;ygDragDrop.prototype.handleElId=null;ygDragDrop.prototype.invalidHandleTypes=null;ygDragDrop.prototype.startPageX=0;ygDragDrop.prototype.startPageY=0;ygDragDrop.prototype.groups=null;ygDragDrop.prototype.locked=false;ygDragDrop.prototype.lock=function(){this.locked=true;};ygDragDrop.prototype.unlock=function(){this.locked=false;};ygDragDrop.prototype.isTarget=true;ygDragDrop.prototype.padding=null;ygDragDrop.prototype._domRef=null;ygDragDrop.prototype.__ygDragDrop=true;ygDragDrop.prototype.constrainX=false;ygDragDrop.prototype.constrainY=false;ygDragDrop.prototype.minX=0;ygDragDrop.prototype.maxX=0;ygDragDrop.prototype.minY=0;ygDragDrop.prototype.maxY=0;ygDragDrop.prototype.maintainOffset=false;ygDragDrop.prototype.xTicks=null;ygDragDrop.prototype.yTicks=null;ygDragDrop.prototype.b4StartDrag=function(x,y){};ygDragDrop.prototype.startDrag=function(x,y){};ygDragDrop.prototype.b4Drag=function(e){};ygDragDrop.prototype.onDrag=function(e){};ygDragDrop.prototype.onDragEnter=function(e,id){};ygDragDrop.prototype.b4DragOver=function(e){};ygDragDrop.prototype.onDragOver=function(e,id){};ygDragDrop.prototype.b4DragOut=function(e){};ygDragDrop.prototype.onDragOut=function(e,id){};ygDragDrop.prototype.b4DragDrop=function(e){};ygDragDrop.prototype.onDragDrop=function(e,id){};ygDragDrop.prototype.b4EndDrag=function(e){};ygDragDrop.prototype.endDrag=function(e){};ygDragDrop.prototype.b4MouseDown=function(e){};ygDragDrop.prototype.onMouseDown=function(e){};ygDragDrop.prototype.onMouseUp=function(e){};ygDragDrop.prototype.getEl=function(){if(!this._domRef){this._domRef=ygDDM.getElement(this.id);}return this._domRef;};ygDragDrop.prototype.getDragEl=function(){return ygDDM.getElement(this.dragElId);};ygDragDrop.prototype.init=function(id,_43){this.initTarget(id,_43);yui.Event.addListener(id,"mousedown",this.handleMouseDown,this);};ygDragDrop.prototype.initTarget=function(id,_44){this.padding=[0,0,0,0];this.groups={};this.id=id;this.setDragElId(id);this.invalidHandleTypes={a:"a"};this.handleElId=id;if(document&&document.body){this.setInitPosition();}this.addToGroup((_44)?_44:"default");};ygDragDrop.prototype.setPadding=function(_45,_46,_47,_48){if(!_46&&0!==_46){this.padding=[_45,_45,_45,_45];}else{if(!_47&&0!==_47){this.padding=[_45,_46,_45,_46];}else{this.padding=[_45,_46,_47,_48];}}};ygDragDrop.prototype.setInitPosition=function(_49,_50){var dx=_49||0;var dy=_50||0;var p=ygPos.getPos(this.getEl());this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);};ygDragDrop.prototype.setStartPosition=function(pos){var p=pos||ygPos.getPos(this.getEl());this.startPageX=p[0];this.startPageY=p[1];};ygDragDrop.prototype.addToGroup=function(_55){this.groups[_55]=true;ygDDM.regDragDrop(this,_55);};ygDragDrop.prototype.setDragElId=function(id){this.dragElId=id;};ygDragDrop.prototype.setHandleElId=function(id){this.handleElId=id;ygDDM.regHandle(this.id,id);};ygDragDrop.prototype.setOuterHandleElId=function(id){yui.Event.addListener(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);};ygDragDrop.prototype.unreg=function(){yui.Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;ygDDM._remove(this);};ygDragDrop.prototype.isLocked=function(){return (ygDDM.isLocked()||this.locked);};ygDragDrop.prototype.handleMouseDown=function(e,oDD){if(oDD.isLocked()){return;}ygDDM.refreshCache(oDD.groups);var pt=new yui.Point(yui.Event.getPageX(e),yui.Event.getPageY(e));if(ygDDM.isOverTarget(pt,oDD)){var _58=yui.Event.getTarget(e);if(oDD.isValidHandleChild(_58)&&(oDD.id==oDD.handleElId||ygDragDrop.handleWasClicked(_58,oDD.id))){oDD.setStartPosition();oDD.b4MouseDown(e);oDD.onMouseDown(e);ygDDM.handleMouseDown(e,oDD);ygDDM.stopEvent(e);}}};ygDragDrop.prototype.addInvalidHandleType=function(_59){var _60=_59.toUpperCase();this.invalidHandleTypes[_60]=_60;};ygDragDrop.prototype.removeInvalidHandleType=function(_61){var _62=_61.toUpperCase();this.invalidHandleTypes[_62]=null;};ygDragDrop.prototype.isValidHandleChild=function(_63){var _64=_63.nodeName;if(_64=="#text"){_64=_63.parentNode.nodeName;}return (!this.invalidHandleTypes[_64]);};ygDragDrop.prototype.setXTicks=function(_65,_66){this.xTicks=[];this.xTickSize=_66;var _67={};for(var i=this.initPageX;i>=this.minX;i=i-_66){if(!_67[i]){this.xTicks[this.xTicks.length]=i;_67[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_66){if(!_67[i]){this.xTicks[this.xTicks.length]=i;_67[i]=true;}}this.xTicks.sort(ygDDM.numericSort);};ygDragDrop.prototype.setYTicks=function(_69,_70){this.yTicks=[];this.yTickSize=_70;var _71={};for(var i=this.initPageY;i>=this.minY;i=i-_70){if(!_71[i]){this.yTicks[this.yTicks.length]=i;_71[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_70){if(!_71[i]){this.yTicks[this.yTicks.length]=i;_71[i]=true;}}this.yTicks.sort(ygDDM.numericSort);};ygDragDrop.prototype.setXConstraint=function(_72,_73,_74){this.leftConstraint=_72;this.rightConstraint=_73;this.minX=this.initPageX-_72;this.maxX=this.initPageX+_73;if(_74){this.setXTicks(this.initPageX,_74);}this.constrainX=true;};ygDragDrop.prototype.setYConstraint=function(iUp,_76,_77){this.topConstraint=iUp;this.bottomConstraint=_76;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_76;if(_77){this.setYTicks(this.initPageY,_77);}this.constrainY=true;};ygDragDrop.prototype.resetConstraints=function(){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}};ygDragDrop.prototype.getTick=function(val,_79){if(!_79){return val;}else{if(_79[0]>=val){return _79[0];}else{for(var i=0;i<_79.length;++i){var _80=i+1;if(_79[_80]&&_79[_80]>=val){var _81=val-_79[i];var _82=_79[_80]-val;return (_82>_81)?_79[i]:_79[_80];}}return _79[_79.length-1];}}};ygDragDrop.prototype.toString=function(val,_83){return ("ygDragDrop {"+this.id+"}");};ygDragDrop.handleWasClicked=function(_84,id){if(ygDDM.isHandle(id,_84.id)){return true;}else{var p=_84.parentNode;while(p){if(ygDDM.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}return false;};yui=window.yui||{};var ygDragDropMgr=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.POINT=0;this.INTERSECT=1;this.mode=this.POINT;this._execOnAll=function(_85,_86){for(var i in ygDDM.ids){for(var j in ygDDM.ids[i]){var oDD=ygDDM.ids[i][j];if(!ygDDM.isTypeOfDD(oDD)){continue;}oDD[_85].apply(oDD,_86);}}};this._onLoad=function(){ygDDM._execOnAll("setInitPosition",[]);yui.Event.addListener(document,"mouseup",ygDDM.handleMouseUp);yui.Event.addListener(document,"mousemove",ygDDM.handleMouseMove);yui.Event.addListener(window,"unload",ygDDM._onUnload);yui.Event.addListener(window,"resize",ygDDM._onResize);ygDDM.initalized=true;};this._onResize=function(e){ygDDM._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,_88){if(!this.initialized){this.init();}if(!this.ids[_88]){this.ids[_88]={};}this.ids[_88][oDD.id]=oDD;};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(_90,_91){if(!this.handleIds[_90]){this.handleIds[_90]={};}this.handleIds[_90][_91]=_91;};this.isDragDrop=function(id){return (this.getDDById(id))?true:false;};this.getRelated=function(_92,_93){var _94=[];for(var i in _92.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_93||dd.isTarget){_94[_94.length]=dd;}}}return _94;};this.isLegalTarget=function(oDD,_96){var _97=this.getRelated(oDD);for(var i=0;i<_97.length;++i){if(_97[i].id==_96.id){return true;}}return false;};this.isTypeOfDD=function(oDD){return (oDD&&oDD.__ygDragDrop);};this.isHandle=function(_98,_99){return (this.handleIds[_98]&&this.handleIds[_98][_99]);};this.getDDById=function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;};this.handleMouseDown=function(e,oDD){this.dragCurrent=oDD;var el=oDD.getEl();this.startX=yui.Event.getPageX(e);this.startY=yui.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout("ygDDM.startDrag(ygDDM.startX, ygDDM.startY)",this.clickTimeThresh);};this.startDrag=function(x,y){clearTimeout(ygDDM.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;};this.handleMouseUp=function(e){if(!ygDDM.dragCurrent){return;}clearTimeout(ygDDM.clickTimeout);if(ygDDM.dragThreshMet){ygDDM.fireEvents(e,true);}else{}ygDDM.stopDrag(e);ygDDM.stopEvent(e);};this.stopEvent=function(e){if(this.stopPropagation){yui.Event.stopPropagation(e);}if(this.preventDefault){yui.Event.preventDefault(e);}};this.stopDrag=function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};};this.handleMouseMove=function(e){if(!ygDDM.dragCurrent){return;}if(!ygDDM.dragThreshMet){var _100=Math.abs(ygDDM.startX-yui.Event.getPageX(e));var _101=Math.abs(ygDDM.startY-yui.Event.getPageY(e));if(_100>ygDDM.clickPixelThresh||_101>ygDDM.clickPixelThresh){ygDDM.startDrag(ygDDM.startX,ygDDM.startY);}}if(ygDDM.dragThreshMet){ygDDM.dragCurrent.b4Drag(e);ygDDM.dragCurrent.onDrag(e);ygDDM.fireEvents(e,false);}ygDDM.stopEvent(e);};this.fireEvents=function(e,_102){var dc=this.dragCurrent;if(!dc){return;}var x=yui.Event.getPageX(e);var y=yui.Event.getPageY(e);var pt=new yui.Point(x,y);var _104=[];var _105=[];var _106=[];var _107=[];var _108=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_105.push(ddo);}_104[i]=true;delete this.dragOvers[i];}for(var _110 in dc.groups){if("string"!=typeof _110){continue;}for(i in this.ids[_110]){var oDD=this.ids[_110][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_102){_107.push(oDD);}else{if(!_104[oDD.id]){_108.push(oDD);}else{_106.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_105.length>0){dc.b4DragOut(e,_105);dc.onDragOut(e,_105);}if(_108.length>0){dc.onDragEnter(e,_108);}if(_106.length>0){dc.b4DragOver(e,_106);dc.onDragOver(e,_106);}if(_107.length>0){dc.b4DragDrop(e,_107);dc.onDragDrop(e,_107);}}else{for(i=0;i<_105.length;++i){dc.b4DragOut(e,_105[i].id);dc.onDragOut(e,_105[i].id);}for(i=0;i<_108.length;++i){dc.onDragEnter(e,_108[i].id);}for(i=0;i<_106.length;++i){dc.b4DragOver(e,_106[i].id);dc.onDragOver(e,_106[i].id);}for(i=0;i<_107.length;++i){dc.b4DragDrop(e,_107[i].id);dc.onDragDrop(e,_107[i].id);}}};this.getBestMatch=function(dds){var _112=null;if(dds.length==1){_112=dds[0];}else{for(var i=0;i500){}else{setTimeout("ygDDM._addListeners()",10);this._timeoutCount+=1;}}};this.addEvent=function(el,_134,fn,_136){yui.Event.addListener(el,_134,fn);};this.removeEvent=function(el,_137,fn,_138){yui.Event.removeListener(el,_137,fn);};this.fixIEEvent=function(ev){if(ev.srcElement&&!ev.target){ev.eventPhase=2;ev.pageX=ev.clientX+this.getScrollLeft();ev.pageY=ev.clientY+this.getScrollTop();if(!ev.preventDefault){ev.preventDefault=function(){this.returnValue=false;};}if(ev.type=="mouseout"){ev.relatedTarget=ev.toElement;}else{if(ev.type=="mouseover"){ev.relatedTarget=ev.fromElement;}}if(!ev.stopPropagation){ev.stopPropagation=function(){this.cancelBubble=true;};}ev.target=ev.srcElement;}return ev;};this.fixDOMEvent=function(ev){if(!ev.srcElement){ev.srcElement=ev.originalTarget;}if(!ev.pageX&&ev.clientX&&ev.clientY){ev.pageX=ev.clientX;ev.pageY=ev.clientY;}return ev;};this.getEvent=function(){if(window.event){ev=this.fixIEEvent(window.event);}else{ev=this.getEvent.caller.arguments[0];ev=this.fixDOMEvent(this.getEvent.caller.arguments[0]);}return ev;};};var ygDDM=ygDragDropMgr;ygDDM._addListeners(); /******************* event_1.0.1.js *********************/ yui=window.yui||{};yui.CustomEvent=function(_1,_2){this.type=_1;this.scope=_2||window;this.subscribers=[];if(yui["Event"]){yui.Event.regCE(this);}};yui.CustomEvent.prototype.subscribe=function(fn,_4){this.subscribers.push(new yui.Subscriber(fn,_4));};yui.CustomEvent.prototype.unsubscribe=function(fn,_5){for(var i=0;i=0){_28=this.listeners[_29];}if(!el||!_28){return false;}if(el.removeEventListener){el.removeEventListener(_27,_28[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_27,_28[this.WFN]);}}delete this.listeners[_29][this.WFN];delete this.listeners[_29][this.FN];delete this.listeners[_29];return true;};this.getTarget=function(ev,_31){var t=ev.target||ev.srcElement;if(_31&&t&&"#text"==t.nodeName){return t.parentNode;}else{return t;}};this.getPageX=function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;};this.getPageY=function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;};this.getRelatedTarget=function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return t;};this.getTime=function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;};this.stopEvent=function(ev){this.stopPropagation(ev);this.preventDefault(ev);};this.stopPropagation=function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}};this.preventDefault=function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}};this.getEvent=function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;};this.getCharCode=function(ev){return ev.charCode||(ev.type=="keypress")?ev.keyCode:0;};this._getCacheIndex=function(el,_36,fn){for(var i=0;i0){for(i=0;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};yui.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};yui.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 yui.Region(t,r,b,l);}else{return null;}};yui.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 yui.Region(t,r,b,l);};yui.Region.prototype.toString=function(){return("Region {"+" t: "+this.top+", r: "+this.right+", b: "+this.bottom+", l: "+this.left+"}");} yui.Region.getRegion=function(el){var p=ygPos.getPos(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new yui.Region(t,r,b,l);};yui.Point=function(x,y){this.x=x;this.y=y;this.top=y;this.right=x;this.bottom=y;this.left=x;};yui.Point.prototype=new yui.Region(); /**************** TextCheck.js ******************/ /** * 程式說明:頁面input檢查 * @author 朱益成 * @version 1.0 * Created Date:2002.02.19 * Modified Date: * 2003.5.13 Sand 修改CustIdCheck驗證規則,使用正規表示法。 * 2003.10.28 Sand 修改大陸人ID規則。 * 2003.11.03 Sand 修改身分證字號英文部分可輸入小寫。 * 2004.02.25 alan 修改FNS外國人ID規則。 */ //判斷身分證字號============================================================ function CustIdCheck(CustId){ CustStr1= new String((CustId).substring(0,1).toUpperCase()); CustStr2= new String((CustId).substring(1)); if( CustId.length != 10 && CustId.length != 11){ alert("身分證字號或統一編號輸入長度有誤"); return false; } /*正規表示法規範區*/ Re1 = /^[A-Za-z][1-2]{1}\d{8}/g; //第一碼須為英文,第二碼須為1或2,後8碼須為數字 Re2 = /^[A-Za-z][1-2]{1}\d{9}/g; //第一碼須為英文,第二碼須為1或2,後9碼須為數字 Re3 = /\d{8}[A-Za-z]{2}/g; //外國人前8碼數字,後兩碼英文 Re4 = /\d{10}/g; //大陸人10碼為數字 Re5 = /[A-Za-z]{2}\d{8}/g; //FNS外國人前兩碼英文,後8碼數字 if(Re1.test(CustId) || Re2.test(CustId)){ //本國人檢核程式 //依法規判斷身份字號 str=CustId; Temp=""; TempID=""; CheckSum=0; Weight = new Array(1,9,8,7,6,5,4,3,2,1,1); Location1=new Array("A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","W","X","Y","Z","I","O"); Location2=new Array("10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","32","30","31","33" ,"34","35"); for(x=0;x 10 ){ alert("使用者代號輸入錯誤!"); return false; } return true; } //判斷密碼 function PasswordCheck(Password){ if((Password) == null || (Password)== "" || (Password).length < 4 || (Password).length > 10 ){ alert("輸入密碼不正確!"); return false; } return true; } //判斷金額 function AmountCheck(Amount){ if(Amount == null || Amount == ""){ alert("請輸入金額!"); return false; } //Alan added 20050812 Alanstr1=Amount.indexOf(" ",0); if(Alanstr1 >= 0){ alert("請勿輸入空白文字!"); return false; } if(isNaN(Amount)){ alert("輸入金額須為數字!"); return false; } str1=Amount.indexOf(".",0); if(str1 == -1) str1=Amount.length; else if(str1 == (Amount.length-1)){ alert("輸入金額需為整數,不可帶小數點!"); return false; } if(Amount.substring(0,str1).length > 11){ alert("輸入金額過大!"); return false; } //if(Amount.substring(str1+1,Amount.length).length > 2){ // // alert("輸入金額小數位數僅能二位!"); // // return false; // //} //pierre 5/31 if(Amount.substring(str1+1,Amount.length).length > 0){ alert("輸入金額需為整數!"); return false; } if(Amount.substring(0,1) == "-" || Amount.substring(0,1) == "+"){ alert("輸入金額不可有正負號!"); return false; } if(Amount.charAt(0) == "0"){ alert("輸入金額第一位數不可為0!"); return false; } } //斷判輸入值是否為數字 function CheckNum(Value) { if(Value == null || Value == ""){ alert("請輸入相關值!"); return false; } if(isNaN(Value)){ alert("輸入須為數字!"); return false; } var len = Value.length; for(var i=0;i="0"&&c<="9")){ alert("輸入須為數字!"); return false; } } } function CheckMDate(Value) { // theYear: 民國年 // theMonth: 從1到12的月份 // theDate: 從1到31的日期 var theMonth=Value.substring(0,2); var theDate=Value.substring(2,4); var correct=true; if(Value.length !=4) correct=false; if(theMonth < 1 || theMonth > 12) correct=false; if(theDate < 1 || theDate > 31) correct=false; if(theMonth == 2 && theDate > 28){ if(theDate == 29 && theYear % 4 == 0 && theYear % 100 != 0) { correct=false; } if(theDate == 29 && theYear % 4 == 0 && theYear % 400 == 0) { correct=false; } correct=false; } if(theMonth == 1 || theMonth == 3 || theMonth == 5 || theMonth == 7 || theMonth == 8 || theMonth == 10 || theMonth == 12) if(theDate > 31 || theDate < 1) correct=false; if(theMonth == 4 || theMonth == 6 || theMonth == 9 || theMonth == 11) if(theDate > 30 || theDate < 1) correct=false; if(!correct){ alert("請檢查您輸入的日期!"); return false; } } function CheckYDate(Value) { // theYear: 民國年 // theMonth: 從1到12的月份 // theDate: 從1到31的日期 var theYear=Value.substring(0,2); var theMonth=Value.substring(2,4); var correct=true; if(Value.length !=4) correct=false; theYear=theYear+1911; if(theYear<=1911) correct=false; if(theMonth != 1 && theMonth != 2 && theMonth != 3 && theMonth != 4 && theMonth != 5 && theMonth != 6 && theMonth != 7 && theMonth != 8 && theMonth != 9 && theMonth != 10 && theMonth != 11 && theMonth != 12 ) correct=false; if(!correct){ alert("請檢查您輸入的日期!"); return false; } } //確認是否為英文字============================================================================= function checkisNaN(CharStr){ alert("c"); //alert(CharStr); var len=CharStr.length; for(var x=0;x="A"&&c<="Z")||(c>="a"&&c<="z"))) return false; } return true; } //=========================================================================================== //確認是否為英數字夾雜=========================================== function check_pwderr (pwd){ alert("0"); var len = pwd.length; var clen=0; var nlen=0; for(var i=0;i="A"&&c<="Z")||(c>="a"&&c<="z")||(c>="0"&&c<="9"))) return false; //revised by jiunjie, 05/30/2002 if ((c>="A"&&c<="Z")||(c>="a"&&c<="z")) clen += 1; if (c>="0"&&c<="9") nlen += 1; } if (!(clen>0&&nlen>0)) return false; return true; } //=========================================================== //大小寫提示 function change_CapsLock(status,clst,div){ alert("a"); if (status == "on"){ div.style.visibility='visible'; clst.value = "on"; var div1 = new ygDD('divCapslock'); } if (status == "off"){ div.style.visibility='hidden'; clst.value = "off"; } } function capsLock(event,e2,v,clst,div){ alert("a"); var clst=document.sForm.capslock_status; var div=document.getElementById('divCapslock'); var k = event.keyCode; if (!e2) e2 = window.event; var k2 = e2.which ? e2.which : ( e2.keyCode ? e2.keyCode : ( e2.charCode ? e2.charCode : 0 ) ); if (event.type=="keyup"){ if (k!=20) return; } if (k==20){ if (clst.value=="on" || clst.value=="off"){ if (event.type=="keydown") return; if (clst.value =="on") change_CapsLock("off",clst,div); else change_CapsLock("on",clst,div); } return; }else{ if (v.length==0 || clst.value=="on" || clst.value=="off"){ if (v.length==0 && clst.value == ""){ }else{ return; } } if (k==8) return; if (!event.shiftKey && k2 >= 65 && k2 <= 90 ){ change_CapsLock("on",clst,div); return; } if (event.shiftKey && k2 >= 97 && k2 <= 128 ){ change_CapsLock("on",clst,div); return; } if (!event.shiftKey && k2 >= 97 && k2 <= 128 ){ change_CapsLock("off",clst,div); return; } if (event.shiftKey && k2 >= 65 && k2 <= 90 ){ change_CapsLock("off",clst,div); return; } } }