
if(typeof(rdcjs)=="undefined")
_rdc=rdcjs={};if(!$){var $=function(id){return"string"==typeof id?document.getElementById(id):id;};}
_rdc.ModalBoxHelper=function(){}
_rdc.ModalBoxHelper.isIE=(document.all)?true:false;_rdc.ModalBoxHelper.isIE6=_rdc.ModalBoxHelper.isIE&&([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1]==6);_rdc.ModalBoxHelper.addEvent=function(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}
else if(elm.attachEvent){var r=elm.attachEvent('on'+evType,fn);return r;}
else{elm['on'+evType]=fn;}}
_rdc.ModalBoxHelper.Extend=function(destination,source){for(var property in source){destination[property]=source[property];}}
_rdc.ModalBoxHelper.Bind=function(object,fun){return function(){return fun.apply(object,arguments);}}
_rdc.ModalBoxHelper.Each=function(list,fun){for(var i=0,len=list.length;i<len;i++){fun(list[i],i);}};_rdc.ModalBoxHelper.Contains=function(a,b){return a.contains?a!=b&&a.contains(b):!!(a.compareDocumentPosition(b)&16);}
_rdc.OverLay=function(options,boxId){var prefix="modalboxlay";if($(prefix+boxId))
document.body.removeChild($(prefix+boxId));this.SetOptions(options);var newDiv=document.createElement("div");newDiv.id=prefix+boxId;newDiv.className="modalBoxOverlay";this.Lay=$(this.options.Lay)||document.body.insertBefore(newDiv,document.body.childNodes[0]);this.Color=this.options.Color;this.Opacity=parseInt(this.options.Opacity);this.zIndex=parseInt(this.options.zIndex);with(this.Lay.style){display="none";zIndex=this.zIndex;left=top=0;position="fixed";width=height="100%";}
if(_rdc.ModalBoxHelper.isIE6){this.Lay.style.position="absolute";this._resize=_rdc.ModalBoxHelper.Bind(this,function(){this.Lay.style.width=Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth)+"px";this.Lay.style.height=Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight)+"px";});this.Lay.innerHTML='<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;filter:alpha(opacity=0);"></iframe>'}}
_rdc.OverLay.prototype={SetOptions:function(options){this.options={Lay:null,Color:"#fff",Opacity:50,zIndex:1000};_rdc.ModalBoxHelper.Extend(this.options,options||{});},Show:function(){if(_rdc.ModalBoxHelper.isIE6){this._resize();window.attachEvent("onresize",this._resize);}
with(this.Lay.style){_rdc.ModalBoxHelper.isIE?filter="alpha(opacity:"+this.Opacity+")":opacity=this.Opacity/100;backgroundColor=this.Color;display="block";}},Close:function(){this.Lay.style.display="none";if(_rdc.ModalBoxHelper.isIE6){window.detachEvent("onresize",this._resize);}}};_rdc.ModalBox=function(box,options){this.Box=$(box);this.OverLay=new _rdc.OverLay(options,box);this.SetOptions(options);this.Fixed=!!this.options.Fixed;this.Over=!!this.options.Over;this.Center=!!this.options.Center;this.onShow=this.options.onShow;this.onClose=this.options.onClose;this.onShowForResize=this.options.onShowForResize;this.Box.style.zIndex=this.OverLay.zIndex+1;this.Box.style.display="none";if(_rdc.ModalBoxHelper.isIE6){this._top=this._left=0;this._select=[];this._fixed=_rdc.ModalBoxHelper.Bind(this,function(){this.Center?this.SetCenter():this.SetFixed();});}}
_rdc.ModalBox.prototype={SetOptions:function(options){this.options={Over:true,Fixed:true,Center:false,onShow:function(){},onClose:function(){},onShowForResize:function(){}};_rdc.ModalBoxHelper.Extend(this.options,options||{});},SetFixed:function(){this.Box.style.top=document.documentElement.scrollTop-this._top+this.Box.offsetTop+"px";this.Box.style.left=document.documentElement.scrollLeft-this._left+this.Box.offsetLeft+"px";this._top=document.documentElement.scrollTop;this._left=document.documentElement.scrollLeft;},SetCenter:function(){this.Box.style.marginTop=document.documentElement.scrollTop-this.Box.offsetHeight/2+"px";this.Box.style.marginLeft=document.documentElement.scrollLeft-this.Box.offsetWidth/2+"px";},Show:function(options){this.Box.style.position=this.Fixed&&!_rdc.ModalBoxHelper.isIE6?"fixed":"absolute";this.Over&&this.OverLay.Show();this.Box.style.display="block";if(this.Center){this.Box.style.top=this.Box.style.left="50%";if(this.Fixed){this.Box.style.marginTop=-this.Box.offsetHeight/2+"px";this.Box.style.marginLeft=-this.Box.offsetWidth/2+"px";}else{this.SetCenter();}}
if(_rdc.ModalBoxHelper.isIE6){if(!this.Over){this._select.length=0;_rdc.ModalBoxHelper.Each(document.getElementsByTagName("select"),_rdc.ModalBoxHelper.Bind(this,function(o){if(!_rdc.ModalBoxHelper.Contains(this.Box,o)){o.style.visibility="hidden";this._select.push(o);}}))}
this.Center?this.SetCenter():this.Fixed&&this.SetFixed();this.Fixed&&window.attachEvent("onscroll",this._fixed);}
this.onShow();this.onShowForResize();},Close:function(){this.Box.style.display="none";this.OverLay.Close();if(_rdc.ModalBoxHelper.isIE6){window.detachEvent("onscroll",this._fixed);_rdc.ModalBoxHelper.Each(this._select,function(o){o.style.visibility="visible";});}
this.onClose();}};if(typeof(rdcjs)=="undefined")
_rdc=rdcjs={};if(!$){var $=function(id){return"string"==typeof id?document.getElementById(id):id;};}
_rdc.DragDropHelper=function(){}
_rdc.DragDropHelper.isIE=(document.all)?true:false;_rdc.DragDropHelper.isIE6=_rdc.DragDropHelper.isIE&&([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1]==6);_rdc.DragDropHelper.isIE8=_rdc.DragDropHelper.isIE&&([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1]==8);_rdc.DragDropHelper.Extend=function(destination,source){for(var property in source){destination[property]=source[property];}}
_rdc.DragDropHelper.Bind=function(object,fun){return function(){return fun.apply(object,arguments);}}
_rdc.DragDropHelper.BindAsEventListener=function(object,fun){return function(event){return fun.call(object,(event||window.event));}}
_rdc.DragDropHelper.CurrentStyle=function(element){return element.currentStyle||document.defaultView.getComputedStyle(element,null);}
_rdc.DragDropHelper.addEvent=function(oTarget,sEventType,fnHandler){if(oTarget.addEventListener){oTarget.addEventListener(sEventType,fnHandler,false);}else if(oTarget.attachEvent){oTarget.attachEvent("on"+sEventType,fnHandler);}else{oTarget["on"+sEventType]=fnHandler;}};_rdc.DragDropHelper.removeEvent=function(oTarget,sEventType,fnHandler){if(oTarget.removeEventListener){oTarget.removeEventListener(sEventType,fnHandler,false);}else if(oTarget.detachEvent){oTarget.detachEvent("on"+sEventType,fnHandler);}else{oTarget["on"+sEventType]=null;}};_rdc.DragDropHelper.getScrollXY=function(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];}
_rdc.DragDrop=function(dragDrop,options){this.DragDrop=$(dragDrop);this._x=this._y=0;this._marginLeft=this._marginTop=0;this._fM=_rdc.DragDropHelper.BindAsEventListener(this,this.Move);this._fS=_rdc.DragDropHelper.Bind(this,this.Stop);this.SetOptions(options);this.Limit=!!this.options.Limit;this.LimitScreen=!!this.options.LimitScreen;this.mxLeft=parseInt(this.options.mxLeft);this.mxRight=parseInt(this.options.mxRight);this.mxTop=parseInt(this.options.mxTop);this.mxBottom=parseInt(this.options.mxBottom);this.LockX=!!this.options.LockX;this.LockY=!!this.options.LockY;this.Lock=!!this.options.Lock;this.onStart=this.options.onStart;this.onMove=this.options.onMove;this.onStop=this.options.onStop;this._Handle=$(this.options.Handle)||this.DragDrop;this._mxContainer=$(this.options.mxContainer)||null;this.DragDrop.style.position="absolute";if(_rdc.DragDropHelper.isIE&&!!this.options.Transparent){with(this._Handle.appendChild(document.createElement("div")).style){width=height="100%";backgroundColor="#fff";filter="alpha(opacity:0)";fontSize=0;}}
this.Repair();_rdc.DragDropHelper.addEvent(this._Handle,"mousedown",_rdc.DragDropHelper.BindAsEventListener(this,this.Start));}
_rdc.DragDrop.prototype={SetOptions:function(options){this.options={Handle:"",Limit:false,LimitScreen:true,mxLeft:0,mxRight:9999,mxTop:0,mxBottom:9999,mxContainer:"",LockX:false,LockY:false,Lock:false,Transparent:false,onStart:function(){},onMove:function(){},onStop:function(){}};_rdc.DragDropHelper.Extend(this.options,options||{});},Start:function(oEvent){if(this.Lock){return;}
this.Repair();this._x=oEvent.clientX-this.DragDrop.offsetLeft;this._y=oEvent.clientY-this.DragDrop.offsetTop;var delta=0;if(_rdc.DragDropHelper.isIE8)
delta=10;this._x+=delta;this._y+=delta;this._marginLeft=parseInt(_rdc.DragDropHelper.CurrentStyle(this.DragDrop).marginLeft)||0;this._marginTop=parseInt(_rdc.DragDropHelper.CurrentStyle(this.DragDrop).marginTop)||0;_rdc.DragDropHelper.addEvent(document,"mousemove",this._fM);_rdc.DragDropHelper.addEvent(document,"mouseup",this._fS);if(_rdc.DragDropHelper.isIE){_rdc.DragDropHelper.addEvent(this._Handle,"losecapture",this._fS);this._Handle.setCapture();}else{_rdc.DragDropHelper.addEvent(window,"blur",this._fS);oEvent.preventDefault();};this.onStart();},Repair:function(){if(this.Limit){this.mxRight=Math.max(this.mxRight,this.mxLeft+this.DragDrop.offsetWidth);this.mxBottom=Math.max(this.mxBottom,this.mxTop+this.DragDrop.offsetHeight);!this._mxContainer||_rdc.DragDropHelper.CurrentStyle(this._mxContainer).position=="relative"||_rdc.DragDropHelper.CurrentStyle(this._mxContainer).position=="absolute"||(this._mxContainer.style.position="relative");}},Move:function(oEvent){if(this.Lock){this.Stop();return;};window.getSelection?window.getSelection().removeAllRanges():document.selection.empty();var iLeft=oEvent.clientX-this._x,iTop=oEvent.clientY-this._y;if(this.Limit){var mxLeft=this.mxLeft,mxRight=this.mxRight,mxTop=this.mxTop,mxBottom=this.mxBottom;if(!!this._mxContainer){mxLeft=Math.max(mxLeft,0);mxTop=Math.max(mxTop,0);mxRight=Math.min(mxRight,this._mxContainer.clientWidth);mxBottom=Math.min(mxBottom,this._mxContainer.clientHeight);};iLeft=Math.max(Math.min(iLeft,mxRight-this.DragDrop.offsetWidth),mxLeft);iTop=Math.max(Math.min(iTop,mxBottom-this.DragDrop.offsetHeight),mxTop);}
if(this.LimitScreen){var limX=_rdc.DragDropHelper.isIE6?_rdc.DragDropHelper.getScrollXY()[0]:0;var limY=_rdc.DragDropHelper.isIE6?_rdc.DragDropHelper.getScrollXY()[1]:0;if(iLeft<limX)
iLeft=limX;if(iTop<limY)
iTop=limY;}
if(!this.LockX){this.DragDrop.style.left=iLeft-this._marginLeft+"px";}
if(!this.LockY){this.DragDrop.style.top=iTop-this._marginTop+"px";}
this.onMove();},Stop:function(){_rdc.DragDropHelper.removeEvent(document,"mousemove",this._fM);_rdc.DragDropHelper.removeEvent(document,"mouseup",this._fS);if(_rdc.DragDropHelper.isIE){_rdc.DragDropHelper.removeEvent(this._Handle,"losecapture",this._fS);this._Handle.releaseCapture();}else{_rdc.DragDropHelper.removeEvent(window,"blur",this._fS);};this.onStop();}};