var scrollArray=new Array();var menu_clicked=true;var menu_clicked_animating=false;var menu_goto="";var current_menu_item="";var current_download_item="";var indicatorSpeed=500;var scrollSpeed=250;var resetTimer=0;var ignoreHashChange=false;var firstRun=true;window.onload=function(e){$("#content").css("visibility","visible");$("#loadscreen").slideUp(250);$(window).resize(windowResize);windowResize();$(window).on('hashchange',hashChanged);goToByScroll();loadDownload('section_accolade_sani',"");} jQuery(document).ready(function($){$(".sections").each(function(i,obj){scrollArray[i]=[$(obj).offset().top+$('body').scrollTop(),$(obj).attr('id').split("section_").join("")];});if(navigator.platform=='iPad'||navigator.platform=='iPhone'||navigator.platform=='iPod'){$("#menu li").hover(function(){$("#menu li a").removeClass("a_hover");$("#topheader_logo a").removeClass("a_hover");});};$("#contact_form").validate({submitHandler:function(form){$(form).ajaxSubmit({target:'#progress',success:clearf});}});});function windowResize(){var new_left=($(window).width()-$("#container").width())/2+"px";$("#container").css("left",new_left);$("#content").css("top",$("#topheader").height()-6);$("#topheader_container").css("left",new_left);if(current_menu_item!=""&¤t_menu_item!=undefined){var offset_item=$(current_menu_item).offset();$("#menu_indicator").animate({left:offset_item.left,width:$(current_menu_item).innerWidth()},1,'easeOutExpo');}resetIpadMenu();}function goToByScroll(new_id){unbindScrollHash();var id=new_id;if(id==null||id==undefined||id==""){if(location.hash!=undefined&&location.hash!=null&&location.hash!=""){id=location.hash;}else{id="#home";}}var the_id=id.split("#").join("");var gotosection=the_id;if($("#section_"+the_id).parent().attr('id')=="section_producten"){gotosection="producten";}if(the_id=="producten"){the_id=$("#section_"+gotosection).children(":first").attr("id").split("section_").join("");}if(current_menu_item!="#menu_"+gotosection){location.hash="#"+the_id;if(navigator.platform=='iPad'||navigator.platform=='iPhone'||navigator.platform=='iPod'){$('body,html').animate({scrollTop:$("#section_"+the_id).offset().top-$("#topheader").height()+7+$('content').scrollTop()},scrollSpeed,'easeOutExpo',function(){indicatorMove(gotosection);});}else{$('body,html').animate({scrollTop:$("#section_"+the_id).offset().top-$("#topheader").height()+7+$('content').scrollTop()},scrollSpeed,'easeOutExpo');indicatorMove(gotosection);}$(current_menu_item).removeClass("menu_selected");current_menu_item="#menu_"+gotosection;$(current_menu_item).addClass("menu_selected");clearTimeout(resetTimer);resetTimer=setTimeout("resetIpadMenu()",indicatorSpeed+300);}else{bindScrollHash();}}function indicatorMove(id){var menu_item="#menu_"+id;var offset_item=$(menu_item).offset();$("#menu_indicator").stop();$("#menu_indicator").animate({left:offset_item.left,width:$(menu_item).innerWidth()},indicatorSpeed,'easeOutExpo',bindScrollHash);}function resetIpadMenu(){$('#bottomspacer').css('height','981px');if($('#bottomspacer').css('height')!='980px'){$('#bottomspacer').css('height','980px');}}function unbindScrollHash(){$(window).unbind('scroll');unbindHash();}function bindScrollHash(){$(window).bind('scroll',checkScroll);bindHash();}function unbindHash(){ignoreHashChange=true;}function bindHash(){ignoreHashChange=false;}function hashChanged(e){e.preventDefault();if(ignoreHashChange==false){goToByScroll("");}ignoreHashChange=false;}function checkScroll(){unbindHash();var currentScroll=$(window).scrollTop();for(var i=0;i=scrollArray.length-1){if(currentScroll+$("#topheader").height()>scrollArray[i][0]-marginNumber){var currentId=scrollArray[scrollArray.length-1][1];}}else{if(currentScroll+$("#topheader").height()>scrollArray[i][0]-marginNumber&¤tScroll+$("#topheader").height() .section_title";var new_title=$(title).clone();var theContent="#"+section+" .section_download_container";var new_theContent=$(theContent).clone();if(item==""){item=$("#first_down");}$(current_download_item).closest('li').removeClass("downloads_selected");current_download_item=item;$(current_download_item).closest('li').addClass("downloads_selected");$("#section_title_downloads").animate({opacity:0},250,'easeOutExpo',function(){switchDownload(new_title,new_theContent)});$("#download_placeholder").animate({opacity:0},250,'easeOutExpo');}function switchDownload(title,theContent){$('#section_title_downloads').empty();$('#download_placeholder').empty();$('#section_title_downloads').append(title);$('#download_placeholder').append(theContent);$("#section_title_downloads").animate({opacity:1},250,'easeOutExpo');$("#download_placeholder").animate({opacity:1},250,'easeOutExpo');}function showContactForm(obj){var section=($(obj).closest('.sections'));var title="#"+section.attr('id')+" > .section_title h1";var new_title=$(title).text();var new_top=section.offset();$('#contact_form_container #product').val(new_title);$('#contact_form_container #text_area').val("Chciałbym uzyskać więcej informacji o produkcie: "+new_title);$('#progress').css('display','none');$('#progress').text('Twoja wiadomość została wysłana.');$('#contact_form_container').css('display','none');$('#contact_form_container').css('top',new_top.top+35);$('#contact_form_container').fadeIn();}function closeContactForm(){$('#contact_form_container').fadeOut();}function showResponse(){$('#progress').fadeIn();}function clearf(){$('#email').clearFields();$('#progress').fadeIn();}