EventListener.addEvent(window,"load",function(){new DesignControls() }); function DesignControls(){var B=document.getElementsByTagName("input"); var A=""; for(var D=0; D0){this._constructor.apply(this,arguments) }}DesignCheckBox.prototype._constructor=function(A){this.input=A; this.GUI=this.transform(A); if(A.parentNode.tagName.toUpperCase()!="LABEL"||document.all||this.safari){if(!A.disabled){EventListener.addEvent(this.GUI,"click",this.onclick,this) }}}; DesignCheckBox.prototype.onclick=function(A){this.input.focus(); this.forwardClick(this.input); this.updateGUI() }; DesignCheckBox.prototype.updateGUI=function(){ClassName.remove(this.GUI,"DCcheckboxdisabledchecked"); ClassName.remove(this.GUI,"DCcheckboxchecked"); ClassName.remove(this.GUI,"DCcheckboxdisabled"); if(this.input.checked){if(this.input.disabled){ClassName.add(this.GUI,"DCcheckboxdisabledchecked") }else{ClassName.add(this.GUI,"DCcheckboxchecked") }}else{if(this.input.disabled){ClassName.add(this.GUI,"DCcheckboxdisabled") }}}; DesignCheckBox.prototype.create=function(A){var B=document.createElement("span"); B.className="DCcheckbox"; if(this.input.checked){ClassName.add(B,"DCcheckboxchecked") }return(B) }; function DesignRadioGroup(B){this.designRadios=new Array(); for(var A=0; A0){this._constructor.apply(this,arguments) }}DesignRadio.prototype._constructor=function(C,B,A){this.input=C; this.group=B; this.index=A; this.GUI=this.transform(C); if(C.parentNode.tagName.toUpperCase()!="LABEL"||document.all||this.safari){if(!C.disabled){EventListener.addEvent(this.GUI,"click",this.onclick,this) }}}; DesignRadio.prototype.onclick=function(A){this.input.focus(); this.forwardClick(this.input); this.updateGUI() }; DesignRadio.prototype.updateGUI=function(){this.group.updateGUI() }; DesignRadio.prototype.create=function(A){var B=document.createElement("span"); B.className="DCradio"; if(this.input.checked){ClassName.add(B,"DCradiochecked") }return(B) }; function DesignSelect(){}DesignSelect.prototype=new DesignControl; DesignSelect.prototype.constructor=DesignSelect; DesignSelect.superclass=DesignControl.prototype; function DesignSelect(){if(arguments.length>0){this._constructor.apply(this,arguments) }}DesignSelect.prototype._constructor=function(A){this.input=A; this.GUI=this.transform(A); if(!A.disabled){if(this.onclick){EventListener.addEvent(this.GUI,"click",this.onclick,this) }}}; DesignSelect.prototype.log=function(A){}; DesignSelect.prototype.makeActive=function(){this.log("makeActive"); var A=this; this.createTextInput(); this.inputElement.tabIndex=-1; this.inputElement.onkeypress=function(B){if(B.keyCode==27){A.makeActiveClosed() }A.updateGUI() } }; DesignSelect.prototype.makeActiveClosed=function(){this.log("makeActiveClosed"); this.makeActive(); var A=this; this.GUI.onclick=function(){A.makeActiveOpen() }; this.setOptionsVisible(false); this.textInput.style.left=""; this.GUI.style.zIndex=0 }; DesignSelect.prototype.makeActiveOpen=function(){this.log("makeActiveOpen"); this.makeActive(); var A=this; this.GUI.onclick=null; this.setOptionsVisible(true); if(this.isSearch){this.textInput.style.left="0px"; this.log(this.textInput.style.left); this.log(this.textInput.style.zIndex) }this.textInput.focus(); this.GUI.style.zIndex=1000 }; DesignSelect.prototype.updateFocusDelayed=function(){this.log("updateFocusDelayed"); if(this.textInputFocused||this.optionsFocused){if(!this.isOptionsVisible()){this.makeActiveOpen() }}else{if(this.isOptionsVisible()){this.makeActiveClosed() }}}; DesignSelect.prototype.updateFocus=function(){var A=this; window.setTimeout(function(){A.updateFocusDelayed() },200) }; DesignSelect.prototype.createTextInput=function(){this.log("createTextInput"); this.log(this.textInput); if(!this.textInput){var A=this; this.textInput=document.createElement("input"); this.log("created textInput"); this.textInput.type="text"; this.textInput.className="choiceSearchStatus"; this.textInput.value=this.pattern; this.textInput.ds=this; this.textInput.onkeydown=function(B){if(!B){B=window.event }A.log("DOWN key: "+B.keyCode+" | char: "+B.charCode); if(B.keyCode==13){A.textInput.blur(); return EventListener.cancelEvent(B) }if(B.keyCode==27){A.makeActiveClosed() }if(B.keyCode==38){A.selectOffset(-1,B) }if(B.keyCode==40){A.selectOffset(1,B) }}; this.textInput.onkeyup=function(B){if(!B){B=window.event }A.log("UP key: "+B.keyCode+" | char: "+B.charCode); A.pattern=A.isSearch?A.textInput.value:""; if(B.keyCode!=27&&B.keyCode!=38&&B.keyCode!=40){A.updateOptions() }}; this.textInput.onfocus=function(){A.log("focus textInput"); A.textInputFocused=true; A.updateFocus() }; this.textInput.onblur=function(){A.log("blur textInput"); A.textInputFocused=false; A.updateFocus() }; this.GUI.appendChild(this.textInput) }this.textInput.style.display="none"; this.textInput.style.display="block"; this.textInput.style.display="inline"; this.log("this.textInput.style"); this.log(this.textInput.style.left); this.log(this.textInput.style.zIndex); this.log(this.textInput.style.display) }; DesignSelect.prototype.isOptionsVisible=function(){return this.options.style.display=="block" }; DesignSelect.prototype.setOptionsVisible=function(A){this.log("visible: "+A); var B=this.options.style; B.display=A?"block":"none"; B.marginTop=this.status.parentNode.offsetHeight+"px"; this.GUI.style.left=A?"0pt":""; if(A){this.setDimensions(); if(!this.safari){var E=(window.innerHeight||document.documentElement.clientHeight)+(window.pageYOffset||document.documentElement.scrollTop); var D=Utils.calculateTop(this.options); var C=this.options.offsetHeight; var B=this.options.style; if(E-D-C<0){B.marginTop=-(C+1)+"px" }else{B.marginTop=this.status.parentNode.offsetHeight+"px" }}}}; DesignSelect.prototype.selectOffset=function(C,B){var A=this.selectOffsetImpl(C,B); if(A==undefined){A=this.selectOffsetImpl(C,B) }this.selectIndex(A,B) }; DesignSelect.prototype.selectOffsetImpl=function(C,B){var A=this.scroller.childNodes.length; if(A<=0){return }if(!this.filteredSelectedIndex){this.filteredSelectedIndex=0 }this.filteredSelectedIndex+=C; if(this.filteredSelectedIndex<0){this.filteredSelectedIndex=A-1 }if(this.filteredSelectedIndex>=A){this.filteredSelectedIndex=0 }return this.scroller.childNodes[this.filteredSelectedIndex].index }; DesignSelect.prototype.onselect=function(B){this.log("onselect"); var A=(B)?B.target:window.event.srcElement; if(A.nodeType!=1){A=A.parentNode }this.selectIndex(A.index,B); this.makeActiveClosed(); EventListener.cancelEvent(B) }; DesignSelect.prototype.selectIndex=function(A,B){if(this.input.selectedIndex!=A){this.input.selectedIndex=A; if(this.input.onchange){this.input.onchange.call(this.input,B) }if(this.input.onselect){this.input.onselect.call(this.input,B) }}this.updateGUI() }; DesignSelect.prototype.updateGUI=function(){this.log("updateGUI"); if(this.input.options.length>this.input.selectedIndex){this.status.innerHTML=this.input.options[this.input.selectedIndex].innerHTML }for(var B=0; B10){var B=this.scroller.childNodes[0].offsetHeight; this.options.style.height=(10*B)+"px"; this.options.style.width=(A+18)+"px"; this.options.style.overflow="auto" }else{if(A>0){this.options.style.width=A+"px" }}this.scroller.tabIndex=-1 }; DesignSelect.prototype.scrollIntoView=function(D){var G=D.offsetLeft,F=D.offsetTop; var C=D.offsetWidth,A=D.offsetHeight; if(D.parentNode!=D.offsetParent){G-=D.parentNode.offsetLeft; F-=D.parentNode.offsetTop }var H=D.parentNode; while(H&&(H.nodeType==1)){if(GH.scrollLeft+H.clientWidth){H.scrollLeft=(G+C)-H.clientWidth }if(FH.scrollTop+H.clientHeight){H.scrollTop=(F+A)-H.clientHeight }var E=H.offsetLeft,B=H.offsetTop; if(H.parentNode!=H.offsetParent){E-=H.parentNode.offsetLeft; B-=H.parentNode.offsetTop }G+=E-H.scrollLeft; F+=B-H.scrollTop; H=H.parentNode }}; DesignSubmit.prototype=new DesignControl; DesignSubmit.prototype.constructor=DesignCheckBox; DesignSubmit.superclass=DesignControl.prototype; function DesignSubmit(){if(arguments.length>0){this._constructor.apply(this,arguments) }}DesignSubmit.prototype._constructor=function(A){this.input=A; this.GUI=this.transform(A); if(!A.disabled){EventListener.addEvent(this.GUI,"click",this.onclick,this) }}; DesignSubmit.prototype.transform=function(C){var A=document.createElement("span"); var B=this.create(C); A.id=C.id; C.id=C.id+"_replaced"; EventListener.addEvent(C,"focus",this.focus,this); EventListener.addEvent(C,"blur",this.blur,this); ClassName.add(B,"DCblur"); ClassName.add(B,C.className); A.appendChild(B); C.DC=this; C.parentNode.insertBefore(A,C); ClassName.add(C,"replaced"); A.onfocus=function(){C.focus() }; return A }; DesignSubmit.prototype.create=function(D){if(D.disabled){var E=document.createElement("div"); E.className="DCsubmitDisabled"; E.href="#" }else{var E=document.createElement("a"); E.className="DCsubmit"; E.href="#" }E.onclick=function(){return false }; var C=document.createElement("span"); E.appendChild(C); var B=document.createElement("span"); C.appendChild(B); var A=document.createElement("span"); B.appendChild(A); A.innerHTML=D.value; return(E) }; DesignSubmit.prototype.onclick=function(A){this.input.focus(); if(this.input.onclick){var B=this.input.onclick.call(this.input,A); if(B){this.input.click() }}else{this.input.click() }EventListener.cancelEvent(A) }; DesignSubmit.prototype.focus=function(){ClassName.swap(this.GUI,"DCblur","DCfocus") }; DesignSubmit.prototype.blur=function(){ClassName.swap(this.GUI,"DCfocus","DCblur") }; DesignSubmit.prototype.updateGUI=function(){replacingInString=this.input.id.slice(0,-9); replacingInput=document.getElementById(replacingInString); inner=replacingInput.firstChild; while(inner){next=inner.nextSibling; replacingInput.removeChild(inner); inner=next }child=this.create(this.input); inputclasses=this.input.className; ClassName.add(child,inputclasses.replace(/replaced/,"")); ClassName.add(child,"DCblur"); replacingInput.appendChild(child) };