function myScope(func,obj,args){return function(){obj.args=args;return func.apply(obj,arguments);};};Date.prototype.format=function(format){var returnStr='';var replace=Date.replaceChars;for(var i=0;i<format.length;i++){var curChar=format.charAt(i);if(replace[curChar]){returnStr+=replace[curChar].call(this);}else{returnStr+=curChar;}}return returnStr;};Date.replaceChars={shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],longMonths:['January','February','March','April','May','June','July','August','September','October','November','December'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],longDays:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],d:function(){return(this.getDate()<10?'0':'')+this.getDate();},D:function(){return Date.replaceChars.shortDays[this.getDay()];},j:function(){return this.getDate();},l:function(){return Date.replaceChars.longDays[this.getDay()];},N:function(){return this.getDay()+1;},S:function(){return(this.getDate()%10==1&&this.getDate()!=11?'st':(this.getDate()%10==2&&this.getDate()!=12?'nd':(this.getDate()%10==3&&this.getDate()!=13?'rd':'th')));},w:function(){return this.getDay();},z:function(){return"Not Yet Supported";},W:function(){return"Not Yet Supported";},F:function(){return Date.replaceChars.longMonths[this.getMonth()];},m:function(){return(this.getMonth()<9?'0':'')+(this.getMonth()+1);},M:function(){return Date.replaceChars.shortMonths[this.getMonth()];},n:function(){return this.getMonth()+1;},t:function(){return"Not Yet Supported";},L:function(){return(((this.getFullYear()%4==0)&&(this.getFullYear()%100!=0))||(this.getFullYear()%400==0))?'1':'0';},o:function(){return"Not Supported";},Y:function(){return this.getFullYear();},y:function(){return(''+this.getFullYear()).substr(2);},a:function(){return this.getHours()<12?'am':'pm';},A:function(){return this.getHours()<12?'AM':'PM';},B:function(){return"Not Yet Supported";},g:function(){return this.getHours()%12||12;},G:function(){return this.getHours();},h:function(){return((this.getHours()%12||12)<10?'0':'')+(this.getHours()%12||12);},H:function(){return(this.getHours()<10?'0':'')+this.getHours();},i:function(){return(this.getMinutes()<10?'0':'')+this.getMinutes();},s:function(){return(this.getSeconds()<10?'0':'')+this.getSeconds();},e:function(){return"Not Yet Supported";},I:function(){return"Not Supported";},O:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+'00';},P:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+':'+(Math.abs(this.getTimezoneOffset()%60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()%60));},T:function(){var m=this.getMonth();this.setMonth(0);var result=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,'$1');this.setMonth(m);return result;},Z:function(){return-this.getTimezoneOffset()*60;},c:function(){return this.format("Y-m-d")+"T"+this.format("H:i:sP");},r:function(){return this.toString();},U:function(){return this.getTime()/1000;}};function byteconvert(bytes){var s=['bytes','kb','MB','GB','TB','PB'];var e=Math.floor(Math.log(bytes)/Math.log(1024));if(bytes>0){return(bytes/Math.pow(1024,Math.floor(e))).toFixed(2)+" "+s[e];}
return bytes+" "+s[0];}
function getXY(oElement,reference){var iReturnValue={'x':0,'y':0};while((oElement!=null)&&(oElement!=reference)){iReturnValue.y+=oElement.offsetTop;iReturnValue.x+=oElement.offsetLeft;oElement=oElement.offsetParent;}
return iReturnValue;}
function getY(oElement,reference){var iReturnValue=0;while(oElement!=null){iReturnValue+=oElement.offsetTop;oElement=oElement.offsetParent;}
return iReturnValue;}
function getX(oElement,reference){var iReturnValue=0;while(oElement!=null){iReturnValue+=oElement.offsetLeft;oElement=oElement.offsetParent;}
return iReturnValue;}
var myURL=function(url){this.url=''+url;this.params={};this.initQuery=function(all,name,value){if(name){this.params[name]=value;}
return this;}
this.setQuery=function(name,value){if(name){this.params[name]=value;}
return this;}
this.getQueryValue=function(name){return this.params[name];}
this.init=function(){var reg1=/(https?:\/\/)?([a-zA-Z0-9_\-\.]+)?(:[0-9]+)?\/?([^\?#]*)?(\?([^#]*)?)?(#(.*))?/;var result=this.url.match(reg1);this.scheme=result[1];this.host=result[2];this.port=result[3];this.path=result[4];this.query=result[6];this.hash=result[8];if(this.query){var reg2=/(?:^|&)([^&=]*)=?([^&]*)/g;var result=this.query.match(reg2);this.query.replace(reg2,myScope(this.initQuery,this));}}
this.getScheme=function(){return((this.scheme)?(this.scheme):(''));}
this.getHost=function(){return((this.host)?(this.host):(''));}
this.getPort=function(){return((this.port)?(':'+this.port):(''));}
this.getPortValue=function(){return((this.port)?(this.port):(''));}
this.getPath=function(){return((this.path)?('/'+this.path):(''));}
this.getPathValue=function(){return((this.path)?(this.path):(''));}
this.addToString=function(k,v){if(v!==false){this.queryString=((this.queryString)?(this.queryString+'&'):('?'))+k+'='+v;}}
this.getQuery=function(){this.queryString='';$.each(this.params,myScope(this.addToString,this));return this.queryString;}
this.getHash=function(){return((this.hash)?('#'+this.hash):(''));}
this.getHashValue=function(){return((this.hash)?(this.hash):(''));}
this.getURL=function(){return this.getScheme()+this.getHost()+this.getPort()+this.getPath()+this.getQuery()+this.getHash();}
this.init();}
var eventArray=function(source,name){this.source=source;this.name=name;this.size=0;this.events=new Array();this.add=function(callback){this.size++;this.events.push(callback);return true;}
this.call=function(){var result=true;var index=0;while((result)&&(this.size>index)){result=this.events[index](arguments);index++;}
return result;}
return this;};var log=false;var logger=function(){this.last='';this.span=false;this.count=0;this.log=false;this.make_log=false;this.init=function(){if($('#log').length==0&&this.make_log){$('head').append('<link rel="stylesheet" type="text/css" href="/js/jquery.utils.css" media="screen" />');$('body').append('<ul id="log"></ul>');this.log=$('#log').hide();this.log.dblclick(myScope(this.hide,this));}}
this.show=function(e){return true;}
this.hide=function(e){this.log.hide();return false;}
this.error=function(message){this.message(message,'error');}
this.infoObjectItem=function(name,value){log.info('+'+name+':'+value);}
this.infoObject=function(obj){log.info('Object:');$.each(obj,myScope(this.infoObjectItem,this));return true;}
this.info=function(message){this.message(message,'info');}
this.obj=function(obj,message){this.message('['+obj.name+']: '+message,'info');}
this.message=function(message,type){if(this.log){this.log.show();if((message==this.last)&&(this.span)){this.count+=1;this.span.html(this.count+'x');}else{this.count=1;this.log.prepend('<li class="'+type+'">'+message+'<span></span></li>');this.span=$('li:first span',this.log);}
this.last=message;}}
this.init();};var log=false;$(document).ready(function(){log=new logger();});$.fn.settings=function(){this.idValues={};this.objValues={};this.add=function(idName,values){if(typeof this.idValues[idName]=='undefined'){this.idValues[idName]={};}
$.extend(this.idValues[idName],values);}
this.addByObject=function(objName,values){if(typeof this.objValues[objName]=='undefined'){this.objValues[objName]={};}
$.extend(this.objValues[objName],values);}
this.get=function(name){if(this.values[name]){return this.values[name];}
return false;}
this.get=function(name){if(typeof this.idValues[name]!='undefined'){return this.idValues[name];}
return false;}
this.getByObject=function(name){if(typeof this.objValues[name]!='undefined'){return this.objValues[name];}
return false;}};var settings=new $.fn['settings']();$.fn.openers=function(){this.windows=new Array();this.open=function(obj,url,w,h,s){var newWindow=window.open(url,s+"_jswin","toolbar=no,width="+w+",height="+h+",scrollbars=yes,resizable=yes");this.windows.push({'caller':obj,'window':newWindow});return newWindow;}
this.call=function(w,func,data){for(var i=0;i<this.windows.length;i++){if(this.windows[i]['window']==w){return this.windows[i]['caller'][func](data);}}
return false;}
this.close=function(obj){for(var i=0;i<this.windows.length;i++){if(this.windows[i]['caller']==obj){this.windows[i]['window'].close();this.windows.splice(i,1);return true;}}
return false;}}
var openers=new $.fn['openers']();$.fn.collection=function(name){this.name=name;this.layers=new Array();this.add=function(layer){this.layers.push(layer);}
this.getValue=function(func){for(var i=0;i<this.layers.length;i++){if(this.layers[i][func]()){return true;}}
return false;}
this.setOnlyMe=function(layer,name_on,name_off){var result=false;for(var i=0;i<this.layers.length;i++){if(this.layers[i]==layer){result=this.layers[i][name_on]();}else{this.layers[i][name_off]();}}
return result;}
this.set=function(name,args){for(var i=0;i<this.layers.length;i++){this.layers[i][name](args);}}}
var changeItems=new $.fn['collection']('changeItems');var bubbles=new $.fn['collection']('bubbles');$.fn.load=function(name,callback){if(!$.fn[name]){}
return false;};var loader=function(name,makers){this.name=name;this.makers=makers;this.done=false;this.data=new Array();this.index=0;this.loadDone=function(){this.done=true;this.call();};this.add=function(data){this.data.push(data);if(this.done){this.call();}}
this.init=function(){log.info('Loading: /js/jquery.'+name+'.js');if(typeof $.fn[name]=='undefined'){$.getScript('/js/jquery.'+name+'.js',myScope(this.loadDone,this));}else{this.loadDone();}};this.call=function(){var item=false;while(item=this.data.pop()){this.create(this.index,item);this.index++;}}
this.create=function(index,item){var id=$(item.object).attr('id');if(typeof item.settings=='undefined'){item.settings={};}
jQuery.extend(item.settings,settings.get(id));jQuery.extend(item.settings,settings.getByObject(this.name));if($.fn[name]){log.info('Create obj: ('+index+')'+name);var newObj=new $.fn[name](item.object,index,item.settings);if(typeof item.callback=='function'){item.callback(newObj);}
return true;}
return false;}
this.init();return this;}
var makers=function(){this.names=new Array();this.add=function(name,data){if(typeof this.names[name]=='undefined'){var load=new loader(name,this);this.names[name]=load;}
this.names[name].add(data);}
return this;}
var makers=new makers();$.fn.make=function(name,settings,callback){if(this.length==0){return false;}
$.each(this,function(index,object){makers.add(name,{'object':object,'settings':settings,'callback':callback});});return this;};function make_calls(calls,local_settings,obj){if(calls){for(var i=0;i<calls.length;i++){$(calls[i].selector,obj).make(calls[i].name,local_settings);}}}
jQuery.fn.swap=function(){var a=this[0];var b=this[1];if(a&&b){var parentNode=b.parentNode;if(a.nextSibling==b){parentNode.replaceChild(a,b);parentNode.insertBefore(b,a);}else{parentNode.replaceChild(b,a);parentNode.insertBefore(a,b);}}
return this;};function initData(context){$('body').make('bodyObject');$('#head .dateTime').make('time');$('#map').make('googleMap');$('.printMe').make('myPrint');$('.saveMe').make('saveMe');$('.partneri-obsah .img').make('partneri');$('.skupina').make('mytabs');$('#rychlaNavigace').make('navigace');$('.focusToggle').make('searchInput');$('.gallery a').lightBox({fixedNavigation:false});};$.ajaxSetup({cache:false});$(document).ready(function(){initData(document);});
