function isNull(a){return (typeof(a)=="object" && !a);}
function isUndefined(a){return typeof(a)=="undefined";} 
function isFunction(a){return typeof(a)=="function";}
function isString(a){return typeof(a)=="string";}
function isArray(a){return a && !(a.propertyIsEnumerable("length")) && typeof a==="object" && typeof a.length==="number";}

function listProperties(obj){var lst="";for(var prop in obj)if(typeof obj[prop]!="function")lst+=prop+": "+obj[prop]+"\n";return lst;}
function listMethods(obj,full){var lst="";for(var prop in obj)if(typeof obj[prop]=="function")lst+=prop+": "+obj[prop]+"\n";if(full)return lst;var lst2="";var fceRE=browser.isIE?/(.*): function(\([^\{]+)\{/g:/(.*):\s+\ *function\s*(.*)\{/g;while(result=fceRE.exec(lst)){lst2+=result[1]+result[2]+"\n";}return lst2;}

function trim(inpstr){return inpstr.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");}
String.prototype.trim=function(){return trim(this);} 
function isMail(inpstr){return /^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/.test(inpstr);}
String.prototype.isMail=function(){return isMail(this);} 
function number_format(number,decimals,point,separator){if(!isNaN(number)){point=point?point:".";number=number.toString().split(".");if(separator){var tmp_number=[];for(var i=number[0].length,j=0;i>0;i-=3){var pos=i>0?i-3:i;tmp_number[j++]=number[0].substring(i,pos);}number[0]=tmp_number.reverse().join(separator);}if(decimals)if(number[1])number[1]=Math.round(parseFloat(number[1].substr(0,decimals)+"."+number[1].substr(decimals,number[1].length),10)); else number[1]="00";return(number.join(point));}else return null;} 
Number.prototype.number_format=function(decimals,point,separator){return number_format(this,decimals,point,separator);};

var browser={isIE:!!(window.attachEvent && !window.opera),isOpera:!!window.opera,isMozilla:(navigator.product=="Gecko" && navigator.userAgent.indexOf("KHTML")==-1),getIEversion:function(){if(!browser.isIE)return 0;else{var ver=navigator.appVersion;ver=ver.substring(ver.indexOf("MSIE")+4);return ver.substring(0,ver.indexOf(";"));}},toString:function(){return listProperties(navigator);}};
document.lang=document.getElementsByTagName("html")[0].lang?document.getElementsByTagName("html")[0].lang:"cs";

function getEl(elid){return document.getElementById(elid);}
function gE(el){if(typeof(el)=="string")el=document.getElementById(el);if(!el)return null;el.getElementsByClassName=function(clsName,tagName){return getElementsByClassName(this,clsName,tagName);};el.getElementsByTagNames=function(){var args=[this];var al=arguments.length;for(var i=0;i<al;i++)args.push(arguments[i]);return getElementsByTagNames.apply(null,args);};el.setDN=function(){if(arguments.length==0)setDN(this);else setDN.apply(null,arguments);};el.setDB=function(){if(arguments.length==0)setDB(this);else setDB.apply(null,arguments);};el.setDI=function(){if(arguments.length==0)setDI(this);else setDI.apply(null,arguments);};el.setTrDB=function(){if(arguments.length==0)setTrDB(this);else setTrDB.apply(null,arguments);};  el.setVV=function(){if(arguments.length==0)setVV(this);else setVV.apply(null,arguments);};el.setVH=function(){if(arguments.length==0)setVH(this);else setVH.apply(null,arguments);};el.swapDisplay=function(){if(arguments.length==0)swapDisplay(this);else swapDisplay.apply(null,arguments);};el.swapVisibility=function(){if(arguments.length==0)swapVisibility(this);else swapVisibility.apply(null,arguments);};el.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};el.nextEl=function(){return nextEl(this);};el.prevEl=function(){return prevEl(this);};el.lastEl=function(){return lastEl(this);};el.firstEl=function(){return firstEl(this);};el.registerEvent=function(evtype,fc,capt){registerEvent(this,evtype,fc,capt);};el.unregisterEvent=function(evtype,fc,capt){unregisterEvent(this,evtype,fc,capt);};el.perform=function(fc){fc(this)};return el;}
function getElementsByClassName(parEl,clsName,tagName){if(typeof(parEl)=="string")parEl=document.getElementById(parEl);if(isUndefined(tagName))tagName="*";var out=[];var els=parEl.getElementsByTagName(tagName);if(isArray(clsName))clsName=clsName.join("|");for(var i=0;i<els.length;i++){if(eval("/\\b"+clsName+"\\b/").test(els[i].className))out.push(els[i]);}out.setDN=function(){if(arguments.length==0)setDN(this);else setDN.apply(null,arguments);};out.setDB=function(){if(arguments.length==0)setDB(this);else setDB.apply(null,arguments);};out.setDI=function(){if(arguments.length==0)setDI(this);else setDI.apply(null,arguments);};out.setTrDB=function(){if(arguments.length==0)setTrDB(this);else setTrDB.apply(null,arguments);};out.setVV=function(){if(arguments.length==0)setVV(this);else setVV.apply(null,arguments);};out.setVH=function(){if(arguments.length==0)setVH(this);else setVH.apply(null,arguments);};out.swapDisplay=function(){if(arguments.length==0)swapDisplay(this);else swapDisplay.apply(null,arguments);};out.swapVisibility=function(){if(arguments.length==0)swapVisibility(this);else swapVisibility.apply(null,arguments);};out.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};out.registerEvent=function(evtype,fc,capt){registerEvent(this,evtype,fc,capt);};out.unregisterEvent=function(evtype,fc,capt){unregisterEvent(this,evtype,fc,capt);};out.perform=function(fc){var tl=this.length;for(var i=0;i<tl;i++)fc(this[i]);};return out;}
function getElementsByTagNames(el){var out=[];if(isString(el))el=document.getElementById(el);var al=arguments.length;for(var i=1;i<al;i++){var tmpa=el.getElementsByTagName(arguments[i]);var tmpal=tmpa.length;for(var j=0;j<tmpal;j++)out.push(tmpa[j]);}out.setDN=function(){if(arguments.length==0)setDN(this);else setDN.apply(null,arguments);};out.setDB=function(){if(arguments.length==0)setDB(this);else setDB.apply(null,arguments);};out.setDI=function(){if(arguments.length==0)setDI(this);else setDI.apply(null,arguments);};out.setTrDB=function(){if(arguments.length==0)setTrDB(this);else setTrDB.apply(null,arguments);};out.setVV=function(){if(arguments.length==0)setVV(this);else setVV.apply(null,arguments);};out.setVH=function(){if(arguments.length==0)setVH(this);else setVH.apply(null,arguments);};out.swapDisplay=function(){if(arguments.length==0)swapDisplay(this);else swapDisplay.apply(null,arguments);};out.swapVisibility=function(){if(arguments.length==0)swapVisibility(this);else swapVisibility.apply(null,arguments);};out.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};out.registerEvent=function(evtype,fc,capt){registerEvent(this,evtype,fc,capt);};out.unregisterEvent=function(evtype,fc,capt){unregisterEvent(this,evtype,fc,capt);};out.perform=function(fc){var tl=this.length;for(var i=0;i<tl;i++)fc(this[i]);};return out;}
function firstEl(el){if(el=el.firstChild){if(el.nodeType==1)return gE(el); else return nextEl(el);}else return null;}
function lastEl(el){if(el=el.lastChild){if(el.nodeType==1)return gE(el); else return prevEl(el);}else return null;}
function nextEl(el){while(el=el.nextSibling)if(el.nodeType==1)return gE(el);return null;}
function prevEl(el){while(el=el.previousSibling)if(el.nodeType==1)return gE(el);return null;}

function registerEvent(el,evtype,fc,capt){if(el==window && evtype=="domready"){if(isUndefined(window._onbuilt))window._onbuilt=[];if(window._dombuilt){fc();return;}window._onbuilt.push(fc);if(!isFunction(window._built))window._built=function(){if(window._dombuilt)return;for(var i=0;i<window._onbuilt.length;i++)window._onbuilt[i]();window._dombuilt=true;};if(browser.isIE && document.readyState){if(!getEl("ie_ready")){var src=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<scr'+'ipt id="ie_ready" defer src="'+src+'"><\/script>');getEl("ie_ready").onreadystatechange=function(){if(this.readyState=="complete")window._built();};}}else{if(browser.isMozilla)document.addEventListener("DOMContentLoaded",window._built,0); else window.addEventListener("load",window._built,0);}return true;}function _registerEvent(el,evtype,fc,capt){if(el.addEventListener){el.addEventListener(evtype,fc,capt);return true;}else if(el.attachEvent){var f=el.attachEvent("on"+evtype,function(){fc.apply(el,arguments)});return f;}return false;}if(isString(el))_registerEvent(getEl(el),evtype,fc,capt);else if(ell=el.length){for(var i=0;i<ell;i++)_registerEvent(el[i],evtype,fc,capt);}else _registerEvent(el,evtype,fc,capt);}
function unregisterEvent(el,evtype,fc,capt){if(el==window && evtype=="domready"){for(var i=0;i<window._onbuilt.length;i++){if(window._onbuilt[i]===fc)window_onbuilt.splice(i,1);}return true;}function _unregisterEvent(el,evtype,fc,capt){if(el.removeEventListener){el.removeEventListener(evtype,fc,capt);return true;}else if(el.detachEvent){var f=el.detachEvent("on"+evtype,function(){fc.apply(el,arguments)});return f;}return false;}if(isString(el))_unregisterEvent(getEl(el),evtype,fc,capt);else if(ell=el.length){for(var i=0;i<ell;i++)_unregisterEvent(el[i],evtype,fc,capt);}else _unregisterEvent(el,evtype,fc,capt);}
function getEvent(e){if(isUndefined(e))e=window.event;if(isUndefined(e.target))e.target=e.srcElement;if(isUndefined(e.layerX))e.layerX=e.offsetX;if(isUndefined(e.layerY))e.layerY=e.offsetY;if(isUndefined(e.which) && e.keyCode)e.which=e.keyCode;if(!e.preventDefault)e.preventDefault=function(){e.returnValue=false;};return e;}

function getViewportHeight(){if(window.innerHeight)return parseInt(window.innerHeight);else if(document.documentElement && document.documentElement.clientHeight)return parseInt(document.documentElement.clientHeight);else if(document.body && document.body.clientHeight)return parseInt(document.body.clientHeight);}
function getViewportWidth(){if(window.innerWidth)return parseInt(window.innerWidth);else if(document.documentElement && document.documentElement.clientWidth)return parseInt(document.documentElement.clientWidth);else if(document.body && document.body.clientWidth)return parseInt(document.body.clientWidth);}
function getElementHeight(el){if(typeof(el)=="string")el=document.getElementById(el);if(browser.isIE)return parseInt(el.offsetHeight);else return parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("height"));}
function getElementWidth(el){if(typeof(el)=="string")el=document.getElementById(el);if(browser.isIE)return parseInt(el.offsetWidth);else return parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("width"));}
function findPosX(el){if(typeof(el)=="string")el=document.getElementById(el);var curleft=0;if(el.offsetParent){while(el.offsetParent){curleft+=el.offsetLeft;el=el.offsetParent;}}else if(el.x)curleft+=el.x;return parseInt(curleft);}
function findPosY(el){if(typeof(el)=="string")el=document.getElementById(el);var curtop=0;if(el.offsetParent){while(el.offsetParent){curtop+=el.offsetTop;el=el.offsetParent;}}else if(el.y)curtop+=el.y;return parseInt(curtop);}

function setDN(){function _setDN(el){if(el.style)el.style.display="none";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setDN(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setDN(el[j]);}else _setDN(el);}}
function setDB(){function _setDB(el){if(el.style)el.style.display="block";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setDB(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setDB(el[j]);}else _setDB(el);}}
function setDI(){function _setDI(el){if(el.style)el.style.display="inline";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setDI(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setDI(el[j]);}else _setDI(el);}}
function setVH(){function _setVH(el){if(el.style)el.style.visibility="hidden";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setVH(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setVH(el[j]);}else _setVH(el);}}
function setVV(){function _setVV(el){if(el.style)el.style.visibility="visible";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setVV(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setVV(el[j]);}else _setVV(el);}}
function setTrDB(){function _setTrDB(el){if(el.style)el.style.display=browser.isIE?"block":"table-row";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setTrDB(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setTrDB(el[j]);}else _setTrDB(el);}}
function swapDisplay(){function _swapDisplay(el){if(el.style)el.style.display=el.style.display=="none"?"block":"none";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_swapDisplay(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_swapDisplay(el[j]);}else _swapDisplay(el);}}
function swapVisibility(){function _swapVisibility(el){if(el.style)el.style.visibility=el.style.visibility=="hidden"?"visible":"hidden";}var al=arguments.length;for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_swapVisibility(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_swapVisibility(el[j]);}else _swapVisibility(el);}}
function clipEl(el,l,t,r,b){function _clipEl(el,l,t,r,b){if(el.style) el.style.clip="rect("+t+"px,"+(getElementWidth(el)-r)+"px,"+(getElementHeight(el)-b)+"px,"+l+"px)";}if(typeof(el)=="string")_clipEl(getEl(el));else if(ell=el.length){for(var j=0;j<ell;j++)_clipEl(el[j],l,t,r,b);}else _clipEl(el,l,t,r,b);}


function AJAX(){var req=false;if(window.XMLHttpRequest){req=new XMLHttpRequest();if(req.overrideMimeType)req.overrideMimeType("text/xml");}else if(window.ActiveXObject){try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}if(!req){throw("Fatal AJAX error");} this.setFinalMethod=function(fce){req.onreadystatechange=function(){if(req.readyState==4)fce(req.status);};};this.request=function(method,url,params,async){if(method.toUpperCase()=="POST"){req.open("POST",url);if(!isUndefined(params))req.send(params);}else req.open(method.toUpperCase(),url+(isUndefined(params)?"":"?"+params),(async || true));req.send(null);};this.getResponseText=function(){return req.responseText;};this.getResponseObject=function(){return req.responseXML;}};

function Slider(name,start,finalv,step,division,method1,method2){this.name=name;this.actual=start;this.start=start;this.finalv=finalv;this.ffinalv=finalv;this.step=step;this.division=division;this.running=isUndefined(method1)?function(){}:method1;this.last=isUndefined(method2)?function(){}:method2;}
Slider.prototype.run=function(){if(this.actual<this.finalv){this.actual+=Math.ceil((this.finalv-this.actual)/this.division);}else{this.actual+=Math.floor((this.finalv-this.actual)/this.division);}if(this.actual!=this.finalv){this.running(this.actual);this.timer=setTimeout(this.name+".run()",this.step);}else{this.last(this.finalv);clearTimeout(this.timer);}}
Slider.prototype.stop=function(){clearTimeout(this.timer);}
Slider.prototype.reverse=function(){if(this.finalv!=this.start)this.finalv=this.start;else this.finalv=this.ffinalv;}

function Cookie(name,expires){this.name=name;this.expires=expires;}
Cookie.prototype.getValue=function(name,default_value){var strCookie=document.cookie.split("; ");for(var i=0;i<strCookie.length;i++){var strPar=strCookie[i].split("=");if(this.name+"_"+name==strPar[0])return unescape(strPar[1]);};return default_value;}
Cookie.prototype.setValue=function(name,value,uexpires){var date=new Date();date.setTime(date.getTime()+((uexpires?uexpires:this.expires)*24*60*60*1000));var expires="; expires="+date.toGMTString();document.cookie=this.name+"_"+name+"="+value+expires+"; path=/";return value;}
Cookie.prototype.destroy=function(name){if(name){this.setValue(name,"",-1);}else{var strCookie=document.cookie.split("; ");for(var i=0;i<strCookie.length;i++){var strPar=strCookie[i].split("=");if(strPar[0].substring(0,this.name.length+1)==this.name+"_")this.setValue(strPar[0].substring(this.name.length+1),"",-1);}}}

