function printVerificationCode(){ document.write("BMW2007"); } function printVerificationTextfield(){ document.write(""); } var whichBrowser = navigator.appName; var whichVersion = parseFloat(navigator.appVersion); var isOld; if(((whichBrowser=='Microsoft Internet Explorer')&(whichVersion>=4)) | ((whichBrowser=='Netscape')&(whichVersion>=5))){ isOld = 0; removeOldBrowserAlert(); } else { isOld = 1; } var alreadyWarned = 0; function getPostOrderPrice(form,id){ if(isOld){ return; } var qty = 1; var type = ""; var value = ""; var price = form.price.value; var baseCost = eval(price); var totalCost = ""; for(var $i=0;$i
You'll still get our 30-Day Money-Back Guarantee and industry-leading 4 year warranty on speakers and subwoofer systems, except you save!

"; function displayBStockMessage(){ jQuery.prompt(bstockmsg,{ prefix:'ahqa', buttons:{ "Yes, I'll take B-Stock":1,"No, I'd like brand new":0 }, submit: function(v,m,f){ if(v && document.getElementById('bstockid')){ document.getElementById('bstockid').value = v; } //alert('Would be submitting form now since they selected one'); submitAddFormNow(); //return 1; } }); } var outofstockmsg = "
We're sorry, the product is currently on backorder.
You can choose to sign up on our waiting list and we will notify you as soon as the product is back in stock and available."; function displayOutOfStockMessage(){ jQuery.prompt(outofstockmsg,{ prefix:'ahqa', buttons:{ "Yes Please":1,"No Thanks":0 }, submit: function(v,m,f){ if(v){ toggle_element('boWaitList1','show'); toggle_element('boWaitList2','show'); } } }); } var gotourl = ''; function goToCart(){ if(!gotourl){ gotourl = 'viewCart.php'; } if(!go || go == '0'){ return; } else { document.location.href = gotourl; } } function displayIntlSaleRestriction(msg){ jQuery.prompt(msg,{ prefix:'ahqa', buttons:{ }, callback: goToCart }); } var cursku; function getWaitlistURL(){ opt = getKitOptionsSelected(); var surl = web + "/assets/ajax/getAlternateSKU.php?itemID=" + iid + "&sku=" + sku + "&nsid=" + nsid + "&opt=" + opt; jQuery.ajax({ url: surl, cache: false, success: function(html){ if(html != ''){ if(document.getElementById('alsku')){ document.getElementById('alsku').value = html; } var skurl = "/boWaitList.php?itemID=" + iid + "&sku=" + html; if(document.getElementById('wlfrm')){ document.getElementById('wlfrm').src = skurl; } } else { } }, error: function(o,m,e){ return 0; } }); } function openwaitlistform(surl){ } function displayWaitListSKUForm(surl){ opt = getKitOptionsSelected(); var surl = web + "/assets/ajax/getAlternateSKU.php?itemID=" + iid + "&sku=" + sku + "&nsid=" + nsid + "&opt=" + opt; jQuery.ajax({ url: surl, cache: false, success: function(html){ if(html != ''){ if(document.getElementById('alsku')){ document.getElementById('alsku').value = html; } var skurl = web + "/assets/ajax/addToWaitList.php?itemID=" + iid + "&sku=" + html; openwaitlistform(skurl); } else { } }, error: function(o,m,e){ return 0; } }); } function checkKitAvailability(frm,skipoptions){ if( !skipoptions ){ var opt = getKitOptionsSelected(frm); // opt will be false if not all the options are selected yet if( !opt ){ return 1; } } else { var opt = ''; } var availablecheck = makesureitsavailable(opt); } function showCheckingAvailability(){ if( document.getElementById('stockmessagechecking') ){ document.getElementById('stockmessagechecking').style.display = "block"; } if( document.getElementById('stockmessage') ){ document.getElementById('stockmessage').style.display = "none"; } if( document.getElementById('instockmessage') ){ document.getElementById('instockmessage').style.display = "none"; } if( document.getElementById('lowstockmessage') ){ document.getElementById('lowstockmessage').style.display = "none"; } if( document.getElementById('outofstockmessage') ){ document.getElementById('outofstockmessage').style.display = "none"; } } var isavailable = 1; function makesureitsavailable(opt){ if(!document.getElementById('stockstatusid') || document.getElementById('stockstatusid').value != '10'){ return; } showCheckingAvailability(); var surl = web + "/assets/ajax/isAvailable.php?itemID=" + iid + "&sku=" + sku + "&nsid=" + nsid + "&locid=" + locid + "&opt=" + opt; jQuery.ajax({ url: surl, cache: false, success: function(html){ if(document.getElementById('dchk')){ document.getElementById('dchk').value = 1; } if(html == '0'){ showOutOfStockMessage(); getWaitlistURL(); // only need this if out of stock } else if(html < lowstockthreshold ) { showLowStockMessage(); } else { showInStockMessage(); } }, error: function(o,m,e){ isavailable = 0; return 0; } }); } function showInStockMessage(){ if( document.getElementById('stockmessagechecking') ){ document.getElementById('stockmessagechecking').style.display = "none"; } if( document.getElementById('stockmessage') ){ document.getElementById('stockmessage').style.display = "none"; } if( document.getElementById('instockmessage') ){ document.getElementById('instockmessage').style.display = "block"; } if( document.getElementById('lowstockmessage') ){ document.getElementById('lowstockmessage').style.display = "none"; } if( document.getElementById('outofstockmessage') ){ document.getElementById('outofstockmessage').style.display = "none"; } } function showLowStockMessage(){ if( document.getElementById('stockmessagechecking') ){ document.getElementById('stockmessagechecking').style.display = "none"; } if( document.getElementById('stockmessage') ){ document.getElementById('stockmessage').style.display = "none"; } if( document.getElementById('instockmessage') ){ document.getElementById('instockmessage').style.display = "none"; } if( document.getElementById('lowstockmessage') ){ document.getElementById('lowstockmessage').style.display = "block"; } if( document.getElementById('outofstockmessage') ){ document.getElementById('outofstockmessage').style.display = "none"; } } function showOutOfStockMessage(){ if( document.getElementById('stockmessagechecking') ){ document.getElementById('stockmessagechecking').style.display = "none"; } if( document.getElementById('stockmessage') ){ document.getElementById('stockmessage').style.display = "none"; } if( document.getElementById('instockmessage') ){ document.getElementById('instockmessage').style.display = "none"; } if( document.getElementById('lowstockmessage') ){ document.getElementById('lowstockmessage').style.display = "none"; } if( document.getElementById('outofstockmessage') ){ document.getElementById('outofstockmessage').style.display = "block"; } } var lowstockthreshold = 4; var isavailable = 1; function submitavailability(){ if(document.getElementById('dchk') && document.getElementById('dchk').value == '1'){ checkforbstock(opt); return 0; } showCheckingAvailability(); var opt = getKitOptionsSelected(); if(opt && opt != ''){ getALTSKUNOW(opt); } var surl = web + "/assets/ajax/isAvailable.php?itemID=" + iid + "&sku=" + sku + "&nsid=" + nsid+ "&locid=" + locid + "&opt=" + opt; jQuery.ajax({ url: surl, cache: false, success: function(html){ if(document.getElementById('dchk')){ document.getElementById('dchk').value = 1; } if(html == '0'){ showOutOfStockMessage(); getWaitlistURL(); // only need this if out of stock } else if(html < lowstockthreshold ) { showLowStockMessage(); } else { showInStockMessage(); } checkforbstock(opt); // always check for bstock }, error: function(o,m,e){ isavailable = 0; getWaitlistURL(); checkforbstock(); //open_prompt('There was an error adding the product to your cart. Please try again.'); return 0; } }); } function submitadminavailability(){ if(document.getElementById('dchk') && document.getElementById('dchk').value == '1'){ checkforbstock(opt); return 0; } showCheckingAvailability(); var opt = getKitOptionsSelected(); if(opt && opt != ''){ getALTSKUNOW(opt); } var surl = web + "/assets/ajax/isAvailable.php?itemID=" + iid + "&sku=" + sku + "&nsid=" + nsid+ "&locid=" + locid + "&opt=" + opt; jQuery.ajax({ url: surl, cache: false, success: function(html){ if(document.getElementById('dchk')){ document.getElementById('dchk').value = 1; } if(html == '0'){ showOutOfStockMessage(); getWaitlistURL(); // only need this if out of stock } else if(html < lowstockthreshold ) { showLowStockMessage(); } else { showInStockMessage(); } checkforbstock(opt); // always check for bstock }, error: function(o,m,e){ isavailable = 0; getWaitlistURL(); checkforbstock(); //open_prompt('There was an error adding the product to your cart. Please try again.'); return 0; } }); } function checkforbstock(opt){ var isitreallybstock = 0; if(!opt || opt == ''){ opt = getKitOptionsSelected(); } var surl = web + "/assets/ajax/isBStock.php?itemID=" + iid + "&sku=" + sku + "&nsid=" + nsid + "&opt=" + opt; jQuery.ajax({ url: surl, cache: false, success: function(html){ if(html != '1'){ isitreallybstock = 0; // no b stock, just submit it submitAddFormNow(); } else { isitreallybstock = 1; if(document.getElementById('hasbstockid')){ document.getElementById('hasbstockid').value = 1; } displayBStockMessage(); } }, error: function(o,m,e){ // error checking bstock, just submit it //alert(surl + o + m + e); submitAddFormNow(); } }); } function validateAddForm(){ if( !checkoptions(document.getElementById('add_form'),250) ){ return 0; } if(document.getElementById('stockstatusid') && document.getElementById('stockstatusid').value == '10'){ submitavailability(); // this will check for availability and bstock, but only if } else { checkforbstock(); //submitAddFormNow(); } /** if(document.getElementById('hasbstockid') && document.getElementById('hasbstockid').value != 0 && document.getElementById('hasbstockid').value != ''){ //setTimeout ( "submitAddFormNow()", 15000 ); //displayBStockMessage(); } else { submitAddFormNow(); } */ return 0; } function submitAddFormNow(){ //alert('Would be submitting form now'); document.getElementById('add_form').submit(); } function getKitOptionsSelected(frm){ if( !frm ){ frm = document.getElementById('add_form'); } var selectedkitoptions = ''; if (document.images) { for (i=0;i