function checkExtras() { if (document.getElementById('product_form').bypassCheck && document.getElementById('product_form').bypassCheck == 1) return true; var extrasDelim = document.getElementById('check_extras'); if (extrasDelim && typeof extrasDelim == 'object') { extrasArr = extrasDelim.value.split(','); for (var i = 0; i < extrasArr.length; i++) { if (extrasArr[i].search('=') !== false) { var extraParts = extrasArr[i].split('='); if (parseInt(extraParts[0]) > 0) { var extraId = 'xtra_bool_' + extraParts[1]; var extraObj = document.getElementById(extraId); if (extraObj && typeof extraObj == 'object' && extraObj.checked == false) { showOptionAlert(extraParts[1]); return false; } } } } } return true; } function showOptionAlert(extraNum) { var pageId = document.getElementById('check_extras_page').value; thisBumbleBox = new bumbleBox('/?page_type=shop_option_alert_modal&extra_num=' + extraNum + '&page=' + pageId, 'Psst...', '320px', '450px', 'ajax'); thisBumbleBox.show(); } function optionAlertResubmit(extraNum) { if (extraNum && extraNum > 0) { document.getElementById('xtra_bool_' + extraNum).checked = true; } document.getElementById('product_form').bypassCheck = 1; document.getElementById('product_form').submit(); } function searchBoxShow() { var x = document.getElementsByClassName("top_search_box"); for (var i = 0; i < x.length; i++) { x[i].style.display = 'block'; x[i].style.opacity = '1'; } document.getElementById('top_search_box').style.display = 'block'; document.getElementById('top_search_box').style.opacity = '1'; document.getElementById('site_search_search').focus(); var x = document.getElementsByClassName("site_search_search"); for (var i = 0; i < x.length; i++) { x[i].focus(); } } function searchBoxHide() { if ( document.getElementById('site_search_search') === document.activeElement || document.getElementById('site_search_go') === document.activeElement || document.getElementById('site_search') === document.activeElement || document.getElementById('sitesearch') === document.activeElement || document.getElementById('top_search_box') === document.activeElement) { return 0; } else { var x = document.getElementsByClassName("top_search_box"); var i; for (i = 0; i < x.length; i++) { var thisEl = x[i]; (function(x) { setTimeout(function() { x.style.display = 'none'; }, 500); })(thisEl); thisEl.style.opacity = '0'; } window.setTimeout(function() { document.getElementById('top_search_box').style.display = 'none'; }, 500); document.getElementById('top_search_box').style.opacity = '0'; } } function searchBoxCheck() { window.setTimeout('searchBoxHide()', 200); } document.getElementById('top_search_button').onclick = function() { searchBoxShow(); return false; } document.getElementById('site_search_search').onblur = function() { searchBoxCheck(); }