window.document.write('<link rel="stylesheet" type="text/css" href="/css/cru-js.css">');
var CMN=function(){var cmn,tO=function(v,type){var t=typeof v;if(t==="object"){if(!v){t="null";}else{if(typeof v.length==="number"&&(v.propertyIsEnumerable&&!v.propertyIsEnumerable("length"))&&typeof v.splice==="function"){t="array";}}}
return type?t===type:t;},pI=function(n){return parseInt(n,10);},getParams=function(j,d){var o={},dl=d.length,pr,roots=window.document.getElementsByTagName("html");d[-1]=["lang",roots[0].getAttribute("lang")||"cs"];for(var i=-1;i<dl;i++){pr=d[i][0];o[pr]=tO(j[pr],"undefined")?d[i][1]:j[pr];}
o.toString=function(){var pr,p="";for(pr in this){if(this.hasOwnProperty(pr)&&this[pr]!==arguments.callee){p+=(pr+": "+(tO(this[pr],"function")?"function...":this[pr])+"\n");}}
return p;};return o;},module=function(o,d,f){return function(j){var par=getParams((j||{}),d),M=function(){},m;M.prototype=o;M.prototype.getParams=function(){return par;};M.prototype.getParam=function(p){return par[p];};M.prototype.setParam=function(p,v){for(var prop in par){if(prop===p){par[prop]=v;return true;}}
return false;};M.prototype.name="module";M.prototype.toString=function(){return"CMN "+this.name+"\n\nParameters:\n"+this.getParams();};M.prototype.constructor=M;m=new M();if(tO(f,"function")){f.apply(m);}
return m;};},rm=[],gex=function(d){if(!d){return d;}
return function(s){var all=d.getElementsByTagName("*"),l=all.length,i,e;for(i=0;i<l;i++){e=all[i];if(e.hasAttribute("id")){if(e.getAttribute("id")===s){return e;}}}};},ge=function(s,doc){var g=gex(doc)||function(s){return window.document.getElementById(s);},el=tO(s,"string")?g(s)?g(s):null:s,rml=rm.length,c=el?tO(el.cmn,"undefined")?{}:el.cmn:{},i;if(!el){return el;}
if(c!==CMN){for(i=0;i<rml;i++){el[rm[i][0]]=rm[i][1];}
el.fE=el.firstEl=cmn.firstEl;el.lE=el.lastEl=cmn.lastEl;el.nE=el.nextEl=cmn.nextEl;el.pE=el.prevEl=cmn.prevEl;el.hC=el.hasClass=cmn.hasClass;el.aC=el.addClass=cmn.addClass;el.rC=el.removeClass=cmn.removeClass;el.aL=el.addListener=function(evtype,fc,capt){return cmn.addListener(this,evtype,fc,capt);};el.rL=el.removeListener=function(evtype,fc,capt){return cmn.removeListener(this,evtype,fc,capt);};el.cE=el.createEl=function(){var o=cmn.createEl.apply(null,arguments);if(tO(o,"array")){return o.append(this);}else{return this.appendChild(o);}};el.getElementsByTagNames=cmn.getElementsByTagNames;el.getElementsByClassName=function(cl,tg){return cmn.getElementsByClassName(this,cl,tg);};el.cmn=cmn;}
return el;},gc=function(a){if(!a){return a;}
var rml=rm.length,i,c=tO(a.cmn,"undefined")?{}:a.cmn,l=a.length;if(c!==CMN){for(i=0;i<rml;i++){a[rm[i][0]]=rm[i][1];}
a.aC=a.addClass=function(){var ag=[].splice.call(arguments,null),i;for(i=0;i<l;i++){cmn.addClass(a[i],ag);}
return a;};a.rC=a.removeClass=function(){var ag=[].splice.call(arguments,null),i;for(i=0;i<l;i++){cmn.removeClass(a[i],ag);}
return a;};a.aL=a.addListener=function(evtype,fc,capt){var i;for(i=0;i<l;i++){cmn.addListener(a[i],evtype,fc,capt);}
return a;};a.rL=a.removeListener=function(evtype,fc,capt){var i;for(i=0;i<l;i++){cmn.removeListener(a[i],evtype,fc,capt);}
return a;};a.execute=function(fc){var i;for(i=0;i<l;i++){fc.apply(a[i]);}
return a;};a.append=function(el){el=ge(el);var i;for(i=0;i<l;i++){el.appendChild(a[i]);}
return a;};a.cmn=cmn;}
return a;},regElM=function(fn,f){var sf=function(x){if(tO(x,"array")){var a=tO(x.cmn,"undefined")?{}:x.cmn,i,l;if(a!==CMN){x=gc(x);}
if(f){l=x.length;for(i=0;i<l;i++){f(x[i]);}}}else{x=ge(x);if(f){f(x);}}
return x;},nf=function(){var o=null,l=arguments.length,i,ao=[],c,e;if(l>1){for(i=0;i<l;i++){e=arguments[i];if(tO(e,"array")){ao.concat(sf(e));}else{ao.push(sf(e));}}
c=tO(ao.cmn,"undefined")?{}:ao.cmn;o=c===CMN?ao:gc(ao);}else if(l===1){o=sf(arguments[0]);}
return o;};if(f){cmn[fn]=nf;rm.push([fn,function(){return sf(this);}]);}else{return nf;}},dombuilt=false,onbuilt=[],built=function(){if(dombuilt){return;}
var i,l=onbuilt.length;for(i=0;i<l;i++){onbuilt[i]();}
dombuilt=true;},lsts=[];cmn={tO:tO,isMail:function(s){s=s||((this!==CMN)?this:false)||"";return(/^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/).test(s);},trim:function(s){s=s||((this!==CMN)?this:false)||"";return s.replace(/^\s+|\s+$/g,"");},number_format:function(n,e,d,t){n=n||((this!==CMN)?this:false)||0;t=t||",";d=d||".";var c=isNaN(e)?2:e,sg=n<0?"-":"",i,j;n=Math.abs(+n||0).toFixed(c);i=pI(n)+"";j=i.length>3?i.length%3:0;return sg+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"");},extendTypes:function(){String.prototype.trim=this.trim;String.prototype.isMail=this.isMail;Number.prototype.number_format=this.number_format;},createEl:function(i){var ce=function(j){var par=getParams(j,[["tag","div"],["id",""],["className",""],["text",""],["style",null],["attrs",null],["doc",window.document]]),e=par.doc.createElement(par.tag);if(par.id!==""){e.id=par.id;}
if(par.className!==""){e.className=par.className;}
if(par.text!==""){e.appendChild(par.doc.createTextNode(par.text));}
if(par.style){for(var styleProp in par.style){if(par.style.hasOwnProperty(styleProp)&&!tO(par.style[styleProp],"function")){e.style[styleProp]=par.style[styleProp];}}}
if(par.attrs){for(var attrName in par.attrs){if(par.attrs.hasOwnProperty(attrName)&&!tO(par.attrs[attrName],"function")){e.setAttribute(attrName,par.attrs[attrName]);}}}
return e;},o=[],al=arguments.length,x,y,p,pl;for(x=0;x<al;x++){p=arguments[x];if(tO(p,"array")){pl=p.length;for(y=0;y<pl;y++){o.push(ce(p[y]));}}else{o.push(ce(p));}}
if(o.length===1){return ge(o[0]);}else if(o.length>1){return gc(o);}else{return null;}},browser:{isIE:!!(window.attachEvent&&!window.opera),isOpera:!!window.opera,isGecko:!!window.document.getAnonymousElementByAttribute,isWebKit:navigator.userAgent.indexOf("KHTML")>-1,toString:function(){var s="";for(var p in navigator){if(tO(navigator[p],"string")||tO(navigator[p],"number")){s+=(p+": "+navigator[p]+"\n");}}
return s;}},getViewportWidth:function(){if(window.innerWidth){return pI(window.innerWidth);}else{if(window.document.documentElement&&window.document.documentElement.clientWidth){return pI(document.documentElement.clientWidth);}else{if(window.document.body&&window.document.body.clientWidth){return pI(window.document.body.clientWidth);}}}},getViewportHeight:function(){if(window.innerHeight){return pI(window.innerHeight);}else{if(window.document.documentElement&&window.document.documentElement.clientHeight){return pI(window.document.documentElement.clientHeight);}else{if(window.document.body&&window.document.body.clientHeight){return pI(window.document.body.clientHeight);}}}},getCollection:function(){var o=null,l=arguments.length,i,ao=[],c,e;for(i=0;i<l;i++){e=arguments[i];if(tO(e,"array")){ao.concat(e);}else{ao.push(e);}}
c=tO(ao.cmn,"undefined")?{}:ao.cmn;o=c===CMN?ao:gc(ao);return o;},addClass:function(){var a0=arguments[0],c=this===CMN,el=c?tO(a0,"string")?window.document.getElementById(a0):a0:this,st=c?1:0,al=arguments.length,i,e,j,jl,n,ac=function(el,cl){var re=new RegExp("\\b"+cl+"\\b");if(!re.test(el.className)){el.className=(el.className?el.className:"")+" "+cl;}};for(i=st;i<al;i++){e=arguments[i];if(tO(e,"array")){jl=e.length;for(j=0;j<jl;j++){n=e[j];if(tO(n,"array")){CMN.addClass(el,n);}else{ac(el,n);}}}else{ac(el,e);}}
return ge(el);},removeClass:function(){var a0=arguments[0],c=this===CMN,el=c?tO(a0,"string")?window.document.getElementById(a0):a0:this,st=c?1:0,al=arguments.length,i,e,j,jl,n,rc=function(el,cl){var re=new RegExp("\\s*"+cl+"\\s*","g");el.className=el.className.replace(re,"");};for(i=st;i<al;i++){e=arguments[i];if(tO(e,"array")){jl=e.length;for(j=0;j<jl;j++){n=e[j];if(tO(n,"array")){CMN.removeClass(el,n);}else{rc(el,n);}}}else{rc(el,e);}}
return ge(el);},hasClass:function(){var a0=arguments[0],c=this===CMN,el=c?tO(a0,"string")?window.document.getElementById(a0):a0:this,s=[],st=c?1:0,al=arguments.length,re,e,i;for(i=st;i<al;i++){e=arguments[i];if(tO(e,"array")){s.concat(e);}else if(tO(e,"string")){s.push(e);}}
re=new RegExp("\\b("+s.join("|")+")\\b");return re.test(el.className);},getElementsByTagNames:function(){var a0=arguments[0],c=this===CMN,el=c?tO(a0,"string")?window.document.getElementById(a0):a0:this,st=c?1:0,o=[],al=arguments.length,e,i,j,jl,con=function(a,ae){var i,l=a.length,e=ae.length+l;for(i=l;i<e;i++){a[i]=ae[i-l];}
return a;};for(i=st;i<al;i++){e=arguments[i];if(tO(e,"array")){jl=e.length;for(j=0;j<jl;j++){o=con(o,el.getElementsByTagName(e[j]));}}else if(tO(e,"string")){o=con(o,el.getElementsByTagName(e));}}
return gc(o);},getElementsByClassName:function(el,cl,tg){var a,al,o=[],re,i;tg=tg||"*";el=tO(el,"string")?window.document.getElementById(el):el;a=CMN.getElementsByTagNames(el,tg);cl=tO(cl,"array")?cl.join("|"):tO(cl,"string")?cl:"";re=new RegExp("\\b("+cl+")\\b");al=a.length;for(i=0;i<al;i++){if(re.test(a[i].className)){o.push(a[i]);}}
return gc(o);},firstEl:function(el){el=el||this;if(tO(el,"string")){el=window.document.getElementById(el);}
if(el.firstChild){el=el.firstChild;if(el.nodeType===1){return ge(el);}
return CMN.nextEl(el);}
return null;},lastEl:function(el){el=el||this;if(tO(el,"string")){el=window.document.getElementById(el);}
if(el.lastChild){el=el.lastChild;if(el.nodeType===1){return ge(el);}
return CMN.prevEl(el);}
return null;},nextEl:function(el){el=el||this;if(tO(el,"string")){el=window.document.getElementById(el);}
while(el.nextSibling){el=el.nextSibling;if(el.nodeType===1){return ge(el);}}
return null;},prevEl:function(el){el=el||this;if(tO(el,"string")){el=window.document.getElementById(el);}
while(el.previousSibling){el=el.previousSibling;if(el.nodeType==1){return ge(el);}}
return null;},getPosX:function(el){el=tO(el,"string")?window.document.getElementById(el):el;var curleft=0;if(el.offsetParent){while(el.offsetParent){curleft+=el.offsetLeft;el=el.offsetParent;}}else if(el.x){curleft+=el.x;}
return pI(curleft);},getPosY:function(el){el=tO(el,"string")?window.document.getElementById(el):el;var curtop=0;if(el.offsetParent){while(el.offsetParent){curtop+=el.offsetTop;el=el.offsetParent;}}else if(el.y){curtop+=el.y;}
return pI(curtop);},getStyle:function(el,prop){el=tO(el,"string")?window.document.getElementById(el):el;var cs;if(window.document.defaultView&&window.document.defaultView.getComputedStyle){cs=el.ownerDocument.defaultView.getComputedStyle(el,"");if(!cs){return cs;}
return cs[prop];}
return el.currentStyle[prop];},getElementHeight:function(el){el=tO(el,"string")?window.document.getElementById(el):el;return pI(this.browser.isIE?el.offsetHeight:this.getStyle(el,"height"));},getElementWidth:function(el){el=tO(el,"string")?window.document.getElementById(el):el;return pI(this.browser.isIE?el.offsetWidth:this.getStyle(el,"width"));},addListener:function(el,evtype,fc,capt){var src,r,f;el=tO(el,"string")?window.document.getElementById(el):el;if(el===window&&evtype==="domready"){if(dombuilt){fc();return true;}
onbuilt.push(fc);if(CMN.browser.isIE&&document.readyState){if(!window.document.getElementById("ie_ready")){src=window.location.protocol==="https:"?"://0":((" java").substring(1)+"script:void(0)");window.document.write('<scr'+'ipt id="ie_ready" defer src="'+src+'"><\/script>');window.document.getElementById("ie_ready").onreadystatechange=function(){if(this.readyState==="complete"){built();}};}}else{if(CMN.browser.isGecko){window.document.addEventListener("DOMContentLoaded",built,false);}else{window.addEventListener("load",built,false);}}
return true;}else{if(el.addEventListener){el.addEventListener(evtype,fc,capt);}else if(el.attachEvent){f=function(){fc.apply(el,arguments);};r=el.attachEvent("on"+evtype,f,capt);if(r){lsts.push([fc,f]);}}
return ge(el);}},removeListener:function(el,evtype,fc,capt){var i,l=onbuilt.length,o=false,ll=lsts.length;el=tO(el,"string")?window.document.getElementById(el):el;if(el===window&&evtype==="domready"){for(i=0;i<l;i++){if(onbuilt[i]===fc){onbuilt.splice(i,1);o=true;}}
return o;}else{if(el.removeEventListener){el.removeEventListener(evtype,fc,capt);}else if(el.detachEvent){for(i=0;i<ll;i++){if(lsts[i][0]===fc){el.detachEvent("on"+evtype,lsts[i][1],capt);}}}
return ge(el);}},getEvent:function(e){e=e||window.event;if(tO(e.target,"undefined")){e.target=e.srcElement;}
if(tO(e.layerX,"undefined")){e.layerX=e.layerX=e.offsetX;}
if(tO(e.layerY,"undefined")){e.layerY=e.layerY=e.offsetY;}
if(tO(e.which,"undefined")){e.which=e.which=e.keyCode;}
if(tO(e.preventDefault,"undefined")){e.preventDefault=function(){e.returnValue=false;};}
return e;},createModule:function(n,d,f){cmn[n]=module({name:n},d,f);},xhr:function(j){var getRequest=function(){var req=null,MSXMLProgID=["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"];try{req=new XMLHttpRequest();}catch(xX){for(var i=0;i<MSXMLProgID.length;i++){try{req=new window.ActiveXObject(MSXMLProgID[i]);break;}catch(xA){}}}finally{return req;}},req=getRequest();if(!req){throw{name:"FatalError",message:"Cannot initialize XHR object :("};}
var o=module({name:"xhr",response:{xml:null,text:"",json:null,status:0,json_error:null},onresponse:function(){}},[["url",""],["method","GET"],["params",""],["async",true],["timestamp",false],["onresponse",false]])(j),p=o.getParams(),setResult=function(){o.response.status=req.status;if(req.status===200){o.response.xml=req.responseXML;o.response.text=req.responseText;try{o.response.json=window.JSON?window.JSON.parse(req.responseText):eval("("+req.responseText+")");}catch(xJ){o.response.json_error=xJ;}}};if(tO(p.onresponse,"function")){o.onresponse=p.onresponse;}
if(p.async){req.onreadystatechange=function(){if(req.readyState==4){setResult();o.onresponse();}};}
o.send=function(){if(p.timestamp){p.params+=("&cmn_xhr_timestamp="+new Date().getTime());}
if(p.method.toUpperCase()==="POST"){req.open("POST",p.url,p.async);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(req.overrideMimeType){req.setRequestHeader("Connection","close");}
req.send(p.params);}else{req.open("GET",p.url+"?"+p.params,p.async);req.send(null);}
if(!p.async){setResult();}};return o;},ani:function(j){var timer,ts,k,d=[["start",0],["end",0],["method",function(){}],["timestep",100],["duration",1000],["course","linear"]],o={name:"ani",x:0,y:0,running:false},onstart=[],onend=[],m=module(o,d)(j),p=m.getParams(),sgn=(p.end-p.start)<0,pas=function(){var end=sgn?p.start:p.end,r;m.x=new Date().getTime()-ts.getTime();switch(p.course){case"square":r=Math.ceil(Math.pow(m.x*k,2));break;case"cubature":r=Math.ceil(Math.pow(m.x*k,3));break;case"root":r=Math.ceil(Math.sqrt(m.x*k));break;case"linear":r=Math.ceil(m.x*k);break;}
m.y=p.start+Math.pow(-1,sgn)*r;if(m.y>=end||m.x>p.duration){m.y=sgn?p.end:end;m.stop();p.method.apply(m);for(var i=0;i<onend.length;i++){if(tO(onend[i],"function")){onend[i].apply(m);}}}else{p.method.apply(m);}};m.onstart=function(f,a){if(tO(a,"undefined")||a){onstart.push(f);}else{for(var i=0;i<onstart.length;i++){if(onstart[i].toString()==f.toString()){onstart.splice(i,1);}}}};m.setParam=function(par,v){if(this.constructor.prototype.setParam(par,v)){sgn=(p.end-p.start)<0;}};m.onend=function(f,a){if(tO(a,"undefined")||a){onend.push(f);}else{for(var i=0;i<onend.length;i++){if(onend[i].toString()==f.toString()){onend.splice(i,1);}}}};m.run=function(){this.running=true;this.y=p.start;var sl=onstart.length,he=Math.pow(-1,sgn)*(p.end-p.start);switch(p.course){case"square":k=Math.sqrt(he)/p.duration;break;case"cubature":k=Math.pow(he,1/3)/p.duration;break;case"root":k=Math.pow(he,2)/p.duration;break;case"linear":k=he/p.duration;break;}
for(var i=0;i<sl;i++){if(tO(onstart[i],"function")){onstart[i].apply(this);}}
ts=new Date();timer=window.setInterval(pas,p.timestep);};m.stop=function(){this.running=false;window.clearInterval(timer);};m.reverse=function(){var start=this.getParam("start");this.setParam("start",this.getParam("end"));this.setParam("end",start);};return m;}};cmn.gE=cmn.getEl=ge;cmn.gC=cmn.getCollection;cmn.cE=cmn.createEl;cmn.fE=cmn.firstEl;cmn.lE=cmn.lastEl;cmn.nE=cmn.nextEl;cmn.pE=cmn.prevEl;cmn.gX=cmn.getPosX;cmn.gY=cmn.getPosY;cmn.gH=cmn.getElementHeight;cmn.gW=cmn.getElementWidth;cmn.aC=cmn.addClass;cmn.rC=cmn.removeClass;cmn.hC=cmn.hasClass;cmn.aL=cmn.addListener;cmn.rL=cmn.removeListener;regElM("setDN",function(el){el.style.display="none";});regElM("setDB",function(el){el.style.display=el.tagName.toLowerCase()==="tr"?"table-row":"block";});regElM("setDI",function(el){el.style.display="inline";});regElM("setVV",function(el){el.style.visibility="visible";});regElM("setVH",function(el){el.style.visibility="hidden";});regElM("swapDisplay",function(el){el.style.display=el.style.display==="none"?(el.tagName.toLowerCase()==="tr"?"table-row":"block"):"none";});regElM("swapVisibility",function(el){el.style.visibility=el.style.visibility==="hidden"?"visible":"hidden";});cmn.cC=cmn.createCollection=regElM();return cmn;}(),APP=function(){
  var v,app={  
    FormValidator:function(el){
      var lang=document.lang,RE=[],i,errClass="error",inps=[],labels=[];
      RE.mail=/^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/;
      RE.iso_date=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
      RE.czech_date=/^([0-9]{1,2}\.\s*){2}\s*[0-9]{4}$/;
      RE.phone=/^(\s*\d\s*){9}$/; 
      RE.int=/^[0-9]+$/;
      RE.zip=/^[1-7][0-9]{2}\s*[0-9]{2}$/;
      el=CMN.gE(el);
      var labelEls=el.getElementsByTagNames("label");
      for(i=0;i<labelEls.length;i++){
        if(labelEls[i].htmlFor && labelEls[i].htmlFor!==""){
          labels[labelEls[i].htmlFor]=labelEls[i].firstChild.data;
        }
      }

      el.aL("submit",function(e){
        var emptys=[],invalids=[],usermessages=[],alrt="",i,j,el,mode,modes,type,typeRE,label,sels;
        e=CMN.getEvent(e);
        for(i=0;i<inps.length;i++){
          if(CMN.tO(inps[i][4],"undefined") || eval(inps[i][4])){
            inps[i][0]=CMN.gE(inps[i][0]);
            el=inps[i][0];
            mode=inps[i][1].toLowerCase().replace(/\ /gi,"").split("&");
            modes=[];
            for(j=0;j<mode.length;j++){
              modes[mode[j]]=true;
            }
            type=inps[i][2];
            if(CMN.tO(type,"string") && type.trim()!==""){
              typeRE=RE[type];
            }else{
              typeRE=type;
            }
            label="";
            if(!CMN.tO(inps[i][3],"undefined") && !CMN.tO(inps[i][3],"null")){
              label=inps[i][3];
            }else if(!CMN.tO(labels[el.id],"undefined")){
              label=labels[el.id];
            }
            if(modes.require){
              if(el.value.trim()===""){
                emptys.push(label);
                el.aC(errClass);
              }
            }
            if(modes.date){
            	
              sels=el.getElementsByTagName("select");

              if(isNaN(sels[0].value) || isNaN(sels[1].value) || isNaN(sels[2].value)){
                emptys.push(label);
                el.aC(errClass);
              }
              
              var d1=new Date(sels[2].value,sels[1].value-1,sels[0].value);
              var d2=new Date();
              
              var t1=d1.getTime();
              var t2=d2.getTime();
              
              if(t1>t2){
               el.aC(errClass);
               usermessages.push(label+" nesmí být v budoucnu");
              }
              
              
            }
            
            
            if(modes.datep){
              
              sels=el.getElementsByTagName("select");

              if(isNaN(sels[0].value) || isNaN(sels[1].value) || isNaN(sels[2].value)){
                emptys.push(label);
                el.aC(errClass);
              }
              
               var d1=new Date(sels[2].value,sels[1].value-1,sels[0].value);
              var d2=new Date();
              
              var t1=d1.getTime();
              var t2=d2.getTime();
              
              if(t1<=t2){
               el.aC(errClass);
               usermessages.push(label+" nesmí být v minulosti");
              }
              
            

            }
            if(modes.validate){
              if(el.value.trim()!=="" && !typeRE.test(el.value)){
                invalids.push(label);
                el.aC(errClass);
              }
            }
            if(modes.user){
              if(eval(inps[i][5])){
                usermessages.push(inps[i][6]);
              }
            }
          }
        }
        if(emptys.length>0 || invalids.length>0 || usermessages.length>0){
          if(emptys.length>0){
            alrt+="Následující položky nebyly vyplněny:\n\n";
            for(i=0;i<emptys.length;i++){
              alrt+=emptys[i]+"\n";
            }
          }

          if(invalids.length>0){
            if(emptys.length>0){
              alrt+="\n\n";
            }
            alrt+="Následující položky mají chybný formát:\n\n";
            for(i=0;i<invalids.length;i++){
              alrt+=invalids[i]+"\n";
            }
          }

          if(usermessages.length>0){
            if(emptys.length>0 || invalids.length>0){
              alrt+="\n\n";
            }
            alrt+="Další chyby:\n\n";
            for(i=0;i<usermessages.length;i++){
              alrt+=usermessages[i]+"\n";
            }
          }

          window.alert(alrt);
          e.preventDefault();
        }
      });

      this.registerInput=function(){
        var mode=arguments[1].toLowerCase().replace(/\ /gi,"").split("&"),j,type,typeRE,modes=[];
        for(j=0;j<mode.length;j++){
          modes[mode[j]]=true;
        }
        type=arguments[2];
        if(CMN.tO(type,"string") && type.trim()!==""){
          typeRE=RE[type];
        }else{
          typeRE=type;
        }
        if(modes.validate){
          CMN.gE(arguments[0]).aL("change",function(){
            if(typeRE.test(this.value)){
              this.rC(errClass);
            }
          });
        }
        if(modes.date){
          CMN.gE(arguments[0]).getElementsByTagNames("select").aL("change",function(){
            var ok=true;
            CMN.gE(this.parentNode).getElementsByTagNames("select").execute(function(){
              if(isNaN(this.value)){
                ok=false;
              }
            });
            if(ok){
              CMN.gE(this.parentNode).rC(errClass);
            }
          });
        }
        if(modes.require){
          CMN.gE(arguments[0]).aL("change",function(){
            if(this.value.trim()!==""){
              this.rC(errClass);
            }
          });
        }
        inps.push(arguments);
      };
    },


    expirator:{
      init:function(start){
        var ex=CMN.gE("expire"),timer,fc=function(){
          var d=new Date()/1000,dif=start-d+600,m=Math.floor(dif/60),s=Math.floor(dif-m*60);
          ex.lE().firstChild.data=m+":"+((s<10)?("0"+s):s);
          if(m===0 && s<10 && s>7){
            CMN.cC(CMN.gE(ex.parentNode).getElementsByClassName("sms","input"),"smssub").execute(function(){this.disabled=true;});
          }
          if(m===0 && s===0){
            window.clearInterval(timer);
            timer=window.setTimeout("window.location.reload();",1000);
            window.location.reload();
          }
        };
        ex.firstChild.data="Časový limit platnosti kódu: ";
        ex.cE({tag:"b",text:" "});
        fc();
        timer=window.setInterval(fc,1000);
      }
    },


     datator:function(){
      CMN.aL(window,"domready",function(){
        var el=CMN.gE("container"),m=el.getElementsByClassName("month","select"),y=el.getElementsByClassName("year","select");
      
      
      
      
        m.aL("change",function(){
          var el=CMN.gE(this),to_now=0,m=el.value,y=el.nE().value,d=el.pE(),l=d.options.length,i,c,months=["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"];
          if(!isNaN(m) && !isNaN(y)){
            c=(new Date(y,m,0)).getDate();
            
            var val=d.value;
            
            if(l>c+1){
              d.options.length=c+1;
            }else{
              for(i=l;i<=c;i++){
               d.options[d.options.length]=new Option(i,i,val==i,val==i);
              }
              
              if(val<=c)d.value=val;
              
            }
            
           
            
            
          }
          
                    if(!isNaN(m) && !isNaN(y) && to_now){

              if(y==(new Date()).getFullYear()){

                //useknout mesice
                var val=m;
                el.options.length=1;
                for(i=(new Date()).getMonth();i<12;i++){
                   el.options[el.options.length]=new Option(months[i],i+1,val==(i+1),val==(i+1));
                }
                if((val-1)<=(new Date()).getMonth())el.value=val;
               
               
                if((m-1)==(new Date()).getMonth()){
                	c=(new Date(el.nE().value,el.value,0)).getDate();
              var val=d.value;
                  d.options.length=1;
                  for(i=(new Date()).getDate();i<=c;i++){
               d.options[d.options.length]=new Option(i,i);
              }
              if(val<=(new Date()).getDate())d.value=val;
              
                }else{
                	val=d.value;
               d.options.length=1;
               	c=(new Date(el.nE().value,el.value,0)).getDate();

                  
                  for(i=1;i<=c;i++){
               d.options[d.options.length]=new Option(i,i,val==i,val==i);
              }
              d.value=val
              
                }
                
                
              }else{
                var val=el.value;
              	  el.options.length=1;

                for(i=0;i<12;i++){
                   el.options[el.options.length]=new Option(months[i],i+1);
                }
                el.value=val;
                val=d.value;
                	c=(new Date(el.nE().value,el.value,0)).getDate();
                	
                d.options.length=1;
                  for(i=1;i<=c;i++){
               d.options[d.options.length]=new Option(i,i,i==val,i==val);
              }
                d.value=val;
                
                
              }
              
              
              
            }

          




          
          
        });
        
        
        y.aL("change",function(){
          var el=CMN.gE(this),to_now=0,m=el.pE().value,y=el.value,d=el.pE().pE(),l=d.options.length,i,c,months=["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"];
          if(!isNaN(m) && !isNaN(y)){
            c=(new Date(y,m,0)).getDate();
var val=d.value;
            if(l>c+1){
              d.options.length=c+1;
            }else{
              for(i=l;i<=c;i++){
               d.options[d.options.length]=new Option(i,i,val==i,val==i);
              }
              if(val<=c)d.value=val;
              
              
            }
            
            
            
          }
          
                       if(!isNaN(m) && !isNaN(y) && to_now){

              if(y==(new Date()).getFullYear()){

                //useknout mesice
                var val=m;
                el.pE().options.length=1;
                for(i=(new Date()).getMonth();i<12;i++){
                   el.pE().options[el.pE().options.length]=new Option(months[i],i+1,val==(i+1),val==(i+1));
                }
                if((val-1)<=(new Date()).getMonth())el.pE().value=val;
               
               
                if((m-1)==(new Date()).getMonth()){
                	c=(new Date(el.value,el.pE().value,0)).getDate();
              var val=d.value;
                  d.options.length=1;
                  for(i=(new Date()).getDate();i<=c;i++){
               d.options[d.options.length]=new Option(i,i);
              }
              if(val<=(new Date()).getDate())d.value=val;
              
                }else{
                	val=d.value;
                		c=(new Date(el.value,el.pE().value,0)).getDate();
               d.options.length=1;
                  for(i=1;i<=c;i++){
               d.options[d.options.length]=new Option(i,i,val==i,val==i);
              }
              d.value=val;
              
                }
                
                
              }else{
              	  var val=el.pE().value;
              	  el.pE().options.length=1;
                for(i=0;i<12;i++){
                   el.pE().options[el.pE().options.length]=new Option(months[i],i+1);
                }
                el.pE().value=val;
                
                c=(new Date(el.value,el.pE().value,0)).getDate();
                
                val=d.value;
                d.options.length=1;
                  for(i=1;i<=c;i++){
                    d.options[d.options.length]=new Option(i,i);
                 }
              d.value=val;
              
                
                
              }
              
              
              
            }

          
          
          
          
        });


var fc=function(){
  var col=CMN.cC("child_birth_day_type_0_2","child_birth_day_type_1_2","child_birth_day_type_2_2","child_birth_day_type_3_2");
  var col2=CMN.cC("child_birth_day_type_0_1","child_birth_day_type_1_1","child_birth_day_type_2_1","child_birth_day_type_3_1");

var ch=false;
var b=-1;
  for(i=0;i<col.length;i++){
    if(col[i].checked){ch=true;
b=i;break;
}
}
if(ch){
  for(i=0;i<col.length;i++){
    if(!col[i].checked)col[i].disabled=true;
if(i!=b)col2[i].checked=true;
}

}else{
  for(i=0;i<col.length;i++){
  col[i].disabled=false;
}


}

};

CMN.aL("child_birth_day_type_0_1","click",fc);
CMN.aL("child_birth_day_type_1_1","click",fc);
CMN.aL("child_birth_day_type_2_1","click",fc);
CMN.aL("child_birth_day_type_3_1","click",fc);


CMN.aL("child_birth_day_type_0_2","click",fc);
CMN.aL("child_birth_day_type_1_2","click",fc);
CMN.aL("child_birth_day_type_2_2","click",fc);
CMN.aL("child_birth_day_type_3_2","click",fc);

fc();


      });






      return app;
    },


    switchator:function(p){
//dodelat vypinani hvezdicky :)
      CMN.aL(window,"domready",function(){
        CMN.gE("container").getElementsByClassName("sophr","input").aL("click",function(){
          var that=this;

// a natvrdku

if(that.value==1){
  CMN.gE(this.parentNode.parentNode.parentNode).pE().setDN().pE().setDN();  
}else{
  CMN.gE(this.parentNode.parentNode.parentNode).pE().setDB().pE().setDB();
}

// tady to jinak musi se natahnout vsechny zase a pak to nastavit          CMN.gE(that.parentNode).nE().lE().pE().style.display=that.checked?"inline":"none";

          CMN.gE(that.parentNode.parentNode.parentNode).getElementsByTagNames("select").execute(function(){
            var ch=this.parentNode.parentNode==that.parentNode.parentNode;
          if(1)  this.disabled=!ch;else{
            
          }
            CMN.rC(this.parentNode,"error");
          });
        }).execute(function(){
          var that=this;
        //  CMN.gE(that.parentNode).nE().lE().pE().style.display=that.checked?"inline":"none";
          CMN.gE(that.parentNode.parentNode).getElementsByTagNames("select").execute(function(){
         if(!p)   this.disabled=!that.checked;else{
           
         }
          });                
        });
      });
      return app;
    },

    
    registerInput:function(){
      var args=arguments;
      CMN.aL(window,"domready",function(){
        v.registerInput.apply(null,args);
      });
      return app;
    },

  
    init:function(action){
      CMN.extendTypes();
      CMN.aL(window,"domready",function(){
        var fc;
        v=new APP.FormValidator(action);



        if(action==="edit2"){

          // CMN.gE("captchaim").src="/captcha.php?"+Math.random();
          CMN.gE("f_phone").aL("change",function(){
            this.value=this.value.replace(/\s+/g,"");
            this.value=this.value.substring(0,3)+" "+this.value.substring(3,6)+" "+this.value.substring(6);
          });

          CMN.gE("f_zip").aL("change",function(){
            this.value=this.value.replace(/\s+/g,"");
            this.value=this.value.substring(0,3)+" "+this.value.substring(3,5);
          });


          (function(j){

            var l=arguments.length,i,f=function(j){
              var ver=CMN.cE({className:"ver"}),el=CMN.gE("f_"+j.action);
              CMN.aL("f_"+j.action,"blur",function(){

              	  
                var val=this.value.trim(),that=this;
                
                if(j.re.test(val)){
                  CMN.xhr({url:"/ajax.php",params:"action="+j.action+"_edit&"+j.action+"="+val+"&user_id="+CMN.gE("user_id").value,onresponse:function(){
                    var o=this.response.xml,st=o.getElementsByTagName("status"),displ=CMN.gE(that).nextEl().nextEl();
                    if(st[0].firstChild.data==="OK"){
                      displ.className="yes";
                      displ.innerHTML='<img src="/images/ok.gif">';
                    }else{
                      displ.className="no";
                      displ.innerHTML='<img src="/images/nok.gif"> obsazen'+(el.suff || "");
                    }
                  }}).send();
                }else{
                if(val!=="" )	this.nextEl().nextEl().innerHTML='<img src="/images/nok.gif" style="vertical-align:middle;margin-left:10px">  Chybný formát! (správný formát: '+j.example+')';
                	else 	this.nextEl().nextEl().innerHTML="";
                  //window.alert("Je třeba zadat kontrolovanou hodnotu ve správném formátu");
                }
              });

            };
            for(i=0;i<l;i++){
              f(arguments[i]);
            }
          })({action:"login",example:"jmeno@domena.cz",re:/^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/},{action:"phone",example:"604 123 456",re:/^(\s*\d\s*){9}$/},{action:"nick",re:/^.+$/,suff:"a"});

CMN.cC("f_login","f_phone","f_passwd","f_passwd_again","f_nick").aL("focus",function(){
  this.nextEl().nextEl().setDN();
  this.nextEl().nextEl().nextEl().setDB();
  CMN.gE("strength").setDN();
}).aL("blur",function(){
  this.nextEl().nextEl().setDB();  
  this.nextEl().nextEl().nextEl().setDN();
});

CMN.gE("f_passwd_again").aL("blur",function(){
  if(this.value!==CMN.gE("f_passwd").value && this.value.trim()!==""){
  	this.nextEl().nextEl().innerHTML="Hesla se neshodují";
  }else{
  	this.nextEl().nextEl().innerHTML="";
  }

});




CMN.getElementsByClassName("edit2","ztp").aL("click",function(){
    var sel=this.pE().pE(),i;
    sel.options.length=1;
  if(this.checked){
    for(i=2010;i>=1900;i--){
      sel.options[sel.options.length]=new Option(i,i);
    }
  }else{
    for(i=2010;i>=2007;i--){
      sel.options[sel.options.length]=new Option(i,i);
    }
  }
});



function passwordChanged() {
var strength = document.getElementById('strength');
CMN.setDB(strength);
CMN.pE("strength").setDN();
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9]).*$", "g");
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
var enoughRegex = new RegExp("(?=.{1,}).*", "g");
var pwd = document.getElementById("f_passwd");
if (pwd.value.length==0) {
strength.innerHTML = '';
} else if (false == enoughRegex.test(pwd.value)) {
strength.innerHTML = '';
} else if (strongRegex.test(pwd.value)) {
strength.innerHTML = '<span ><img src="/images/strong.gif"> Bezpečné heslo.</span>';
} else if (mediumRegex.test(pwd.value)) {
strength.innerHTML = '<span ><img src="/images/medium.gif"> Středně bezpečné heslo.</span>';
} else {
strength.innerHTML = '<span ><img src="/images/weak.gif"> Slabé heslo.</span>';
}
}

CMN.aL("f_passwd","keyup",passwordChanged);









          if(!CMN.gE("f_receive_email").checked){
            CMN.gE("rec_email").getElementsByClassName("reccheck","input").execute(function(){this.disabled=true;});
          }

          if(!CMN.gE("f_receive_sms").checked){
            CMN.gE("rec_sms").getElementsByClassName("reccheck","input").execute(function(){this.disabled=true;});
          }

          if(CMN.gE("f_receive_email")) {
            CMN.gE("f_receive_email").aL("click", function(){
              if(this.checked == true){
                CMN.gE("rec_email2").setDB();
              } else {
                CMN.gE("rec_email2").setDN();                
              }
            });
            if(CMN.gE("f_receive_email").disabled == true) {
                CMN.gE("rec_email2").setDB();              
            }
          }
          
          if(CMN.gE("f_receive_sms")) {
            CMN.gE("f_receive_sms").aL("click", function(){
              if(this.checked == true){
                CMN.gE("rec_sms2").setDB();
              } else {
                CMN.gE("rec_sms2").setDN();                
              }
            });
            if(CMN.gE("f_receive_sms").disabled == true) {
                CMN.gE("rec_sms2").setDB();              
            }
          }
          
          CMN.gE(action).getElementsByClassName("togrec","input").aL("click",function(){
            var inps=CMN.gE(this.parentNode.parentNode).getElementsByClassName("reccheck","input");
            for(var i=0;i<inps.length;i++){
              if(this.checked){
                inps[i].disabled=false;
              }else{
                inps[i].checked=false;
                inps[i].disabled=true;
              }
            }
          });
          CMN.gE(action).getElementsByClassName("regcheck","input").aL("click",function(){
            if(this.checked){
              CMN.gE(this.parentNode).nE().setDB();
            }else{
              CMN.gE(this.parentNode).nE().setDN();    
            }
          });
          /*
          CMN.gE("label_f_captcha").cE({tag:"span",text:"nový kód"}).aL("click",function(e){
            e=CMN.getEvent(e);
            CMN.pE(this).src="/captcha.php?"+Math.random();
            e.preventDefault();
          });
*/
          v.registerInput("f_login","require&validate","mail");
          v.registerInput("f_phone","require&validate","phone");
          v.registerInput("f_passwd_again","user",null,null,"CMN.gE('f_passwd').value.trim()!=='' && CMN.gE('f_passwd_again').value.trim()!==''","CMN.gE('f_passwd').value!==CMN.gE('f_passwd_again').value","Hesla si neodpovídají");
          v.registerInput("f_nick","require");
          v.registerInput("f_first_name","require");
          v.registerInput("f_last_name","require");
          v.registerInput("f_street","require");
          v.registerInput("f_street_number","require");
          v.registerInput("f_city","require");
          v.registerInput("f_zip","require&validate","zip");
          
          
          //v.registerInput("f_final_agree","user",null,null,"(function(el){var els=CMN.gE(el).getElementsByTagName('input'),l=els.length,i;for(i=1;i<l;i++){if(els[i].checked){return true;}}return false;})('rec_email')","!CMN.gE('f_final_agree').checked","Projevili jste zájem o zasílání obchodních sdělení e-mailem. Potvrďte, prosím, souhlas na konci formuláře.");                    
          //v.registerInput("f_final_agree","user",null,null,"(function(el){var els=CMN.gE(el).getElementsByTagName('input'),l=els.length,i;for(i=1;i<l;i++){if(els[i].checked){return true;}}return false;})('rec_sms')","!CMN.gE('f_final_agree').checked","Projevili jste zájem o zasílání obchodních sdělení SMS zprávou. Potvrďte, prosím, souhlas na konci formuláře.");                    
          
        }

        
        if(action==="register1"){

          CMN.gE("captchaim").src="/captcha.php?"+Math.random();

          CMN.gE("f_phone").aL("change",function(){
            this.value=this.value.replace(/\s+/g,"");
            this.value=this.value.substring(0,3)+" "+this.value.substring(3,6)+" "+this.value.substring(6);
          });

          CMN.gE("f_zip").aL("change",function(){
            this.value=this.value.replace(/\s+/g,"");
            this.value=this.value.substring(0,3)+" "+this.value.substring(3,5);
          });

          (function(j){

            var l=arguments.length,i,f=function(j){
              var ver=CMN.cE({className:"ver"}),el=CMN.gE("f_"+j.action);
              CMN.aL("f_"+j.action,"blur",function(){

              	  
                var val=this.value.trim(),that=this;
                
                if(j.re.test(val)){
                  CMN.xhr({url:"/ajax.php",params:"action="+j.action+"&"+j.action+"="+val,onresponse:function(){
                    var o=this.response.xml,st=o.getElementsByTagName("status"),displ=CMN.gE(that).nextEl().nextEl();
                    if(st[0].firstChild.data==="OK"){
                      displ.className="yes";
                      displ.innerHTML='<img src="/images/ok.gif">';
                    }else{
                      displ.className="no";
                      displ.innerHTML='<img src="/images/nok.gif"> obsazen'+(el.suff || "");
                    }
                  }}).send();
                }else{
                if(val!=="" )	this.nextEl().nextEl().innerHTML='<img src="/images/nok.gif" style="vertical-align:middle;margin-left:10px">  Chybný formát! (správný formát: '+j.example+')';
                	else 	this.nextEl().nextEl().innerHTML="";
                  //window.alert("Je třeba zadat kontrolovanou hodnotu ve správném formátu");
                }
              });

            };
            for(i=0;i<l;i++){
              f(arguments[i]);
            }
          })({action:"login",example:"jmeno@domena.cz",re:/^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/},{action:"phone",example:"604 123 456",re:/^(\s*\d\s*){9}$/},{action:"nick",re:/^.+$/,suff:"a"});

CMN.cC("f_login","f_phone","f_passwd","f_passwd_again","f_nick").aL("focus",function(){
  this.nextEl().nextEl().setDN();
  this.nextEl().nextEl().nextEl().setDB();
  CMN.gE("strength").setDN();
}).aL("blur",function(){
  this.nextEl().nextEl().setDB();  
  this.nextEl().nextEl().nextEl().setDN();
});

CMN.gE("f_passwd_again").aL("blur",function(){
  if(this.value!==CMN.gE("f_passwd").value && this.value.trim()!==""){
  	this.nextEl().nextEl().innerHTML="Hesla se neshodují";
  }else{
  	this.nextEl().nextEl().innerHTML="";
  }

});


CMN.getElementsByClassName("register1","ztp").aL("click",function(){
    var sel=this.pE().pE().pE(),i;
    sel.options.length=1;
  if(this.checked){
    for(i=2010;i>=1900;i--){
      sel.options[sel.options.length]=new Option(i,i);
    }
  }else{
    for(i=2010;i>=2007;i--){
      sel.options[sel.options.length]=new Option(i,i);
    }
  }
});



function passwordChanged() {
var strength = document.getElementById('strength');
CMN.setDB(strength);
CMN.pE("strength").setDN();
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9]).*$", "g");
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
var enoughRegex = new RegExp("(?=.{1,}).*", "g");
var pwd = document.getElementById("f_passwd");
if (pwd.value.length==0) {
strength.innerHTML = '';
} else if (false == enoughRegex.test(pwd.value)) {
strength.innerHTML = '';
} else if (strongRegex.test(pwd.value)) {
strength.innerHTML = '<span ><img src="/images/strong.gif"> Bezpečné heslo.</span>';
} else if (mediumRegex.test(pwd.value)) {
strength.innerHTML = '<span ><img src="/images/medium.gif"> Středně bezpečné heslo.</span>';
} else {
strength.innerHTML = '<span ><img src="/images/weak.gif"> Slabé heslo.</span>';
}
}

CMN.aL("f_passwd","keyup",passwordChanged);



          if(!CMN.gE("f_receive_email").checked){
            CMN.gE("rec_email").getElementsByClassName("reccheck","input").execute(function(){this.disabled=true;});
          }

          if(!CMN.gE("f_receive_sms").checked){
            CMN.gE("rec_sms").getElementsByClassName("reccheck","input").execute(function(){this.disabled=true;});
          }

          if(CMN.gE("f_receive_email")) {
            CMN.gE("f_receive_email").aL("click", function(){
              if(this.checked == true){
                CMN.gE("rec_email2").setDB();
              } else {
                CMN.gE("rec_email2").setDN();                
              }
            });
          }

          if(CMN.gE("f_receive_sms")) {
            CMN.gE("f_receive_sms").aL("click", function(){
              if(this.checked == true){
                CMN.gE("rec_sms2").setDB();
              } else {
                CMN.gE("rec_sms2").setDN();                
              }
            });
          }
          
          CMN.gE(action).getElementsByClassName("togrec","input").aL("click",function(){
            var inps=CMN.gE(this.parentNode.parentNode).getElementsByClassName("reccheck","input");
            for(var i=0;i<inps.length;i++){
              if(this.checked){
                inps[i].disabled=false;
              }else{
                inps[i].checked=false;
                inps[i].disabled=true;
              }
            }
          });

          CMN.gE(action).getElementsByClassName("regcheck","input").aL("click",function(){
            if(this.checked){
              CMN.gE(this.parentNode).nE().setDB();
            }else{
              CMN.gE(this.parentNode).nE().setDN();    
            }
          });

          CMN.gE("label_f_captcha").cE({tag:"span",text:"nový kód"}).aL("click",function(e){
            e=CMN.getEvent(e);
            CMN.pE(this).src="/captcha.php?"+Math.random();
            e.preventDefault();
          });



          v.registerInput("f_login","require&validate","mail");
          v.registerInput("f_phone","require&validate","phone");
          v.registerInput("f_passwd","require");
          v.registerInput("f_passwd_again","require");
          v.registerInput("f_passwd_again","user",null,null,"CMN.gE('f_passwd').value.trim()!=='' && CMN.gE('f_passwd_again').value.trim()!==''","CMN.gE('f_passwd').value!==CMN.gE('f_passwd_again').value","Hesla si neodpovídají");
          v.registerInput("f_nick","require");
          v.registerInput("f_first_name","require");
          v.registerInput("f_last_name","require");
          v.registerInput("f_street","require");
          v.registerInput("f_street_number","require");
          v.registerInput("f_city","require");
          v.registerInput("f_zip","require&validate","zip");
          //v.registerInput("f_final_agree","user",null,null,"(function(el){var els=CMN.gE(el).getElementsByTagName('input'),l=els.length,i;for(i=1;i<l;i++){if(els[i].checked){return true;}}return false;})('rec_email')","!CMN.gE('f_final_agree').checked","Projevili jste zájem o zasílání obchodních sdělení e-mailem. Potvrďte, prosím, souhlas na konci formuláře.");                    
          //v.registerInput("f_final_agree","user",null,null,"(function(el){var els=CMN.gE(el).getElementsByTagName('input'),l=els.length,i;for(i=1;i<l;i++){if(els[i].checked){return true;}}return false;})('rec_sms')","!CMN.gE('f_final_agree').checked","Projevili jste zájem o zasílání obchodních sdělení SMS zprávou. Potvrďte, prosím, souhlas na konci formuláře.");                    

        }

        
        if(action==="register2"){
          CMN.gE(action).getElementsByClassName("sms","input").aL("keyup",function(e){
            e=CMN.getEvent(e);
            if(e.which===9 || e.which===16){
              return;
            }

            if(this.id!="f_sms3"){
              if(this.value.length===3){
                CMN.nE(this).nE().focus();
              }
            }
          });

          v.registerInput("f_sms1","require&validate",/^.{3}$/,"První část SMS kódu");
          v.registerInput("f_sms2","require&validate",/^.{3}$/,"Druhá část SMS kódu");
          v.registerInput("f_sms3","require&validate",/^.{3}$/,"Třetí část SMS kódu");
        }



        if(action==="newsms"){
          CMN.gE("label_f_captcha").cE({tag:"span",text:"nový kód"}).aL("click",function(){
            CMN.pE(this).src="/captcha.php?"+Math.random();
          });
          v.registerInput("f_captcha","require",null,"Kontrolní kód z obrázku");
        }


        if(action==="password1"){
          v.registerInput("f_email","require&validate","mail");
        }

        if(action==="edit1"){
          v.registerInput("f_login","require&validate","mail");
          v.registerInput("f_passwd","require");
        }


      });

      return app;

    }


  

  };

  return app;
}();