var el_g,el_s,elq_g,elq_s,el_smiles,el_login,stype=0,cpreviewWin=0,xstyle,moreSm=false,loginForm=false,elStyle=new Array();var imgLoad=new Image();imgLoad.src="imgs/loading.gif";d=document;l=(d.layers)?1:0;op=navigator.userAgent.toLowerCase().indexOf("opera")!=-1;ie=(d.all)?1:0;function gE(g,c){if(l){c=(c)?c:self;var b=c.document.layers;if(b[g]){return b[g]}for(var a=0;a<b.length;){t=gE(g,b[a++])}return t}if(d.all){return d.all[g]}return d.getElementById(g)}function sE(a){if(l){a.visibility="show"}else{a.style.visibility="visible"}}function hE(a){if(l){a.visibility="hide"}else{a.style.visibility="hidden"}}function init(){el_g=gE("search_g");el_s=gE("search_s");hE(el_s);elq_g=gE("squery");elq_s=gE("nquery");elq_g.value=elq_s.value}var oldCellColor="#FFF";function focusRow(c){var a=c.cells;if(!a){return}oldCellColor=a[0].style.backgroundColor;for(var b=0;b<a.length;b++){a[b].style.backgroundColor="whitesmoke"}}function blurRow(c){var a=c.cells;if(!a){return}for(var b=0;b<a.length;b++){a[b].style.backgroundColor=oldCellColor}}function findPosX(a){var b=0;if(a.offsetParent){while(1){b+=a.offsetLeft;if(!a.offsetParent){break}a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(1){a+=b.offsetTop;if(!b.offsetParent){break}b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function subMenu(){var f='<div class="submenu"><ul><li><a href="http://rozvrhy.jaros.in/" target="_blank">Tvůrce rozvrhů</a></li>';f+='<li><a href="http://www.jaros.in/item/sudoku-brain">Sudoku Brain</a></li>';f+='<li><a href="http://www.jaros.in/item/dochazka-a-poznamky">Docházka & poznámky</a></li>';f+='<li><a href="http://www.jaros.in/item/on-line-herna">On-line herna</a></li></ul><div>';var b=0;var a=0;var e=0;var c=document.getElementById("projekty");if(c){b=findPosX(c)-1;a=findPosY(c)+28}else{a=96;e=-45}Tip(f,POSX,b,POSY,a,FIXX,e,WIDTH,155,STICKY,1,CLICKCLOSE,true,BGCOLOR,"#FFF",FADEIN,500,FADEOUT,500)}function hideMenu(){tt_HideInit()}function linkuj(a,e){var c=encodeURIComponent(a);var b=encodeURIComponent(e);var g="http://www.jaros.in/skins/inv/icons/";var f='<a href="http://linkuj.cz/?id=linkuj&url='+c+"&title="+b+'" target="_blank"><img src="'+g+'linkuj.gif" alt="Linkuj.cz" title="Linkuj.cz"></a>';f+=' <a href="http://www.jagg.cz/bookmarks.php?action=add&address='+c+"&title="+b+'" target="_blank"><img src="'+g+'jagg.gif" alt="Jagg.cz" title="Jagg.cz"></a>';f+=' <a href="http://www.topclanky.cz/pridat?url='+c+"&title="+b+'" target="_blank"><img src="'+g+'topclanky.gif" alt="Topčlánky.cz" title="Topčlánky.cz"></a>';f+=' <a href="http://vybrali.sme.sk/submit.php?url'+c+'" target="_blank"><img src="'+g+'vybralisme.gif" alt="Vybrali.sme.sk" title="Vybrali.sme.sk"></a>';f+=' <a href="http://delicious.com/save?v=5&noui&jump=close&url='+c+"&title="+b+'" target="_blank"><img src="'+g+'delicious.gif" alt="Del.icio.us" title="Del.icio.us"></a>';f+=' <a href="http://twitter.com/home?status='+c+'" target="_blank"><img src="'+g+'twitter.gif" alt="Twitter.com" title="Twitter.com"></a>';f+=' <a href="http://www.facebook.com/share.php?u='+c+"&t="+b+'" target="_blank"><img src="'+g+'facebook.gif" alt="Facebook.com" title="Facebook.com"></a>';f+=' <a href="http://digg.com/submit?phase=2&url='+c+"&title="+b+'" target="_blank"><img src="'+g+'digg.gif" alt="Digg.com" title="Digg.com"></a><br />';f+='<a href="http://www.stumbleupon.com/submit?url='+c+"&title="+b+'" target="_blank"><img src="'+g+'stumbleupon.gif" alt="StumbleUpon.com" title="StumbleUpon.com"></a>';f+=' <a href="http://technorati.com/faves?add='+c+'" target="_blank"><img src="'+g+'technorati.gif" alt="Technocrati.com" title="Technocrati.com"></a>';f+=' <a href="http://www.topodkazy.cz/submit.php?url='+c+"&title="+b+'" target="_blank"><img src="'+g+'topodkazy.gif" alt="TopOdkazy.cz" title="TopOdkazy.cz"></a>';f+=' <a href="http://www.bookmarky.cz/a.php?cmd=add&url='+c+"&title="+b+'" target="_blank"><img src="'+g+'bookmarky.gif" alt="Bookmarky.cz" title="Bookmarky.cz"></a>';f+=' <a href="http://fungu.cz/link.aspx?l='+c+"&title="+b+'" target="_blank"><img src="'+g+'fungu.gif" alt="Fungu.cz" title="Fungu.cz"></a>';f+=' <a href="http://www.reddit.com/submit?url='+c+"&title="+b+'" target="_blank"><img src="'+g+'reddit.gif" alt="Reddit.com" title="Reddit.com"></a>';f+=' <a href="http://www.flickr.com/photos/submit?url='+c+"&title="+b+'" target="_blank"><img src="'+g+'flickr.gif" alt="Flickr.com" title="Flickr.com"></a>';f+=' <a href="http://www.jaros.in/rss" target="_blank"><img src="'+g+'rss.gif" alt="RSS 2.0" title="RSS 2.0"></a>';Tip(f,FIXX,-140,TITLE,"Sdílet „"+e+"“",WIDTH,280,SHADOW,true,STICKY,1,CLOSEBTN,true,CLICKCLOSE,true,FADEIN,500,FADEOUT,500)}function switch_search(a){if(stype!=a){if(a==0){sE(el_g);hE(el_s);elq_g.value=elq_s.value}else{sE(el_s);hE(el_g);elq_s.value=elq_g.value}stype=a}}function popUp(f,c,a,g,b,e){if(!b){b=0}if(!e){e=0}levy=Math.round((screen.width-a)/2);horni=Math.round((screen.height-g)/2)-10;return window.open(f,c,"width="+a+",height="+g+",left="+levy+",top="+horni+",status="+b+",resizable=1,menubar=0,scrollbars="+e+",toolbar=0")}function removeDiacritic(a){return a.replace(/[ÁÄČÇĎÉĚËÍŇÓÖŘŠŤÚŮÜÝŽáäčçďéěëíňóöřšťúůüýž]/g,function(b){return convertDiacritic(b)})}function convertDiacritic(a){switch(a){case"Á":return"A";case"Ä":return"A";case"Č":return"C";case"Ç":return"C";case"Ď":return"D";case"É":return"E";case"Ě":return"E";case"Ë":return"E";case"Í":return"I";case"Ň":return"N";case"Ó":return"O";case"Ö":return"O";case"Ř":return"R";case"Š":return"S";case"Ť":return"T";case"Ú":return"U";case"Ů":return"U";case"Ü":return"U";case"Ý":return"Y";case"Ž":return"Z";case"á":return"a";case"ä":return"a";case"č":return"c";case"ç":return"c";case"ď":return"d";case"é":return"e";case"ě":return"e";case"ë":return"e";case"í":return"i";case"ň":return"n";case"ó":return"o";case"ö":return"o";case"ř":return"r";case"š":return"s";case"ť":return"t";case"ú":return"u";case"ů":return"u";case"ü":return"u";case"ý":return"y";case"ž":return"z"}}function getWordsCount(a){a=removeDiacritic(a);a=a.replace(/\[[0-9]+\]/g,function(g){return"Reakce na "+g+" >"});a=a.replace(/:[\!\?]:/g,"xxx");var f=a.split(/[^\w\d-]+/g);for(var e=0;e<f.length;e++){if(!f[e]){f.splice(e,1);e--}}var c=f.length,b="Text vašeho komentáře obsahuje ";b+=c+" ";if(c==1){b+="slovo"}else{if(c>1&&c<5){b+="slova"}else{b+="slov"}}b+=" ("+a.length+" znaků).";return b}function comPreview(){var b=gE("nucleus_cf_body");if(b.value==""){alert("Nejprve vyplňte text komentáře!");return}var a=encodeURI(b.value);while(a.indexOf("+")!=-1){a=a.replace("+","%2B")}while(a.indexOf(".*")!=-1){a=a.replace(".*",".~*")}a=escape(a);if(a.length>8100){alert("Komentář je příliš dlouhý, náhled bude zkrácen!");a=a.substring(0,8100)}a="http://www.jaros.in/nucleus/com_preview.php?t="+a+"&s="+xstyle.substring(1,10);CB_Open("href="+a+",,width=500,,height=300,,title="+getWordsCount(b.value))}function reply(b){var a=gE("nucleus_cf_body");if(a){a.focus();if(a.value!=""){a.value+="\r\n"}a.value+="["+(b)+"] "}}function smile(e){var b=gE("nucleus_cf_body");if(b){if(document.addEventListener){var c=b.selectionStart;var a=e;if(b.value.substring(c-1,c)!=" "){a=" "+a}if(b.value.length>c&&b.value.substring(c,c+1)!=" "){a+=" "}b.value=b.value.substring(0,c)+a+b.value.substring(c,b.value.length);c+=e.length+1;b.focus();b.selectionStart=c;b.selectionEnd=c}else{b.focus();b.value+=" "+e}}}function moreSmiles(){if(!el_smiles){el_smiles=gE("smiles")}if(moreSm){hE(el_smiles)}else{sE(el_smiles)}moreSm=!moreSm}function displayLogin(){if(!el_login){el_login=gE("loginbox")}if(loginForm){hE(el_login)}else{sE(el_login)}loginForm=!loginForm}function valid_cf(a){if(a.nucleus_cf_body.value==""){alert("Není vyplněn text Vašeho komentáře!");a.nucleus_cf_body.focus();return false}else{if(a.nucleus_cf_name.value==""){alert("Není vyplněno Vaše jméno!");a.nucleus_cf_name.focus();return false}else{if(a.nucleus_cf_mail.value==""){alert("Není vyplněn Váš e-mail!");a.nucleus_cf_mail.focus();return false}else{if(window.RegExp){re=new RegExp("^[^.]+(.[^.]+)*@([^.]+[.])+[a-z]{2,4}$");if(!re.test(a.nucleus_cf_mail.value)){alert("Zadaný e-mail není správnou\nadresou elektronické pošty!");a.nucleus_cf_mail.focus();return false}}else{return true}}}}}function doTranslate(a){if(a.value){a=a.value}if(a=="cs|cs"){if(location.hostname=="www.jaros.in"){return}else{location.href=unescape(gfg("u"))}}else{if(location.hostname=="www.jaros.in"&&a!="cs|cs"){location.href="http://translate.google.com/translate?client=tmpg&hl=en&langpair="+a+"&u="+escape(location.href)}else{location.href="http://translate.google.com/translate?client=tmpg&hl=en&langpair="+a+"&u="+unescape(gfg("u"))}}}function gfg(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+b+"=([^&#]*)";var e=new RegExp(a);var c=e.exec(location.href);if(c==null){return""}return c[1]}styles=new Array();styles[1]="xgreen";styles[2]="xblue";styles[3]="xbrown";styles[4]="xpink";styles[5]="xred";sColor=new Array();sColor[styles[1]]="#E6FFC0";sColor[styles[2]]="#E9F4FF";sColor[styles[3]]="#E3DBD2";sColor[styles[4]]="#FFE8F8";sColor[styles[5]]="#FFE8EA";var cookie_key="sektorpj_style";function setStyle(g,f){var e,c,b;for(e=0;(c=document.getElementsByTagName("link")[e]);e++){if(c.getAttribute("rel").indexOf("style")!=-1&&c.getAttribute("title")){c.disabled=true;if(c.getAttribute("title")==g){c.disabled=false}}}if(f){createCookie(cookie_key,g,365)}}function setColor(a){setStyle(a,1);elStyle[xstyle].style.borderColor="#FFF";elStyle[a].style.borderColor=sColor[a];xstyle=a}function overColor(a){elStyle[a].style.borderColor=sColor[a];switch(a){case styles[1]:Tip("Zelená barva");break;case styles[2]:Tip("Modrá barva");break;case styles[3]:Tip("Hnědá barva");break;case styles[4]:Tip("Růžová barva");break;case styles[5]:Tip("Rudá barva");break}}function outColor(a){if(a!=xstyle){elStyle[a].style.borderColor="#FFF"}UnTip()}function createCookie(c,e,f){if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));var a="; expires="+b.toGMTString()}else{a=""}document.cookie=c+"="+e+a+"; path=/"}function readCookie(b){var f=b+"=";var a=document.cookie.split(";");for(var e=0;e<a.length;e++){var g=a[e];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function onDocReady(){for(var a=1;a<styles.length;a++){elStyle[styles[a]]=gE(styles[a])}elStyle[xstyle].style.borderColor=sColor[xstyle]}function bindReady(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);onDocReady()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);onDocReady()}});if(document.documentElement.doScroll&&window==window.top){(function(){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}onDocReady()})()}}}}function init2(){var a=readCookie(cookie_key);xstyle=a?a:styles[1];if(xstyle.charAt(0)!="x"){xstyle=styles[1]}setStyle(xstyle,0)}window.onload=function(a){init();init2()};init2();bindReady();