var displayCart = 'false'; function enableSubmit(form) { form.submitButton.disabled=false; } function disableSubmit(form) { if (form.searchText.value == '') { form.submitButton.disabled=true; } } function disableSearch(form) { form.submitButton.disabled=true; } function addToCart(key, qty, aForm) { aForm.addBTKey.value=key; aForm.addQty.value=qty; aForm.cartAction.value='A'; displayCart = 'true'; } function clearAddress() { document.shipForm.shippingName.value = ''; document.shipForm.shippingStreet1.value = ''; document.shipForm.shippingStreet2.value = ''; document.shipForm.shippingStreet3.value = ''; document.shipForm.shippingCity.value = ''; document.shipForm.shippingState.value = ''; document.shipForm.shippingZip.value = ''; document.shipForm.shippingCountry.value = 0; document.shipForm.shippingTelephone.value = ''; document.shipForm.shippingTelephoneArea.value = ''; document.shipForm.shippingTelephoneNPA.value = ''; document.shipForm.shippingTelephoneNXX.value = ''; document.shipForm.shippingAddressNum.value = 0; document.shipForm.shippingAddressNumString.value = '0'; if(document.shipForm.addressRadio != null) { document.shipForm.addressRadio.checked = false; for(var i = 0; i < document.shipForm.addressRadio.length; i++) { if(document.shipForm.addressRadio[i].checked == true) { document.shipForm.addressRadio[i].checked = false; } } } } function TabNext(obj,event,len,next_field) { phone_field_length=0; if (event == "down") { phone_field_length=obj.value.length; } else if (event == "up") { if (obj.value.length != phone_field_length) { phone_field_length=obj.value.length; if (phone_field_length == len) { next_field.focus(); } } } } function openWindow(url) { popupWin = window.open(url, 'remote','menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, dependent, width=500, height=260, left=50, top=50') } function openLargeWindow(url) { popupWin = window.open(url, 'remote','menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, dependent, width=700, height=800, left=50, top=50') } function setTelephoneNum() { document.shipForm.shippingTelephone.value = document.shipForm.shippingTelephoneArea.value + document.shipForm.shippingTelephoneNPA.value + document.shipForm.shippingTelephoneNXX.value; } function setBillingPhoneNum() { document.billingInfoForm.billingPhone.value = document.billingInfoForm.billingArea.value + document.billingInfoForm.billingNpa.value + document.billingInfoForm.billingNxx.value; } function guestSignIn() { document.loginForm.guestSignin.value='Y'; document.loginForm.submit(); } function initPage(indexVal) { document.getElementById('selectSearch').value = indexVal; } function loadCheckout() { var userBrowser = navigator.appName; if(userBrowser == 'Microsoft Internet Explorer') { var inputElements = document.getElementsByTagName("input"); for(var i = 0; i < inputElements.length; i++) { if(inputElements[i].className && inputElements[i].className.indexOf("disableAutoComplete" != -1)) { inputElements[i].setAttribute("autocomplete", "off"); } } } } function removeFromCart(key, line, aForm) { aForm.addBTKey.value=key; aForm.addQty.value=0; aForm.lineNumber.value=line; aForm.cartAction.value='UL'; } function saveLineValue(name, value) { document.getElementById(name).value=value; } function saveShipValue(ship, aForm) { aForm.shipMethod.value=ship; } function saveNewValue(changeValue, line) { document.getElementById("cartItems" + line).value=changeValue; } function setSearch(zone, catalog, target, query, oForm) { oForm.zoneID.value=zone; oForm.zoneCatalogID.value =catalog; oForm.btnValues.value=target; oForm.query.value=query; } function setFashion(target, query, color, gendersize, oForm) { oForm.btnValues.value=target; oForm.query.value=query; oForm.color.value=color; oForm.gendersize.value=gendersize; } function set(target, query, oForm) { oForm.btnValues.value=target; oForm.query.value=query; } function setSort(sort, oForm) { oForm.selectSort.value=sort; } function setCategory(category, oForm) { oForm.category.value=category; } function setTracks(target, query, discNum, trackNum, oForm) { oForm.btnValues.value=target; oForm.query.value=query; oForm.discNum.value=discNum; oForm.trackNum.value=trackNum; } function setBtnValue(target, oForm) { oForm.btnValues.value=target; } function setProductType(type, oForm) { oForm.productType.value=type; } function setBrowseType(type, oForm) { oForm.browseType.value=type; } function setSearchText(text, oForm) { oForm.searchText.value=text; } function setSearchID(id, oForm) { oForm.searchID.value=id; } function setCartToCheckout() { document.cartForm.returnPage.value='buynow'; } function setShippingAddress(name, street1, street2, street3, city, state, zip, phone, country, addressnum) { document.shipForm.shippingName.value = name; document.shipForm.shippingStreet1.value = street1; document.shipForm.shippingStreet2.value = street2; document.shipForm.shippingStreet3.value = street3; document.shipForm.shippingCity.value = city; document.shipForm.shippingState.value = state; document.shipForm.shippingZip.value = zip; document.shipForm.shippingCountry.value = country; document.shipForm.shippingTelephone.value = phone; if (phone.length == 10) { document.shipForm.shippingTelephoneArea.value = phone.substring(0,3); document.shipForm.shippingTelephoneNPA.value = phone.substring(3,6); document.shipForm.shippingTelephoneNXX.value = phone.substring(6,10); } document.shipForm.shippingAddressNum.value = addressnum; document.shipForm.shippingAddressNumString.value = addressnum; } function setShowAll(num) { document.shipForm.showAll.value = num; document.shipForm.submit(); } function setTab(tab) { var tdElement = 'td_' + prev; var divElement = 'div_' + prev; var tableElement = 'table_' + prev; document.all[tdElement].className="tab" document.all[divElement].className="boxtop" document.all[tableElement].className="tabtest" prev = tab; tdElement = 'td_' + tab; divElement = 'div_' + tab; tableElement = 'table_' + tab; document.all[tdElement].className="tab on" document.all[divElement].className="boxtop on" document.all[tableElement].className="tabtest2" } function updateAddress(action) { document.shipForm.action.value = action; document.shipForm.submit(); } function updateAllItems(aForm) { aForm.cartAction.value='U'; aForm.submit(); } function updateCart(key, lineItem, lineNum, aForm) { aForm.addBTKey.value=key; aForm.addQty.value=document.getElementById("cartItems" + lineItem).value; aForm.lineNumber.value=lineNum; aForm.cartAction.value='UL'; } function updateShipping() { document.cartForm.cartAction.value='US'; document.cartForm.submit(); } function isEmpty(s) { return ((s == null) || (s.length == 0) || (s == "")) } function isNull(a) { return typeof a == 'object' && !a; }