var sel=undefined,base_url;$(document).ready(function(){base_url=location.protocol+"//"+location.host+"/";$("ul.sf-menu").superfish();set_links();$("a").each(function(){$(this).removeClass("sel")});location.hash!=""&&load_content(base_url+location.hash.substring(1));setInterval(checkBack,500)});var loc;function checkBack(){lh=location.hash.substring(1);loc!=undefined&&lh!=loc&&load_content(base_url+lh)}var loading=false;
function set_links(){$("a").each(function(a,c){$(this).attr("name")!="change_lang"&&c.href.indexOf(base_url)!=-1&&c.href.indexOf("mailto:")==-1&&$(this).attr("class").indexOf("fancybox")==-1&&$(this).attr("id").indexOf("fancybox-")==-1&&$(this).bind({dblclick:function(){return link_click(c)},click:function(){return link_click(c)}});$(this).attr("class").indexOf("fancybox")!=-1&&$(this).attr("id").indexOf("fancybox-")==-1&&$("a.fancybox").fancybox()})}
function link_click(a){if(!loading){loading=true;$("ul.sf-menu").hideSuperfishUl();$(a).data("clicked",true);clickBut(a);load_content(a.href);return false}}function load_content(a){loc=location.hash=a.replace(base_url,"");$("#content").fadeOut("fast",function(){$("#cover").load(a+" #content",function(){$("#cover").css("display","none");$("#cover").fadeIn("slow");set_links();callMe!=undefined&&callMe();loading=false})})}
function clickBut(a){$(sel).toggleClass("sel");sel=a;$(a).toggleClass("sel");a=a.href;if(a.indexOf("o-nas")!=-1)document.getElementById("header_flash_obj").clickBut(2);else if(a.indexOf("sluzby")!=-1)document.getElementById("header_flash_obj").clickBut(3);else if(a.indexOf("reference")!=-1)document.getElementById("header_flash_obj").clickBut(4);else if(a.indexOf("kontakt")!=-1)document.getElementById("header_flash_obj").clickBut(5);else if(a.indexOf("/cze/")!=-1||a.indexOf("/eng/")!=-1)document.getElementById("header_flash_obj").clickBut(1)}
function referenceClick(a){load_content(a);return false}function goHome(){load_content(base_url);return false}function replace_fonts(){Cufon.replace("h2");Cufon.replace(".cufon");Cufon.replace(".program th")}
function referenceFlash(a,c){var b=new SWFObject("/flash/reference.swf?"+Math.random(),"referenceflashobj","230","550","9","#333333");b.addParam("quality","high");b.addParam("salign","t");b.addParam("allowFullScreen","true");b.addParam("wmode","transparent");b.addVariable("xmlurl",a);b.addVariable("lang",c);b.write("referenceflash")};