function menuFixed(id) { var obj = document.getElementById(id); var _getHeight = obj.offsetTop; window.onscroll = function() { changePos(id,_getHeight); } } function changePos(id,height) { var obj = document.getElementById(id); var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; var imgh = [document.body.offsetWidth || document.documentElement.offsetWidth]-80; if(scrollTop < height){ obj.style.position = 'relative'; document.getElementById("hhh").style.marginLeft = "0" + "px"; }else{ obj.style.position = 'fixed'; obj.style.margin = "0"; obj.style.top = "0"; obj.style.display = "block"; obj.style.visibility = "visible"; var imgh = [document.body.clientWidth || document.documentElement.clientWidth]-80; document.getElementById("hhh").style.height = document.getElementById("ggw").offsetHeight + "px"; document.getElementById("hhh").style.marginLeft = "-40" + "px"; } } window.onload = function() { menuFixed("ggw"); } function attr_change(kk,attr0,attr1,attr2,attr3,attr4,w,l,f,e,d1,d2,d3,img_code) { $('#tab_div table td.gray_col').css("background-color","#f0f0f0"); $('#tab_div table td.normal').css("background-color","#ffffff"); $('#tr'+kk+' td.normal').css("background-color","#dbe0e4"); $('#td'+kk).css("background-color","#dbe0e4"); $('#attr0').text(attr0); $('#attr1').text(attr1); $('#attr2').text(attr2); $('#attr3').text(attr3); $('#attr4').text(attr4); $('#w').text(w.toFixed(2)); $('#l').text(l.toFixed(2)); $('#f').text(f.toFixed(2)); $('#e').text(e.toFixed(2)); $('#d1').text(d1.toFixed(2)); $('#d2').text(d2.toFixed(2)); if(img_code=='no_insulation_circular'||img_code=='no_insulation_fork') $('#d3').text(d3.toFixed(2)); } function tube_change(kk,attr0,f,l,w,d,c) { $('#tab_div table td.gray_col').css("background-color","#f0f0f0"); $('#tab_div table td.normal').css("background-color","#ffffff"); $('#tr'+kk+' td.normal').css("background-color","#dbe0e4"); $('#td'+kk).css("background-color","#dbe0e4"); $('#attr0').text(attr0); $('#f').text(f.toFixed(2)); $('#l').text(l.toFixed(2)); $('#w').text(w.toFixed(2)); $('#d').text(d.toFixed(2)); $('#c').text(c.toFixed(2)); } function no_insulation_tube_change(kk,attr0,l,d,c,w) { $('#tab_div table td.gray_col').css("background-color","#f0f0f0"); $('#tab_div table td.normal').css("background-color","#ffffff"); $('#tr'+kk+' td.normal').css("background-color","#dbe0e4"); $('#td'+kk).css("background-color","#dbe0e4"); $('#attr0').text(attr0); $('#l').text(l.toFixed(2)); $('#d').text(d.toFixed(2)); $('#c').text(c.toFixed(2)); $('#w').text(w.toFixed(2)); }