// JavaScript Document // Some instances of IE on Windows will cause Google Translate to choke. // This provides graceful error handling for GT, while still providing feedback on other errors: window.onerror=function(msg, url, linenumber){ if(url.search(/google/i)==-1){ return false; } else { //$("#google_translate_element").html('Translate This Page'); return true; } } var t; var productPage=false; $(function(){ preLoadImages("images/nav_over.jpg", "images/sec_nav_over.jpg"); $("#nav td:last").css("border", "none"); $("#nav a").hover(function(event){ $("#nav a").removeClass("over"); clearTimeout(t); if($(this).attr("id")!="products"){ $("#prodDrop").slideUp(); } $(this).addClass("over"); }, function(){ $(this).removeClass("over"); if($(this).attr("id")!="products"){ $("#prodDrop").slideUp(); } }); $("#products").mouseover(function(){ $("#prodDrop").slideDown(); }); $("#prodDrop").hover(function(){ $("#products").addClass("over"); }, function(){ t=setTimeout("clearDrop()", 100); }); $("#masthead, #mastheadMap").mouseover(clearDrop); if(productPage){ $("#rplinks").removeClass("nonProduct"); $("#contentBlock").css("padding-bottom" , "20px"); } $("#toleranceTable tr").each(function(){ $(this).find('td:last-child').addClass('last'); $(this).find('th:last-child').addClass('last'); }); $(".blackTable tr").each(function(){ $(this).find("td:first-child").css({"white-space" : "nowrap", "font-weight" : "bold", "padding-right" : "15px"}); }); $("#chemTable tr, .firstLeft tr").each(function(){ $(this).find("td:first-child, th:first-child").css("text-align", "left"); }); $(".spreadTable tr").each(function(){ $(this).find("td:first-child").css("padding-right", "20px"); $(this).find("td:last-child").css("padding-left", "20px"); }); $("#answers p").after('
'); $(".sprocketTable tr").each(function(){ $(this).find("td:nth-child(4)").not(".na").each(function(){ var $this = $(this); var htm = $this.html(); // Add classes to tr for dynamic styling based on items $this.parent('tr').addClass('lb').addClass('hover').attr('data-href', htm); $this.parent('tr').find('td:first-child').html(''); // Leaving the anchor to fire the lightbox click $(this).html(''+htm+''); }); }); $(".sprocketTable th, #repTable td").addClass("notranslate"); $('tr.lb').click(function() { var $this = $(this); $this.find('a.lb').click(); }); $("a.lb").lightBox(); $(".wideTable tr").each(function(){ $(this).find("td:first-child, th:first-child").css({"text-align" : "left"}); }); }); function clearDrop(){ $("#prodDrop").slideUp(function(){ $("#products").removeClass("over"); }); }