function getFormValues(form,checkbox_null){if(typeof(checkbox_null)=="undefined"){checkbox_null=false;} var ret={};for(var key=0;key0){if(element.multiple){var vals={};for(var y=0;y=0){value=element.options[element.selectedIndex].value;}}}}else{name=null;} if(value===""){value="";} if(name!=null){var first=name.indexOf("[");if(first>0&&name.substring(name.length-1)=="]"){var arr=name.substring(first+1,name.length-1).split("][");name=name.substring(0,first);var tmp=ret[name];if(typeof(tmp)!="object"){tmp={};} if(arr.length==0||arr.length==1&&arr[0]==""){var cnt=0;for(var x in tmp){cnt++;} tmp[cnt]=value;}else{var keys=[];for(var i in arr){keys.push(arr[i].replace('"',"'"));if(eval("typeof(tmp["+keys.join("][")+"]);")=="undefined"){eval("tmp["+keys.join("][")+"] = {};");}} eval("tmp["+keys.join("][")+"] = value");} ret[name]=tmp;}else{ret[name]=value;}}} return ret;} function checkMail(string){var mail=/^.+@.+\..{2,4}$/;return mail.test(string);} function trim(stringToTrim){if(typeof(stringToTrim)=="number"){stringToTrim=stringToTrim+"";}else if(typeof(stringToTrim)!="string"){return"";} return stringToTrim.replace(/^\s+|\s+$/g,"");} function InputElement(name,type,size,maxlength,resizable){if(typeof(name)=="object"&&typeof(type)=="undefined"&&typeof(size)=="undefined"&&typeof(maxlength)=="undefined"&&typeof(resizable)=="undefined"){this.resize=false;this.setElement(name);}else{if(typeof(name)=="undefined"){name="text";} if(typeof(type)=="undefined"||type=="radio"||type=="checkbox"){type="text";} var element=document.createElement('input');element.name=name;element.type=type;if(typeof(size)!="undefined"){element.size=size;} if(typeof(maxlength)!="undefined"&&maxlength!=null){element.maxLength=maxlength;} if(typeof(resizable)!="undefined"&&resizable){this.resize=true;}else{this.resize=false;} this.setElement(element);}} InputElement.prototype.setElement=function(element){var insert=null;if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null&&element.parentNode.className.indexOf("inputElement")>=0){var cont_old=element.parentNode;element.parentNode.removeChild(element);insert=[cont_old.parentNode,null];if(cont_old.nextSibling){insert[1]=cont_old.nextSibling;} cont_old.parentNode.removeChild(cont_old);}else if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null){insert=[element.parentNode,null];if(element.nextSibling){insert[1]=element.nextSibling;} element.parentNode.removeChild(element);} this.container=document.createElement('div');this.container.className="inputElement";var events=['abort','blur','change','error','focus','reset','click','mousedown','mousemove','mouseout','mouseover','mouseup','keydown','keypress','keyup'];this.functions={};for(var k in events){var name="on"+events[k];if(typeof(element[name])!="undefined"&&element[name]!=null){this.functions[name]=element[name];}} if(element.disabled||element.readOnly){this.enabled=false;element.disabled=true;element.readonly=true;}else{this.enabled=true;element.disabled=false;element.readonly=false;} this.element=element;this.element.style.display="block";this.element.style.border="0";this.element.style.margin="0";this.element.style.verticalAlign="middle";this.element.style.overflow="hidden";this.element.style.width="100%";this.element.style.height="100%";if(this.resize){this.container.style.width="auto";this.element.functions=this.functions;this.element.onchange=this._changeFunction;this.element.onkeyup=this._keyFunction;this.text=document.createElement('span');this.text.style.height="1px";this.text.style.display="block";this.text.style.whiteSpace="pre";this.text.style.lineHeight="1px";this.text.style.margin="0 0 -1px 0";this.text.style.visibility="hidden";this.text.appendChild(document.createTextNode(this.element.value));this.container.appendChild(this.text);} this.container.appendChild(this.element);if(insert!=null){if(insert[1]!=null){insert[0].insertBefore(this.container,insert[1]);}else{insert[0].appendChild(this.container);}}};InputElement.prototype.setHeight=function(height){this.element.style.height=height+"px";} InputElement.prototype.setWidth=function(width){this.element.style.width=width+"px";this.container.style.width=width+"px";} InputElement.prototype.getValue=function(trim_val){if(typeof(trim_val)=="undefined"){trim_val=false;} var value=this.element.value;if(trim_val){value=trim(value);} return value;};InputElement.prototype.setValue=function(value){this.element.value=value;if(typeof(this.text)!="undefined"){this.text.firstChild.data=value;}};InputElement.prototype.setId=function(val){this.element.id=val;};InputElement.prototype.setTitle=function(val){this.element.title=val;};InputElement.prototype.setEnabled=function(bool){if(bool){this.enabled=true;this.element.disabled=false;this.element.readOnly=false;this.element.onkeyup=null;this.element.onkeydown=null;this._setFunctions();}else{this.enabled=false;this.element.disabled=true;this.element.readOnly=true;this.element.onkeyup=function(){return false;};this.element.onkeydown=function(){return false;};}};InputElement.prototype.focus=function(){this.element.focus();};InputElement.prototype.blur=function(){this.element.blur();};InputElement.prototype.setIndex=function(num){this.element.tabIndex=num;};InputElement.prototype.setFunction=function(event,object){this.functions[event]=object;if(event!="onkeyup"&&event!="onchange"){this.element[event]=object;}};InputElement.prototype.getNode=function(){return this.container;};InputElement.prototype.getElement=function(){return this.element;};InputElement.prototype.getForm=function(){return this.element.form;};InputElement.prototype._makeResizable=function(){};InputElement.prototype._changeFunction=function(e){this.parentNode.firstChild.firstChild.data=this.value;if(typeof(this.functions["onchange"])!="undefined"){return this.functions["onchange"].call(this,e);}};InputElement.prototype._keyFunction=function(e){this.parentNode.firstChild.firstChild.data=this.value;if(typeof(this.functions["onkeyup"])!="undefined"){return this.functions["onkeyup"].call(this,e);}};InputElement.prototype._setFunctions=function(){for(var key in this.functions){if(key!="onkeyup"&&key!="onchange"){this.element[key]=this.functions[key];}}};function FileElement(name,text){if(typeof(text)=="undefined"){text="Procházet";} this.text=text;if(typeof(name)=="object"){this.setElement(name);}else{var element=document.createElement('input');element.name=name;element.type="file";this.setElement(element);}} FileElement.prototype.setElement=function(element){var insert=null;if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null&&element.parentNode.className.indexOf("fileElement")>=0){var cont_old=element.parentNode;element.parentNode.removeChild(element);insert=[cont_old.parentNode,null];if(cont_old.nextSibling){insert[1]=cont_old.nextSibling;} cont_old.parentNode.removeChild(cont_old);}else if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null){insert=[element.parentNode,null];if(element.nextSibling){insert[1]=element.nextSibling;} element.parentNode.removeChild(element);} this.container=document.createElement('div');this.container.className="fileElement";var events=['abort','blur','change','error','focus','reset','click','mousedown','mousemove','mouseout','mouseover','mouseup'];this.functions={};for(var k in events){var name="on"+events[k];if(typeof(element[name])!="undefined"&&element[name]!=null){this.functions[name]=element[name];}} element.onchange=this._changeFile;if(element.disabled){this.enabled=false;element.style.display="none";this.container.className+=" disabled";}else{element.style.display="block";this.enabled=true;} this.element=element;this.element.object=this;this.element.style.display="inline";this.element.style.fontSize="45px";this.element.size="4";this.element.style.opacity=".0";if(navigator.appName=='Microsoft Internet Explorer'){var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");var rv=6;if(re.exec(ua)!=null){rv=parseFloat(RegExp.$1);} if(rv<=8){this.element.style.filter="alpha(opacity=0)";}} var box=document.createElement('span');box.style.display="block";box.style.width="600px";box.style.height="100%";box.style.direction="ltr";box.style.margin="-20% -10px 0 0";box.style.overflow="hidden";box.appendChild(this.element);var label=document.createElement('label');label.style.display="block";label.style.direction="ltr";label.appendChild(document.createTextNode(this.text));var button=document.createElement('div');button.style.textAlign="right";button.style.direction="rtl";button.style.overflow="hidden";button.className="button";button.appendChild(label);button.appendChild(box);var file=document.createElement('span');file.className="file";file.appendChild(document.createTextNode('\u00a0'));file.style.display="block";file.style.overflow="hidden";this.file=file;this.container.appendChild(file);var del=document.createElement('div');del.className="delete";del.appendChild(document.createTextNode('\u00a0'));del.title="Odstranit vybraný soubor";del.object=this;del.onclick=function(e){this.object.reset(e);};this.container.appendChild(del);this.container.appendChild(button);if(insert!=null){if(insert[1]!=null){insert[0].insertBefore(this.container,insert[1]);}else{insert[0].appendChild(this.container);}}};FileElement.prototype.reset=function(event){this.file.firstChild.data="\u00a0";var elem=document.createElement('input');elem.type="file";elem.name=this.element.name;elem.size=this.element.size;elem.style.display="inline";elem.style.fontSize="45px";elem.size="4";elem.style.opacity=".0";elem.object=this;if(navigator.appName=='Microsoft Internet Explorer'){elem.style.filter="alpha(opacity=0)";} elem.onchange=this._changeFile;if(this.element.id){elem.id=this.element.id;} if(this.element.tabIndex){elem.tabIndex=this.element.tabIndex;} this.element.parentNode.insertBefore(elem,this.element);this.element.parentNode.removeChild(this.element);this.element=elem;if(typeof(this.functions["onchange"])!="undefined"){this.functions["onchange"].call(this.element,event);}};FileElement.prototype._changeFile=function(event){var path=this.value;var file="";var obj=this.object;if(path.length>0){path=path.replace(/\\/g,"/");file=path.split("/").pop();} obj.file.firstChild.data=file;if(typeof(obj.functions["onchange"])!="undefined"){obj.functions["onchange"].call(this,event);}};FileElement.prototype.getValue=function(){return this.element.value;};FileElement.prototype.setValue=function(){return false;};FileElement.prototype.setId=function(val){this.element.id=val;};FileElement.prototype.setTitle=function(val){this.container.title=val;};FileElement.prototype.setEnabled=function(bool){if(bool){this.enabled=true;this.element.style.display="none";this.container.className="fileElement disabled";}else{this.enabled=false;this.container.className="fileElement";this.element.style.display="block";}};FileElement.prototype.focus=function(){return false;};FileElement.prototype.blur=function(){return false;};FileElement.prototype.setIndex=function(num){this.element.tabIndex=num;};FileElement.prototype.setFunction=function(event,object){this.functions[event]=object;if(event!="onchange"){this.element[event]=object;}};FileElement.prototype.getNode=function(){return this.container;};FileElement.prototype.getElement=function(){return this.element;};FileElement.prototype.getForm=function(){return this.element.form;};FileElement.prototype.removeEmpty=function(){if(this.element.value==""){this.element.parentNode.removeChild(this.element);}};function SelectElement(name,options,selected){if(typeof(name)=="object"&&typeof(options)=="undefined"&&typeof(selected)=="undefined"){this.setElement(name);}else{if(typeof(name)=="undefined"){name="select";} if(typeof(options)=="undefined"){options=["-"];} this.element=document.createElement('select');this.element.name=name;for(var key in options){if(typeof(options[key])=="object"&&typeof(options[key].text)!="undefined"&&typeof(options[key].value)!="undefined"){var option=document.createElement('option');option.appendChild(document.createTextNode(options[key].text));option.value=options[key].value;this.element.appendChild(option);}else if(typeof(options[key])=="object"&&typeof(options[key].label)!="undefined"&&typeof(options[key].options)!="undefined"){var group=document.createElement('optgroup');group.label=options[key].label;for(var k2 in options[key].options){var option=document.createElement('option');if(typeof(options[key].options[k2])=="object"&&typeof(options[key].options[k2].text)!="undefined"&&typeof(options[key].options[k2].value)!="undefined"){option.appendChild(document.createTextNode(options[key].options[k2].text));option.value=options[key].options[k2].value;}else{option.appendChild(document.createTextNode(options[key].options[k2]));option.value=k2;} group.appendChild(option);} this.element.appendChild(group);}else{var option=document.createElement('option');option.appendChild(document.createTextNode(options[key]));option.value=key;this.element.appendChild(option);}} if(this.element.options.length>0){this.element.selectedIndex=0;} if(typeof(selected)!="undefined"){for(var i=0;i=0){var cont_old=element.parentNode;element.parentNode.removeChild(element);insert=[cont_old.parentNode,null];if(cont_old.nextSibling){insert[1]=cont_old.nextSibling;} cont_old.parentNode.removeChild(cont_old);}else if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null){insert=[element.parentNode,null];if(element.nextSibling){insert[1]=element.nextSibling;} element.parentNode.removeChild(element);} this.functions={};this.container=document.createElement('div');this.container.className="selectElement";var events=['blur','change','focus','click','mousedown','mousemove','mouseout','mouseover','mouseup'];this.functions={};for(var k in events){var name="on"+events[k];if(typeof(element[name])!="undefined"&&element[name]!=null){this.functions[name]=element[name];}} if(element.disabled){this.enabled=false;this.container.className="selectElement disabled";}else{this.enabled=true;} element.style.display="none";this.element=element;this.container.appendChild(this.element);if(insert!=null){if(insert[1]!=null){insert[0].insertBefore(this.container,insert[1]);}else{insert[0].appendChild(this.container);}} this._buildNewElements();};SelectElement.prototype.getValue=function(){return this.element.options[this.element.selectedIndex].value;};SelectElement.prototype.setValue=function(value){for(var i=0;isize){this.options.style.overflow="auto";this.options.style.height=(this.itemHeight*size)+"px";}else{this.options.style.overflow="visible";this.options.style.height="auto";}};SelectElement.prototype.getElement=function(){return this.element;};SelectElement.prototype.getNode=function(){return this.container;};SelectElement.prototype.getForm=function(){return this.element.form;};SelectElement.prototype._buildNewElements=function(){var body=top.document.getElementsByTagName('body')[0];var button=document.createElement('span');button.appendChild(document.createTextNode('\u00a0'));button.style.display="block";button.style.width="16px";button.style.height="100%";if(typeof(button.style.styleFloat)!="undefined"){button.style.styleFloat="right";}else{button.style.cssFloat="right";} this.label=document.createElement('label');this.label.style.display="block";this.label.style.width="auto";this.label.style.height="auto";if(typeof(this.label.style.styleFloat)!="undefined"){this.label.style.styleFloat="none";}else{this.label.style.cssFloat="none";} this.label.appendChild(button);this.label.appendChild(document.createTextNode(this.element.options[this.element.selectedIndex].text));this.label.onclick=this._labelFunction;var height=0;var maxheight=12;var options=document.createElement('div');options.style.clear="both";options.style.position='absolute';options.style.top="-999px";options.style.left="-999px";options.style.whiteSpace="nowrap";options.className="selectElementOptions";if(body!=null){body.appendChild(options);}else{height=10;} var label_function=function(event){var select=this.parentNode.parentNode.getElementsByTagName('select')[0];var label=this.parentNode.parentNode.getElementsByTagName('label')[0];var index=this.rel.split("_").pop();var before=select.selectedIndex;select.selectedIndex=index;if(typeof(select.onchange)!="undefined"&&select.onchange!=null&&index!=before){select.onchange.call(select,event);} label.childNodes[1].data=select.options[select.selectedIndex].text;this.parentNode.style.display="none";return false;} var group_before=null;var use_groups=false;var add_group=null;for(var i=0;iheight){height=group_label.scrollHeight;} if(group_label.scrollHeight>maxheight){maxheight=group_label.scrollHeight;} add_group=null;} var row=document.createElement('a');row.href="";row.rel="r_"+i;row.appendChild(document.createTextNode(this.element.options[i].text));row.style.display="block";row.style.whiteSpace="nowrap";row.onclick=label_function;if(use_groups){row.className="in-group";} options.appendChild(row);if(row.scrollHeight>height){height=row.scrollHeight;} if(row.scrollHeight>maxheight){maxheight=row.scrollHeight;}} this.itemHeight=height;this.label.style.display="block";this.label.style.height=maxheight+"px";this.label.style.lineHeight=maxheight+"px";this.label.style.whiteSpace="nowrap";this.container.style.height=maxheight+"px";var width=options.scrollWidth+23;this.container.style.width=width+"px";options.style.width=width+"px";options.style.top="";options.style.left="";options.style.display="none";if(this.element.options.length>6){options.style.overflow="auto";options.style.height=(height*6)+"px";} for(var k in this.functions){if(k!="onclick"){this.label[k]=new Function('this.parentNode.getElementsByTagName("select")[0].'+k+'();');}} body.removeChild(options);this.container.appendChild(this.label);this.container.appendChild(options);this.options=options;};SelectElement.prototype._labelFunction=function(){if(typeof(this.parentNode)!="undefined"){var select=this.parentNode.getElementsByTagName('select')[0];var options=this.parentNode.getElementsByTagName('div')[0];if(options.style.display=="none"){options.style.display="";}else{options.style.display="none";} if(typeof(select.onclick)!="undefined"&&select.onclick!=null){select.onclick();}}};function RadioElement(name,value,checked){if(typeof(name)=="object"&&typeof(value)=="undefined"&&typeof(checked)=="undefined"){this.setElement(name);}else{if(typeof(name)=="undefined"){name="radio";} this.element=document.createElement('input');this.element.name=name;this.element.type="radio";this.element.value=value;this._buildNewElements();}} RadioElement.prototype.setElement=function(element){var insert=null;if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null&&element.parentNode.className.indexOf("radioElement")>=0){var cont_old=element.parentNode;element.parentNode.removeChild(element);insert=[cont_old.parentNode,null];if(cont_old.nextSibling){insert[1]=cont_old.nextSibling;} cont_old.parentNode.removeChild(cont_old);}else if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null){insert=[element.parentNode,null];if(element.nextSibling){insert[1]=element.nextSibling;} element.parentNode.removeChild(element);} this.functions={};this.container=document.createElement('div');this.container.className="radioElement";var events=['blur','change','focus','click','mousedown','mousemove','mouseout','mouseover','mouseup'];this.functions={};for(var k in events){var name="on"+events[k];if(typeof(element[name])!="undefined"&&element[name]!=null){this.functions[name]=element[name];}} if(element.disabled){this.enabled=false;this.container.className="radioElement disabled";}else{this.enabled=true;} element.style.zIndex="-100";element.style.position="relative";element.style.top="-100%";element.style.margin="0";if(navigator.appName=='Microsoft Internet Explorer'){var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");var rv=6;if(re.exec(ua)!=null){rv=parseFloat(RegExp.$1);} if(rv<=7){element.style.display="none";}} this.element=element;this._buildNewElements();this.container.appendChild(this.element);if(insert!=null){if(insert[1]!=null){insert[0].insertBefore(this.container,insert[1]);}else{insert[0].appendChild(this.container);}}};RadioElement.prototype.getValue=function(param){if(typeof(param)!="undefined"&¶m){return this.element.value;} if(this.element.checked){return this.element.value;}else{return null;}};RadioElement.prototype.setValue=function(value){if(value===true){this.select();}else if(value!==false){this.element.value=value;}};RadioElement.prototype.select=function(){this.button.onclick();};RadioElement.prototype.setId=function(val){this.element.id=val;};RadioElement.prototype.setTitle=function(val){this.element.title=val;};RadioElement.prototype.setEnabled=function(bool){if(bool){this.enabled=true;this.element.disabled=false;this.button.onclick=this._buttonFunction;this.container.className="radioElement";}else{this.enabled=false;this.element.disabled=true;this.button.onclick=function(){return false;};this.container.className="radioElement disabled";}};RadioElement.prototype.focus=function(){return false;};RadioElement.prototype.blur=function(){return false;};RadioElement.prototype.setIndex=function(num){this.element.tabIndex=num;};RadioElement.prototype.setFunction=function(event,object){this.functions[event]=object;this.element[event]=object;if(event!="onclick"){this.button[event]=new Function('this.parentNode.getElementsByTagName("input")[0].'+event+'();');}else{this.button._onclick=object;}};RadioElement.prototype.getElement=function(){return this.element;};RadioElement.prototype.getNode=function(){return this.container;};RadioElement.prototype.getForm=function(){return this.element.form;};RadioElement.prototype._buttonFunction=function(event){if(typeof(this.parentNode)!="undefined"){var element=this.parentNode.getElementsByTagName('input')[0];if(element.disabled){return;} var elements=[];if(element.form){elements=element.form.elements;}else{var inputs=document.getElementsByTagName('input');for(var i=0;i=0){elements[i].parentNode.getElementsByTagName('span')[0].className="";}}} element.checked=true;this.className="selected";if(typeof(this._onclick)!="undefined"){this._onclick.call(element,event);}}};RadioElement.prototype._buildNewElements=function(){this.button=document.createElement('span');this.button.appendChild(document.createTextNode('\u00a0'));this.button.style.display="block";this.button.style.width="100%";this.button.style.height="100%";this.button.onclick=this._buttonFunction;for(var event in this.functions){if(event!="onclick"){this.button[event]=new Function('this.parentNode.getElementsByTagName("input")[0].'+event+'();');}} if(this.element.checked){this.button.className="selected";} this.container.appendChild(this.button);};function CheckboxElement(name,value,checked){if(typeof(name)=="object"&&typeof(value)=="undefined"&&typeof(checked)=="undefined"){this.setElement(name);}else{if(typeof(name)=="undefined"){name="checkbox";} this.element=document.createElement('input');this.element.name=name;this.element.type="checkbox";this.element.value=value;if(typeof(checked)=="undefined"){checked=false;} this.functions={};this.enabled=true;this.container=document.createElement('div');this.container.appendChild(this.element);this.container.className="checkboxElement";this.element.checked=checked;this._buildNewElements();}} CheckboxElement.prototype.setElement=function(element){var insert=null;if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null&&element.parentNode.className.indexOf("checkboxElement")>=0){var cont_old=element.parentNode;element.parentNode.removeChild(element);insert=[cont_old.parentNode,null];if(cont_old.nextSibling){insert[1]=cont_old.nextSibling;} cont_old.parentNode.removeChild(cont_old);}else if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null){insert=[element.parentNode,null];if(element.nextSibling){insert[1]=element.nextSibling;} element.parentNode.removeChild(element);} this.functions={};this.container=document.createElement('div');this.container.className="checkboxElement";var events=['blur','change','focus','click','mousedown','mousemove','mouseout','mouseover','mouseup'];this.functions={};for(var k in events){var name="on"+events[k];if(typeof(element[name])!="undefined"&&element[name]!=null){this.functions[name]=element[name];}} if(element.disabled){this.enabled=false;this.container.className="checkboxElement disabled";}else{this.enabled=false;} element.style.display="none";this.element=element;this.container.appendChild(this.element);if(insert!=null){if(insert[1]!=null){insert[0].insertBefore(this.container,insert[1]);}else{insert[0].appendChild(this.container);}} this._buildNewElements();};CheckboxElement.prototype.getValue=function(param){if(typeof(param)!="undefined"&¶m){return this.element.value;} if(this.element.checked){return this.element.value;}else{return null;}};CheckboxElement.prototype.setValue=function(value){if(value===true){this.check();}else if(value===false){this.uncheck();}else{this.element.value=value;}};CheckboxElement.prototype.click=function(){if(this.element.checked){this.uncheck();}else{this.check();}};CheckboxElement.prototype.check=function(){if(typeof(this.element.onclick)!="undefined"&&this.element.onclick!=null){this.element.onclick();} this.element.checked=true;this.button.className="selected";};CheckboxElement.prototype.uncheck=function(){if(typeof(this.element.onclick)!="undefined"&&this.element.onclick!=null){this.element.onclick();} this.element.checked=false;this.button.className="";};CheckboxElement.prototype.setId=function(val){this.element.id=val;};CheckboxElement.prototype.setTitle=function(val){this.element.title=val;this.container.title=val;};CheckboxElement.prototype.setEnabled=function(bool){if(bool){this.enabled=true;this.element.disabled=false;this.button.onclick=this._labelFunction;this.container.className="checkboxElement";}else{this.enabled=false;this.element.disabled=true;this.button.onclick=function(){return false;};this.container.className="checkboxElement disabled";}};CheckboxElement.prototype.focus=function(){return false;};CheckboxElement.prototype.blur=function(){return false;};CheckboxElement.prototype.setIndex=function(num){this.element.tabIndex=num;};CheckboxElement.prototype.setFunction=function(event,object){this.functions[event]=object;this.element[event]=object;if(event!="onclick"){this.button[event]=new Function('this.parentNode.getElementsByTagName("input")[0].'+event+'();');}};CheckboxElement.prototype.getElement=function(){return this.element;};CheckboxElement.prototype.getNode=function(){return this.container;};CheckboxElement.prototype.getForm=function(){return this.element.form;};CheckboxElement.prototype._buttonFunction=function(){if(typeof(this.parentNode)!="undefined"){var element=this.parentNode.getElementsByTagName('input')[0];var ret=true;if(typeof(element.onclick)!="undefined"&&element.onclick!=null){ret=element.onclick();} if(ret===false){return false;} if(element.disabled){return false;} if(element.checked){element.checked=false;this.className="";}else{element.checked=true;this.className="selected";}} return false;};CheckboxElement.prototype._buildNewElements=function(){this.element.style.display="none";this.button=document.createElement('span');this.button.appendChild(document.createTextNode('\u00a0'));this.button.style.display="block";this.button.style.width="100%";this.button.style.height="100%";this.button.onclick=this._buttonFunction;for(var event in this.functions){if(event!="onclick"){this.button[event]=new Function('this.parentNode.getElementsByTagName("input")[0].'+event+'();');}} if(this.element.checked){this.button.className="selected";} this.container.appendChild(this.button);};document.onclick=function(e){if(e==null){e=window.event};var target=e.target!=null?e.target:e.srcElement;var clicked=null;while(target!=null){if(typeof(target.nodeName)!="undefined"&&target.nodeName.toLowerCase()=="div"&&target.className.indexOf("selectElement")>=0){clicked=target;break;} target=target.parentNode;} var divs=document.getElementsByTagName('div');for(var i=0;i=0&&divs[i]!=clicked){var sub=divs[i].getElementsByTagName('div');if(sub.length==1){sub[0].style.display="none";}}}}