// JavaScript Document function change_tab(tab){ document.getElementById('info').style.display = 'none'; document.getElementById('data').style.display = 'none'; document.getElementById('download').style.display = 'none'; document.getElementById('ask').style.display = 'none'; document.getElementById('part').style.display = 'none'; document.getElementById('video').style.display = 'none'; document.getElementById('rate').style.display = 'none'; document.getElementById(tab).style.display = 'block'; document.getElementById('info_tab').style.backgroundColor = ''; document.getElementById('data_tab').style.backgroundColor = ''; document.getElementById('download_tab').style.backgroundColor = ''; document.getElementById('ask_tab').style.backgroundColor = ''; document.getElementById('part_tab').style.backgroundColor = ''; document.getElementById('video_tab').style.backgroundColor = ''; document.getElementById('rate_tab').style.backgroundColor = ''; document.getElementById(tab+'_tab').style.backgroundColor = '#0089c8'; document.getElementById('info_tab').style.color = '#333'; document.getElementById('data_tab').style.color = '#333'; document.getElementById('download_tab').style.color = '#333'; document.getElementById('ask_tab').style.color = '#333'; document.getElementById('part_tab').style.color = '#333'; document.getElementById('video_tab').style.color = '#333'; document.getElementById('rate_tab').style.color = '#333'; document.getElementById(tab+'_tab').style.color = '#fff'; document.getElementById('info_tab_arrow').style.visibility = 'hidden'; document.getElementById('data_tab_arrow').style.visibility = 'hidden'; document.getElementById('download_tab_arrow').style.visibility = 'hidden'; document.getElementById('ask_tab_arrow').style.visibility = 'hidden'; document.getElementById('part_tab_arrow').style.visibility = 'hidden'; document.getElementById('rate_tab_arrow').style.visibility = 'hidden'; document.getElementById(tab+'_tab_arrow').style.visibility = 'visible'; } function prod_to_continue(){ clearTimeout(timeout); document.getElementById('add_to_cart_choice_wrap').style.display = "none"; } var timeout; function add_to_cart(pid, cid){ var guar_send = ""; for(var j = 0; ; j++){ var guar = document.getElementsByName("guar_"+j); if(guar.length <= 0)break; for(var i in guar){ if(guar[i].checked && guar[i].value != 0){ guar_send = guar_send+"&guar_"+j+"="+guar[i].value; break; } } } var constructions = document.getElementsByName("construction"); var c_value = ""; for(i = 0; i < constructions.length; i++){ if(constructions.item(i).checked && constructions.item(i).value != "noconstruction"){ c_value = constructions.item(i).value; break; } } //tmp_sale_accupack var accupack = document.getElementsByName("accupack"); var a_value = ""; for(i = 0; i < accupack.length; i++){ if(accupack.item(i).checked){ a_value = accupack.item(i).value; break; } } ajax_query('/other/add_to_cart.php?pid='+pid+guar_send+'&construction='+c_value+'&accupack='+a_value); refresh_cart(); //timeout = setTimeout('prod_to_continue()', 5000); document.getElementById('add_to_cart_choice_wrap').style.display = "flex"; } var gallery_pos = 0; function move_subcat(direction){ if(direction == "right"){ for(i = 1; i <= 105; i++){ setTimeout('move_subcat_to("'+(gallery_pos * 105 - i)+'px")',i*2); } --gallery_pos; } else{ for(i = 1; i <= 105; i++){ setTimeout('move_subcat_to("'+(gallery_pos * 105 + i)+'px")',i*2); } ++gallery_pos; } move_subcat_visibility(); } function move_subcat_visibility(){ var left = document.getElementById('gallery_arrow_l'); var right = document.getElementById('gallery_arrow_r'); if(gallery_pos < 0){ left.style.backgroundImage = "url(/images/sub_cat_arrow_l.webp)"; left.style.cursor = "pointer"; left.onclick = function(){move_subcat('left');}; } else{ left.style.backgroundImage = "url(/images/sub_cat_arrowg_l.webp)"; left.style.cursor = "auto"; left.onclick = ""; } if(Math.abs(gallery_pos - 3) == num_gallery){ right.style.backgroundImage = "url(/images/sub_cat_arrowg_r.webp)"; right.style.cursor = "auto"; right.onclick = ""; } else{ right.style.backgroundImage = "url(/images/sub_cat_arrow_r.webp)"; right.style.cursor = "pointer"; right.onclick = function(){move_subcat('right');}; } } function move_subcat_to(to){ document.getElementById('gallery_table').style.left = to; } window.onscroll = function(){top_info();} function top_info(){ top_popup_wrap = document.getElementById('top_popup_wrap'); start = document.getElementById('top_info_start').getBoundingClientRect(); if(start.top <= 0)top_popup_wrap.style.top = "0px"; else top_popup_wrap.style.top = "-170px"; }