/* 
 * kmlib3 v3.1.5
 * license: GNU/LGPL
 * author: Josef Vanžura <gindar@zamraky.cz>
*/
 String.prototype.isStringIn=String.prototype.isstringin=function (a){return (this.indexOf(a)!=-1)};String.prototype.isCharIn=String.prototype.ischarin=function (a){for(q=0;q<this.length;q++){if(this.charAt(q)==a){return true;break}};return false};Array.prototype.isIn=Array.prototype.isin=function (a){for(i in this){if(this[i]==a) return true};return false};Array.prototype.isKeyIn=Array.prototype.iskeyin=function (a){for(i in this){if(i==a) return true};return false};Array.prototype.getKeyByValue=Array.prototype.getkeybyvalue=function (v){for(i in this){if((this)[i]==v) return i};return null};
 var kmlib={defined:true,version:'3.1.5'};var doNothing=function (){};var retFalse=function (){return false};function obj(o){if(isType(o,'o')) return o;if(isType(o,'sn')){if(o.isCharIn(":")){return extObjSelector(o)}else{return document.getElementById(o)}};return document};function wr(t){document.write(t)};var extend=function(){var t=arguments[0],a=1;if( arguments.length==1){a=0};var p;while ( (p=arguments[a++])!=null){for(i in p){t[i]=p[i]}};return t};function Object2Array(o){a=[];for(i in o){a[i]=o[i]};return a} function forEach(a,f){for(i in a){if(isArray(a)&&a.hasOwnProperty(i)){f(a[i],i)};if(isObject(a)){f(a[i],i)}}};kmlib.log_data=[];kmlib.log=function(a){kmlib.log_data[kmlib.log_data.length]=a};kmlib.log_get=kmlib.logGet=function(){return kmlib.log_data};var ua=((navigator.userAgent).toLowerCase());var Client={safari:ua.isStringIn("webkit"),gecko:ua.isStringIn("gecko"),opera:ua.isStringIn("opera"),msie:ua.isStringIn("msie"),msie6:ua.isStringIn("msie 6"),msie7:ua.isStringIn("msie 7")};Client.pngSupport=!(Client.msie&&!Client.msie7);Client.msie_not7=Client.msie&&!Client.msie7;Client.is=function (st){var ua=((navigator.userAgent).toLowerCase());return (new RegExp(st).test(ua))};ua=null;
 function getType(o){var t='';switch(typeof(o)){case "string":t="s";break;case "number":t="n";break;case "boolean":t="b";break;case "object":t="o";break;case "function":t="f";break;default:t="u";break};return t};function isType(o,t){return t.isCharIn(getType(o))};function isDefined(o){return (!isType(o,'u')&&o!=null)};function isInteger(o){return (isType(o,'n')&&((o-parseInt(o))==0))};function isFloat(o){return (isType(o,'n')&&((o-parseInt(o))!=0))};function isNumber(o){return isType(o,'n')};function isFunction(o){return isType(o,'f')};function isElement(o){return o&&(o.nodeType==1)};function isString(o){return isType(o,'s')};function isArray(o){return o&&o.constructor===Array};function isObject(o){return isType(o,"o")&&!(o.constructor===Array)};
 kmlib.events={d:[]};function setEvent(ob,evt,func,bl,n,blr){ob=obj(ob);if(!ob.events){ob.events=[]};if(evt=="mousewheel"&&Client.gecko) evt="DOMMouseScroll";var id=ob.events.length*1;ob.events[id]={fire:function(e){EventFire(e,ob.events[id])},name:n || false,func:func,type:evt,blocked:bl || false,blockReturn:blr || false,evtnum:id,active:true};if(document.addEventListener){ob.addEventListener(evt,ob.events[id+""].fire,false)}else{ob.attachEvent("on"+evt,ob.events[id+""].fire)};kmlib.events.d[kmlib.events.d.length]=[ob,id,evt];return (kmlib.events.d.length-1)};function setMultiEvent(ob,evt,func,bl,n,blr){evt=evt.split(",");var ou=[];for(evti=0;evti<evt.length;evti++){ou[ou.length]=setEvent(ob,evt[evti],func,bl,n,blr)};return ou};function unsetEvent(id){if(isArray(id)){forEach(id,function(o){unsetEvent(o)});return true};ev=kmlib.events.d[id];if(obj(ev[0]).events) obj(ev[0]).events[ev[1]]=null};function unsetAllEvents(ob){if(obj(ob).events) obj(ob).events=[]};function setEventOff(id){if(isArray(id)){forEach(id,function(o){setEventOff(o)});return true};ev=kmlib.events.d[id];if(obj(ev[0]).events) obj(ev[0]).events[ev[1]].active=false};function setEventOn(id){if(isArray(id)){forEach(id,function(o){setEventOn(o)});return true};ev=kmlib.events.d[id];if(obj(ev[0]).events) obj(ev[0]).events[ev[1]].active=true};function EventFire(e,ob){if(ob!=null&&ob.active){e=e || window.event;e.evtTarget=e.target || e.srcElement;e.evtName=ob.name;e.evtNum=ob.evtnum;if(e.type=="mousewheel" || e.type=="DOMMouseScroll"){e.wheel=(e.wheelDelta) ? e.wheelDelta :-(e.detail || 0);if(0<e.wheel) e.wheel="up";if(0>e.wheel) e.wheel="down"};if(e.type.isStringIn("key")){e.code=e.which || e.keyCode};if(e.type.match(/click|mouse|menu/)){e.page_x=e.pageX || e.clientX + document.documentElement.scrollLeft;e.page_y=e.pageY || e.clientY + document.documentElement.scrollTop;e.client_x=e.pageX ? e.pageX - window.pageXOffset :e.clientX;e.client_y=e.pageY ? e.pageY - window.pageYOffset :e.clientY;e.rightClick=(e.which==3) || (e.button==2)};if(ob.blocked) e=blockEvents(e);if(ob.blockReturn) e=blockReturns(e);return ob.func(e,e.evtTarget,ob.name)}};function Evt(e){if(!e){e=window.event};return e};function blockEvents(e){if(e.stopPropagation){e.stopPropagation(true)}else{e.cancelBubble=true} return e};function blockReturns(e){if(e.preventDefault){e.preventDefault(true)}else{e.returnValue=false} return e};
 function setAttrs(o,a){extend(obj(o),a)};function setCSS(o,a){extend(obj(o).style,a)};function getCSS(o,a,b){return (b?parseInt(obj(o).style[a]):obj(o).style[a])};function addClass(o,arg){if(!new RegExp('\\b'+arg+'\\b').test(obj(o).className)){obj(o).className+=obj(o).className?' '+arg:arg}};function delClass(o,arg){obj(o).className=obj(o).className.replace((obj(o).className.match(' '+arg)?' '+arg:arg),'')};function hasClass(o,arg){return (new RegExp('\\b'+arg+'\\b').test(obj(o).className)) || (obj(o).className==arg)};function setClass(o,arg){obj(o).className=arg};function setVis(o,arg){if(arg){obj(o).style.display=""}else{obj(o).style.display="none"}};function isVis(o){return (obj(o).style.display!="none")};function setOpacity(o,arg){if(Client.msie){obj(o).style.filter="alpha(opacity="+(arg)+")"}else{obj(o).style.opacity=(arg/100)}};function setClip(o,t,r,b,l){obj(o).style.clip='rect('+t+'px '+r+'px '+b+'px '+l+'px)'};function elementOffsetPosition(elm){var x=elm.offsetLeft;var y=elm.offsetTop;var p=elm.offsetParent;while (p!=null){x +=p.offsetLeft;y +=p.offsetTop;p=p.offsetParent};return {x:x,y:y}};function elementInsidePosition(elm,x,y){elm.offsetPosition=elementOffsetPosition(elm);x=(x-elm.offsetPosition.x) + document.documentElement.scrollLeft;y=(y-elm.offsetPosition.y) + document.documentElement.scrollTop;if(x < 0) x=0;if(y < 0) y=0;if(x > elm.offsetWidth - 1) x=elm.offsetWidth - 1;if(y > elm.offsetHeight - 1) y=elm.offsetHeight - 1;return {x:x,y:y}};
 function extObjSelector(o){function filterObjsWithClass(o,c,r){tmp_elems=[];forEach(o,function (ob){if(r&&ob.className&&hasClass(ob,c)){tmp_elems[tmp_elems.length]=ob};if(!r&&ob.className&&!hasClass(ob,c)){tmp_elems[tmp_elems.length]=ob};if(!r&&!ob.className){tmp_elems[tmp_elems.length]=ob}});return tmp_elems};if(o.isCharIn(":")){regex=new RegExp("^([^\:]*)\:([^\.\!]*)?(\.([^\!]*)(\!(.+))?)?$");pth=(o.replace(regex,"$1#$2#$4#$6")).split("#");tmp_elem=document;if(pth[0]!=""){tmp_elem=obj(pth[0])};if(pth[1]!=""){if(pth[1].isCharIn(",")){pth[1]=pth[1].split(",");tmp_elem2=[];forEach(pth[1],function(otg){forEach(tmp_elem.getElementsByTagName(otg),function (ott){tmp_elem2.push(ott)})});tmp_elem=tmp_elem2}else{tmp_elem=tmp_elem.getElementsByTagName(pth[1])}}else{tmp_elem=tmp_elem.getElementsByTagName("*")};if(pth[2]!=""){tmp_elem=filterObjsWithClass(tmp_elem,pth[2],1)};if(pth[3]!=""){tmp_elem=filterObjsWithClass(tmp_elem,pth[3],0)};return tmp_elem};return false};function objCollection(a,f){forEach(obj(a),function (o){if(o.nodeType==1){f(o)}})} 
 function Sqrt(n,by){var ret=0;while(true){n=n/by;if(n >=1){ret++}else{break}};return ret};function ang2xy(a,r,x,y){xx=(r*Math.sin(a))+x;yy=(r*Math.cos(a))+y;return [xx,yy]};function random(nfr,nto){return (nfr+parseInt(Math.random()*(nto-nfr)))};
 var Timer={l:[],l2:[],d:[]};function Loop(f,i,n){if(n){Timer.l[n]=setInterval(f,i);return null};return setInterval(f,i)};function Delay(f,d,n){if(n){Timer.d[n]=setTimeout(f,d);return null};return setTimeout(f,d)};function stopDelay(id){if(isType(id,'sn')) clearTimeout(Timer.d[id]);clearTimeout(id)};function stopLoop(id){if(isType(id,'sn')) clearInterval(Timer.l[id]);clearInterval(id)};function getDelay(id){return Timer.d[id]};function getLoop(id){return Timer.l[id]};function Loop2(f,i,n){Timer.l2[n]={o:setInterval("Loop2Process('"+n+"')",i),a:true,f:f};return null};function startLoop2(n){Timer.l2[n].a=true};function stopLoop2(n){Timer.l2[n].a=false};function Loop2Process(n){var o=Timer.l2[n];if(o.a) eval(Timer.l2[n].f)};
 var kmlib_Ajax={r:new Array(),n:0};function kmlib_httpRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{try{return new ActiveXObject("Microsoft.XMLHTTP")} catch (e){return false}}};function sendRequest(url,d,rf,post,nam){var n=kmlib_Ajax.n;kmlib_Ajax.r[n]={o:new kmlib_httpRequest(),rf:rf,url:url,d:d,nam:nam};rq=kmlib_Ajax.r[n];if(rq.o){kmlib_Ajax.r[n].o.onreadystatechange=function(){if(kmlib_Ajax.r[n].o.readyState==4){kmlib_Ajax.r[n].rf(kmlib_Ajax.r[n].o.responseText,kmlib_Ajax.r[n].nam)}};if(post){kmlib_Ajax.r[n].o.open("POST",rq.url,true);kmlib_Ajax.r[n].o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");kmlib_Ajax.r[n].o.send(rq.d)}else{kmlib_Ajax.r[n].o.open("GET",rq.url+"?"+rq.d,true);kmlib_Ajax.r[n].o.send(null)};rq=null;kmlib_Ajax.n++;return n}};
 var Animator={d:new Array()};Animator.start=function (id,i,a,f,ff){if(isDefined(this.d[id])){this.d[id].loopObj=Loop('Animator.cycle(id)',this.d[id].interval)}else{this.d[id]={array:a,func:f,ffunc:ff?ff:doNothing,interval:i,act:0,loopObj:Loop('Animator.cycle("'+id+'")',i)}}};Animator.cycle=function (id){Animator.d[id].func(this.d[id].array[this.d[id].act],id,this.d[id].act);this.d[id].act++;if(this.d[id].act==this.d[id].array.length) this.finish(id)};Animator.stop=function (id){stopLoop(this.d[id].loopObj)};Animator.finish=function (id){stopLoop(this.d[id].loopObj);this.d[id].ffunc(id);this.d[id]=null};Animator.kill=function (id){stopLoop(this.d[id].loopObj);this.d[id]=null};
 function array2csv(arr,div){tmp="";for(i=0;i < arr.length;i++){tmp +=arr[i]+""+div};return tmp};function csv2array(data,div){return (data.split(div))};var periodExec={};periodExec.exec=function (){};

