function Ajax(url,data){var xmlHttp=null;var onSuccessCbF='';var onSuccessMth='';var onFailureCbF='';var onLoadingCbF='';var onLoadedCbF='';var onSuccessArg='';var onFailureArg='';var onLoadingArg='';var onLoadedArg='';var notrun=true;var rawdata=false;function init(){if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();}else if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
this.doRequest=function(options){init();var encoded=null;if(typeof(data)!="undefined"){if(data!==null){method="POST";encoded=JSON.stringify(data);}else{method="GET";}}else{method="GET";}
xmlHttp.onreadystatechange=getResponse;xmlHttp.open(method,url,true);if(document.xmlVersion){xmlHttp.setRequestHeader('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');}else{xmlHttp.setRequestHeader('Accept','text/html,*/*;q=0.8');}
if(typeof(options)=="undefined"){options={};}
if(typeof(options["elements"])=="object"&&typeof(options["elements"].join)!="undefined"){xmlHttp.setRequestHeader("HTML-Nodes",options["elements"].join(";"));}else if(typeof(options["raw"])=="undefined"||!options["raw"]){xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}else if(typeof(options["raw"])!="undefined"&&options["raw"]){rawdata=true;}
if(typeof(options["headers"])!="undefined"){for(var k in options["headers"]){xmlHttp.setRequestHeader(k,options["headers"][k]);}}
if(method!="GET"){xmlHttp.send(encoded);}else{xmlHttp.send(null);}};function getResponse(){switch(xmlHttp.readyState){case 1:_onLoading();break;case 2:_onLoaded();break;case 4:if(xmlHttp.status==200){_onSuccess();}else{_onFailure();}
break;default:break;}}
function getXmlResponse(){return xmlHttp.responseXML;}
function getTextResponse(){return xmlHttp.responseText;}
function _onSuccess(){if(onSuccessCbF==''){delete xmlHttp;return false;}
var output='';switch(onSuccessMth){default:case"text":output=getTextResponse();break;case"xml":output=getXmlResponse();break;}
if(!rawdata){try{output=JSON.parse(output);}catch(e){alert(e+"\n"+output);}}
var ref=null;if(typeof(onSuccessCbF)=="string"){if(onSuccessCbF.indexOf(".")>=0){var objs=onSuccessCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);}
eval(onSuccessCbF).call(ref,output,onSuccessArg);}else if(typeof(onSuccessCbF)=="function"){onSuccessCbF(output,onSuccessArg);}else if(typeof(onSuccessCbF)=="object"){onSuccessCbF[1].call(onSuccessCbF[0],output,onSuccessArg);}
delete xmlHttp;return true;}
function _onFailure(){var output=getTextResponse();if(onFailureCbF){var ref=null;if(typeof(onFailureCbF)=="string"){if(onFailureCbF.indexOf(".")>=0){var objs=onFailureCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);}
eval(onFailureCbF).call(ref,output,onFailureArg);}else if(typeof(onFailureCbF)=="function"){onFailureCbF(output,onFailureArg);}else if(typeof(onFailureCbF)=="object"){onFailureCbF[1].call(onFailureCbF[0],output,onFailureArg);}}delete xmlHttp;return true;}
function _onLoading(){if(notrun){notrun=false;if(onLoadingCbF==''){delete xmlHttp;return false;}
var ref=null;if(typeof(onLoadingCbF)=="string"){if(onLoadingCbF.indexOf(".")>=0){var objs=onLoadingCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);}
eval(onLoadingCbF).call(ref,onLoadingArg);}else if(typeof(onLoadingCbF)=="object"){if(typeof(onLoadingCbF.length)!="undefined"){onLoadingCbF[1].call(onLoadingCbF[0],onLoadingArg);}else{onLoadingCbF(onLoadingArg);}}
delete xmlHttp;return true;}}
function _onLoaded(){if(onLoadedCbF==''){delete xmlHttp;return false;}
var ref=null;if(typeof(onLoadedCbF)=="string"){if(onLoadedCbF.indexOf(".")>=0){var objs=onLoadedCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);}
eval(onLoadedCbF).call(ref,onLoadedArg);}else if(typeof(onLoadedCbF)=="object"){if(typeof(onLoadedCbF.length)!="undefined"){onLoadedCbF[1].call(onLoadedCbF[0],onLoadedArg);}else{onLoadedCbF(onLoadedArg);}}
delete xmlHttp;return true;};this.onSuccess=function(callback_fce,arg){onSuccessCbF=callback_fce;onSuccessMth="text";onSuccessArg=arg;};this.onFailure=function(callback_fce,arg){onFailureCbF=callback_fce;onFailureArg=arg;};this.onLoading=function(callback_fce,arg){onLoadingCbF=callback_fce;onLoadingArg=arg;};this.onLoaded=function(callback_fce,arg){onLoadedCbF=callback_fce;onLoadedArg=arg;}}
if(!this.JSON){this.JSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text){return eval("("+text+")");};}}());
function ToughStorage(f){this.data={};this.userDataElement=null;this.flashElement=null;this.onload=f;this.full_loaded=false;this.use_flash=false;}
ToughStorage.prototype.init=function(){var elm=document.createElement('div');if(typeof(elm.style.behavior)!="undefined"){elm.style.position="absolute";elm.style.behavior="url(#default#userData)";elm.id="userdata_el";var body=document.getElementsByTagName('body')[0];body.appendChild(elm);this.userDataElement=elm;}
if(typeof(FlashDetect)!="undefined"){if(FlashDetect.installed&&FlashDetect.major>=6){this.use_flash=true;}}
this.full_loaded=false;var data=null;var cookie=null;var cookie=this.getCookie();if(cookie){var ex=null;try{data=this.unserialize(cookie);}catch(ex){}}
if(data==null){var storage=null;var storage=this.HTML5StorageGet();if(storage){try{data=this.unserialize(storage);}catch(ex){}}}
if(data==null){var userdata=null;var userdata=this.userDataGet();if(userdata){try{data=this.unserialize(userdata);}catch(ex){}}}
if(data==null){this.data={};this.imageGet();}else{this.data=data;this.full_loaded=true;}
if(this.full_loaded&&this.onload){this.onload(this.data);}};ToughStorage.prototype.get=function(name){return this.data[name];};ToughStorage.prototype.set=function(name,value,saveall){if(this.full_loaded){this.data[name]=value;if(typeof(saveall)=="undefined"||saveall==true){var str=this.serialize(this.data);this.setCookie(str);this.HTML5StorageSet(str);this.userDataSet(str);this.imageSet(str);this.flashSet(str);}
return true;}else{return false;}};ToughStorage.prototype.save=function(){var str=this.serialize(this.data);this.setCookie(str);this.HTML5StorageSet(str);this.userDataSet(str);this.imageSet(str);this.flashSet(str);};ToughStorage.prototype.flashGet=function(){if(this.use_flash){this.embedFlash({"loadFunct":"flashGetData"});}};ToughStorage.prototype.embedFlash=function(vars){var old_ie=false;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){old_ie=true;}}
var body=document.getElementsByTagName('body')[0];if(!old_ie){var elm=document.createElement('object');elm.type="application/x-shockwave-flash";elm.data="/_files/_swf/storage.swf";elm.width=1;elm.height=1;elm.style.position="absolute";elm.id="u_stor_flash";var param=document.createElement('param');param.name="movie";param.value="/_files/_swf/storage.swf";elm.appendChild(param);var param=document.createElement('param');param.name="allowScriptAccess";param.value="always";elm.appendChild(param);var v=[];for(var key in vars){v.push(key+"="+vars[key]);}
var param=document.createElement('param');param.name="flashVars";param.value=v.join("&");elm.appendChild(param);body.appendChild(elm);this.flashElement=elm;}else{var v=[];for(var key in vars){v.push(key+"="+this.urlencode(vars[key]));}
var tmp=document.createElement('div');tmp.innerHTML+='<object type="application/x-shockwave-flash" style="position:absolute" width="1" id="u_stor_flash" height="1"><param name="allowScriptAccess" value="always" /><param name="flashVars" value="'+v.join("&")+'" /><param name="movie" value="/_files/_swf/storage.swf" /></object>';body.appendChild(tmp);this.flashElement=tmp.firstChild;}
this.flashElement.j_obj=this;};ToughStorage.prototype.flashSet=function(str){if(this.use_flash){if(this.flashElement==null){this.embedFlash({"loadFunct":"flashSetData"});}else{this.flashSetData();}}};ToughStorage.prototype.flashGetData=function(data){try{this.data=this.unserialize(data);}catch(ex){this.data={};}
this.full_loaded=true;if(this.onload){this.onload(this.data);}};ToughStorage.prototype.flashSetData=function(){if(this.flashElement&&typeof(this.flashElement.storeData)!="undefined"){this.flashElement.storeData(this.serialize(this.data));}};ToughStorage.prototype.imageGet=function(){if(typeof(Ajax)=="undefined"){return null;}
var instance=this;var success=function(data){var end=true;try{instance.data=instance.unserialize(data);}catch(ex){if(instance.use_flash){instance.flashGet();end=false;}else{instance.data={};}}
if(end){instance.full_loaded=true;if(instance.onload){instance.onload(instance.data);}}}
var failure=function(data){instance.data={};if(!instance.use_flash){instance.full_loaded=true;if(instance.onload){instance.onload(instance.data);}}else{instance.flashGet();}}
var ajax=new Ajax("/_img/u_st_x154.png",null);ajax.onSuccess(success);ajax.onFailure(failure);ajax.doRequest({"raw":true});}
ToughStorage.prototype.imageSet=function(value){if(typeof(Ajax)=="undefined"){return null;}
var ajax=new Ajax("/_img/u_st_x154.png",null);ajax.doRequest({"raw":true});}
ToughStorage.prototype.userDataGet=function(){var name="c_stor_d";if(this.userDataElement&&typeof(this.userDataElement.load)!="undefined"){this.userDataElement.load(name);return this.userDataElement.getAttribute(name);}
return null;}
ToughStorage.prototype.userDataSet=function(val){var name="c_stor_d";if(this.userDataElement&&typeof(this.userDataElement.save)!="undefined"){this.userDataElement.setAttribute(name,val);this.userDataElement.save(name);}}
ToughStorage.prototype.HTML5StorageGet=function(){var storage=null;if(window.localStorage){storage=window.localStorage;}
if(storage==null&&window.globalStorage){storage=window.globalStorage[document.location.hostname];}
if(storage){return storage.getItem("c_stor_data");}
return null;};ToughStorage.prototype.HTML5StorageSet=function(value){var storage=null;if(window.localStorage){storage=window.localStorage;}
if(storage==null&&window.globalStorage){storage=window.globalStorage[document.location.hostname];}
if(storage){storage.setItem("c_stor_data",value);}};ToughStorage.prototype.serialize=function(obj){if(typeof(JSON)!="undefined"){return JSON.stringify(obj);}else{var arr=[];for(var k in obj){var val=obj[k];if(typeof val=='boolean'){val=val?'true':'false';}else if(typeof val=='string'){val='"'+val+'"';}
arr.push('"'+k+'":'+val);}
return"{"+arr.join(",")+"}";}};ToughStorage.prototype.unserialize=function(val){if(val==null){return null;}
return eval("("+val+")");};ToughStorage.prototype.getCookie=function(){var c_name="c_stor_cookie";var c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;var c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return this.urldecode(document.cookie.substring(c_start,c_end));}
return null;};ToughStorage.prototype.setCookie=function(value){document.cookie="c_stor_cookie="+this.urlencode(value);};ToughStorage.prototype.urlencode=function(str){str=(str+'').toString();return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/%20/g,'+');};ToughStorage.prototype.urldecode=function(str){return decodeURIComponent(str.replace(/\+/g,'%20'));};
var FlashDetect=new function(){var self=this;self.installed=false;self.raw="";self.major=-1;self.minor=-1;self.revision=-1;self.revisionStr="";var activeXDetectRules=[{"name":"ShockwaveFlash.ShockwaveFlash.7","version":function(obj){return getActiveXVersion(obj);}},{"name":"ShockwaveFlash.ShockwaveFlash.6","version":function(obj){var version="6,0,21";try{obj.AllowScriptAccess="always";version=getActiveXVersion(obj);}catch(err){}
return version;}},{"name":"ShockwaveFlash.ShockwaveFlash","version":function(obj){return getActiveXVersion(obj);}}];var getActiveXVersion=function(activeXObj){var version=-1;try{version=activeXObj.GetVariable("$version");}catch(err){}
return version;};var getActiveXObject=function(name){var obj=-1;try{obj=new ActiveXObject(name);}catch(err){obj={activeXError:true};}
return obj;};var parseActiveXVersion=function(str){var versionArray=str.split(",");return{"raw":str,"major":parseInt(versionArray[0].split(" ")[1],10),"minor":parseInt(versionArray[1],10),"revision":parseInt(versionArray[2],10),"revisionStr":versionArray[2]};};var parseStandardVersion=function(str){var descParts=str.split(/ +/);var majorMinor=descParts[2].split(/\./);var revisionStr=descParts[3];return{"raw":str,"major":parseInt(majorMinor[0],10),"minor":parseInt(majorMinor[1],10),"revisionStr":revisionStr,"revision":parseRevisionStrToInt(revisionStr)};};var parseRevisionStrToInt=function(str){return parseInt(str.replace(/[a-zA-Z]/g,""),10)||self.revision;};self.majorAtLeast=function(version){return self.major>=version;};self.minorAtLeast=function(version){return self.minor>=version;};self.revisionAtLeast=function(version){return self.revision>=version;};self.versionAtLeast=function(major){var properties=[self.major,self.minor,self.revision];var len=Math.min(properties.length,arguments.length);for(i=0;i<len;i++){if(properties[i]>=arguments[i]){if(i+1<len&&properties[i]==arguments[i]){continue;}else{return true;}}else{return false;}}};self.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var type='application/x-shockwave-flash';var mimeTypes=navigator.mimeTypes;if(mimeTypes&&mimeTypes[type]&&mimeTypes[type].enabledPlugin&&mimeTypes[type].enabledPlugin.description){var version=mimeTypes[type].enabledPlugin.description;var versionObj=parseStandardVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revisionStr=versionObj.revisionStr;self.revision=versionObj.revision;self.installed=true;}}else if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var version=-1;for(var i=0;i<activeXDetectRules.length&&version==-1;i++){var obj=getActiveXObject(activeXDetectRules[i].name);if(!obj.activeXError){self.installed=true;version=activeXDetectRules[i].version(obj);if(version!=-1){var versionObj=parseActiveXVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revision=versionObj.revision;self.revisionStr=versionObj.revisionStr;}}}}}();};FlashDetect.JS_RELEASE="1.0.4";
function lightbox(){this.speed=30;this.container=null;this.box=null;this.animation=null;this.dimensions=null;this.interval=null;this.actualSize=[0,0];this.image=null;this.opened=false;this.objects={};this.actualOpacity=100;this.overlay=null;this.left_button=null;this.right_button=null;this.title=null;this.label=null;this.counter=null;this.loading_image=null;this.actualType=null;this.object=null;this.panel=null;this.side_panel=null;this.panel_group=null;this.min_width=300;this.min_height=200;this.panel_height=0;this.min_height_tmp=null;this.init=function(){this.createBox();this.replaceLinks();this.loading_image=new Image();this.loading_image.width=32;this.loading_image.height=32;this.loading_image.src="/_img/lightbox/loading.gif";};this.replaceLinks=function(content){var parent=true;if(typeof(content)=="undefined"){content=document;parent=false;}
var check={};var nodes=content.getElementsByTagName('a');for(var i=0;i<nodes.length;i++){var node=nodes[i];if(node.className.indexOf("lightbox")>=0){var type=this.getType(node.href);if(type!=null){var index=node.className.indexOf("lightbox_");var key="a "+this.getObjectCount()+1;if(index>=0){key="m "+node.className.substring(index+9).split(" ").shift();}
key+=" "+type;if(typeof(this.objects[key])=="undefined"){this.objects[key]=[];}
var x=null;if(typeof(check[key])=="undefined"){check[key]=[];}else{if(typeof(check[key][node.href])!="undefined"){x=check[key][node.href];}}
if(x==null){x=this.objects[key].length;this.objects[key][x]={"object":[node.href,node.title],"status":"new","type":type};}
if(typeof(check[key][node.href])=="undefined"){check[key][node.href]=x;}
node.rel=key+"-"+x;if(parent){node.onclick=function(){var parts=this.rel.split("-");var index=parseInt(parts.pop(),10);var key=parts.join("-");lightbox.open(key,index);return false;};}else{node.onclick=function(){var parts=this.rel.split("-");var index=parseInt(parts.pop(),10);var key=parts.join("-");window.parent.lightbox.open(key,index);return false;};}}}}
delete check;};this.openLink=function(elem){if(typeof(elem.rel)!="undefined"){var parts=elem.rel.split("-");var index=parseInt(parts.pop(),10);var key=parts.join("-");window.parent.lightbox.open(key,index);}};this.addPanel=function(contents,min_height,group){if(typeof(min_height)!="undefined"&&min_height!=null){this.panel_height=min_height;}
if(typeof(group)!="undefined"){this.panel_group=group;}
this.side_panel=this.createPanel();while(contents.hasChildNodes()){this.side_panel.appendChild(contents.firstChild);}
if(contents.parentNode){contents.parentNode.removeChild(contents);}};this.createBox=function(){this.overlay=document.createElement('div');this.overlay.id="lightbox_overlay";this.overlay.style.display="none";this.overlay.style.position="absolute";this.overlay.style.top="0";this.overlay.style.left="0";this.overlay.style.zIndex=99996;this.overlay.appendChild(document.createTextNode('\u00a0'));this.overlay.onclick=function(){lightbox.close();};var overlay_instance=this.overlay;this.container=document.createElement('div');this.container.className="container";this.container.appendChild(document.createTextNode('\u00a0'));this.box=document.createElement('div');this.box.id="lightbox";this.box.style.position="absolute";this.box.style.display="none";this.box.style.zIndex=99997;var box_instance=this.box;var close=document.createElement('a');close.href="javascript:void(0);";close.title="zavřít";close.style.zIndex=99999;close.onclick=function(){lightbox.close();};close.className="close";close.appendChild(document.createTextNode("\u00a0"));var l=document.createElement('span');l.appendChild(document.createTextNode("\u00a0"));this.left_button=document.createElement('a');this.left_button.href="javascript:void(0);";this.left_button.onclick=function(){lightbox.prev();};this.left_button.onmouseout=function(){box_instance.style.zIndex=99998;overlay_instance.style.zIndex=99995;};this.left_button.onmouseover=function(){box_instance.style.zIndex=99999;overlay_instance.style.zIndex=99994;};this.left_button.style.left="0";this.left_button.style.top="0";this.left_button.style.display="block";this.left_button.style.position="absolute";this.left_button.style.textAlign="left";this.left_button.style.zIndex="99";this.left_button.className="prev";this.left_button.appendChild(l);var r=document.createElement('span');r.appendChild(document.createTextNode("\u00a0"));this.right_button=document.createElement('a');this.right_button.href="javascript:void(0);";this.right_button.onclick=function(){lightbox.next();};this.right_button.onmouseout=function(){box_instance.style.zIndex=99998;overlay_instance.style.zIndex=99995;};this.right_button.onmouseover=function(){box_instance.style.zIndex=99999;overlay_instance.style.zIndex=99994;};this.right_button.style.right="0";this.right_button.style.top="0";this.right_button.style.display="block";this.right_button.style.position="absolute";this.right_button.style.textAlign="right";this.right_button.style.zIndex="99";this.right_button.className="next";this.right_button.appendChild(r);this.title=document.createElement('span');this.title.style.display="block";this.title.className="title";this.title.style.overflow="hidden";this.title.appendChild(document.createTextNode('\u00a0'));this.counter=document.createElement('span');this.counter.style.display="none";this.counter.className="counter";this.counter.appendChild(document.createTextNode('\u00a0'));this.label=document.createElement('div');this.label.style.overflow="hidden";this.label.appendChild(this.title);this.label.appendChild(this.counter);this.box.appendChild(this.left_button);this.box.appendChild(this.right_button);this.box.appendChild(close);this.box.appendChild(this.container);this.box.appendChild(this.label);var body=document.getElementsByTagName('body')[0];body.appendChild(this.box);body.appendChild(this.overlay);};this.createPanel=function(){var panel=document.createElement('div');panel.id="lightbox_panel";panel.style.display="none";panel.style.position="absolute";panel.style.zIndex=99999;var body=document.getElementsByTagName('body')[0];body.appendChild(panel);return panel;};this.open=function(key,index){var parts=key.split(" ");if(this.side_panel&&(this.panel_group==null||this.panel_group.toLowerCase()==parts[1])){this.panel=this.side_panel;this.min_height_tmp=this.min_height;this.min_height=Math.max(this.panel_height,this.min_height);}else{this.panel=null;if(this.min_height_tmp!=null){this.min_height=this.min_height_tmp;}}
if(this.objects[key].length<=1){this.counter.style.display="none";}else{this.counter.style.display="block";}
if(this.opened===false){this.box.style.display="";if(this.panel!=null){this.panel.style.display="";}
if(this.dimensions==null){this.dimensions=this.getDimensions();}
this.setSize(this.min_width,this.min_height);this.setOverlay();}else if(this.dimensions==null){this.dimensions=this.getDimensions();}
this.opened=[key,index];lightbox.hideLabel();lightbox.hideButtons();this.actualType=this.objects[key][index]["type"];if(this.actualType=="image"){this.counter.firstChild.data="obrázek "+(index+1)+" z "+this.objects[key].length;}else{this.counter.firstChild.data="náhled "+(index+1)+" z "+this.objects[key].length;}
if(this.objects[key][index]["status"]=="loaded"){if(this.objects[key][index]["type"]=="image"){this.image=this.objects[key][index]["object"];this.setTitle(this.image.alt);}else{this.object=this.objects[key][index]["object"];this.setTitle(this.object.title);}
this.removeContent();this.resizeBox();}else{this.removeContent();this.actualOpacity=100;this.setImage(this.loading_image);if(this.objects[key][index]["type"]=="image"){this.image=new Image();this.image.alt=this.objects[key][index]["object"][1];this.image.id="i"+index+"k"+key;this.image.onload=function(){var parts=this.id.substring(1).split("k");var index=parts.shift();var key=parts.join("k");lightbox.objects[key][index]["status"]="loaded";lightbox.setTitle(this.alt);lightbox.removeContent();lightbox.resizeBox();};this.image.src=this.objects[key][index]["object"][0];this.objects[key][index]["object"]=this.image;}else{this.object=new Object();this.object.title=this.objects[key][index]["object"][1];this.object.key=key;this.object.index=index;var ajax=new Ajax(this.objects[key][index]["object"][0],null);ajax.onSuccess("lightbox.setData",this.object);ajax.onFailure("lightbox.set404Data",this.object);ajax.doRequest({"raw":true});this.objects[key][index]["object"]=this.object;}}};this.close=function(){this.opened=false;clearInterval(this.interval);this.interval=null;this.animation=null;this.overlay.style.display="none";this.box.style.display="none";this.dimensions=null;if(this.panel!=null){this.panel.style.display="none";}};this.setOverlay=function(){this.overlay.style.width=this.dimensions["page"][0]+"px";this.overlay.style.height=this.dimensions["page"][1]+"px";this.overlay.style.display="";};this.setData=function(data,obj){var key=obj.key;var index=obj.index;var tag='<!--lightbox_start-->';var tag2='<!--lightbox_end-->';var tag_i=data.indexOf(tag);if(tag_i>=0){data=data.substring(tag_i+tag.length).split(tag2).shift();}
var tmp=document.createElement('div');tmp.id="lightbox_html";tmp.style.position="absolute";tmp.style.overflow="visible";tmp.style.top="-9999px";tmp.innerHTML=data;this.replaceLinks(tmp);var body=document.getElementsByTagName('body')[0];body.appendChild(tmp);obj.width=Math.max(tmp.scrollWidth+20,this.min_width);obj.height=Math.max(tmp.scrollHeight+20,this.min_height);body.removeChild(tmp);tmp.style.position="static";tmp.style.overflow="";tmp.style.top="0";obj.data=tmp;this.setTitle(obj.title);this.objects[key][index]["status"]="loaded";this.removeContent();this.resizeBox();};this.set404Data=function(data,obj){var key=obj.key;var index=obj.index;var tmp=document.createElement('div');tmp.id="lightbox_html";tmp.style.position="absolute";tmp.style.overflow="visible";tmp.style.top="-9999px";tmp.appendChild(document.createTextNode('Stránka nenalezena'));obj.width=Math.max(300,this.min_width);obj.height=Math.max(200,this.min_height);tmp.style.position="static";tmp.style.overflow="";tmp.style.top="0";obj.data=tmp;this.setTitle(obj.title);this.objects[key][index]["status"]="loaded";this.removeContent();this.resizeBox();};this.resizeBox=function(){var mh=this.dimensions["view"][1]-200;var mw=this.dimensions["view"][0]-100;if(this.actualType=="image"){var h=this.image.height;var w=this.image.width;if(w>mw||h>mh){if(w>h){var r=h/w;while(w>mw||h>mh){w--;h=Math.round(w*r);}}else{var r=w/h;while(w>mw||h>mh){h--;w=Math.round(h*r);}}
this.image.width=w;this.image.height=h;}
if(w<this.min_width){w=this.min_width;}
if(h<this.min_height){h=this.min_height;}}else{var h=this.object.height;var w=this.object.width;if(w>mw){w=mw;this.object.width=mw;}
if(h>mh){this.object.height=mh;}}
var coef=1;if(w>this.actualSize[0]){coef=w/this.actualSize[0];}else if(w<this.actualSize[0]){coef=this.actualSize[0]/w;}
var sp=coef*this.speed;if(sp<=0){sp=1;}else if(sp>15){sp=15;}
this.animation=["w",w,w>this.actualSize[0]?sp:-sp];if(this.interval==null){this.interval=setInterval(function(){lightbox.animate();},20);}};this.setTitle=function(str){if(this.dimensions==null){this.dimensions=this.getDimensions();}
this.title.firstChild.data=str;this.dimensions["label"]=this.label.scrollHeight;};this.setImage=function(image){if(this.actualSize[1]>image.height){var top=Math.ceil((this.actualSize[1]-image.height)/2);image.style.position="relative";image.style.top=top+"px";image.style.zIndex=5;}
image.style.display="block";image.style.margin="0 auto";this.container.removeChild(this.container.firstChild);this.container.appendChild(image);};this.removeImage=function(){this.animation=["o",0,-Math.round(this.speed*0.3)];if(this.interval==null){this.interval=setInterval(function(){lightbox.animate();},20);}};this.viewImage=function(){this.animation=["o",100,Math.round(this.speed*0.3)];this.setImage(this.image);this.setOpacity(0);if(this.interval==null){this.interval=setInterval(function(){lightbox.animate();},20);}};this.setContent=function(){while(this.container.hasChildNodes()){this.container.removeChild(this.container.firstChild);}
var node=this.object.data;node.style.width=this.actualSize[0]+"px";node.style.height=this.actualSize[1]+"px";this.container.appendChild(node);};this.removeContent=function(){while(this.container.hasChildNodes()){this.container.removeChild(this.container.firstChild);}
this.container.appendChild(document.createTextNode('\u00a0'));};this.showLabel=function(){this.label.style.visibility="";};this.hideLabel=function(){this.label.style.visibility="hidden";};this.hideButtons=function(){this.left_button.style.display="none";this.right_button.style.display="none";};this.showButtons=function(){var group=this.objects[this.opened[0]];var w=Math.ceil(this.actualSize[0]/3);if(w<120){w=120;}
if(group.length-1>this.opened[1]){this.right_button.style.display="";this.right_button.style.width=w+"px";this.right_button.style.height=this.actualSize[1]+"px";this.right_button.style.lineHeight=this.actualSize[1]+"px";}
if(this.opened[1]>0){this.left_button.style.display="";this.left_button.style.width=w+"px";this.left_button.style.height=this.actualSize[1]+"px";this.left_button.style.lineHeight=this.actualSize[1]+"px";}};this.next=function(){var o=this.opened;this.open(o[0],o[1]+1);};this.prev=function(){var o=this.opened;this.open(o[0],o[1]-1);};this.animate=function(){if(this.animation[0]=="w"){if(this.animation[1]==this.actualSize[0]){var h=this.actualType=="image"?this.image.height:this.object.height;if(h<this.min_height){h=this.min_height;}
var coef=1;if(h>this.actualSize[1]){coef=h/this.actualSize[1];}else if(h<this.actualSize[1]){coef=this.actualSize[1]/h;}
var sp=coef*this.speed;if(sp<=0){sp=1;}else if(sp>15){sp=15;}
this.animation=["h",h,h>this.actualSize[1]?sp:-sp];return;}else{var w=this.actualSize[0]+this.animation[2];if(this.animation[2]>0&&w>this.animation[1]){w=this.animation[1];}else if(this.animation[2]<0&&w<this.animation[1]){w=this.animation[1];}
this.setSize(w,this.actualSize[1]);}}else if(this.animation[0]=="h"){if(this.animation[1]==this.actualSize[1]){if(this.actualType=="image"){this.viewImage();}else{this.setContent();this.showButtons();this.showLabel();clearInterval(this.interval);this.interval=null;this.animation=null;}
return;}else{var h=this.actualSize[1]+this.animation[2];if(this.animation[2]>0&&h>this.animation[1]){h=this.animation[1];}else if(this.animation[2]<0&&h<this.animation[1]){h=this.animation[1];}
this.setSize(this.actualSize[0],h);}}else if(this.animation[0]=="o"){if(this.actualOpacity!=this.animation[1]){var o=this.actualOpacity+this.animation[2];if(this.animation[2]>0&&o>this.animation[1]){o=this.animation[1];}else if(this.animation[2]<0&&0<this.animation[1]){o=this.animation[1];}
this.setOpacity(o);}else{if(this.animation[2]<0){this.removeContent();this.hideLabel();}else if(this.animation[2]>0){this.showButtons();this.showLabel();}
clearInterval(this.interval);this.interval=null;this.animation=null;return;}}};this.setSize=function(width,height){var w=false;var h=false;if(this.actualSize[0]!=width){this.container.style.width=width+"px";this.label.style.width=width+"px";w=true;}
if(this.actualSize[1]!=height){if(this.panel!=null){this.panel.style.height=(height+this.dimensions["label"]+2)+"px";}
this.container.style.height=height+"px";h=true;}
this.actualSize=[width,height];if(w){var left=Math.round(this.dimensions["scroll"][0]+this.dimensions["view"][0]/2-this.actualSize[0]/2-this.dimensions["panel"]/2);if(this.panel!=null){this.panel.style.left=left+"px";left+=22;}
this.box.style.left=(left+this.dimensions["panel"])+"px";}
if(h){var top=Math.round(this.dimensions["scroll"][1]+this.dimensions["view"][1]/2-this.actualSize[1]/2-this.dimensions["label"]/2);if(this.panel!=null){this.panel.style.top=top+"px";}
this.box.style.top=top+"px";}};this.resize=function(){this.overlay.style.display="none";lightbox.dimensions=lightbox.getDimensions();lightbox.setOverlay();};this.getDimensions=function(){this.overlay.style.display="none";var top=0;var left=0;var viewportwidth=0;var viewportheight=0;var width=0;var height=0;if(typeof window.innerWidth!='undefined'){viewportwidth=window.innerWidth;viewportheight=window.innerHeight;}
if(typeof document.documentElement!='undefined'){top=document.documentElement.scrollTop;left=document.documentElement.scrollLeft;if(viewportwidth==0&&viewportheight==0){viewportwidth=document.documentElement.clientWidth;viewportheight=document.documentElement.clientHeight;}
height=document.documentElement.scrollHeight;width=document.documentElement.scrollWidth;}else{var node=document.getElementsByTagName('html')[0];left=node.scrollLeft;top=node.scrollTop;if(viewportwidth==0&&viewportheight==0){viewportwidth=node.clientWidth;viewportheight=node.clientHeight;}
width=node.scrollWidth;if(node.scrollHeight>height){height=node.scrollHeight;}}
return{"view":[viewportwidth,viewportheight],"page":[width,height],"scroll":[left,top],"label":this.label.scrollHeight,"panel":(this.panel!=null?this.panel.scrollWidth:0)};};this.getObjectCount=function(){var ret=0;for(var i in this.objects){ret++;}
return ret;};this.setOpacity=function(value){if(typeof(this.container.firstChild.style)=="undefined"){return;}
if(typeof(this.container.firstChild.style.opacity)!="undefined"){this.container.firstChild.style.opacity=value/100;}
if(typeof(this.container.firstChild.style.mozOpacity)!="undefined"){this.container.firstChild.style.mozOpacity=value/100;}
if(typeof(this.container.firstChild.style.filter)!="undefined"){this.container.firstChild.style.filter='alpha(opacity='+(value)+')';}
this.actualOpacity=value;};this.getType=function(url){var ext=url.split("?").shift().split(".").pop().toLowerCase();switch(ext){case'html':return'text';case'htm':return'text';case'txt':return'text';case'jpg':return'image';case'gif':return'image';case'jpeg':return'image';case'png':return'image';case'tga':return'image';case'tiff':return'image';case'bmp':return'image';default:return'text';}}}
lightbox=new lightbox();window.onresize=function(){if(lightbox.opened!==false){if(navigator.appName=='Microsoft Internet Explorer'){setTimeout("lightbox.resize()",10);}else{lightbox.resize();}}else{lightbox.dimensions=null;}};
function getFormValues(form,checkbox_null){if(typeof(checkbox_null)=="undefined"){checkbox_null=false;}
var ret={};for(var key=0;key<form.elements.length;key++){var element=form.elements[key];var value=null;var name=element.name;if(element.type=="checkbox"||element.type=="radio"){if(element.checked){value=element.value;}else{if(element.type=="checkbox"&&checkbox_null){value=null;}else{name=null;}}}else if(element.nodeName.toLowerCase()=="select"){if(element.options&&element.options.length>0){if(element.multiple){var vals={};for(var y=0;y<element.options.length;y++){var option=element.options[y];if(option.selected){vals.push(option.value);}}
value=vals;}else{if(element.selectedIndex<element.options.length&&element.selectedIndex>=0){value=element.options[element.selectedIndex].value;}}}}else if(element.type!="submit"&&element.type!="reset"&&element.type!="button"){value=element.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<this.element.options.length;i++){if(this.element.options[i].value==selected){this.element.selectedIndex=i;break;}}}
this.element.style.display="none";this.functions={};this.enabled=true;this.container=document.createElement('div');this.container.appendChild(this.element);this.container.className="selectElement";this._buildNewElements();}}
SelectElement.prototype.setElement=function(element){var insert=null;if(typeof(element.parentNode)!="undefined"&&element.parentNode!=null&&element.parentNode.className.indexOf("selectElement")>=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;i<this.element.options.length;i++){if(this.element.options[i].value==value){this.element.selectedIndex=i;this.label.childNodes[1].data=this.element.options[this.element.selectedIndex].text;break;}}};SelectElement.prototype.setId=function(val){this.element.id=val;};SelectElement.prototype.setTitle=function(val){this.element.title=val;};SelectElement.prototype.setEnabled=function(bool){if(bool){this.enabled=true;this.element.disabled=false;this.label.onclick=this._labelFunction;this.container.className="selectElement";}else{this.enabled=false;this.element.disabled=true;this.label.onclick=null;this.container.className="selectElement disabled";}};SelectElement.prototype.focus=function(){return false;};SelectElement.prototype.blur=function(){return false;};SelectElement.prototype.setIndex=function(num){this.element.tabIndex=num;};SelectElement.prototype.setWidth=function(value){this.container.style.width=value+"px";this.container.getElementsByTagName('div')[0].style.width=value+"px";};SelectElement.prototype.getWidth=function(value){return parseInt(this.container.style.width.replace("px",""));};SelectElement.prototype.setHeight=function(value){this.label.style.height=value+"px";this.label.style.lineHeight=value+"px";this.container.style.height=value+"px";};SelectElement.prototype.addWidth=function(value){var width=parseInt(this.container.style.width.replace("px",""));this.container.style.width=(width+value)+"px";this.container.getElementsByTagName('div')[0].style.width=(width+value)+"px";};SelectElement.prototype.addHeight=function(value){var height=parseInt(this.container.style.height.replace("px",""));this.label.style.height=(height+value)+"px";this.label.style.lineHeight=(height+value)+"px";this.container.style.height=(height+value)+"px";};SelectElement.prototype.setFunction=function(event,object){this.functions[event]=object;this.element[event]=object;if(event!="onclick"&&event!="onchange"){this.label[event]=new Function('this.parentNode.getElementsByTagName("select")[0].'+event+'();');}};SelectElement.prototype.setSize=function(size){if(this.element.options.length>size){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;i<this.element.options.length;i++){if(this.element.options[i].parentNode.nodeName.toLowerCase()=="optgroup"){var group=this.element.options[i].parentNode;if(group_before!=group){add_group=group.label;}else{add_group=null;}
group_before=group;use_groups=true;}else{group_before=null;add_group=false;use_groups=false;}
if(add_group){var group_label=document.createElement('span');group_label.appendChild(document.createTextNode(add_group));group_label.style.display="block";group_label.style.whiteSpace="nowrap";options.appendChild(group_label);if(group_label.scrollHeight>height){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.title=this.element.options[i].text;row.appendChild(document.createTextNode(this.element.options[i].text));row.style.overflow="hidden";row.style.textOverflow="ellipsis";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>10){options.style.overflow="auto";options.style.height=(height*10)+"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";}
var elem=document.createElement('input');elem.name=name;elem.type="radio";elem.value=value;if(typeof(checked)!="undefined"&&checked){elem.checked=true;}
this.setElement(elem);if(typeof(checked)!="undefined"&&checked){elem.checked=true;}}}
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);}}
if(this.element.id!=""&&this.element.form){var labels=this.element.form.getElementsByTagName('label');var instance=this;for(var i=0;i<labels.length;i++){if(labels[i].htmlFor==this.element.id){labels[i].onclick=function(){instance.select();}}}}};RadioElement.prototype.getValue=function(param){if(typeof(param)!="undefined"&&param){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;}
if(typeof(this._onclick)!="undefined"){var ret=this._onclick.call(element,event);if(ret===false){return;}}
var elements=[];if(element.form){elements=element.form.elements;}else{var inputs=document.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].form==null){elements.push(inputs[i]);}}}
for(var i=0;i<elements.length;i++){if(elements[i].name==element.name&&elements[i].type=="radio"){elements[i].checked=false;if(elements[i].parentNode!=null&&elements[i].parentNode.className.indexOf("radioElement")>=0){elements[i].parentNode.getElementsByTagName('span')[0].className="";}}}
element.checked=true;this.className="selected";}};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"&&param){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);};function ScrollElement(content,target,options){if(typeof(options)=="undefined"){options={"btn_height":16,"bar_width":16};}else{if(typeof(options["btn_height"])=="undefined"){options["btn_height"]=16;}
if(typeof(options["bar_width"])=="undefined"){options["bar_width"]=16;}}
var padding=null;var width=null;var height=null;if(typeof(options["width"])!="undefined"){width=options["width"];if(typeof(options["height"])!="undefined"){height=options["height"];}else{height=100;}}
if(typeof(options["padding"])!="undefined"){padding=options["padding"];}
this.max_scroll=0;if(typeof(options["scroll_height"])!="undefined"){this.max_scroll=options["scroll_height"];}
if(typeof(options["speed"])!="undefined"){this.speed=options["speed"];}else{this.speed=10;}
if(typeof(target)=="undefined"||target==null){target=content;target.style.overflow="hidden";if(padding==null){padding=this._getPadding(target);}
if(width==null||height==null){height=target.clientHeight;width=target.clientWidth;target.style.padding="0";if(padding[0]>0||padding[1]>0){target.style.width=width+"px";width+=padding[0]+padding[1];}
if(padding[2]>0||padding[3]>0){target.style.height=height+"px";height-=padding[2]+padding[3];}}
var tmp=content.cloneNode(content,true);tmp.className="";tmp.removeAttribute("class");tmp.removeAttribute("style");tmp.id="";tmp.removeAttribute("id");content=tmp;}else{target.style.overflow="hidden";if(padding==null){padding=this._getPadding(content);}
if(width==null||height==null){var style=getComputedStyle(target,null);width=target.clientWidth;height=target.clientHeight;}
if(content.parentNode){content.parentNode.removeChild(content);}}
target.style.position="relative";target.className=target.className.replace("scrollElement","")+" scrollElement";this.sizes={"padding":padding,"width":width,"height":height,"buttonHeight":options["btn_height"],"scrollerWidth":options["bar_width"]};this.container=target;this.content=null;this.scroll_interval=null;this.cursor_start=null;this.scroll_button=null;this.scroll_button_pos=0;this.button_start=null;this.setElement(content,false);}
ScrollElement.prototype.startScroll=function(direction,e){if(!e){e=window.event;}
var instance=this;if(direction==0){this.stopScroll();var doc=document.getElementsByTagName('html')[0];doc.onmousemove=function(e){instance.scrollEvent(e);}
doc.onmouseup=function(e){instance.stopScroll();}
this.cursor_start=e.clientY;this.button_start=this.scroll_button_pos;}else{var scroll_funct=function(){var newpos=instance.position+direction*instance.speed;if(newpos<=0){newpos=0;instance.stopScroll();}else if(newpos>=instance.max_scroll){newpos=instance.max_scroll;instance.stopScroll();}
if(instance.max_scroll!=0){var ratio=instance.max_pos/instance.max_scroll;var top=Math.round(newpos*ratio);instance.scroll_button_pos=top;instance.track_button.style.top=top+"px";}
instance.content.scrollTop=newpos;instance.position=newpos;};if(this.scroll_interval==null){this.scroll_interval=setInterval(scroll_funct,40);}}};ScrollElement.prototype.scrollEvent=function(e){if(!e){e=window.event;}
if(this.cursor_start!==null){var instance=this;var pos=e.clientY-this.cursor_start;var ratio=this.max_pos/this.max_scroll;var top=this.button_start+pos;if(top<0){top=0;}else if(top>this.max_pos){top=this.max_pos;}
this.scroll_button_pos=top;this.track_button.style.top=top+"px";newpos=Math.round(top/ratio);if(newpos<=0){newpos=0;}else if(newpos>=this.max_scroll){newpos=this.max_scroll;}
this.content.scrollTop=newpos;this.position=newpos;}};ScrollElement.prototype.stopScroll=function(){if(this.scroll_interval!=null){clearInterval(this.scroll_interval);}
this.button_start=null;this.cursor_start=null;this.scroll_interval=null;};ScrollElement.prototype.setElement=function(content,compute_style){if(typeof(compute_style)=="undefined"||compute_style){this.sizes[padding]=this_getPadding(content);}
while(this.container.hasChildNodes()){this.container.removeChild(this.container.firstChild);}
var instance=this;content.style.width=(this.sizes["width"]-this.sizes["scrollerWidth"]-this.sizes["padding"][0]-this.sizes["padding"][1])+"px";content.style.padding=this.sizes["padding"][2]+"px "+this.sizes["padding"][1]+"px "+this.sizes["padding"][3]+"px "+this.sizes["padding"][0]+"px ";content.style.height=this.sizes["height"]+"px";content.style.border="0";content.style.overflow="hidden";content.onmousewheel=function(e){if(!e)e=window.event;instance.wheelScroll(e);return false;};if(content.addEventListener){content.addEventListener("DOMMouseScroll",function(e){instance.wheelScroll(e);if(e.preventDefault)e.preventDefault();e.returnValue=false;return false;},false);}
this.container.appendChild(content);this.content=content;this.position=content.scrollTop;if(this.max_scroll==0){this.max_scroll=content.scrollHeight-content.clientHeight;}
this.scroller=this.buildScrollbar(this.sizes["scrollerWidth"],this.sizes["height"]+this.sizes["padding"][2]+this.sizes["padding"][3],this.sizes["buttonHeight"]);this.container.appendChild(this.scroller);};ScrollElement.prototype.buildScrollbar=function(width,height,btn_height){var bar=document.createElement('div');bar.style.width=width+"px";bar.height=height+"px";bar.className="scrollbar";var instance=this;var btn=document.createElement('span');btn.style.display="block";btn.style.width=width+"px";btn.style.height=btn_height+"px";btn.style.padding="0";btn.style.overflow="hidden";btn.style.border="0";btn.style.margin="0";btn.style.position="static";btn.className="button top";btn.appendChild(document.createTextNode('\u00a0'));btn.onmousedown=function(){instance.startScroll(-1);return false;};btn.onmouseup=function(){instance.stopScroll();return false;};btn.onmouseout=function(){instance.stopScroll();return false;};btn.onselectstart=function(){return false;};bar.appendChild(btn);var track_height=(height-2*btn_height);var track=document.createElement('div');track.style.display="block";track.style.width=width+"px";track.style.height=track_height+"px";track.style.padding="0";track.style.border="0";track.style.margin="0";track.style.position="static";track.className="track";track.onselectstart=function(){return false;};track.onmousedown=function(){return false;};if(this.max_scroll>0){var ratio=track_height/(this.max_scroll+height);var m_tbn_height=Math.round(track_height*ratio);if(m_tbn_height<40){m_tbn_height=40;}else if(m_tbn_height/2!=Math.ceil(m_tbn_height/2)){m_tbn_height=Math.round(m_tbn_height/2)*2;}
this.max_pos=track_height-m_tbn_height;var top_part=document.createElement('span');top_part.style.display="block";top_part.style.width=width+"px";top_part.style.padding="0";top_part.style.margin="0";top_part.style.overflow="hidden";top_part.style.position="static";top_part.className="top_part";top_part.appendChild(document.createTextNode('\u00a0'));var bottom_part=document.createElement('span');bottom_part.style.display="block";bottom_part.style.width=width+"px";bottom_part.style.padding="0";bottom_part.style.margin="0";bottom_part.style.bottom="0";bottom_part.style.overflow="hidden";bottom_part.style.position="absolute";bottom_part.className="bottom_part";bottom_part.appendChild(document.createTextNode('\u00a0'));var middle_part=document.createElement('span');middle_part.style.display="block";middle_part.style.width=width+"px";middle_part.style.height=btn_height+"px";middle_part.style.padding="0";middle_part.style.margin="0";middle_part.style.top=Math.round(m_tbn_height/2-btn_height/2)+"px";middle_part.style.overflow="hidden";middle_part.style.position="absolute";middle_part.className="middle_part";middle_part.appendChild(document.createTextNode('\u00a0'));btn=document.createElement('span');btn.style.display="block";btn.style.width=width+"px";btn.style.height=m_tbn_height+"px";btn.style.padding="0";btn.style.border="0";btn.style.margin="0";btn.style.overflow="hidden";btn.style.position="relative";btn.className="button middle";btn.appendChild(bottom_part);btn.appendChild(middle_part);btn.appendChild(top_part);btn.onmousedown=function(e){instance.startScroll(0,e);return false;};btn.onmouseup=function(){instance.stopScroll();return false;};btn.onselectstart=function(){return false;};this.track_button=btn;track.appendChild(btn);}else{track.appendChild(document.createTextNode('\u00a0'));}
bar.appendChild(track);btn=document.createElement('span');btn.style.display="block";btn.style.width=width+"px";btn.style.height=btn_height+"px";btn.style.padding="0";btn.style.border="0";btn.style.margin="0";btn.style.position="static";btn.className="button bottom";btn.appendChild(document.createTextNode('\u00a0'));btn.onmousedown=function(){instance.startScroll(1);return false;};btn.onmouseup=function(){instance.stopScroll();return false;};btn.onmouseout=function(){instance.stopScroll();return false;};btn.onselectstart=function(){return false;};bar.appendChild(btn);bar.style.position="absolute";bar.style.right="0";bar.style.top="0";return bar;};ScrollElement.prototype._getPadding=function(content){var style=getComputedStyle(content,null);var padding_r=style.getPropertyValue("padding-right");var padding_l=style.getPropertyValue("padding-left");var padding_t=style.getPropertyValue("padding-top");var padding_b=style.getPropertyValue("padding-bottom");if(padding_r){padding_r=parseInt(padding_r.replace("px",""),10);if(isNaN(padding_r)){padding_r=0;}}else{padding_r=0;}
if(padding_l){padding_l=parseInt(padding_l.replace("px",""),10);if(isNaN(padding_l)){padding_l=0;}}else{padding_l=0;}
if(padding_t){padding_t=parseInt(padding_t.replace("px",""),10);if(isNaN(padding_t)){padding_t=0;}}else{padding_t=0;}
if(padding_b){padding_b=parseInt(padding_b.replace("px",""),10);if(isNaN(padding_b)){padding_b=0;}}else{padding_b=0;}
return[padding_l,padding_r,padding_t,padding_b];}
ScrollElement.prototype.wheelScroll=function(e){var dir=0;if(e.detail){dir=e.detail/3;}else if(e.wheelDelta){dir=-e.wheelDelta/120;}
var newpos=this.position+dir*this.speed*2;if(newpos<=0){newpos=0;}else if(newpos>=this.max_scroll){newpos=this.max_scroll;}
if(this.max_scroll!=0){var ratio=this.max_pos/this.max_scroll;var top=Math.round(newpos*ratio);this.scroll_button_pos=top;this.track_button.style.top=top+"px";}
this.content.scrollTop=newpos;this.position=newpos;}
if(!window.getComputedStyle){window.getComputedStyle=function(el,pseudo){this.el=el;this.getPropertyValue=function(prop){var re=/(\-([a-z]){1})/g;if(prop=='float')prop='styleFloat';if(re.test(prop)){prop=prop.replace(re,function(){return arguments[2].toUpperCase();});}
return el.currentStyle[prop]?el.currentStyle[prop]:null;}
return this;}}
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<divs.length;i++){if(divs[i].className.indexOf("selectElement")>=0&&divs[i]!=clicked){var sub=divs[i].getElementsByTagName('div');if(sub.length==1){sub[0].style.display="none";}}}}

