
$(document).ready(function(){if(typeof(PAGE_AUTO_SCROLL)=='undefined'||PAGE_AUTO_SCROLL!=false){var links_box_offset=$('#links_box').offset();$('html, body').animate({scrollTop:links_box_offset.top},'fast');}controls_set_functionality();$.ajaxSetup({complete:function(XMLHttpRequest,textStatus){controls_set_functionality();}});$("a.t_out").live("click",function(){open($(this).attr("href"));return false;});$('a.showbox').live("click",function(){$($(this).attr('href')+' p:first-child').css('margin-top','0px');$($(this).attr('href')).toggle(100);return false;});$("input.numbersonly").live("keypress",function(e){return numbersonly(e,false);});$("input.numbersonly_dec").live("keypress",function(e){return numbersonly(e,true);});$("input.psconly").live("keypress",function(e){return psconly(e);});$("input.static").live("keypress",function(e){return false;});$("#menu_main ul.submenu").prepend('<li class="first-child"><span class="first-child_left"></span><span class="first-child_right"></span></li>').append('<li class="last-child"><span class="last-child_left"></span><span class="last-child_right"></span></li>');$("ul#menu_main a").hover(function(){menu_reset_timeout();var position=$(this).position();var submenu=$(this).siblings('ul.submenu');var my_parent_menu=$(this).closest('ul');skryj_menu(my_parent_menu,submenu);if(submenu.length){var menu_main=my_parent_menu.attr('id')=='menu_main'?true:false;var submenu_width=submenu.outerWidth();var spans_width=16;submenu.children('li.last-child').css('left',spans_width+'px').css('width',(submenu_width-(2*spans_width))+'px');if(!menu_main){submenu.children('li.first-child').css('left',spans_width+'px').css('width',(submenu_width-(2*spans_width))+'px');}if(menu_main){var left_offset=3;submenu.css("left",(position.left-left_offset)+"px");if($.browser.msie&&parseInt($.browser.version)<=6){submenu.css("left",(position.left+2)+"px");}}else{var left_offset=$(this).outerWidth()+10;submenu.css("left",(position.left+left_offset)+"px");submenu.css("top",position.top+"px");if($.browser.msie&&parseInt($.browser.version)<=6){submenu.css("left",(position.left+left_offset-10)+"px");}}if($.browser.msie&&parseInt($.browser.version)<=6){submenu.css('display','block');var submenu_width=0;submenu.children('li').each(function(){if($(this).width()>submenu_width){submenu_width=$(this).width();}});submenu.width(submenu_width);}else{submenu.slideDown("fast");}}},function(){var my_parent_menu=$(this).closest('ul');menu_skryt_timeout(my_parent_menu);});$("#menu_main ul.submenu").hover(function(){$(this).prev().addClass('active');menu_reset_timeout();},function(){var my_parent_menus=$(this).closest('ul');menu_skryt_timeout(my_parent_menus[1]);});if($(window).width()<$("div#flash_box").width()){var flash_posun_left=($("div#flash_box").width()-$(window).width())/2;$("div#flash_box").css('left','-'+flash_posun_left+'px');}var flashvars={xmlPath:(LANG_CODE=='en')?"/flash/slideshow_en.xml":"/flash/slideshow.xml",tedy_url:'http://www.interspar.cz/spar/uvodni_stranka/uvodni_stranka4.htm'};var flashparams={quality:"high",bgcolor:"transparent",allowScriptAccess:"sameDomain",allowFullScreen:"false",wmode:"transparent"};var flashattributes={id:"flash_top_slideshow",name:"flash_top_slideshow"};swfobject.embedSWF("/flash/slideshow.swf","flash_container","998","329","9.0.0","",flashvars,flashparams,flashattributes);$('div.gallery').children().wrap('<div class="gi"></div>');$('div.gallery').children(':odd').after('<div class="gi_clear"></div>');if(typeof(PAGE_AUTO_SCROLL)=='undefined'||PAGE_AUTO_SCROLL!=false){var back_to_top_container_1=$('#back_to_top_container_1');if(back_to_top_container_1){var mb_back_to_top_1=$('<p id="mb_back_to_top_1"><a href="">&lt; '+TRANSLATION_ZPET_NAHORU+'</a></p>');mb_back_to_top_1.click(function(){$('html, body').animate({scrollTop:0},'normal');return false;});back_to_top_container_1.append(mb_back_to_top_1);}}var back_to_top_container_2=$('#back_to_top_container_2');if(back_to_top_container_2){var mb_back_to_top_2=$('<p id="mb_back_to_top_2"><a href="">&lt; '+TRANSLATION_ZPET_NAHORU+'</a></p>');mb_back_to_top_2.click(function(){$('html, body').animate({scrollTop:0},'normal');return false;});back_to_top_container_2.append(mb_back_to_top_2);}$('div.hp_news_item a').hover(function(){$(this).closest('div.hp_news_item').children('img').addClass('hover');},function(){$(this).closest('div.hp_news_item').children('img').removeClass('hover');});refresh_main_box_loga_p_timeout=setTimeout("refresh_main_box_loga()",3000);});function controls_set_functionality(){}var menu_timeout=150;var menu_p_timeout=null;function menu_skryt_timeout(menu_obj,except_obj){menu_p_timeout=setTimeout(function(){skryj_menu(menu_obj,except_obj);},menu_timeout);}function menu_reset_timeout(){clearTimeout(menu_p_timeout);}function skryj_menu(menu_obj,except_obj){if(!menu_obj){menu_obj=$("#menu_main");}var submenus_obj=(except_obj&&except_obj.length)?menu_obj.find('ul.submenu').not(except_obj):menu_obj.find('ul.submenu');submenus_obj.each(function(){if($(this)!=$(except_obj)){if($.browser.msie&&parseInt($.browser.version)<=6){$(this).css('display','none');$(this).prev().removeClass('active');}else{$(this).slideUp(50,function(){$(this).prev().removeClass('active');});}}});}var refresh_main_box_loga_p_timeout=null;var main_box_slides=null;var main_box_slides_length=null;var main_box_slides_actual_idx=0;function refresh_main_box_loga(){clearTimeout(refresh_main_box_loga_p_timeout);if(!main_box_slides){$.getJSON('/main_box_logos.php',{},function(data){if(!data.error){main_box_slides=data.slides;main_box_slides_length=main_box_slides.length;change_main_box_loga();}});}else{change_main_box_loga();}}function change_main_box_loga(){main_box_slides_actual_idx=main_box_slides_actual_idx+1;if(main_box_slides_actual_idx>=main_box_slides_length){main_box_slides_actual_idx=0;}$('#main_box_loga').html(main_box_slides[main_box_slides_actual_idx]);refresh_main_box_loga_p_timeout=setTimeout("refresh_main_box_loga()",3000);}function numbersonly(e,dec){var key;var keychar;if(window.event)key=window.event.keyCode;else if(e)key=e.which;else
return true;keychar=String.fromCharCode(key);if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27))return true;else if(("0123456789").indexOf(keychar)>-1)return true;else if(dec&&((".,").indexOf(keychar)>-1)){return true;}else
return false;}function psconly(myfield,e){var key;var keychar;if(window.event)key=window.event.keyCode;else if(e)key=e.which;else
return true;keychar=String.fromCharCode(key);if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27))return true;else if(((' 0123456789').indexOf(keychar)>-1))return true;else
return false;}function zobrazSkryj(id){el=document.getElementById(id).style;el.display=(el.display=='block')?'none':'block';}
