$(document).ready(function(){ // Make homepage boxes under big picture even height. if (page_loc == "home") { $("#home-rotation li").css("opacity","0"); $("#home-rotation li").first().css("opacity","1"); int_home_rotate = 0; int_all_rotation = $("#home-rotation li").length - 1; interval_rotation = setInterval("rotateHome()",5000); } /* $('#btn_place_your_order').click(function(){ $(this).prop("disabled", true); $("#testform").submit(); }); */ $('#btn_request_catalogs').click(function(){ $(this).prop("disabled", true); $(this).css("background-color","#999"); $(this).css("color","#fff"); $("#form_request_catalogs").submit(); }); $('#btn_place_your_order').click(function(){ $(this).prop("disabled", true); $(this).css("background-color","#999"); $(this).css("color","#fff"); $("#form_cartInformation").submit(); }); $('#btn_test_disable').click(function(){ $(this).prop("disabled", true); $("#testform").submit(); }); $('#header_search_button').click(function(event){ $keyword = $('#header_keywords').val() if($keyword.length < 2) { event.preventDefault(); alert('Please enter the search keyword') return false; } }); }); $(window).on('load', function(){ if (page_loc == "home") { tmp_tallest = 0; tmp_a = parseInt($(".home-three-a").css("height")); tmp_b = parseInt($(".home-three-b").css("height")); tmp_c = parseInt($(".home-three-c").css("height")); if (tmp_a > tmp_tallest) { tmp_tallest = tmp_a; } if (tmp_b > tmp_tallest) { tmp_tallest = tmp_b; } if (tmp_c > tmp_tallest) { tmp_tallest = tmp_c; } $(".home-three").css("height",tmp_tallest + "px"); tmp_logoSlide = parseInt($("#home-logos-slider").css("height")); interval_logoSlide = setInterval("slideLogosUp()",100); } tmpSearch = $("#header_keywords").val(); if (tmpSearch == "") { // $("#header_keywords").val("Search by part # or keyword"); // $("#header_keywords").css("color","#808080"); } else { $("#header_keywords").css("color","#000000"); } }); function copyFields() { if (document.getElementById("billing_shipping_same").checked) { document.getElementById("W53").value = document.getElementById("W37").value; document.getElementById("W54").value = document.getElementById("W38").value; document.getElementById("W55").value = document.getElementById("W39").value; document.getElementById("W56").value = document.getElementById("W310").value; document.getElementById("W57").value = document.getElementById("W311").value; document.getElementById("W58").value = document.getElementById("W312").value; document.getElementById("W59").value = document.getElementById("W313").value; document.getElementById("W511").value = document.getElementById("W331").value; document.getElementById("W510").value = document.getElementById("W329").value; document.getElementById("W512").value = document.getElementById("W330").value; } } function searchfocus() { tmpSearch = $("#header_keywords").val(); if (tmpSearch == "Search by part # or keyword") { $("#header_keywords").val(""); $("#header_keywords").css("color","#000000"); } } function searchblur() { tmpSearch = $("#header_keywords").val(); if (tmpSearch == "") { $("#header_keywords").val("Search by part # or keyword"); $("#header_keywords").css("color","#808080"); } } function formFocus(fieldText,fieldID) { tmpValue = $("#" + fieldID).val(); if (tmpValue == fieldText) { $("#" + fieldID).val(""); $("#" + fieldID).css("color","#000000"); } } function formBlur(fieldText,fieldID) { tmpValue = $("#" + fieldID).val(); if (tmpValue == "") { $("#" + fieldID).val(fieldText); $("#" + fieldID).css("color","#808080"); } } function ePopUp(thePageCode) { theEPageWindow=window.open("/catpages.php?page="+thePageCode,"ecatpages","width=740,height=550,scrollbars=1,toolbar=1,menubar=1"); theEPageWindow.focus(); } function slideLogosUp() { tmp_top = parseInt($("#home-logos-slider").css("top")); tmp_top = tmp_top - 1; if (tmp_top <= (tmp_logoSlide-70) * -1) { clearInterval(interval_logoSlide); interval_logoSlide = setInterval("slideLogosDown()",100); } $("#home-logos-slider").css("top",tmp_top + "px"); } function slideLogosDown() { tmp_top = parseInt($("#home-logos-slider").css("top")); tmp_top = tmp_top + 1; if (tmp_top >= 0) { clearInterval(interval_logoSlide); interval_logoSlide = setInterval("slideLogosUp()",100); } $("#home-logos-slider").css("top",tmp_top + "px"); } function advanceRotate(direction) { clearInterval(interval_rotation); $("#home-rotation li:eq(" + int_home_rotate + ")").animate({ opacity:0 },1000); $("#home-main-position li:eq(" + int_home_rotate + ") img").attr("src","/images/home-button-black.png"); if (direction == "next") { int_home_rotate++; } if (direction == "back") { int_home_rotate--; } if (int_home_rotate > int_all_rotation) { int_home_rotate = 0; } if (int_home_rotate < 0) { int_home_rotate = int_all_rotation; } $("#home-rotation li:eq(" + int_home_rotate + ")").animate({ opacity:1 },1000); $("#home-main-position li:eq(" + int_home_rotate + ") img").attr("src","/images/home-button-ltgrey.png"); } function rotateHome() { $("#home-rotation li:eq(" + int_home_rotate + ")").animate({ opacity:0 },1000); $("#home-main-position li:eq(" + int_home_rotate + ") img").attr("src","/images/home-button-black.png"); int_home_rotate++; if (int_home_rotate > int_all_rotation) { int_home_rotate = 0; } $("#home-rotation li:eq(" + int_home_rotate + ")").animate({ opacity:1 },1000); $("#home-main-position li:eq(" + int_home_rotate + ") img").attr("src","/images/home-button-ltgrey.png"); } function rotateSwitch(switchTo) { clearInterval(interval_rotation); $("#home-rotation li:eq(" + int_home_rotate + ")").animate({ opacity:0 },1000); $("#home-main-position li:eq(" + int_home_rotate + ") img").attr("src","/images/home-button-black.png"); int_home_rotate = switchTo; $("#home-rotation li:eq(" + switchTo + ")").animate({ opacity:1 },1000); $("#home-main-position li:eq(" + switchTo + ") img").attr("src","/images/home-button-ltgrey.png"); } function shipping(URL) { self.name = "main_window"; var popUp=window.open("/window-shipping.php","shippingB","width=460,height=310,scrollbars=1,toolbar=1"); popUp.focus(); } function shipMsg(message,qty,omaha,davenport,leadtime) { popUp=window.open("/window-shippingstatus.php?id=" + message + "&total=" + qty + "&o=" + omaha + "&d=" + davenport + "<=" + leadtime,"shippingstatusB","width=400,height=600,scrollbars=1"); popUp.focus() } function availMsg() { popUp=window.open('/availability.php',"shippingstatusB","width=600,height=550,scrollbars=1"); popUp.focus() } function checkEpage() { var parseThisString = $("#header_keywords").val(); var parseThisString = parseThisString.toLowerCase(); if (parseThisString.length = 5) { if (parseThisString.charAt(0) == 'e') { var numberPart = parseThisString.substring(1,5); if (isNaN(numberPart) == false) { window.location = "https://www.dultmeier.com/epage.php?epage=" + parseThisString.toUpperCase(); return false; } } } } function shippingNotice(field) { var rad_val = ""; for (var i=0; i < document.form_cartInformation.W317.length; i++) { if (document.form_cartInformation.W317[i].checked) { rad_val = document.form_cartInformation.W317[i].value; } } document.getElementById("ship_UPS").style.position = "absolute"; document.getElementById("ship_UPS").style.display = "none"; document.getElementById("ship_UP2").style.position = "absolute"; document.getElementById("ship_UP2").style.display = "none"; document.getElementById("ship_UP1").style.position = "absolute"; document.getElementById("ship_UP1").style.display = "none"; document.getElementById("ship_CPU").style.position = "absolute"; document.getElementById("ship_CPU").style.display = "none"; document.getElementById("ship_OTH").style.position = "absolute"; document.getElementById("ship_OTH").style.display = "none"; if (rad_val) { document.getElementById("ship_" + rad_val).style.position = "relative"; document.getElementById("ship_" + rad_val).style.display = "block"; } } function checkTextArea(field, maxl) { var tempField = field.value.substring(0,maxl); if (field.value.length > maxl) { field.value = tempField; } }