/*Copr©2009 Denver Braughler. ARR.*/

var t=window.location.href.split('/');t[2]=t[2].toLowerCase();if('www.'==t[2].substr(0,4)||'http:'==t[0]){_PageName=t.slice(3).join('/');document.write('<script type="text/javascript" src="/5.js"></script>');PG=''}

//*** UTILITY ***
function wpoison(a,b,t){return '<a href="&#109;ai'+'lto:'+a+'\100'+b.replace(/·/g,'.')+'">'+(''==t?a+'&#64;'+b:t)+'</a>'}
//function $(){var results=[],el,i;for(;i<arguments.length;++i){results.push(Element.extend($isStr(el=arguments[i])?ElGet(el):el))};return results.length<2?results[0]:results}
function ElGet(e){var el=document.getElementById(e);el||alert('[bad el Id: '+e+'] Please try to Refresh page.');return el}
function $isObj(e){return 'object'==typeof e}
function $isFun(e){return 'function'==typeof e}
function $isStr(e){return 'string'==typeof e}
function $isUndef(e){return 'undefined'==typeof e}
function Txt(e,newtxt,old){var el=ElGet(e);el.innerHTML=!old?newtxt:el.innerHTML.replace(old,newtxt)}
function TxtGet(e){return ElGet(e).innerHTML}
function TxtDisp(e,v){var i=0,j;e=e.split(',');for(;i<e.length;++i){j=e[i].split(':');TxtDispPut(j[0],j[1])}}
function TxtDispPut(e,v){ElGet(e).style.display=+v?'block':'none'}
function TxtShow(e){TxtDispPut(e,1)}
function TxtHide(e){TxtDispPut(e,0)}
function TxtVisPut(e,v){ElGet(e).style.visibility=+v?'visible':'hidden'}
function TxtVis(e){TxtVisPut(e,1)}
function TxtHid(e){TxtVisPut(e,0)}
function itemPhoto(e){var a1='»photo';e.innerHTML=a1==e.innerHTML?'«hide \x3Cimg src=\x20'+e.href+'\x20/\x3E':a1;e.blur();return false}
function ValueDefaultPut(e,x){if(''==ValueGet(e))ValuePut(e,x)}
function ValuePut(e,x){return ElGet(e).value=('function'==typeof x?x():x)}
function ValueGet(e){return ElGet(e).value}
function RadioGet(formId,name){var f=ElGet(formId).elements[name],i=0;for(;f.length>i;++i)if(f[i].checked)return f[i].value||i;return -1}
function SelectGet(e){e=ElGet(e);if(e)return e.options[e.selectedIndex]}
function SelectValueGet(e){e=ElGet(e);if(e)return e.options[e.selectedIndex].value}
function SelectValuePut(e,val){e=ElGet(e);if(e)for(var o=0;e.options.length>o;++o)if(e.options[o].value==val)e.selectedIndex=o}
function FunctionChain(f1,f2){if($isFun(f1))return f2;if($isFun(f2))return f1;return function(){f1();f2()}}
function loadManuSpec(anc){if(!anc)return;var e=ElGet('manuSpec');setTimeout("ElGet('manuSpec').style.height='675px'",4000);e.onload=function(){this.style.height='1350px'};e.src=anc.href}
function unframe(iframe){iframe.parentNode.innerHTML=window.frames[iframe.name].document.body.innerHTML}
function bodyOnload(x){URLparms();if(!PG)return;if(x){items();TxtShow('checkoutFt')};if('function'==typeof bodyload)bodyload();loadManuSpec(document.getElementById('manuSpecUrl'));_uacct='UA-1666245-1';
if('function'==typeof urchinTracker){urchinTracker();DB('_uacct='+_uacct+'; urchin ran')}
}
function bodyOnSearch(){return ElGet('words').value.length>1}
function items(){var ta=document.getElementsByTagName('td'),n=0,i,v,b=B();
for(;n<ta.length;++n){i=ta[n].innerHTML;if(i.match(/^\w\w\-\w\w\w[c|e]?$/)&&(ta[n-1].innerHTML=="")){v=getq(b,i);ta[n-1].innerHTML='<input type="text" class="quant" size="5" maxlength="4" onchange="this.value=p(this,\''+i+'\');this.style.backgroundColor=\'\'==this.value?\'#fff\':\'#ff0\'" value="'+v+'"'+(''==v?'':' style="background:#ff0"')+'/><span class="buy">buy</span>'}}}
function intLinks(){var ta=document.getElementsByTagName('a'),n=0,el,t;for(;n<ta.length;++n){el=ta[n];t=el.innerHTML;if(isWrong(t))el.innerHTML=correct(t);t=el.href;if(isWrong(t))el.href=correct(t)}function isWrong(s){return 'http://keith'==s.substr(0,12)}function correct(s){return 'https'+s.substr(4)}}

function URLparms(){PARMset('reload','');var ix,ip,pa=location.search,t='test,scan,pennies,topic'.split(','),i=0;
for(;i<t.length;++i)PARMset(t[i]+'$','');if(pa.length>1){if(-1!=(ix=pa.indexOf('#')))pa=pa.substr(0,ix-1);pa=pa.substr(1).split('&');for(ix=0;ix<pa.length;++ix){ip=pa[ix].split('=');PARMset(decode(ip[0]).toLowerCase()+'$',ip.length>1?parseparm(decode(ip[1])):'')}};(TEST=PARM('test$'))?Txt('a','<p>PARM: '+getCart('aa','')+'</p>\r'):0;return;function decode(v){return(v?unescape(v.replace(/\+/g,' ')):'')}function parseparm(v){return ''==v?'':'0'==v?0:'false'==v?false:'true'==v?true:v}}//get parameters from URL
function PARMset(i,q){var b='aa',c=getCart(b,i),j=c[0];c[!j?c.length:j]=i+'~'+q;setCart(b,c,'PARMset');return q}
function PARM(i){return getq('aa',i)}
function func(f){return $isFun(f)?f():void(0)}
function assert(cond,t){if(!cond)alert('Error: '+t)}
function DB(m){return 'undefined'!=typeof(TEST)&&TEST&&alert(m)}
function DUMP(o){var i='',p;for(p in o)i+=p+'='+o[p]+'\n';ElGet('ft1').innerHTML='<pre>'+i+'</pre>'}

function p(el,i){
var b=B(),k=gete(b,i,0),q=translateToNumeric(el.value);if(q.match(/^[0EeNnXx]*$/))q='X';
var d=item(i,'',400!=PG?PG:k[2]);//if(d.steel||d.cut)return s(i);
if('?'==q||null==(q=d.qNorm(q))){alert(d.Q.help());return ''};d.q=q;uo(b,d);
if(!CARTNOTICE&&2==getCart(b,'').length){400==PG||alert('To see your cart or to proceed with checking out, \nclick the Shopping cart button on the menu near the top of any page.');CARTNOTICE=true}
return ('X'==q||0==q)?'':q}
//*** Fast prompt
function g(i){//note: from a cached page, simply redirects to current page.
var b=B(),k=gete(b,i,0),q,d=item(i,!k[1]?'':+k[1],PG),desc=d.unit.d;if(desc)desc='['+desc.substring(0,75)+'...]';
//if(d.steel)return s(i);
//if(d.cut)return s(i);
q=prompt('Enter count (quantity) of item #'+i+'\n'+desc+(d.q?'...\n( enter "X" to remove )':''),d.q||1);
if(null==q)return void 0;
if(''==q||null==(q=d.qNorm(q)))return alert(d.Q.help());d.q=q;uo(b,d);
if(!CARTNOTICE&&2==getCart(b,'').length){alert('To see your cart or to proceed with checking out, \nclick the Shopping cart button on the menu near the top of any page.');CARTNOTICE=true}
return void 0}

//*** SPECIAL ***
var redrawTimeout=null;
function reloadfile(){alert('Page was not completely loaded or a JavaScript error occurred.');if(!PARM('reload')){PARMset('reload',1);setTimeout('location.reload(1)',2100)};return 1}
function s(i){var b=B(),w;if(i)ui(b,i,'',PG);URLparms();prompt('info required for cut/count/custom item');return !i?false:void 0}
function cartpage(b){location.replace(cartUrl(b));setTimeout('location.reload(false)',2)}
function cartUrl(b){return '/cart.htm?b='+b+(('undefined'!=typeof(TEST)&&TEST)?'&test='+TEST:'')+'#t'}
function goshop(){if(opener&&!opener.closed)opener.focus()}
function B(){var b=PARM('b$');return /^[A-Z][\d]$/.test(b)?b:PARMset('b$','C1')}
function c(){var i=editItem(B());if(!i)return i;if(!item(i)){('undefined'!=typeof(TEST)&&TEST)?alert('Unknown item #'+i):di(B(),i)}
else return 1}//called from cart.htm
function c2(b,d){assert($isStr(b),'@c2: b='+b);if(d.chg()){uo(b,d);cartRedraw();if(!getCart(b,'')[0])setTimeout('goshop()',9);return 1}}//callback from ask.htm
function editItem(b){var c=getCart(b,''),i=c[0];if(i)return i;if(''===i)return null;if(0!=i)c[0]='';setCart(b,c,'editItem');return ''}
function nextItem(c){var i=c[0],j=!i?0:itemCartPos(c,i),k=!j?'':idata(c[j]);
if(j&&''==k[1])return i;j=0;while(c.length>++j){k=idata(c[j]);if(k[0]&&''==k[1])return k[0]}return 0}//in cart c, return next item with no quantity
function ui(b,i,q,p){assert(null!=b&&''!=b,'b is null at ui');if(!i)return;//error?
var c=getCart(b,i),j=c[0],k;if(''==c[1])alert('@ui: c[1]=? from getCart');assert(c.length>0,'@ui: c is null');
q='0'==q?0:q;if(!j){j=c.length;k=[i]}else k=idata(c[j]);if(''!=q)k[1]=q;k[2]=p;c[j]=k.join('~');if('X'==q)c.splice(j,1);c[0]=''==q?i:nextItem(c);setCart(b,c,'ui')}//to basket b set item i with quantity q as seen on page p
function ub(b,i){assert(null!=b&&''!=b,'@ub: b==null');var k=gete(b,i,0),q,q1=k[1],d=item(i,q1,k[2]);if($isUndef(q1))DB('@ub: k='+k.join());
	if(null!=d){q=prompt('Item #'+i+': '+d.unit.d.substring(0,45)+'...\nEnter count (quantity):',q1||1);if(''==q||null==(q=d.qNorm(q))){alert(d.Q.help());return};
	if(q1==q)return;d.q=q;d.recalc('ub');uo(b,d)}}//in basket b prompt for quantity q of item i
function uo(b,d){var q=d.q;if(d.nro!=d.nr||'X'==q)di(b,d.nro);if('X'!=q)ui(b,d.nr,d.q,d.pg.nr)}//in basket b update according to changes in item object d
function sortCart(b,prop){var c=getCart(b,i),j=c.shift(),k;c.sort();c.unshift(j);setCart(b,c,'sC');cartpage(b)}

function di(b,i){ui(b,i,'X')}//from basket b delete item i
function diAll(b,i){//from basket b delete items i*
ui(b,i,'X');var c=getCart(b,''),nxtItem=c[0],j=0,k;while(c.length>++j){k=idata(c[j]);if(k[0].substr(0,i.length)==i)c.splice(j--,1)};c[0]=nxtItem;setCart(b,c,'diAll')}

function getq(b,i){return gete(b,i,1)}//for item/parm i in basket b return quantity q
function getpg(b,i){return gete(b,i,2)}//for item i in basket b return page p
function gete(b,i,e){assert($isStr(b),'@gete: b='+b);assert(i,'@gete: i='+i);var c=getCart(b,i),j=c[0];return 0==j?'':(j=idata(c[j]),e)?j[e]:j}//from item i in basket b return element e (for e=0: return all elements)
function getCart(b,i){assert(null!=b,'b is gone at getCart');b=b||B();var c=getCookie(b).split('&');c[0]=itemCartPos(c,i);return c}
function idata(v){return $isStr(v)?v.split('~'):[-1]}//[item#-options, quantity, page]
function itemBase(i){i=i.split(ICS);return[i[0],i[1]].join(ICS)}
function itemCartPos(c,i){if(''==i)return ''||('0'==c[0]?0:c[0]);for(var j=0;c.length>++j;)if(idata(c[j])[0]==i)return j;return 0}
function getCookie(b){var e=document.cookie.replace(/\s/g,'').split(';'),c=0,t;for(;c<e.length;++c)if((t=e[c].split('='))[0]==b)return 1==t.length||'&'==t[1]?'':t[1];return ''}
function emptyCart(b){if(confirm('Do you really want to empty all selections from your shopping cart?')){setCookie(b,'');setCookie('aa','');wipeCookies();PARMset('b$',b);cartpage(b)};return 0}
function wipeCookies(){var e=document.cookie.split(';'),c=0,b;for(;c<e.length;++c)if((b=e[c].split('=')[0]).length)setCookie(b,'')}
function setCart(b,c,caller){setCookie(b,'');//if(getCookie(b).length||('undefined'!=typeof(TEST)&&(TEST>2))){alert('cookies='+document.cookie);document.cookie=b+'=';document.cookie=b;setCookie(b,'')}
var c1=getCookie(b);if(''!=c1)Txt('ft1',TxtGet('ft1')+'<p class="tt">not empty: '+c1+' ['+c1.length+']</p>');
c=c.join('&').replace(/\s/g,'');
setCookie(b,c);c1=getCookie(b);if(c1==c)return;
var err='Unable to fill shopping cart '+b+' because your browser is not correctly storing cookies;\n @'+caller+':\n'+c+' ['+c.length+'] ==>\n'+c1+' ['+c1.length+']'
Txt('ft1',TxtGet('ft1')+'<p class="tt">'+err.replace(/\n/g,'<br />')+'</p>');
if('aa'!=b)alert(err)}
function setCookie(b,v){b=b.replace(/\s/g,'');if(''==b)return alert('Sorry, error 1');document.cookie=b+'='+v+';expires='+CookieDate(''==v?1:31E9)+';path=/'}
function CookieDate(ms){var e=new Date(),t=e.getTime()+ms;e.setTime(t-(1!=ms?t%864000000-18000000:0));return e.toGMTString()}

//*** VALIDATION ***
function parseq(q){return 'X'==q?q:'x'==q?'X':isNaN(q=parseInt(q,10))?null:q-0}
function translateToNumeric(n){return String(n).replace(/O/gi,'0').replace(/[l\|\!]/gi,'1').replace(/Z/gi,'2').replace(/S/gi,'5').replace(/B/g,'8')}
function stripNonDigits(n){return 'string'==typeof n?n.replace(/\D/g,''):n}

function ccType(n){if(''==n)return '';
if(n.match(/^5[1-5]/))return 'MasterCard';
if(n.match(/^4/))return 'VisaCard';
if(n.match(/^3[47]/))return 'AmExCard';
if(n.match(/^6011/))return 'DiscoverCard';
if(n.match(/^(30[0-5]|3[68]|38)/))return 'DinersClub';return '';
if(n.match(/^(3|1800|2131)/))return 'JCB';
return 'unknown'}

function ccLength(l,type){return true;switch(type){case '':return '';case 'MasterCard':;case 'DiscoverCard':return 16==l;case 'VisaCard':return 16==l||13==l;case 'AmExCard':return 15==l;case 'DinersClub':return 14==l;case 'JCB':return 15==l||16==l;default:return ''}}

function ccSumDigits(n){n=String(n);if(n.length%2)n='0'+n;for(var x=0,i=0,d;n.length>i;++i){d=+n.substr(i,1);d=+n.substr(i,1);x+=(i%2)?d:2*d-((5>d)?0:9)}return x%10}

function ccFormat(n,type){n=n.replace(/^\D+/g,'');return n}

function ccValidate(raw){var m,ok=false,cctype=ccType(n=stripNonDigits(raw=translateToNumeric(raw)));
if(''==n)m='Please supply a credit card number.';
else if(13>n.length)m='Please enter the complete credit card number from the front of your card.';
else if(n.length>16)m='Please enter the credit card number from the front of your card.  Verify that you did not add any extra digits.';
else if(2>cctype.length)m='Credit card number is invalid.  Please retype it.';
else if(!ccLength(String(n).length,cctype))m='Please retype card number from the front of your card and verify that you entered the correct number of digits';
else if(-1==cctype.indexOf('Card'))m='We cannot process '+cctype+' charges.  Please use MasterCard, Visa, DiscoverCard, or American Express.';
else if(ccSumDigits(n))m='Credit card number is invalid.  Please re-type the number.  If you still have trouble, call Keith\'s for assistance.';
else {ok=true;m='Credit card number appears to be correctly entered.'}
return {isValid:ok,formatted:ccFormat(raw,cctype),message:m,number:n,raw:raw,type:cctype};
}//ccValidate()

//*** constants ***
Function.prototype.method=function(name,func){this.prototype[name]=func};
if('function'!=typeof Array.prototype.splice)Array.method('splice',function(s,d){var max=Math.max,min=Math.min,a=[],e,i=max(arguments.length-2,0),k=0,l=this.length,n,v,x;s=s||0;if(0>s){s+=l}s=max(min(s,l),0);d=max(min(isNumber(d)?d:l,l-s),0);v=i-d;n=l+v;while (d>k){e=this[s+k];if(!$isUndef(e));a[k]=e;++k}x=l-d-s;if(0>v){k=s+i;for(;x--;++k)this[k]=this[k-v];this.length=n}else if(v>0){for(k=1;x--;++k)this[n-k]=this[l-k]}for(k=0;i>k;++k)this[s+k]=arguments[k+2];return a});
if('function'!=typeof document.getElementById)document.getElementById=function(e){return document.all?eval('document.all.'+e):document.layers&&false?eval('document.'+e):{id:e,style:{}}};
function upgrade(){alert('Please upgrade your browser');window.location='/info.browsers.htm'}

//*** FORMATTING ***
rj=function(s,w){s=''+s;while(w>s.length)s='\xA0'+s;return(s)}// right-justify text
fmtPrice=function(x){if(null==x)return [x,'none'];var l=(x=parseInt(x,10)+'').length;if(3>l){x='000'.substr(l)+x;l=3}return [x,x.substr(0,l-2)+'.'+x.substr(l-2)]}
fmtWt=function(x){return [x,null==x||''==x?'\xA0':+x>999?this.fmtPrice(x/10)[1]+'#':Math.ceil(x*1.6)/100+'oz']}
fmtUoM=function(x){return ''==x?['',' each','units']:[x,(0!=x?'/':' ')+UoM[x],UoM2[x]]}
fmtNotes=function(sr){assert($isStr(sr),'sr undef');if(!sr)return[0,'','','',''];sr=sr.split(';');var blist='',list='',mne=',',full='',e=0,r,v;for(;sr.length>e;e++){list+=','+(r=sr[e]);blist+=(v='['+r+']\xA0');mne+=ShipCode[r]+',';full+=(e?'<br />':'')+v+ShipRule[r]}
return [e,list.substr(1),blist,mne,'Note'+(1<e?'s':'')+':<tt> '+full+'</tt>']
}
prettyName=function(name){name=name.replace(/[^\w\.]+/g,' ').replace(/[\s]+/g,' ').replace(/^\s/g,'').replace(/\s$/g,'');name=name.charAt(0).toUpperCase()+name.substr(1);return name}

//*** HYPEREVENTS ***
function loadDoc(url,onloadfunc){function loadDocUpd(){if(4>req.readyState)return;if(200!=req.status)return alert("Error while attempting to retrieve data:\n"+req.statusText);if($isFun(onloadfunc)){req.onload=onloadfunc;req.onload()}}
if('file:'==document.location.protocol){
	var x=url.substr(url.indexOf('?')).split('&'),i=0,j,r='';while(x.length){j=x.pop();if('v='==j.substr(0,2)){j=j.substr(2).split('|');x=1;break}}
	if(x)while(j.length){i=j.shift();r+=i+'\t1234\t......................(item '+i+' description) ..........................................................\t500\t\t'+(6==i.length?'':2)+'\t\n'}
	else alert('@loadDoc: no iList');
	return {responseText:r}
}
var req=new XMLHttpRequest();req.onreadystatechange=loadDocUpd;req.open('GET',url,false);window.ActiveXObject?req.send():req.send(null);return req
}
//#//  native:
if(window.XMLHttpRequest);
//#//  MSIE:
else if(window.ActiveXObject){XMLHttpRequest=function(){return new ActiveXObject('Microsoft.XMLHTTP')}}
//#//  Opera or other:
else{XMLHttpRequest=function(){
	this.status=this.readyState=0;this.statusText=this.responseText='';this._Charset='ISO-8859-1';this._setReadyState=function(state){this.readyState=state};
	this.open=function(method,url,async){this.method=method;this.url=url;this._setReadyState(1)}
	this.send=function(data){if(!navigator.javaEnabled())return upgrade();this._setReadyState(2);
		var url=new java.net.URL(new java.net.URL(window.location.href),this.url),conn=url.openConnection(),i=0;
		if(this.method=='POST'){conn.setDoOutput(true);var wr=new java.io.OutputStreamWriter(conn.getOutputStream(),this._Charset);wr.write(data);wr.flush();wr.close()}
		var stream=conn.getInputStream();
		if(stream){this._setReadyState(3);var line,reader=new java.io.BufferedReader(new java.io.InputStreamReader(stream,this._Charset));
			while(null!=(line=reader.readLine()))this.responseText+=line+'\n';reader.close();this.status=200;this.statusText='OK';this._setReadyState(4);if(this.onload)this.onload()
		}
		else{this.status=404;this.statusText='Not Found';this._setReadyState(4);if(this.onerror)this.onerror()}//error
	}}
}


//*** DATABASE PARSING ***
function loadI(iList,dic){if(!iList)return;
var statuso=window.status;window.status='updating cart for item '+iList+'...';
if('inv'==dic&&!_I.length)iList+='|'+cartItems(B());
var i,j,k,req=loadDoc('/cgi-local/inv.cgi?a='+dic+'&v='+iList,null),l=req.responseText.split('\n');
DB(req.responseText);
window.status=statuso;
if('inv'!=dic)return l;
while(l.length){k=l.shift().split('\t');if(k.length){i=k.shift();_I[i]=k.join('\t')}}
return
}
function cartItems(b){var c=getCart(b,''),l='';c.shift();while(c.length)l+='|'+itemBase(idata(c.pop())[0]);return l.substr(1)+(-1!=l.indexOf('13-')?'|13-300|13-301':'')}

function item(i,q,p){DB('@item: i='+i+'; q='+q+'; pg='+p);
if('undefined'==typeof ICS){reloadfile();return null}
var j,o=i.split(ICS),cat=o.shift(),prop=o.shift(),ibase=cat+ICS+prop;if(!/^[0-9A-Z]{2,2}$/.test(cat)){alert('cat '+cat);return null}
if(!/^[0-9A-Z]{3,3}[a-z]?$/.test(prop))return null;
if('undefined'==typeof _I)alert('Sorry, error 2');if($isUndef(q))q='';
if('undefined'==typeof _I[i]||('string'!=typeof _I[i]))''===q||loadI(ibase,'inv');
if(!$isStr(j=_I[i])||(''==j))if(''===q)j='\t';else return DB('@item: null 2, q='+q),null;//allow bypass of loading when ''==q.
j=j.split('\t');var e=j.length,v;while(6>e)j[e++]='';
///if(PARM('pennies$'))j[0]=PENNIES;
var d={nr:i,nro:i,cut:'c'==i.charAt(6),ed:0,ICS:ICS,
	chg:function(){var x=this.nr!=this.nro||this.q!=this.qo||'X'==this.q;return x},
	base:{nr:ibase,d:j[1],sd:j[5],sr:j[3],p:fmtPrice(j[0]),u:fmtUoM(j[4]),w:fmtWt(j[2])},
	unit:{d:j[1],sd:j[5],p:fmtPrice(j[0]),u:fmtUoM(j[4]),w:fmtWt(j[2])},
	fmtLen:function(x){function fmtInch(x,v){v='NaN'!=v?this.L.INCHFRAC[v-97]:x?'':0;return (x||v?'\xA0':'')+(x?x:'')+(x&&v?'-':'')+v+'"'}if(!x)return '';var v=parseInt(x,10)+'',l=v.length;return v+'\''+(x.length>l?fmtInch(x.charCodeAt(l)-65,x.charCodeAt(l+1)):'')},//123Be=123' 2-1/2"
	fmtPrice:fmtPrice,fmtWt:fmtWt,priceOf:function(i,q){return item(i,q,'').p[0]},
	optPut:function(o,v){if(''==v)delete this.o[o];else this.o[o]=v;this.nr=this.base.nr;for(o=0;o<this.o.length;++o)this.nr+=this.ICS+o+this.o[o]},
	o:{},
	oilNoz:/^65\-[3-9]\d\d/.test(i),
	pg:{nr:'',set:function(p){this.nr=p;this.url=(p>1000000)?('k/'+(''+p).substr(2,2)+'-'+(''+p).substr(4)+'.htm'):!P[p]?'':(P[p]+'.htm')},url:''},
	q:q,qo:q,count:(2==j[4])?1:q,
	qNorm:function(q){return null==(q=parseq(q))?q:'X'==q?q:this.Q.min>q||q>this.Q.max?null:q}
};if(p)d.pg.set(p);while(o.length){e=o.shift();d.optPut(e.charAt(0),e.substr(1))}
j=fmtNotes(d.base.sr);d.notes={cnt:j[0],list:j[1],blist:j[2],mne:j[3],full:j[4]};
d.Q={min:0,max:2000,help:function(){return 'Quantity must be a counting number '+this.min+' to '+this.max+' (or 0 to remove from cart).'}};
if(d.cut){
	d.L={min:1,max:999,inc:1};
	d.cutPut=function(l){this.o.L=l};d.cutChrg=function(){return 0};
	if(!d.o.L)d.o.L=0;
	if((d.steel=13==cat)){d.L={min:0.5,max:20.75,inc:'',INCHFRAC:['','1/4','1/2','3/4']};
	d.cutPut=function(l,t){this.o.L=l;this.o.T=t};if(!d.o.T)d.o.T=2;
	d.cutChrg=function(){return !this.o.L?0:this.priceOf('13-301',this.o.T)+this.priceOf('13-300',1)};
	d.threadDesc=function(){var x=this.o.T;return '; '+(x?x:'no')+' thread'+(1!=x?'s':'')}
	}
	d.L.encode=function(x,inch,inchf){return x+(''==inch?'':String.fromCharCode(inch+65)+(inchf?String.fromCharCode(inchf+97):''))};d.L.ft=[0,'']
}
d.recalc=function(caller){
	var ft,q=this.q;
	if(0&&this.cut){
DB('['+caller+']: @recalc:\r KSS#'+d.nr+(';\r d.base.d='+d.base.d,'')+';\r d.q='+d.q+';\r d.o.L='+d.o.L);
		ft=parseInt(this.o.L);ft=ft?ft:'';ft=[ft,ft?ft+'\'':''];
		this.unit.p=this.fmtPrice(Math.round(ft[0]*this.base.p[0]+.1+this.cutChrg()));
		this.unit.w=this.fmtWt(Math.round(ft[0]*this.base.w[0]));
		this.unit.d=this.base.d+';<tt> cut to length '+ft[1]+(this.steel?this.threadDesc():'')+'</tt>';
		this.unit.u=fmtUoM('');
	}
	if(''==q){this.p=this.w=[0,''];this.count=0}else{
	this.count=2==this.base.u[0]?1:this.q;
	this.p=this.fmtPrice(Math.round(this.q*this.unit.p[0]));
	this.w=this.fmtWt(Math.round(this.q*this.unit.w[0]+.1))}
	this.sr=this.base.sr;
DB('['+caller+'] @recalc+: KSS#'+this.nr+';\n this.unit.d='+this.unit.d+';\n this.unit.w[0]='+this.unit.w[0]+'; this.base.w[0]='+this.base.w[0]+'; this.w[0]='+this.w[0]+';\n this.q='+this.q);
}
d.recalc('item()');

DB('@item+tail: KSS#'+d.nr+';\n d.unit.d='+d.unit.d+';\n d.q='+d.q);

return d}//build item detail object

//*** DICTIONARY ***
function sr(r){if(''==r)return '';var x=r.split(','),j=0;r='';while(x.length>j)r+='['+x[j]+']&nbsp;'+ShipCode[+x[j++]]+'<br />';return r}

SandH={basic:{handling:0,shipping:1100},UPS:{oversize1:450,oversize2:650,xtraHandling:600,zonex:[1050,1155,1180,1190,1220,1240,1260,1280,1300,1320,1375,1425]}};
CARTNOTICE=false;_I=[];TEST=false;

US='\t';ICS='-';UoM=['ea','box','ft','joint','pad','roll','pair','pkg','disc'];UoM2=['','boxes','feet','joints','pads','rolls','pairs','packages'];T="";S="ShipCodº?ctl¥c¾t¥MC¥hazmat¥fragile¥truck¼¼f¥©1¥©2¥©3¥©1°©2°©3°2µ°5µ°2µ+H/¸0¥¸µ«8«¸«15«50°s&h¥s/w\"];ShipRulºCu¿lengths gen¾allyÀanno¿b¯ret¹ned¥For you to p¹¶seªproduct,½mus¿hav¯aÀopy yo¹À¹ren¿|1À¾tificati» » file.¥²ick up³ a¿o¹ Mari» Cent¾ store.¥Hazardous mat¾ial -½can¬Becaus¯of th¯high risk of¨damage,½wi·¬Too larg¯for UPS, fre´ »ly¦¦.  ²¹¶s¯th¯fu·joint.±1.±2.±3.±1¢±2¢±3¢¥®2­¥®5­¥21'-¸­  ®¸0',Àa·for¨amount.¥®¸0' ro·s£1¤8§¤¸§¤15§¤50§¢¥No¨and handling ¶rg¯»³.¥Volumetric siz¯of³ m´ inc¹ additi»al¨¶rges in excess of we´.\"]";for(T=31;T--;)S=S.replace(eval("/"+String.fromCharCode(162+T)+"/g")," plus $5.00 UPS handling charge.?hipped UPS oversize ?.\",\"Full roll shipped by freight only; cut pieces up to ?\",\"?.¥Item must be cut to ship UPS, 8'-maximum pieces; over 8' is shipped freight?' shipped by UPS? shipping ?over? this ?¥truckcut?not shipªproduct.¥?0' s£1¢?Over ?e ?+H¥?¥S£?You must p?ªitem?ight?0©1?cha?ll ?10?ur?e=[0,\"?on?¥cut8? w¯?er?t ? c".split("?")[T]);eval(S);S=1;
	function RC(j,s){var x=j.charCodeAt(s);return x<127?0:200>x?NaN:200==x?1:201!=x?x-200:151<(x=j.charCodeAt(!s))?x:152>x?x+24:0}
	function expand(p,c){if(''==c)return c;if('~'==c)return p;var l,rc=RC(c,0);if(rc)c=p.substr(0,rc!=1?rc:0)+c.substr(55<rc?2:1);l=c.length-2;rc=RC(-1==l?' '+c:c.substr(l),1);if(rc)c=c.substr(0,(56>rc)+l)+p.substr(p.length-rc);return c}
P=['','','','','','','sale.new','Íspecials','','dwv.misc','Ìflex_and_culvert','Ìpvc_fittings','ÌrubberÑ','Ìsewer_drain_pipe_andÑ','Ìgasketed_sewer_main','Ìsewage_pumps','ÍumpÎ','','elec.misc','Íalarms','Íboxes_and_connectors','Ícable_wire','Îonduit_and_fittings','Ídevices_covers','ÍfastenË','Îuses','Ílights_bulbs_cords','Ípanels_breakers','Îigtails','Ítelephone_and_tv','Íweatherproof','fixt.bathtubs_showers','Ífaucets_parts','Íkitchen_sinks','Ílaundry','ÏvatoÊ','Ísupplies_traps','Ítoilets_parts','gas.line','Ð.Gastite','Ñregulators','hdw.fasteneÊ','Ìtools','Ñ.electrician','Òpower','','hvac.heating_units.compare.forced-air.gas','ÛAirEase','','hvac.heating_units.Burnham','ÛDucane','ÛModiÊ','Ñers','Ícirc_pumps','Ímisc','Ífilters','ÍhumidifiË','','hvac.parts.misc','Óac','Ógas_oil.controls','ÓAirEase','Ôrmstrong_and_Concorde','ÓBurnham','ÓCaleffi','ÓDucane_and_Reznor','ÓField','ÓHeil','Ôoneywell','Ü.AT','ÝC6','Þ7','ÝDP','ÝH','ÝLP','ÝM','ÝQ','ÝR','ÝS','ÝT','ÝUV','ÝVC','ÞP','ÝW','ÝZ','Ýcontrols','','hvac.parts.Miller','ÓRheem_and_Weatherking','Ôobertshaw','ÓTrane_and_American_Standard','ÓWhite-Rodgers','Ímotors_and_parts','ÍthermostaÊ','Íoil_burner.nozzles','Øparts','Ñtanks','Íhydronics','Íradiant_heat','Îegisters','Õ_boots','Ístack_and_fittings','Ïove_pipe','Ítin_ductwork','Ívent_pipe_and_fittings','Íductboard_and_flexduct','Îryer_vent','plum.brass','Ò.flare_fittings','Íchrome','Îompression_fittings','Ïpper','Îpvc_and_fittings','Ípvc.pipe','Òressure','Ísteel.pipe_and_nips','Óblack.fittings','ÓgalvanizedÑ','Ívalves','Ítubing','Ímisc','supp.chemicals','Íplumbing','Îvc','','water.lawn_and_garden','Ïine.pe','Óinsert_fittings','Îhose_clamps','Îline.pex','Îwell_supplies','Îpumps_parts','Ó.submersible','Îtanks.pressure','Ôstorage','Îheaters_parts','Îtreatment'];var i,j='';for(i in P)j=P[i]=expand(j,P[i]);