if(typeof cK=="undefined") cK="Y"; if(typeof rS=="undefined") rS=""; if(typeof nS=="undefined") nS=""; if(typeof cS=="undefined") cS=""; cN="Cart="; tX=["Minnesota",6.5]; d0A=["Quantity Discounts"]; d1A=["CookBookStandard",300,600,225,650,150,700,90,750,30,800,10,850,5,900]; dA=[d0A,d1A]; var DT=new Date(); MO=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; mo=["January","Febuary","March","April","May","June","July","August","September","October","November","December"]; DY=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; YR=DT.getUTCFullYear()+1; dt=DT.getUTCDate(); mn=DT.getUTCMonth(); wD = new Date(mo[mn]+" 28, "+YR); wD = wD.getDay(); exp=DY[wD]+", 28-"+MO[mn]+"-"+YR; function gC() { hr=DT.getUTCHours(); hr=""+hr; if(hr.length==1) hr="0"+hr; mi=DT.getUTCMinutes()+1; mi=""+mi; if(mi.length==1) mi="0"+mi; wD = DT.getDay(); exp2=DY[wD]+", "+dt+"-"+MO[mn]+"-"+DT.getUTCFullYear()+" "+hr+":"+mi; cL(); if(cK!="N"){ xX='cN=~ZZZ'; wC(); if(document.cookie.indexOf('cN=~ZZZ')<0) cK="N"; else{ cK="Y"; document.cookie='cN=~ZZZ;path=/;expires=Fri, 1-Jan-1980 08:00:00 GMT'; } } if(cK=="Y"&&document.cookie.indexOf('PPubCart=')>-1&&(document.cookie.indexOf(' Cart=')<0&&document.cookie.indexOf('Cart=')!=0)){ sS=document.cookie.split("; "); tmp=["","",""]; for(i=0;i-1){ tmp[0]=tmp[0].substr(tmp[0].indexOf("[")); } else{ tmp[0]=""; } tmp[0]=tmp[0].split("^"); tmp[0]=tmp[0].join("+"); } xX=cN+tmp.join("~"); wC(); } if(cK=="Y"){ cS=""; sS=document.cookie.split("; "); for(i=0;i-1){ cS=cS.split("%23"); cS=cS.join("#"); cS=cS.split("%25"); cS=cS.join("%"); cS=cS.split("%26"); cS=cS.join("&"); cS=cS.split("%27"); cS=cS.join("'"); cS=cS.split("%28"); cS=cS.join("("); cS=cS.split("%29"); cS=cS.join(")"); cS=cS.split("%2B"); cS=cS.join("+"); cS=cS.split("%2F"); cS=cS.join("/"); cS=cS.split("%3F"); cS=cS.join("?"); cS=cS.split("%40"); cS=cS.join("@"); cS=cS.split("%5B"); cS=cS.join("["); cS=cS.split("%5C"); cS=cS.join(""); cS=cS.split("%5D"); cS=cS.join("]"); cS=cS.split("%5E"); cS=cS.join("^"); cS=cS.split("%7C"); cS=cS.join("|"); cS=cS.split("%7E"); cS=cS.join("~"); xX=cN+cS; wC(); } cS=cS.split("~"); if(cS.length==3){ rS=cS[1]; nS=cS[2]; cS=cS[0]; } if(rS=='') { rS=document.location.pathname+document.location.search; xX=cN+cS+"~"+rS+"~"+nS; wC(); } } bT=0; } function cL() { xX=""; yY=""; zZ=""; qN=0; qC=0; qZ=0; qY=0; qM=0; qB=0; } function wC() { if(cK=="Y") document.cookie=xX+yY+zZ+';path=/;expires='+exp+' 08:00:00 GMT'; } function bK() { rc=alert('You cannot enter "0" nor go below "0."'); } function aI() { gC(); if(cK=="N") return; TW=0; qI=0; sT=0; cS=cS.split("]"); qD=cS.length-1; for(i=0;i0;i=i-3) w=w.substr(0,i)+","+w.substr(i); xT=b+w+'.'+x; tT=b+w+'.'+y; } function sI() { xX=cN; for(i=0;i=dA[x][i]) dP=(z*100*dA[x][i+1])/100000; } function gI(x) { x=x.substr(1); x=x.split("|") tI=x[0]; tQ=x[1]; if(tQ=='A'||tQ=='B'||tQ=='C') zQ=1; else zQ=eval(tQ); tP=x[2]; dP=x[3]; qI+=zQ; xP=dP*zQ; sT+=xP; if(typeof gT=='undefined') gT=0; if(tQ!='B'&&tQ!='C') bT+=xP; if(tQ!='C') gT+=xP; tW=x[4]; tD=x[5]; if(typeof TW!='undefined') TW=TW+(tW*zQ); } function rI(x,y) { gC(); qD=x; cS=cS.split("]"); sI(); yY=""; wC(); if(y==1) window.location.reload(); } function cB() { go=0; if(confirm('Are you sure you want to ERASE everything in your Shopping Cart?')){ rB(); if(cK=="N"||php_shop=="Y"){ go=1; } } } function rB() { xX=cN+"~"+rS+"~"+nS; yY=""; zZ=""; wC(); } function iY() { yY='['+nI+'|'+nQ+'|'+nP+'|'+dP+'|'+nW+'|'+nD+'|'+nM+']'; wC(); } function yW(x) { wI=x.split("^"); wI=wI.join(" "); wI=wI.split("+"); wI=wI.join(" "); } function xW(x) { cI=x.split(" "); cI=cI.join("+"); } function UI(x) { gC(); for(i=0;i-1){ as="Subtract"; tf="from" } else{ nQ=Math.abs(nQ); nP=Math.abs(nP); } } if((nQ>0&&X1!='B')||(nP>0&&X1=='B')) { as="Add"; tf="to"; } if((nQ!=0&&X1!='B')||(nP!=0&&X1=='B')){ if(X1!='B') as+=' ('+Math.abs(nQ)+') of '+x[0]+' '+tf+' your Shopping Cart?'; else { fT(nP) tT=tT.split("-"); tT=tT.join(""); as+=' '+x[0]+' for $ '+tT+' to your shopping cart?'; } if(nI.indexOf('eBay')<0) var e=0; else var e=1; qI=0; sT=0; f=0; go=0; if(e==0) if(confirm(as)){ var f=1; if(cK=="N"||php_shop=="Y"){ go=1; return; } } if(f==1||e==1) { if(cS.indexOf("["+nI+"|")>-1){ var CS=cS.split("]"); for(i=0;i=0) tT='$'+tT; else tT='-$'+tT.substr(1); S3='Subt: '+tT; } function BI() { zI(); if(cK=="N") return; document.S.s1.value=S1; document.S.s2.value=S2; document.S.s3.value=S3; } function GC(x) { if(x.NM.value=='') { alert('Please enter the name of the recipient of the gift certificate!'); return false; } else { gn = Math.round(Math.random()*10000000);gn = gn.toString(16); g2 = Math.round(Math.random()*10000000);gn += g2.toString(16); x.nI.value = 'Gift Certif. #'+gn.toUpperCase()+' for '+x.NM.value; } if(x.EM.value!='') { if(/\S+@\S+[.]\S+/.test(x.EM.value)==false) { alert('The email address you entered does not appear to be valid.'); return false; } x.nI.value += ' ('+x.EM.value+')'; } bI(x.nI.value+'|QB|P'+x.nP.value); }