

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,prop;for(var i=0;i<dl;i++){prop=d[i][0];o[prop]=tO(j[prop],"undefined")?d[i][1]:j[prop]}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 lang="cs",roots=window.document.getElementsByTagName("html"),lang_attr=roots[0].getAttribute("lang"),par=getParams((j||{}),d),M=function(){},m;M.prototype=o;M.prototype.lang=lang_attr!==""?lang_attr:lang;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.toString=function(){return"CMN "+(this.name?this.name:"nameless module")+"\n\nParameters:\n"+this.getParams()};m=new M();if(tO(f,"function")){f.apply(m)}return m}},rm=[],ge=function(s){var el=tO(s,"string")?window.document.getElementById(s)?window.document.getElementById(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(j){return ge(this.appendChild(cmn.createEl(j)))};el.getElementsByTagNames=cmn.getElemensByTagNames;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.cmn=cmn}return a},regElMethod=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)}l=x.length;for(i=0;i<l;i++){f(x[i])}}else{x=ge(x);f(x)}return x};cmn[fn]=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=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};rm.push([fn,function(){return sf(this)}])},dombuilt=false,onbuilt=[],built=function(){if(dombuilt){return}var i,l=onbuilt.length;for(i=0;i<l;i++){onbuilt[i]()}dombuilt=true},json_parse,lsts=[];if(window.JSON){json_parse=window.JSON.parse}else{json_parse=function(){var at,ch,escapee={'"':'"','\\':'\\','/':'/',b:'\b',f:'\f',n:'\n',r:'\r',t:'\t'},text,err=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},nxt=function(c){if(c&&c!==ch){err("Expected '"+c+"' instead of '"+ch+"'")}ch=text.charAt(at);at+=1;return ch},number=function(){var number,string="";if(ch==="-"){string="-";nxt("-")}while(ch>="0"&&ch<="9"){string+=ch;nxt()}if(ch==="."){string+=".";while(nxt()&&ch>="0"&&ch<="9"){string+=ch}}if(ch==="e"||ch==="E"){string+=ch;nxt();if(ch==="-"||ch==="+"){string+=ch;nxt()}while(ch>="0"&&ch<="9"){string+=ch;nxt()}}number=+string;if(isNaN(number)){err("Bad number")}else{return number}},string=function(){var hex,i,string="",uffff;if(ch==='"'){while(nxt()){if(ch==='"'){nxt();return string}else if(ch==="\\"){nxt();if(ch==="u"){uffff=0;for(i=0;i<4;i+=1){hex=parseInt(nxt(),16);if(!isFinite(hex)){break}uffff=uffff*16+hex}string+=String.fromCharCode(uffff)}else if(tO(escapee[ch],"string")){string+=escapee[ch]}else{break}}else{string+=ch}}}err("Bad string")},wht=function(){while(ch&&ch<=" "){nxt()}},word=function(){switch(ch){case"t":nxt("t");nxt("r");nxt("u");nxt("e");return true;case"f":nxt("f");nxt("a");nxt("l");nxt("s");nxt("e");return false;case"n":nxt("n");nxt("u");nxt("l");nxt("l");return null}err("Unexpected '"+ch+"'")},value,array=function(){var array=[];if(ch==="["){nxt("[");wht();if(ch==="]"){nxt("]");return array}while(ch){array.push(value());wht();if(ch==="]"){nxt("]");return array}nxt(",");wht()}}err("Bad array")},object=function(){var key,object={};if(ch==="{"){nxt("{");wht();if(ch==="}"){nxt("}");return object}while(ch){key=string();wht();nxt(":");if(Object.hasOwnProperty.call(object,key)){err('Duplicate key "'+key+'"')}object[key]=value();wht();if(ch==="}"){nxt("}");return object}nxt(",");wht()}}err("Bad object")};value=function(){wht();switch(ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&ch<="9"?number():word()}};return function(source,reviver){var result;text=source;at=0;ch=" ";result=value();wht();if(ch){err("Syntax error")}return tO(reviver,"function")?function walk(holder,key){var k,v,value=holder[key];if(value&&tO(value,"object")){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}({"":result},""):result}}()}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(j){var par=getParams(j,[["tag","div"],["id",""],["className",""],["text",""],["style",null],["attrs",null],["doc",window.document]]);var 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},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=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=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,re,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.nextEl(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:"CMN.XHR",message:"Fatal: 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]])(j),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=json_parse(req.responseText)}catch(xJ){o.response.json_error=xJ}}};if(o.getParam("async")){req.onreadystatechange=function(){if(req.readyState==4){setResult();o.onresponse()}}}o.send=function(){var par=this.getParams();if(par.timestamp){par.params+=("&cmn_xhr_timestamp="+new Date().getTime())}if(par.method.toUpperCase()==="POST"){req.open("POST",par.url,par.async);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(req.overrideMimeType){req.setRequestHeader("Connection","close")}req.send(par.params)}else{req.open("GET",par.url+"?"+par.params,par.async);req.send(null)}if(!par.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},onstart=[],onend=[],m=module(o,d)(j),pas=function(){var end=m.getParam("end");m.x=new Date().getTime()-ts.getTime();switch(m.getParam("course")){case"square":m.y=Math.round(Math.pow(m.x,2)*k);break;case"linear":m.y=Math.round(m.x*k);break}if(m.y>=end||m.x>m.getParam("duration")){m.y=end;m.stop();m.getParam("method").apply(m);for(var i=0;i<onend.length;i++){if(tO(onend[i],"function")){onend[i].apply(m)}}}else{m.getParam("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.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.y=this.getParam("start");var sl=onstart.length,he=this.getParam("end")-this.getParam("start");switch(this.getParam("course")){case"square":k=he/this.getParam("duration")/1000;break;case"linear":k=he/this.getParam("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,this.getParam("timestep"))};m.stop=function(){window.clearInterval(timer)};return m},JSON:{parse:json_parse}};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;regElMethod("setDN",function(el){el.style.display="none"});regElMethod("setDB",function(el){el.style.display=el.tagName.toLowerCase()==="tr"?"table-row":"block"});regElMethod("setDI",function(el){el.style.display="inline"});regElMethod("setVV",function(el){el.style.visibility="visible"});regElMethod("setVH",function(el){el.style.visibility="hidden"});regElMethod("swapDisplay",function(el){el.style.display=el.style.display==="none"?"block":"none"});regElMethod("swapVisibility",function(el){el.style.visibility=el.style.visibility==="hidden"?"visible":"hidden"});return cmn}();



// zavisle selecty
function dSelect(master_select,slave_select,dep_array,master_selected,slave_selected,options_truncate){
  var masterElement=getEl(master_select);
  var slaveElement=getEl(slave_select);
  masterElement.onchange=function(){
    var opts=slaveElement.options;
    opts.length=options_truncate;
    if(!isUndefined(dep_array[this.value])){
      var nOpts=dep_array[this.value];
      for(var i=0;i<nOpts.length;i++)opts[opts.length]=new Option(nOpts[i][1],nOpts[i][0],nOpts[i][0]==slave_selected,nOpts[i][0]==slave_selected);
    }
  };
  if(master_selected!="")masterElement.onchange.call(masterElement);
}



function checkBoxes(elid,checked){
  var inps=getEl(elid).getElementsByTagName("input");
  for(var i=0;i<inps.length;i++)if(inps[i].type=="checkbox")inps[i].checked=checked;
  return false;
}





//mapa s umistenim konkretni restaurace
if(Page.page=="restaurant" && !isUndefined(Page.restaurant_id)){
  
  var mapDetail={
    
    loc:null,
    map:null,
    marker:null,
    updateContainer:null,
    
    
    decDeg:function(x){
      	    var o={d:parseInt(x,10),m:0,s:0,ss:0},m=(x-o.d)*60,s;
      	    o.m=parseInt(m,10);
      	    s=(m-o.m)*60;
      	    o.s=parseInt(s,10);
      	    o.ss=Math.round((s-o.s)*1000,3);
      	    return o;
      	  },
      	  
    
    
    
    showCoords:function(c){
      	  
      	  
      	  var displayCoords=function(x,o){
      	    var gps=mapDetail.decDeg(x),inps=getEl("reloccoords").getElementsByTagName("input");
      	    o=o||0;
      	    inps[o+0].value=gps.d;
      	    inps[o+1].value=gps.m;
      	    inps[o+2].value=gps.s;
      	    inps[o+3].value=gps.ss;
      	  };
      	  
      	  displayCoords(c.lat());
      	  displayCoords(c.lng(),4);
      	  

        // getEl("reloccoords").innerHTML=c.lat()+", "+c.lng()+" "+decDeg(c.lat()).d+" "+decDeg(c.lat()).m+" "+decDeg(c.lat()).s+"."+decDeg(c.lat()).ss;

        
      },
    
    
    moveMarker:function(){
      var inps=getEl("reloccoords").getElementsByTagName("input"),lat=parseInt(inps[0].value)+inps[1].value/60+(parseInt(inps[2].value)+inps[3].value/1000)/3600,lng=parseInt(inps[4].value)+inps[5].value/60+(parseInt(inps[6].value)+inps[7].value/1000)/3600,loc=new GLatLng(lat,lng);
      
      mapDetail.map.setCenter(loc,15);
      mapDetail.marker.setLatLng(loc);
      
      
      
      
    },
    
    
    
    showMarker:function(){
      var loc=new GLatLng(mapDetail.loc.latitude,mapDetail.loc.longitude),inps=getEl("reloccoords").getElementsByTagName("input"),i;
      
      
      mapDetail.map.setCenter(loc,15);
      
     
      mapDetail.marker=new GMarker(loc,{draggable:true});
      mapDetail.marker.disableDragging();
      
      
      mapDetail.showCoords(loc);

      for(i=0;i<inps.length;i++){
        inps[i].original=inps[i].value;
        CMN.aL(inps[i],"change",function(){
          var re=/^\d{1,2}$/;
          if(CMN.hC(this,"n3"))re=/^\d{1,3}$/;
          if(!re.test(this.value)){
            alert("Je třeba zadat celé číslo");	
            this.value=this.original;
          }else{
            mapDetail.moveMarker();
            this.original=this.value;
          }
          	  
        }).aL("keypress",function(e){
          e=CMN.getEvent(e);
          if(e.which===13){
          var re=/^\d{1,2}$/;
          if(CMN.hC(this,"n3"))re=/^\d{1,3}$/;
          if(!re.test(this.value)){
            alert("Je třeba zadat celé číslo");	
            this.value=this.original;
          }else{
            mapDetail.moveMarker();
            this.original=this.value;
          }
            
          }
        });
      }

      
      
      GEvent.addListener(mapDetail.marker,"dragend",function(){
       var coords=this.getLatLng();
         
         mapDetail.showCoords(coords);
         //getEl("ncoords").innerHTML=coords.lat()+", "+coords.lng();
        
        });
        
         GEvent.addListener(mapDetail.marker,"drag",function(){
       var coords=this.getLatLng();
       mapDetail.showCoords(coords);
       
         //getEl("ncoords").innerHTML=coords.lat()+", "+coords.lng();
        
        });
        
        
        
      mapDetail.map.addOverlay(mapDetail.marker);
      


    },
    

    saveCoords:function(){
      if(mapDetail.updateContainer.lastChild.lastChild.lastChild.lastChild.previousSibling.innerHTML!=""){
        
        var coords=mapDetail.updateContainer.lastChild.lastChild.lastChild.lastChild.previousSibling.innerHTML.split(",");
        
        var ajax=new AJAX();
         ajax.request("GET",Page.www_root+"change_gps.php","restaurant_id="+Page.restaurant_id+"&latitude="+coords[0]+"&longitude="+coords[1]); 
        
        setDN(mapDetail.updateContainer);
 mapDetail.marker.disableDragging();
      }else alert("Zvolte novou pozici");
    },


    
    init:function(){
    
      var mapContainer=document.createElement("div");
      mapContainer.id="mapc";
      
    
    
     var mapElement=document.createElement("div");
      mapElement.id="map";
      
      mapContainer.appendChild(mapElement);
      
      getEl("pictures").insertBefore(mapContainer,getEl("pictures").firstChild.nextSibling);
    
        mapDetail.map=new GMap2(mapElement);
       
       
       
        
      mapDetail.map.addControl(new GSmallMapControl());

      
mapDetail.map.addControl(new GMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10)));


/*
      var updateBut=new Image();
      updateBut.src=Page.www_root+"images/layout/buttons/coords_update.gif";
      updateBut.alt="Upravit pozici";
      updateBut.className="hand";

     
      updateBut.onclick=function(){
        setDB(this.nextSibling);  
        mapDetail.marker.enableDragging();
        mapDetail.marker.bouncy=true;
        
        
        
      };
      
      
      */
      
      
      
      var zoomBut=new Image();
      zoomBut.src=Page.www_root+"images/layout/buttons/zumin.gif";
      zoomBut.alt=zoomBut.title="Zvětšit mapu";
      zoomBut.className="hand";
      zoomBut.id="zoombut";
      
      
      zoomBut.onclick=function(){
        if(!CMN.hC(this.parentNode,"big")){
          CMN.aC(this.parentNode,"big");

          this.src=Page.www_root+"images/layout/buttons/zumaut.gif";
          this.alt=this.title="Zmenšit mapu";


      
      
      mapDetail.map.checkResize();
     var loc=new GLatLng(mapDetail.loc.latitude,mapDetail.loc.longitude);
      
      
      mapDetail.map.setCenter(loc,15);
        }else{
          CMN.rC(this.parentNode,"big");
          this.src=Page.www_root+"images/layout/buttons/zumin.gif";
          this.alt=this.title="Zvětšit mapu";
          
            mapDetail.map.checkResize();
     var loc=new GLatLng(mapDetail.loc.latitude,mapDetail.loc.longitude);
      
      
      mapDetail.map.setCenter(loc,15);
        }
      };
      
      
      
      
      
      var relocContainer=CMN.cE({id:"reloc"});
      
      relocContainer.appendChild(CMN.cE({tag:"h2",text:"Změna pozice restaurace na mapě"}));
      relocContainer.appendChild(CMN.cE({tag:"p",text:'Přetažením terčíku či zadáním GPS souřadnic zadejte novou pozici restaurace. Potvrďte tlačítkem "Upravit pozici"'}));
      
      var coordsContainer=CMN.cE({id:"reloccoords"});
      
      coordsContainer.innerHTML='<input type="text" maxlength="2" class="n2" > &deg; <input type="text" maxlength="2" class="n2" > \' <input type="text" maxlength="2" class="n2" >.<input type="text" maxlength="3" class="n3" > " N<br> <input type="text" maxlength="2" class="n2" > &deg; <input type="text" maxlength="2" class="n2" > \' <input type="text" maxlength="2" class="n2" >.<input type="text" maxlength="3" class="n3" > " E';
      
      
      
      
      
      
      relocContainer.appendChild(coordsContainer);
      
      
      
      
      
      
            var relocButs=CMN.cE({id:"relocbuts"});
      
      var saveBut=new Image();
      saveBut.src=Page.www_root+"images/layout/buttons/reloc.gif";
      saveBut.alt="Upravit pozici";
      saveBut.className="first";
      relocButs.appendChild(saveBut);
      saveBut.onclick=function(){
        
        
        var inps=getEl("reloccoords").getElementsByTagName("input"),lat=parseInt(inps[0].value)+inps[1].value/60+(parseInt(inps[2].value)+inps[3].value/1000)/3600,lng=parseInt(inps[4].value)+inps[5].value/60+(parseInt(inps[6].value)+inps[7].value/1000)/3600,loc=new GLatLng(lat,lng);
        
        var ajax=new AJAX();
         ajax.request("GET",Page.www_root+"change_gps.php","restaurant_id="+Page.restaurant_id+"&latitude="+lat+"&longitude="+lng); 
        
        
        
        
                 CMN.rC("mapc","reloc");
                CMN.setDB("zoombut","upcoords");
                CMN.setDN(relocContainer);
      
       mapDetail.marker.disableDragging();
        mapDetail.marker.bouncy=false;
      
   
      
         mapDetail.map.checkResize();
    
 mapDetail.map.setCenter(loc,15);
    
        
      };
      
      
      
      
      var cancelBut=new Image();
      cancelBut.src=Page.www_root+"images/layout/buttons/cancel.gif";
      cancelBut.alt="Zrušit";
      relocButs.appendChild(cancelBut);
      
      var cancelReloc=function(){
         CMN.rC("mapc","reloc");
                CMN.setDB("zoombut","upcoords");
                CMN.setDN(relocContainer);
      
       mapDetail.marker.disableDragging();
        mapDetail.marker.bouncy=false;
      
      mapDetail.marker.setLatLng(new GLatLng(mapDetail.loc.latitude,mapDetail.loc.longitude));
      
         mapDetail.map.checkResize();
        var loc=new GLatLng(mapDetail.loc.latitude,mapDetail.loc.longitude);
         mapDetail.map.setCenter(loc,15);
      };
      
      cancelBut.onclick=cancelReloc;
      
      relocContainer.appendChild(relocButs);
      
      
      
      mapContainer.appendChild(relocContainer);
      
      
      mapContainer.appendChild(zoomBut);
      
      var updateBut=document.createElement("div");
      updateBut.id="upcoords";
      updateBut.appendChild(document.createTextNode("Je restaurace na mapě umístěna chybně? "));
      
      var updateButBut=document.createElement("span");
      updateButBut.appendChild(document.createTextNode("Opravte její pozici"));
      updateBut.appendChild(updateButBut);
      
      
      updateButBut.onclick=function(){
       // if(this.parentNode.parentNode.className!=="big"){
         // zoomBut.onclick.apply(this.parentNode.previousSibling);
      //  }
      
      //zvetsit mapu a doprava dat panel tam bude nejaky text a souradnice s inputama 
      // kdyz se bude hybat bodem, budou se menit souradnice, kdyz se budou menit souradnice, bude se menit poloha bodu :) validaovat vstup inputu
      // dole budou dve tlacitka - zmenit pozici a zrusit, zmenit pozici se objevi az po zmene pozice :)
      // po zmenit pozici se objevi hlaska jak to bude a ok a pak se to vrati do puvodni polohy, nezapomenout to do ni vratit asi pomoci te classy big
      // pamatovat si puvodni pozici 
      
      
      CMN.aC(this.parentNode.parentNode,"reloc");
                CMN.setDN("zoombut","upcoords");
                CMN.setDB(relocContainer);
      
      
      mapDetail.map.checkResize();
     var loc=new GLatLng(mapDetail.loc.latitude,mapDetail.loc.longitude);
      
      
      mapDetail.map.setCenter(loc,15);
      
      mapDetail.marker.enableDragging();
        mapDetail.marker.bouncy=true;
      
      
      
      
      
      };
      
      
updateBut.appendChild(document.createTextNode("."));
      
      
      mapContainer.appendChild(updateBut);
      
      var victor=document.createElement("span");
      victor.className="clr";
      
      mapContainer.appendChild(victor);
      
      
      
      
      
      var html='<p>Přetáhněte terčík na mapě na správnou pozici a potvrďte.</p><table id="coords"><tbody><tr><th>Původní:</th><td id="ocoords"></td></tr><tr><th>Nová:</th><td id="ncoords" colspan="2"></td><td><img src="'+Page.www_root+'images/layout/buttons/ulozit.gif" class="hand" alt="Uložit" onclick="mapDetail.saveCoords()" /></td></tr></tbody></table>';
      var div=document.createElement("div");
      
      div.innerHTML=html;
      
         mapDetail.updateContainer=div;
      
      
      div.className="vh";
      
      
      
      
      
      
      var ajax=new AJAX();
      ajax.setFinalMethod(function(status){
        if(status!=200){
          alert("AJAX error (status:"+status+")");      
          return false;
        }
        var xmlDoc=ajax.getResponseObject();
        var lo=xmlDoc.getElementsByTagName("loc");
        var jsonArray=eval(lo[0].firstChild.data);
        mapDetail.loc=jsonArray[0];
        // getEl("ocoords").innerHTML=mapDetail.loc.latitude+", "+mapDetail.loc.longitude;
        mapDetail.showMarker();
      });
      ajax.request("GET",Page.www_root+"ajax_maps.php","restaurant_id="+Page.restaurant_id); 
      
      
    }
  

  
  };
  
}







// google mapa s bodiky 
if(Page.page=="maps"){

  var mapSearch={

    locs:[],
    map:null,
    cntDisplay:null,
    wait:null,
    limit:0,
    total:0,
    

    
    

    showAll:function(){
  //  alert("showAll");
      var bounds=new GLatLngBounds();
      mapSearch.map.setCenter(new GLatLng(0,0),0);
      var zoom=0;
      
      var ll=mapSearch.locs.length;
      for(i=0;i<ll;i++){
        var loc=mapSearch.locs[i];
        bounds.extend(new GLatLng(loc.latitude,loc.longitude));
        if(loc.zoom)zoom=loc.zoom;
      }
    //  alert(mapSearch.map.getBoundsZoomLevel(bounds));
      
      mapSearch.map.setZoom(mapSearch.map.getBoundsZoomLevel(bounds));
      var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;
      var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;
    
      if(zoom>0)mapSearch.map.setCenter(new GLatLng(clat,clng),13); else mapSearch.map.setCenter(new GLatLng(clat,clng));

       // mapSearch.map.setCenter(new GLatLng(lat, lng), 13);

        
        svOverlay = new GStreetviewOverlay();
mapSearch.map.addOverlay(svOverlay);


    },
    
    
    showCount:function(){
      var ll=mapSearch.locs.length;
      if(ll==0)mapSearch.cntDisplay.innerHTML="Nenalezen žádný záznam";

      else if(ll==1)mapSearch.cntDisplay.innerHTML="Nalezen 1 záznam";
      else if(ll<5)mapSearch.cntDisplay.innerHTML="Nalezeny "+ll+" záznamy";
      else mapSearch.cntDisplay.innerHTML="Zobrazuji "+ll+" záznamů z "+mapSearch.total;
    },
    
    
    
    
    
    showLocs:function(show_all){
    
        
        
        
    GEvent.clearListeners(mapSearch.map,"moveend");
    GEvent.clearListeners(mapSearch.map,"zoomend");
    
      mapSearch.map.clearOverlays();
      var ll=mapSearch.locs.length;
      if(ll){
        var createMarker=function(loc){
          var lat=new GLatLng(loc.latitude,loc.longitude);
          /*
          if(loc.prepaid=="Y"){
            var blueIcon = new GIcon(G_DEFAULT_ICON);
            blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
            var marker=new GMarker(lat,{draggable:true,icon:blueIcon});
          }
          
          else */
var marker=new GMarker(lat,{draggable:false});
          
          
          GEvent.addListener(marker,"click",function(){
            
 var ajax=new AJAX();
      ajax.setFinalMethod(function(status){
        if(status!=200){
          alert("AJAX error (status:"+status+")");      
          return false;
        }
        var xmlDoc=ajax.getResponseObject();
        var els=xmlDoc.getElementsByTagName("restaurant");
        //var dataObj=eval(els[0].firstChild.data)//[0];
        var json="";if(els[0].childNodes){
            var nodes=els[0].childNodes;
            for(var i=0;i<nodes.length;i++){
              if(nodes[i].nodeType==3)json+=nodes[i].data;
            }
        }

     try{   var dataObj=CMN.JSON.parse(json);
                          mapSearch.map.openInfoWindowHtml(lat,'<strong>'+dataObj.restaurant_name+'</strong><br />'+dataObj.street+' '+dataObj.street_number+'<br />'+dataObj.city+'<br /><a href="'+dataObj.webinfo+'">více informací &raquo;</a>');       
     }catch(e){alert(e.name+"\n"+e.message);}
     

        
        
      });


      ajax.request("GET",Page.www_root+"ajax_map_detail.php","&restaurant_id="+loc.restaurant_id);
          
                   //  mapSearch.map.openInfoWindowHtml(lat,'<strong>'+loc.restaurant_name+'</strong><br /><br /><a href="'+loc.webinfo+'">více informací &raquo;</a>');       
                   
                   
                   
                   
                   
          });
          
       //   marker.enableDragging();
      //  marker.bouncy=true;
          
          return marker;
        };
       
       mapSearch.wait.setDN();
      
        for(var i=0;i<ll;i++){
//alert(i+": "+mapSearch.locs[i].latitude);
         mapSearch.map.addOverlay(createMarker(mapSearch.locs[i]));

        }


      if(show_all)  mapSearch.showAll();
    
      }else{
        // mapSearch.map.setCenter(new GLatLng(50.077886,14.447647),13);
        
         mapSearch.wait.setDN();
      }
             mapSearch.showCount();
                //   
                   
                   
             GEvent.addListener(mapSearch.map,"dragend",mapSearch.updateCoords);
          GEvent.addListener(mapSearch.map,"zoomend",mapSearch.updateCoords);
          
    },
    


resetCoords:function(){
            mapSearch.coordsSWx.value=0;
            mapSearch.coordsSWy.value=0;
            mapSearch.coordsNEx.value=0;
            mapSearch.coordsNEy.value=0;

},

    
    search:function(frm,ho,fs){

//            mapSearch.coordsSWx.value=0;
//            mapSearch.coordsSWy.value=0;
//            mapSearch.coordsNEx.value=0;
//            mapSearch.coordsNEy.value=0;

      mapSearch.wait.setDB();
      var getFormParams=function(frm){
        var params="";
        var inps=gE(frm).getElementsByTagNames("input","select");
        for(var i=0;i<inps.length;i++)if(isUndefined(ho) ||  !isUndefined(ho) && !ho  || !isUndefined(ho) && ho  && inps[i].type=="hidden" || isUndefined(fs) || !isUndefined(fs) && fs && inps[i]!=mapSearch.coordsSWx && inps[i]!=mapSearch.coordsSWy && inps[i]!=mapSearch.coordsNEx && inps[i]!=mapSearch.coordsNEy)params+=((i==0?"":"&")+inps[i]["name"]+"="+inps[i]["value"]);
        return params;
      };

      
       
            
            
      
      var ajax=new AJAX();
      ajax.setFinalMethod(function(status){
        if(status!=200){
          alert("AJAX error (status:"+status+")");      
          return false;
        }
        var xmlDoc=ajax.getResponseObject();
        var lo=xmlDoc.getElementsByTagName("locations");

        mapSearch.total=lo[0].getAttribute("count");
        var lat=lo[0].getAttribute("street_latitude");
        var lng=lo[0].getAttribute("street_longitude");
        
       
        
        
//        var json=lo[0].firstChild.data;
// alert(ajax.getResponseText())
var json="";if(lo[0].childNodes){
var nodes=lo[0].childNodes;
for(var i=0;i<nodes.length;i++){
  if(nodes[i].nodeType==3)json+=nodes[i].data;
}
}
/*
var div=document.createElement("pre");
div.innerHTML=json;
document.body.appendChild(div);
*/


        mapSearch.locs=(json=="'null'" || json=="")?[]:eval(json);
           
        mapSearch.showLocs(fs);
      });
 // prompt("",Page.www_root+"main.php"+getFormParams(frm)+"&async=true");
      ajax.request("GET",Page.www_root+"main.php",getFormParams(frm)+"&async=true"); 
    },

    
    
    
    
                     updateCoords:function(){
      if(mapSearch.map.isLoaded()){
          var bounds=mapSearch.map.getBounds();
          var zoom = mapSearch.map.getBoundsZoomLevel(bounds);
          var sw=bounds.getSouthWest().toString();
          var ne=bounds.getNorthEast().toString();
          var sw_matches=/([0-9\.]+)\,\s*([0-9\.]+)/.exec(sw);
          var ne_matches=/([0-9\.]+)\,\s*([0-9\.]+)/.exec(ne);
          var cXY = /([0-9\.]+)\,\s*([0-9\.]+)/.exec(mapSearch.map.getCenter());
          
          if(sw_matches){
             var swx=sw_matches[1];
             var swy=sw_matches[2];
             var nex=ne_matches[1];
             var ney=ne_matches[2];
             window.location.hash = 'cx='+ cXY[1] +'&cy='+ cXY[2] +'&zoom='+ zoom;
          }

          
          if(swx!=mapSearch.coordsSWx.value || swy!=mapSearch.coordsSWy.value || nex!=mapSearch.coordsNEx.value || ney!=mapSearch.coordsNEy.value){
            mapSearch.coordsSWx.value=swx;
            mapSearch.coordsSWy.value=swy;
            mapSearch.coordsNEx.value=nex;
            mapSearch.coordsNEy.value=ney;
            
            getEl("city").value="";
            getEl("street").value="";
            getEl("region").value="all";
            getEl("district").value="all";
            
            mapSearch.search(getEl("more-search"));
          }
          }
       
      },
    
    init:function(){
    //  mapSearch.locs=locs;
      var mapElement=document.createElement("div");
      mapElement.id="map";
      getEl("ml").appendChild(mapElement);
      var showAllButton=new Image();
      showAllButton.id="showall";
      showAllButton.src="images/layout/buttons/showall.gif";
      showAllButton.title="Zobrazit vše";
      showAllButton.id="showall";
      
      mapSearch.map=new GMap2(mapElement);
      mapSearch.map.addControl(new GLargeMapControl());
    

    mapSearch.map.addControl(new GMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10)));
      
      
      registerEvent(showAllButton,"click",mapSearch.showAll)

      
      mapSearch.cntDisplay=document.createElement("p");
      mapSearch.cntDisplay.id="cnt";
      
      
   //   getEl("ml").appendChild(showAllButton);
      
      getEl("ml").insertBefore(mapSearch.cntDisplay,mapElement);

      var victor=document.createElement("span");
      victor.className="clr";
      getEl("ml").appendChild(victor);
      
      mapSearch.wait=document.createElement("div");
      mapSearch.wait.id="wait";
      
      getEl("ml").appendChild(mapSearch.wait);
      mapSearch.wait=gE(mapSearch.wait);
      

      
      
//      mapSearch.showLocs();
    
    var LatLng = [50.0823, 14.426]; // default init souradnice mapy X,Y
    var hash = '', zoom = 14;
    if(hash = window.location.hash) {
        hash = /#cx=([0-9\.]+)&cy=([0-9\.]+)&zoom=([0-9]+)/.exec(hash);
        if(hash[1] && hash[2] && hash[3]) {
            LatLng[0]=parseFloat(hash[1]);
            LatLng[1]=parseFloat(hash[2]);
            zoom=parseFloat(hash[3]);
        }
    }
    mapSearch.map.setCenter(new GLatLng(LatLng[0], LatLng[1]), zoom);
    
        var searchForm=getEl("more-search");
      
      
      var createCoordsInput=function(name){
        var el=document.createElement("input");
        el.type="hidden";
        el.name=name;
        searchForm.appendChild(el);
        return el;
      };
      
      
      mapSearch.coordsSWx=createCoordsInput("swx");
      mapSearch.coordsSWy=createCoordsInput("swy");
      mapSearch.coordsNEx=createCoordsInput("nex");
      mapSearch.coordsNEy=createCoordsInput("ney");

  mapSearch.updateCoords();
  
   //   mapSearch.search(searchForm,true);
      
      
              
      
                   
                   
                   
         
     
      
      
      
    }
    
  
  };

}















// naseptavac
var Devil={

  init:function(frm,inp){
    Devil.form=gE(frm);
    Devil.inp=gE(inp);
    Devil.inp.autocomplete=false;
    Devil.inp.setAttribute("autocomplete","off");
    Devil.board=document.createElement("div");
    Devil.board.className="devil";
    Devil.board.actual=null;
    Devil.form.appendChild(Devil.board);
    Devil.inp.onkeyup=Devil.inp.onkeydown=Devil.doTempt;
    Devil.inp.onblur=Devil.night;
  },

 night:function(){
   Devil.board.actual=null;
   setVH(Devil.board);
 },

  doTempt:function(e){

    var e=getEvent(e);


  if(e.type=="keydown" && e.which==13 && !isNull(Devil.board.actual)){
    e.target.value=Devil.board.actual.firstChild.data;
    Devil.form.submit();
    e.preventDefault();
  }

  if((e.which==40 || e.which==38) && Devil.board.innerHTML!=""){

    if(e.type=="keydown" && e.which==38){
      if(isNull(Devil.board.actual)){
        Devil.board.actual=Devil.board.firstChild;
        Devil.board.actual.className="ovr";
      }else if(!isNull(Devil.board.actual.previousSibling)){
        Devil.board.actual.className="";
        Devil.board.actual=Devil.board.actual.previousSibling;
        Devil.board.actual.className="ovr";
      }
    }

    if(e.type=="keydown" && e.which==40){
      if(isNull(Devil.board.actual)){
        Devil.board.actual=Devil.board.firstChild;
        Devil.board.actual.className="ovr";
      }else if(!isNull(Devil.board.actual.nextSibling)){
        Devil.board.actual.className="";
        Devil.board.actual=Devil.board.actual.nextSibling;
        Devil.board.actual.className="ovr";
      }
    }

    e.preventDefault();
    return false;
  }

    if(e.type=="keyup" && e.target.value.trim()!=""){
      var rq=new AJAX();

      rq.setFinalMethod(function(status){
    if(status==200){

     eval("var data="+rq.getResponseText());

     var html="";
     for(var i=0;i<data.words.length;i++){
       html+='<p onmouseover="if(!isNull(Devil.board.actual))Devil.board.actual.className=\'\';Devil.board.actual=this;this.className=\'ovr\'" onmousedown="Devil.board.actual=null;Devil.inp.value=this.firstChild.data;Devil.form.submit()" onmouseout="this.className=\'\'">'+data.words[i].word+"<span>"+data.words[i].count+"&times;</span></p>"
     }

     Devil.board.innerHTML=html;
     Devil.board.actual=null;

     if(html!="")setVV(Devil.board);else setVH(Devil.board);
    }
  });

      rq.request("GET",Page.www_root+"getword.php","key="+e.target.value+"&update="+(new Date()).getTime(),false);
    }
  }

};







registerEvent(window,"domready",function(){
  
  Devil.init("fulltext_form","keyword");
  
});

