var google_loaded=false function DOMLoaded(){replaceSearch();if(typeof (lightbox)!="undefined")lightbox.init()} function WindowLoaded(){} function loadGoogleSearch(query){google.load("search","1",{nooldnames:true,language:"cz"});google.setOnLoadCallback(function(){googleSearch(query)});google_loaded=true} function googleSearch(query){var options=new google.search.SearcherOptions();options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);var searchControl=new google.search.SearchControl(),siteSearch=new google.search.WebSearch();siteSearch.setSiteRestriction("soudopravnicaslav.cz");searchControl.addSearcher(siteSearch,options);var drawOptions=new google.search.DrawOptions();drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_LINEAR);searchControl.draw(document.getElementById("searchcontrol"),drawOptions);searchControl.execute(query)} function makeTimetable(week){var container=document.getElementById('table_container');if(typeof (timetable)=="undefined"||container==null)return false;while(container.hasChildNodes())container.removeChild(container.firstChild);if(typeof (week)=="undefined"&&document.location.hash.length>1){var v=parseInt(document.location.hash.replace("#","").replace("tyden",""));if(!isNaN(v))week=v};if(typeof (week)=="undefined"||typeof (timetable[week])=="undefined"){var exists=false;for(var k in timetable){exists=true;week=k;break};if(!exists)return false};var weeks={};for(var k in timetable)weeks[k]=k+". týden";var data=timetable[week],row=document.createElement('DIV');row.className="row";var col=document.createElement('DIV');col.className="col";var strong=document.createElement('STRONG');strong.appendChild(document.createTextNode("Třída:"));col.appendChild(strong);col.appendChild(document.createTextNode(data.trida));row.appendChild(col);col=document.createElement('DIV');col.className="col";strong=document.createElement('STRONG');strong.appendChild(document.createTextNode("Třídní učitel:"));col.appendChild(strong);col.appendChild(document.createTextNode(data.ucitel));row.appendChild(col);col=document.createElement('DIV');col.className="col";strong=document.createElement('STRONG');strong.appendChild(document.createTextNode("Týden:"));col.appendChild(strong);var select=new SelectElement("tyden",weeks,week);select.setWidth(100);select.setHeight(20);select.setFunction("onchange",function(){var value=this.options[this.selectedIndex].value;makeTimetable(value);document.location.hash="#"+value+"tyden"});col.appendChild(select.getNode());row.appendChild(col);col=document.createElement('DIV');col.className="button";var button=document.createElement('SPAN');button.appendChild(document.createTextNode("Vytisknout"));button.id="print_button";button.onclick=function(){printTable()};col.appendChild(button);row.appendChild(col);container.appendChild(row);var table=document.createElement('TBODY'),days=["PO","ÚT","ST","ČT","PÁ"],times=[null,"7:00 - 7:45","7:50 - 8:35","8:40 - 9:25","9:40 - 10:25","10:30 - 11:15","11:20 - 12:05","12:35 - 13:20","13:25 - 14:10","14:15 - 15:00"],tr=document.createElement('TR');for(var x=0;x<=9;x++){var th=document.createElement('TH');if(x>0){var small=document.createElement('SMALL');small.appendChild(document.createTextNode(times[x]));th.colSpan=2;th.appendChild(document.createTextNode(x));th.appendChild(small);th.className="h"}else{th.className="empty";th.innerHTML=" "};tr.appendChild(th)};table.appendChild(tr);for(var y in days){var tr=document.createElement('TR'),th=document.createElement('TH');th.appendChild(document.createTextNode(days[y]));tr.appendChild(th);for(var x=0;x<9;x++){var td1=document.createElement('TD'),td2=document.createElement('TD'),cell1=trim(data.data[y][x][0]),cell2=trim(data.data[y][x][1]);if(cell2==""&&cell1==""){td1.colSpan=2;td1.innerHTML=' ';td2=null}else if(cell1==""){td1.colSpan=2;td1.innerHTML=cell2.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,'$1
$2');td2=null}else if(cell2==""){td1.colSpan=2;td1.innerHTML=cell1.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,'$1
$2');td2=null}else{td1.innerHTML=cell1.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,'$1
$2');td2.innerHTML=cell2.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,'$1
$2')};tr.appendChild(td1);if(td2)tr.appendChild(td2)};table.appendChild(tr)};var tab=document.createElement('TABLE');tab.appendChild(table);container.appendChild(tab);return true} function printTable(type){if(typeof (type)=="undefined")type=false;var container=document.getElementById('table_container');if(container==null)return false;var win=window.open('about:blank','tisk','width='+(type?"705":"695")+',height='+(type?"550":"370")+',toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');win.document.write('Náhled tabulky
'+container.innerHTML+'
');win.document.getElementById('print_button').onclick=function(){window.print()};return true} function replaceSearch(){var form=document.getElementById('search'),input=form.getElementsByTagName('INPUT')[1];input.style.display="none";var span=document.createElement('EM');span.onclick=function(){if(google_loaded){googleSearch(this.parentNode.parentNode.getElementsByTagName('INPUT')[0].value)}else this.parentNode.parentNode.submit()};span.appendChild(document.createTextNode("Hledat"));input.parentNode.appendChild(span)} function openDocuments(button){var pos=findPos(button),documents=document.getElementById('documents');documents.style.left=pos[0]+"px";documents.style.display="block";documents.style.minWidth=button.scrollWidth+"px";if(typeof document.body.style.maxHeight=="undefined")documents.style.width=button.scrollWidth+"px"} function closeDocuments(e){if(e==null)e=window.event;var target=e.target!=null?e.target:e.srcElement;while(target!=null){if(target.id=="documents"||target.className=="list")return;target=target.parentNode};var documents=document.getElementById('documents');documents.style.display=""} function findPos(obj){var curleft=curtop=0;if(obj.offsetParent)do{if(getStyle(obj,"position")=="relative")break;curleft+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent);return[curleft,curtop]} function getStyle(oElm,strCssRule){var strValue=null,style=null;if(typeof (document.defaultView)!="undefined"&&typeof (document.defaultView.getComputedStyle)!="undefined"){style=document.defaultView.getComputedStyle(oElm,null)}else if(typeof (document.getComputedStyle)!="undefined")style=document.getComputedStyle(oElm,null);if(style!=null){if(!window.opera&&typeof (style.getPropertyCSSValue)!="undefined"&&style.getPropertyCSSValue(strCssRule)!=null){strValue=style.getPropertyCSSValue(strCssRule).cssText}else if(typeof (style.getPropertyValue)!="undefined")strValue=style.getPropertyValue(strCssRule)}else if(oElm.currentStyle){strCssRule=strCssRule.replace(/\-(\w)/g,function(strMatch,p1){return p1.toUpperCase()});strValue=oElm.currentStyle[strCssRule]};return strValue};if(typeof (swfobject)!="undefined"){swfobject.addDomLoadEvent(DOMLoaded);window.onload=WindowLoaded}else if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMLoaded,false);window.onload=WindowLoaded}else if(navigator.appName=='Microsoft Internet Explorer'){document.write('