var np=["ShopBoards_Pluto", "ShopBoards_USB2", "ShopBoards_PCI", "ShopRetro", "ShopFPGA_kits", "ShopFlashy", "ShopFlashyD", "ShopFlashyWidyAccessories", "ShopFlashyProbes", "", "ShopLCD_graphic", "ShopLCD_text", "ShopOpto-displays", "", "", "ShopI2C_accessories", "ShopI2C_displays", "ShopI2C_PLLs", "ShopI2C_master", "", "ShopAdapterBoardsTXDI", "ShopAdapterBoards", "", "", "", "ShopJTAGcables_USB", "ShopJTAGcables_Parallel", "ShopJTAGcables", "", "", "ShopCablesCustom", "ShopCablesProbing", "ShopCablesFlat", "ShopCablesExtension", "ShopCablesUSB", "ShopCablesPower", "", "", "ShopLab", "ShopSwitches", "ShopConnectors", "ShopHeaders", "ShopFPGA_CPLD", "ShopLogic", "ShopMemories", "ShopElectronicComponents", "ShopOptoElectronics", "ShopOscillators", "", "ShopShippingSurcharge"]; shop_email="shop@knjn.com"; shop_currency_code="USD"; shop_currency_name="USD"; shop_currency_symbol="$"; shop_rebate=1.0; SM=0; SMP=[0, 30, 90, 110]; var qsParm=[]; function QueryParameterStrings() {var query=window.location.search.substring(1);var parms=query.split('&');for(var i=0; i 0){var key=parms[i].substring(0,pos);var val=parms[i].substring(pos+1);qsParm[key]=val;}} } QueryParameterStrings(); var pg=qsParm['pg'];if(pg) pg=pg.toLowerCase(); var src=qsParm['src']; var srci=parseInt(src); var htmlfilename=window.location.pathname.substring(1,window.location.pathname.length-5); if(pg=='cat') document.write(''); var detailedview; var NewTableHeader_uniq=1; function NewTableHeader() { document.write('');if(NewTableHeader_uniq){document.write('');document.write('');NewTableHeader_uniq=0;} } function writeCookie(name, value, days) {if (days) {var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/"; } function readCookie(name) {var ca=document.cookie.split(';');var nameEQ=name + "=";for(var i=0; i=4){SM=0; result=false;}}}if(result){ for(; i> 1) ^ item ^ qty) % 64;} } return result; } var CartStr; function Cart_readCookie() { CartStr=readCookie('cart'); CartStrDecode(CartStr); } function Cart_writeCookie() { var cartxor=SM*7;for(var i=0; i0) cartxor=((cartxor << 15) ^ (cartxor >> 1) ^ i ^ CartQty[i]) & 0xFFFF;cartxor %= 64; CartStr='$' + CookieCharset.charAt(cartxor) + CookieCharset.charAt(SM^cartxor); for(var item=0; item0){CartStr=CartStr + CookieCharset.charAt((item%64)^cartxor) + CookieCharset.charAt((item/64%64)^cartxor) + CookieCharset.charAt((item/64/64)^cartxor) + CookieCharset.charAt((CartQty[item]%64)^cartxor) + CookieCharset.charAt((CartQty[item]/64)^cartxor); cartxor=((cartxor >> 1) ^ item ^ CartQty[item]) % 64;} CartStr=CartStr + '$';writeCookie('cart', CartStr, 7); } function ShippingHandling(price) {return price==0?0 : (price<25?7.95 : price<150?9.95 : 11.95) + SMP[SM]; } function Price00(price) {price1000='00' + Math.round(price*1000);nd=(price<0.10)?3 : 2;len=price1000.length; if(price==0)return '0.00';else if(price1000<1000)return '0.' + price1000.substring(len-3, len-3+nd);else return price1000.substring(2, len-3) + '.' + price1000.substring(len-3, len-3+nd); } function UnitPrice(item) { price=Math.abs(Itm[item][0]);if(price==1) return '0.01';nqd=price>100 && (Itm[item][0]%10==1); if(nqd) price-=1;price /= 100; rounding2=price>1?0.05 : price>0.1?0.01 : price>0.001?0.001 : 0;qty=CartQty[item];if(GlobalReduction) return Price00(price*(1-GlobalReduction/100)-rounding2);if(Itr[item]) price=price*(1-Itr[item][0]/100); var qty2=1;while(qty>=10) {qty=Math.floor(qty/10);qty2=qty2*10;}if(qty>=5) {qty=Math.floor(qty/5);qty2=qty2*5;}if(qty>=2) {qty=Math.floor(qty/2);qty2=qty2*2;} var ip=0;var baseprice; return Price00(price/2+(1/2*price*Math.exp(0.9*Math.log(qty2)))/qty2-rounding2); } function ShowCartQty(item) {if(CartQty[item]==undefined || Itm[item][0]<0) CartQty[item]=0;var price=UnitPrice(item);if(price>0) document.getElementById('price'+item).innerHTML=(CartQty[item]>0)?''+CartQty[item]*(Itq[item]?Itq[item] : 1) + ' x $' + price+'' : '(' + (Itq[item]?Itq[item] + ' @ ' : '') + '$' + price + ')';return price; } function CartQtyInc(item, inc) { qty=(CartQty[item]+inc-1)/(Itm[item][0]>50?32: Itm[item][0]>5?16 : 8);while(qty>=10) {qty=qty/10;inc=inc*10;}if(qty>=5) {qty=qty/5;inc=inc*5;}if(qty>=2) {qty=qty/2;inc=inc*2;} CartQty[item] += inc;if(CartQty[item]<0) CartQty[item]=0; else if(CartQty[item]>15) CartQty[item]=15;Cart_writeCookie();ShowItemsTotal(); if(inc>0) setTimeout(show_icon_sc, 1000); } function UpdateSM() {SM=0;Cart_writeCookie();ShowItemsTotal(); } function Add_ULlist(liststr) {if(liststr!=undefined && liststr.length>0){document.write('
    ');for(var i=0; i',liststr[i],'');document.write('
');} } function ItemInfo(item) { if(Itm[item].length>2) return Itm[item][2]; while(item>1000 && Ifo[item]==undefined) item--;return item; } function ItemIfo(itemlist, i) {while(i>0 && (itemlist[i]<0 || (Itm[itemlist[i]].length<=2 && Ifo[itemlist[i]]==undefined))) i--;return Itm[itemlist[i]].length>2?Itm[itemlist[i]][2] : itemlist[i]; } function pageTitle() {switch(pg){case 'shoppinginfo': return 'KNJN.com - Shopping information';case 'cart': return 'KNJN.com - Shopping cart';case 'docs': return 'KNJN.com - Documentation'; case 'pic': return 'KNJN.com - ' + (qsParm['title']?unescape(qsParm['title']) : src);case 'img': return 'KNJN.com - ' + Ifo[ItemInfo(srci)] + ' (item# ' + srci + ')';case 'item': return (src==undefined)?'KNJN.com - unknown item' : 'KNJN.com - ' + Itm[srci][1] + ' (item# ' + srci + ')';default: return 'KNJN.com';} } var ItemsList=[]; function ShowItemsTotal() {TotalCart=0;var TotalItem;var itemlast=0;var PayPal_i=0;var PC='';var str_cart='';var strchk='ABCDEFGHJKLMNPRSTUVWXYZ'; for(var i=0; i
shopping cart
'+'$'+Price00(TotalItem)+'
' : '$'+Price00(TotalItem); document.getElementById('total'+itemlast).innerHTML=TotalItem>0?totalstr : '';if(CartQty[item]>0){ PC=PC+ '/i, "") + (It2[item]?' ('+It2[item].replace(/]*>/i,"").replace(/<\/a>/i, "")+')' : '') +'">\n'; str_cart=str_cart+'Item '+item+strchk.charAt(item%4000%23)+' x '+(CartQty[item]*q)+' ('+encodeURIComponent(Itm[item][1])+')%0A';}}PC=PC + ''; if(!detailedview) document.getElementById('Total').innerHTML='$' + Price00(TotalCart); if(!detailedview) document.getElementById('cartlink').href="mailto:?subject=KNJN shopping cart&body=%0ATo load the shopping cart into your browser, use this link:%0Ahttp://www.knjn.com/shop.html?src="+CartStr+"%0A%0A"+str_cart;if(!detailedview) document.getElementById('cartlink2').href='http://www.knjn.com/shop.html?src=' + CartStr;if(!detailedview) document.getElementById('PayPal_cart').innerHTML=PC; }
ItemTotal ',shop_currency_symbol,'
(',shop_currency_name,')