var APP_BODY; var objekt; var dg; var fn; var dgShow; function selectItem(thefield, item) { if(thefield) { for (var i=0; i document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } function intval( mixed_var, base ) { // Get the integer value of a variable using the optional base for the conversion // // version: 812.3015 // discuss at: http://phpjs.org/functions/intval // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: stensi // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: intval('Kevin van Zonneveld'); // * returns 1: 0 // * example 2: intval(4.2); // * returns 2: 4 // * example 3: intval(42, 8); // * returns 3: 42 // * example 4: intval('09'); // * returns 4: 9 var tmp; var type = typeof( mixed_var ); if(type == 'boolean'){ if (mixed_var == true) { return 1; } else { return 0; } } else if(type == 'string'){ tmp = parseInt(mixed_var * 1); if(isNaN(tmp) || !isFinite(tmp)){ return 0; } else{ return tmp.toString(base || 10); } } else if(type == 'number' && isFinite(mixed_var) ){ return Math.floor(mixed_var); } else{ return 0; } } function dump(arr,level) { var dumped_text = ""; if(!level) level = 0; //The padding given at the beginning of the line. var level_padding = ""; for(var j=0;j \"" + value + "\"\n"; } } } } else { //Stings/Chars/Numbers etc. dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; } return dumped_text; } // // getPageScrol() // Returns array with x,y page scroll values. // Core code from - quirksmode.org // function getPageScrol(){ var yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; } arrayPageScroll = new Array('',yScroll) return arrayPageScroll; } function in_array(needle,haystack) { for(var i in haystack) if(haystack[i]==needle) return true; return false; } function in_array_pos(needle,haystack) { var f = -1; for(var i in haystack) if(haystack[i]==needle) f = i; return f; } function addClass(ele,cls) { if (!this.hasClass(ele,cls)) ele.className += " "+cls; } function removeClass(ele,cls) { if (hasClass(ele,cls)) { var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)'); ele.className=ele.className.replace(reg,' '); } } function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } function encode(str) { return encodeURIComponent(str); } function delArrayKategorie() { if(dg.kategorie.length > 0) { for( var i=0;i 1024 && i < total; i++) size /= 1024; return (Math.round((size * 100)) / 100) + ' ' + sizes[i]; } function appBodyScroll(dx,dy) { if(APP_BODY) { APP_BODY.scrollLeft += dx; APP_BODY.scrollTop += dy; } } function keyListen(evt) { evt = (evt) ? evt : ((event) ? event : null); var key = evt.keyCode; var shift = evt.shiftKey; var ctrl = evt.ctrlKey; //alert(key); if( DialogueOpened && DialogueOpenedID != null ) { //if( key == 27 ) { CloseDialogue(DialogueOpenedID); } } else { /* // pokud existuje kalendar, bude se ovladat pomoci klavesnice var kal = document.getElementById('kalendar-box'); if( kal ) { kalendar.catchKeys(evt); if( in_array(key, Array(37,38,39,40) ) ) return false; } // pokud existuje rocni plan, bude se ovladat pomoci klavesnice var rp = document.getElementById('rocniPlan'); if( rp ) { rocniPlan.move(evt); if( in_array(key, Array(37,38,39,40) ) ) return false; } // pokud existuje denni prehled, bude se ovladat pomoci klavesnice var dp = document.getElementById('denni-prehled'); if( dp ) { denniPrehled.move(evt); if( in_array(key, Array(37,38,39,40) ) ) return false; } // pokud existuje mesicni plan, bude se ovladat pomoci klavesnice var mp = document.getElementById('mesicni-plan'); if( mp ) { mesicniPlan.move(evt); if( in_array(key, Array(37,38,39,40) ) ) return false; } // pokud existuje mesicni plan, bude se ovladat pomoci klavesnice var tp = document.getElementById('tydenni-prehled'); if( tp ) { tydenniPrehled.move(evt); if( in_array(key, Array(37,38,39,40) ) ) return false; } */ } } function mouseListen(evt) { evt = (evt) ? evt : ((event) ? event : null); var mousebutton = evt.button; if( DialogueOpened && DialogueOpenedID != null ) { /* stg */ } else { } } function mouseListen2(evt) { evt = (evt) ? evt : ((event) ? event : null); var mousebutton = evt.button; if( DialogueOpened && DialogueOpenedID != null ) { /* stg */ } else { } } function Arrange() { var doc = document.getElementById('layout-main-content'); var docin = document.getElementById('layout-main-content-in'); var search = document.getElementById('layout-main-content-search'); var tt = document.getElementById('border-tt'); var bb = document.getElementById('border-bb'); var ll = document.getElementById('border-ll'); var rr = document.getElementById('border-rr'); if( doc ) { doc.style.height = document.body.offsetHeight - document.getElementById('layout-menu').offsetHeight - document.getElementById('layout-foot').offsetHeight + 'px'; docin.style.width = (doc.offsetWidth - 20) + 'px'; if( search ) { docin.style.height = (doc.offsetHeight - 40) + 'px'; } else { docin.style.height = (doc.offsetHeight - 20) + 'px'; } if( search ) { search.style.width = (doc.offsetWidth - 20) + 'px'; } if(ll) ll.style.height = (doc.offsetHeight) -20 + 'px'; if(rr) rr.style.height = (doc.offsetHeight) -20 + 'px'; if(tt) tt.style.width = (doc.offsetWidth) -20 + 'px'; if(bb) bb.style.width = (doc.offsetWidth) -20 + 'px'; } } function domReady(evt) { Arrange(); dg = new jsDialogue(); dgShow = new jsShowDialogue(); fn = new jsFunction(); //searRow = new searchRow(); APP_BODY = document.getElementById('layout-main-content-in'); } onresize = Arrange; onload = domReady; onscroll = function Anonymous2() { window.scrollTo(0,0); return false; } document.onkeydown = keyListen; document.onmousedown = mouseListen; document.onmouseup = mouseListen2;