diff --git a/simpleCart.js b/simpleCart.js
index b578fb4..48b6ad6 100755
--- a/simpleCart.js
+++ b/simpleCart.js
@@ -949,6 +949,12 @@
}
+ // add custom pass-through variable
+ if (opts.custom) {
+ data.custom = opts.custom;
+ }
+
+
// add all the items to the form data
simpleCart.each(function (item,x) {
var counter = x+1,
diff --git a/simpleCart.min.js b/simpleCart.min.js
index 78773ee..17dde8c 100755
--- a/simpleCart.min.js
+++ b/simpleCart.min.js
@@ -1,52 +1 @@
-(function(n,f){var r="string",j=function(e,f){return typeof e===f},e=function(e){return j(e,"undefined")},h=function(e){return j(e,"function")},x=function(e){return"object"===typeof HTMLElement?e instanceof HTMLElement:"object"===typeof e&&1===e.nodeType&&"string"===typeof e.nodeName},B=function(l){function D(a){return b.extend({attr:"",label:"",view:"attr",text:"",className:"",hide:!1},a||{})}function E(){if(!b.isReady){try{f.documentElement.doScroll("left")}catch(a){setTimeout(E,1);return}b.init()}}
-var s={MooTools:"$$",Prototype:"$$",jQuery:"*"},p=0,q={},w=l||"simpleCart",y={};l={};l={};var u=n.localStorage,k=n.console||{msgs:[],log:function(a){k.msgs.push(a)}},C={USD:{code:"USD",symbol:"$",name:"US Dollar"},AUD:{code:"AUD",symbol:"$",name:"Australian Dollar"},BRL:{code:"BRL",symbol:"R$",name:"Brazilian Real"},CAD:{code:"CAD",symbol:"$",name:"Canadian Dollar"},CZK:{code:"CZK",symbol:" Kč",name:"Czech Koruna",after:!0},DKK:{code:"DKK",symbol:"DKK ",name:"Danish Krone"},
-EUR:{code:"EUR",symbol:"€",name:"Euro"},HKD:{code:"HKD",symbol:"$",name:"Hong Kong Dollar"},HUF:{code:"HUF",symbol:"Ft",name:"Hungarian Forint"},ILS:{code:"ILS",symbol:"₪",name:"Israeli New Sheqel"},JPY:{code:"JPY",symbol:"¥",name:"Japanese Yen"},MXN:{code:"MXN",symbol:"$",name:"Mexican Peso"},NOK:{code:"NOK",symbol:"NOK ",name:"Norwegian Krone"},NZD:{code:"NZD",symbol:"$",name:"New Zealand Dollar"},PLN:{code:"PLN",symbol:"PLN ",name:"Polish Zloty"},GBP:{code:"GBP",
-symbol:"£",name:"Pound Sterling"},SGD:{code:"SGD",symbol:"$",name:"Singapore Dollar"},SEK:{code:"SEK",symbol:"SEK ",name:"Swedish Krona"},CHF:{code:"CHF",symbol:"CHF ",name:"Swiss Franc"},THB:{code:"THB",symbol:"฿",name:"Thai Baht"},BTC:{code:"BTC",symbol:" BTC",name:"Bitcoin",accuracy:4,after:!0}},m={checkout:{type:"PayPal",email:"you@yours.com"},currency:"USD",language:"english-us",cartStyle:"div",cartColumns:[{attr:"name",label:"Name"},{attr:"price",label:"Price",view:"currency"},
-{view:"decrement",label:!1},{attr:"quantity",label:"Qty"},{view:"increment",label:!1},{attr:"total",label:"SubTotal",view:"currency"},{view:"remove",text:"Remove",label:!1}],excludeFromCheckout:["thumb"],shippingFlatRate:0,shippingQuantityRate:0,shippingTotalRate:0,shippingCustom:null,taxRate:0,taxShipping:!1,data:{}},b=function(a){if(h(a))return b.ready(a);if(j(a,"object"))return b.extend(m,a)},z,A;b.extend=function(a,d){var c;e(d)&&(d=a,a=b);for(c in d)Object.prototype.hasOwnProperty.call(d,c)&&
-(a[c]=d[c]);return a};b.extend({copy:function(a){a=B(a);a.init();return a}});b.extend({isReady:!1,add:function(a,d){var c=new b.Item(a||{}),g=!0,t=!0===d?d:!1;if(!t&&(g=b.trigger("beforeAdd",[c]),!1===g))return!1;(g=b.has(c))?(g.increment(c.quantity()),c=g):q[c.id()]=c;b.update();t||b.trigger("afterAdd",[c,e(g)]);return c},each:function(a,d){var c,g=0,t,e,v;if(h(a))e=a,v=q;else if(h(d))e=d,v=a;else return;for(c in v)if(Object.prototype.hasOwnProperty.call(v,c)){t=e.call(b,v[c],g,c);if(!1===t)break;
-g+=1}},find:function(a){var d=[];if(j(q[a],"object"))return q[a];if(j(a,"object"))return b.each(function(c){var g=!0;b.each(a,function(a,b,d){j(a,r)?a.match(/<=.*/)?(a=parseFloat(a.replace("<=","")),c.get(d)&&parseFloat(c.get(d))<=a||(g=!1)):a.match(/)?(a=parseFloat(a.replace("<","")),c.get(d)&&parseFloat(c.get(d))=/)?(a=parseFloat(a.replace(">=","")),c.get(d)&&parseFloat(c.get(d))>=a||(g=!1)):a.match(/>/)?(a=parseFloat(a.replace(">","")),c.get(d)&&parseFloat(c.get(d))>a||
-(g=!1)):c.get(d)&&c.get(d)===a||(g=!1):c.get(d)&&c.get(d)===a||(g=!1);return g});g&&d.push(c)}),d;e(a)&&b.each(function(a){d.push(a)});return d},items:function(){return this.find()},has:function(a){var d=!1;b.each(function(b){b.equals(a)&&(d=b)});return d},empty:function(){var a={};b.each(function(b){!1===b.remove(!0)&&(a[b.id()]=b)});q=a;b.update()},quantity:function(){var a=0;b.each(function(b){a+=b.quantity()});return a},total:function(){var a=0;b.each(function(b){a+=b.total()});return a},grandTotal:function(){return b.total()+
-b.tax()+b.shipping()},update:function(){b.save();b.trigger("update")},init:function(){b.load();b.update();b.ready()},$:function(a){return new b.ELEMENT(a)},$create:function(a){return b.$(f.createElement(a))},setupViewTool:function(){var a,d=n,c;for(c in s)if(Object.prototype.hasOwnProperty.call(s,c)&&n[c]&&(a=s[c].replace("*",c).split("."),(a=a.shift())&&(d=d[a]),"function"===typeof d)){z=d;b.extend(b.ELEMENT._,y[c]);break}},ids:function(){var a=[];b.each(function(b){a.push(b.id())});return a},save:function(){b.trigger("beforeSave");
-var a={};b.each(function(d){a[d.id()]=b.extend(d.fields(),d.options())});u.setItem(w+"_items",JSON.stringify(a));b.trigger("afterSave")},load:function(){q={};var a=u.getItem(w+"_items");if(a){try{b.each(JSON.parse(a),function(a){b.add(a,!0)})}catch(d){b.error("Error Loading data: "+d)}b.trigger("load")}},ready:function(a){h(a)?b.isReady?a.call(b):b.bind("ready",a):e(a)&&!b.isReady&&(b.trigger("ready"),b.isReady=!0)},error:function(a){var d="";j(a,r)?d=a:j(a,"object")&&j(a.message,r)&&(d=a.message);
-try{k.log("simpleCart(js) Error: "+d)}catch(c){}b.trigger("error",a)}});b.extend({tax:function(){var a=m.taxShipping?b.total()+b.shipping():b.total(),d=b.taxRate()*a;b.each(function(a){a.get("tax")?d+=a.get("tax"):a.get("taxRate")&&(d+=a.get("taxRate")*a.total())});return parseFloat(d)},taxRate:function(){return m.taxRate||0},shipping:function(a){if(h(a))b({shippingCustom:a});else{var d=m.shippingQuantityRate*b.quantity()+m.shippingTotalRate*b.total()+m.shippingFlatRate;h(m.shippingCustom)&&(d+=m.shippingCustom.call(b));
-b.each(function(a){d+=parseFloat(a.get("shipping")||0)});return parseFloat(d)}}});A={attr:function(a,b){return a.get(b.attr)||""},currency:function(a,d){return b.toCurrency(a.get(d.attr)||0)},link:function(a,b){return""+b.text+""},decrement:function(a,b){return""+(b.text||"-")+""},increment:function(a,b){return""+(b.text||"+")+""},image:function(a,b){return"
"},input:function(a,b){return""},remove:function(a,b){return""+(b.text||"X")+""}};b.extend({writeCart:function(a){var d=m.cartStyle.toLowerCase(),c="table"===d,g=c?"tr":"div",t=c?"th":"div",e=c?"td":"div",v=b.$create(d),d=b.$create(g).addClass("headerRow"),f,h;b.$(a).html(" ").append(v);v.append(d);c=0;for(h=m.cartColumns.length;cc.price&&(c.price=0);j(c.quantity,r)&&(c.quantity=parseInt(c.quantity.replace(b.currency().delimiter,""),10));isNaN(c.quantity)&&(c.quantity=1);0>=c.quantity&&g.remove()}var c={},g=this;j(a,"object")&&b.extend(c,a);p+=1;for(c.id=
-c.id||"SCI-"+p;!e(q[c.id]);)p+=1,c.id="SCI-"+p;g.get=function(a,b){var d=!b;return e(a)?a:h(c[a])?c[a].call(g):!e(c[a])?c[a]:h(g[a])&&d?g[a].call(g):!e(g[a])&&d?g[a]:c[a]};g.set=function(a,b){e(a)||(c[a.toLowerCase()]=b,("price"===a.toLowerCase()||"quantity"===a.toLowerCase())&&d());return g};g.equals=function(a){for(var b in c)if(Object.prototype.hasOwnProperty.call(c,b)&&"quantity"!==b&&"id"!==b&&a.get(b)!==c[b])return!1;return!0};g.options=function(){var a={};b.each(c,function(d,c,e){var f=!0;
-b.each(g.reservedFields(),function(a){a===e&&(f=!1);return f});f&&(a[e]=g.get(e))});return a};d()};b.Item._=b.Item.prototype={increment:function(a){a=parseInt(a||1,10);this.quantity(this.quantity()+a);return 1>this.quantity()?(this.remove(),null):this},decrement:function(a){return this.increment(-parseInt(a||1,10))},remove:function(a){if(!1===b.trigger("beforeRemove",[q[this.id()]]))return!1;delete q[this.id()];a||b.update();return null},reservedFields:function(){return"quantity id item_number price name shipping tax taxRate".split(" ")},
-fields:function(){var a={},d=this;b.each(d.reservedFields(),function(b){d.get(b)&&(a[b]=d.get(b))});return a},quantity:function(a){return e(a)?parseInt(this.get("quantity",!0)||1,10):this.set("quantity",a)},price:function(a){return e(a)?parseFloat(this.get("price",!0).toString().replace(b.currency().symbol,"").replace(b.currency().delimiter,"")||1):this.set("price",parseFloat(a.toString().replace(b.currency().symbol,"").replace(b.currency().delimiter,"")))},id:function(){return this.get("id",!1)},
-total:function(){return this.quantity()*this.price()}};b.extend({checkout:function(){if("custom"===m.checkout.type.toLowerCase()&&h(m.checkout.fn))m.checkout.fn.call(b,m.checkout);else if(h(b.checkout[m.checkout.type])){var a=b.checkout[m.checkout.type].call(b,m.checkout);a.data&&a.action&&a.method&&!1!==b.trigger("beforeCheckout",[a.data])&&b.generateAndSendForm(a)}else b.error("No Valid Checkout Method Specified")},extendCheckout:function(a){return b.extend(b.checkout,a)},generateAndSendForm:function(a){var d=
-b.$create("form");d.attr("style","display:none;");d.attr("action",a.action);d.attr("method",a.method);b.each(a.data,function(a,g,e){d.append(b.$create("input").attr("type","hidden").attr("name",e).val(a))});b.$("body").append(d);d.el.submit();d.remove()}});b.extendCheckout({PayPal:function(a){if(!a.email)return b.error("No email provided for PayPal checkout");var d={cmd:"_cart",upload:"1",currency_code:b.currency().code,business:a.email,rm:"GET"===a.method?"0":"2",tax_cart:(1*b.tax()).toFixed(2),
-handling_cart:(1*b.shipping()).toFixed(2),charset:"utf-8"},c=a.sandbox?"https://www.sandbox.paypal.com/cgi-bin/webscr":"https://www.paypal.com/cgi-bin/webscr",g="GET"===a.method?"GET":"POST";a.success&&(d["return"]=a.success);a.cancel&&(d.cancel_return=a.cancel);a.notify&&(d.notify_url=a.notify);b.each(function(a,c){var g=c+1,e=a.options(),f=0,h;d["item_name_"+g]=a.get("name");d["quantity_"+g]=a.quantity();d["amount_"+g]=(1*a.price()).toFixed(2);d["item_number_"+g]=a.get("item_number")||g;b.each(e,
-function(a,c,e){10>c&&(h=!0,b.each(m.excludeFromCheckout,function(a){a===e&&(h=!1)}),h&&(f+=1,d["on"+c+"_"+g]=e,d["os"+c+"_"+g]=a))});d["option_index_"+c]=Math.min(10,f)});return{action:c,method:g,data:d}},GoogleCheckout:function(a){if(!a.merchantID)return b.error("No merchant id provided for GoogleCheckout");if("USD"!==b.currency().code&&"GBP"!==b.currency().code)return b.error("Google Checkout only accepts USD and GBP");var d={ship_method_name_1:"Shipping",ship_method_price_1:b.shipping(),ship_method_currency_1:b.currency().code,
-_charset_:""},c="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/"+a.merchantID;a="GET"===a.method?"GET":"POST";b.each(function(a,c){var e=c+1,f=[],h;d["item_name_"+e]=a.get("name");d["item_quantity_"+e]=a.quantity();d["item_price_"+e]=a.price();d["item_currency_ "+e]=b.currency().code;d["item_tax_rate"+e]=a.get("taxRate")||b.taxRate();b.each(a.options(),function(a,d,c){h=!0;b.each(m.excludeFromCheckout,function(a){a===c&&(h=!1)});h&&f.push(c+": "+a)});d["item_description_"+e]=f.join(", ")});
-return{action:c,method:a,data:d}},AmazonPayments:function(a){if(!a.merchant_signature)return b.error("No merchant signature provided for Amazon Payments");if(!a.merchant_id)return b.error("No merchant id provided for Amazon Payments");if(!a.aws_access_key_id)return b.error("No AWS access key id provided for Amazon Payments");var d={aws_access_key_id:a.aws_access_key_id,merchant_signature:a.merchant_signature,currency_code:b.currency().code,tax_rate:b.taxRate(),weight_unit:a.weight_unit||"lb"},c="https://payments"+
-(a.sandbox?"-sandbox":"")+".amazon.com/checkout/"+a.merchant_id,g="GET"===a.method?"GET":"POST";b.each(function(c,g){var e=g+1,f=[];d["item_title_"+e]=c.get("name");d["item_quantity_"+e]=c.quantity();d["item_price_"+e]=c.price();d["item_sku_ "+e]=c.get("sku")||c.id();d["item_merchant_id_"+e]=a.merchant_id;c.get("weight")&&(d["item_weight_"+e]=c.get("weight"));m.shippingQuantityRate&&(d["shipping_method_price_per_unit_rate_"+e]=m.shippingQuantityRate);b.each(c.options(),function(a,d,c){var g=!0;b.each(m.excludeFromCheckout,
-function(a){a===c&&(g=!1)});g&&("weight"!==c&&"tax"!==c)&&f.push(c+": "+a)});d["item_description_"+e]=f.join(", ")});return{action:c,method:g,data:d}},SendForm:function(a){if(!a.url)return b.error("URL required for SendForm Checkout");var d={currency:b.currency().code,shipping:b.shipping(),tax:b.tax(),taxRate:b.taxRate(),itemCount:b.find({}).length},c=a.url,g="GET"===a.method?"GET":"POST";b.each(function(a,c){var g=c+1,e=[],f;d["item_name_"+g]=a.get("name");d["item_quantity_"+g]=a.quantity();d["item_price_"+
-g]=a.price();b.each(a.options(),function(a,d,c){f=!0;b.each(m.excludeFromCheckout,function(a){a===c&&(f=!1)});f&&e.push(c+": "+a)});d["item_options_"+g]=e.join(", ")});a.success&&(d["return"]=a.success);a.cancel&&(d.cancel_return=a.cancel);a.extra_data&&(d=b.extend(d,a.extra_data));return{action:c,method:g,data:d}}});l={bind:function(a,d){if(!h(d))return this;this._events||(this._events={});var c=a.split(/ +/);b.each(c,function(a){!0===this._events[a]?d.apply(this):e(this._events[a])?this._events[a]=
-[d]:this._events[a].push(d)});return this},trigger:function(a,b){var c=!0,g,f;this._events||(this._events={});if(!e(this._events[a])&&h(this._events[a][0])){g=0;for(f=this._events[a].length;ge?"0"+e:e}function f(f){e.lastIndex=0;return e.test(f)?'"'+f.replace(e,function(e){var f=B[e];return"string"===typeof f?f:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function r(e,j){var s,p,q,n,y=h,u,k=j[e];k&&"object"===typeof k&&"function"===typeof k.toJSON&&(k=k.toJSON(e));"function"===typeof l&&(k=l.call(j,e,k));switch(typeof k){case "string":return f(k);case "number":return isFinite(k)?String(k):"null";case "boolean":case "null":return String(k);
-case "object":if(!k)return"null";h+=x;u=[];if("[object Array]"===Object.prototype.toString.apply(k)){n=k.length;for(s=0;s=/)?(t=parseFloat(t.replace(">=","")),n.get(i)&&parseFloat(n.get(i))>=t||(r=!1)):t.match(/>/)?(t=parseFloat(t.replace(">","")),n.get(i)&&parseFloat(n.get(i))>t||(r=!1)):n.get(i)&&n.get(i)===t||(r=!1):n.get(i)&&n.get(i)===t||(r=!1),r}),r&&e.push(n)}),e):u(t)?(L.each(function(t){e.push(t)}),e):e},items:function(){return this.find()},has:function(t){var e=!1;return L.each(function(n){n.equals(t)&&(e=n)}),e},empty:function(){var t={};L.each(function(e){e.remove(!0)===!1&&(t[e.id()]=e)}),v=t,L.update()},quantity:function(){var t=0;return L.each(function(e){t+=e.quantity()}),t},total:function(){var t=0;return L.each(function(e){t+=e.total()}),t},grandTotal:function(){return L.total()+L.tax()+L.shipping()},update:function(){L.save(),L.trigger("update")},init:function(){L.load(),L.update(),L.ready()},$:function(t){return new L.ELEMENT(t)},$create:function(t){return L.$(e.createElement(t))},setupViewTool:function(){var e,n,r,i=t;for(r in m)if(Object.prototype.hasOwnProperty.call(m,r)&&t[r]&&(e=m[r].replace("*",r).split("."),n=e.shift(),n&&(i=i[n]),"function"==typeof i))return d=i,L.extend(L.ELEMENT._,_[r]),void 0},ids:function(){var t=[];return L.each(function(e){t.push(e.id())}),t},save:function(){L.trigger("beforeSave");var t={};L.each(function(e){t[e.id()]=L.extend(e.fields(),e.options())}),S.setItem(b+"_items",JSON.stringify(t)),L.trigger("afterSave")},load:function(){v={};var t=S.getItem(b+"_items");if(t){try{L.each(JSON.parse(t),function(t){L.add(t,!0)})}catch(e){L.error("Error Loading data: "+e)}L.trigger("load")}},ready:function(t){s(t)?L.isReady?t.call(L):L.bind("ready",t):u(t)&&!L.isReady&&(L.trigger("ready"),L.isReady=!0)},error:function(t){var e="";c(t)?e=t:l(t)&&c(t.message)&&(e=t.message);try{w.log("simpleCart(js) Error: "+e)}catch(n){}L.trigger("error",t)}}),L.extend({tax:function(){var t=F.taxShipping?L.total()+L.shipping():L.total(),e=L.taxRate()*t;return L.each(function(t){t.get("tax")?e+=t.get("tax"):t.get("taxRate")&&(e+=t.get("taxRate")*t.total())}),parseFloat(e)},taxRate:function(){return F.taxRate||0},shipping:function(t){if(s(t))return L({shippingCustom:t}),void 0;var e=F.shippingQuantityRate*L.quantity()+F.shippingTotalRate*L.total()+F.shippingFlatRate;return s(F.shippingCustom)&&(e+=F.shippingCustom.call(L)),L.each(function(t){e+=parseFloat(t.get("shipping")||0)}),parseFloat(e)}}),p={attr:function(t,e){return t.get(e.attr)||""},currency:function(t,e){return L.toCurrency(t.get(e.attr)||0)},link:function(t,e){return""+e.text+""},decrement:function(t,e){return""+(e.text||"-")+""},increment:function(t,e){return""+(e.text||"+")+""},image:function(t,e){return"
"},input:function(t,e){return""},remove:function(t,e){return""+(e.text||"X")+""}},L.extend({writeCart:function(t){var e,n,i,a,o,c=F.cartStyle.toLowerCase(),u="table"===c,s=u?"tr":"div",l=u?"th":"div",f=u?"td":"div",h=L.$create(c),d=L.$create(s).addClass("headerRow"),p=L.$(t);for(p.html(" ").append(h),h.append(d),a=0,o=F.cartColumns.length;o>a;a+=1)e=r(F.cartColumns[a]),n="item-"+(e.attr||e.view||e.label||e.text||"cell")+" "+e.className,i=e.label||"",d.append(L.$create(l).addClass(n).html(i));return L.each(function(t,e){L.createCartRow(t,e,s,f,h)}),h},createCartRow:function(t,e,n,a,o){var u,s,l,f,h,d,p=L.$create(n).addClass("itemRow row-"+e+" "+(e%2?"even":"odd")).attr("id","cartItem_"+t.id());for(o.append(p),u=0,s=F.cartColumns.length;s>u;u+=1)l=r(F.cartColumns[u]),f="item-"+(l.attr||(c(l.view)?l.view:l.label||l.text||"cell"))+" "+l.className,h=i(t,l),d=L.$create(a).addClass(f).html(h),p.append(d);return p}}),L.Item=function(t){function e(){c(n.price)&&(n.price=parseFloat(n.price.replace(L.currency().decimal,".").replace(/[^0-9\.]+/gi,""))),isNaN(n.price)&&(n.price=0),n.price<0&&(n.price=0),c(n.quantity)&&(n.quantity=parseInt(n.quantity.replace(L.currency().delimiter,""),10)),isNaN(n.quantity)&&(n.quantity=1),n.quantity<=0&&r.remove()}var n={},r=this;for(l(t)&&L.extend(n,t),g+=1,n.id=n.id||y+g;!u(v[n.id]);)g+=1,n.id=y+g;r.get=function(t,e){var i=!e;return u(t)?t:s(n[t])?n[t].call(r):u(n[t])?s(r[t])&&i?r[t].call(r):!u(r[t])&&i?r[t]:n[t]:n[t]},r.set=function(t,i){return u(t)||(n[t.toLowerCase()]=i,("price"===t.toLowerCase()||"quantity"===t.toLowerCase())&&e()),r},r.equals=function(t){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&"quantity"!==e&&"id"!==e&&t.get(e)!==n[e])return!1;return!0},r.options=function(){var t={};return L.each(n,function(e,n,i){var a=!0;L.each(r.reservedFields(),function(t){return t===i&&(a=!1),a}),a&&(t[i]=r.get(i))}),t},e()},L.Item._=L.Item.prototype={increment:function(t){var e=t||1;return e=parseInt(e,10),this.quantity(this.quantity()+e),this.quantity()<1?(this.remove(),null):this},decrement:function(t){var e=t||1;return this.increment(-parseInt(e,10))},remove:function(t){var e=L.trigger("beforeRemove",[v[this.id()]]);return e===!1?!1:(delete v[this.id()],t||L.update(),null)},reservedFields:function(){return["quantity","id","item_number","price","name","shipping","tax","taxRate"]},fields:function(){var t={},e=this;return L.each(e.reservedFields(),function(n){e.get(n)&&(t[n]=e.get(n))}),t},quantity:function(t){return u(t)?parseInt(this.get("quantity",!0)||1,10):this.set("quantity",t)},price:function(t){return u(t)?parseFloat(this.get("price",!0).toString().replace(L.currency().symbol,"").replace(L.currency().delimiter,"")||1):this.set("price",parseFloat(t.toString().replace(L.currency().symbol,"").replace(L.currency().delimiter,"")))},id:function(){return this.get("id",!1)},total:function(){return this.quantity()*this.price()}},L.extend({checkout:function(){if("custom"===F.checkout.type.toLowerCase()&&s(F.checkout.fn))F.checkout.fn.call(L,F.checkout);else if(s(L.checkout[F.checkout.type])){var t=L.checkout[F.checkout.type].call(L,F.checkout);t.data&&t.action&&t.method&&!1!==L.trigger("beforeCheckout",[t.data])&&L.generateAndSendForm(t)}else L.error("No Valid Checkout Method Specified")},extendCheckout:function(t){return L.extend(L.checkout,t)},generateAndSendForm:function(t){var e=L.$create("form");e.attr("style","display:none;"),e.attr("action",t.action),e.attr("method",t.method),L.each(t.data,function(t,n,r){e.append(L.$create("input").attr("type","hidden").attr("name",r).val(t))}),L.$("body").append(e),e.el.submit(),e.remove()}}),L.extendCheckout({PayPal:function(t){if(!t.email)return L.error("No email provided for PayPal checkout");var e={cmd:"_cart",upload:"1",currency_code:L.currency().code,business:t.email,rm:"GET"===t.method?"0":"2",tax_cart:(1*L.tax()).toFixed(2),handling_cart:(1*L.shipping()).toFixed(2),charset:"utf-8"},n=t.sandbox?"https://www.sandbox.paypal.com/cgi-bin/webscr":"https://www.paypal.com/cgi-bin/webscr",r="GET"===t.method?"GET":"POST";return t.success&&(e["return"]=t.success),t.cancel&&(e.cancel_return=t.cancel),t.notify&&(e.notify_url=t.notify),t.custom&&(e.custom=t.custom),L.each(function(t,n){var r,i=n+1,a=t.options(),o=0;e["item_name_"+i]=t.get("name"),e["quantity_"+i]=t.quantity(),e["amount_"+i]=(1*t.price()).toFixed(2),e["item_number_"+i]=t.get("item_number")||i,L.each(a,function(t,n,a){10>n&&(r=!0,L.each(F.excludeFromCheckout,function(t){t===a&&(r=!1)}),r&&(o+=1,e["on"+n+"_"+i]=a,e["os"+n+"_"+i]=t))}),e["option_index_"+n]=Math.min(10,o)}),{action:n,method:r,data:e}},GoogleCheckout:function(t){if(!t.merchantID)return L.error("No merchant id provided for GoogleCheckout");if("USD"!==L.currency().code&&"GBP"!==L.currency().code)return L.error("Google Checkout only accepts USD and GBP");var e={ship_method_name_1:"Shipping",ship_method_price_1:L.shipping(),ship_method_currency_1:L.currency().code,_charset_:""},n="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/"+t.merchantID,r="GET"===t.method?"GET":"POST";return L.each(function(t,n){var r,i=n+1,a=[];e["item_name_"+i]=t.get("name"),e["item_quantity_"+i]=t.quantity(),e["item_price_"+i]=t.price(),e["item_currency_ "+i]=L.currency().code,e["item_tax_rate"+i]=t.get("taxRate")||L.taxRate(),L.each(t.options(),function(t,e,n){r=!0,L.each(F.excludeFromCheckout,function(t){t===n&&(r=!1)}),r&&a.push(n+": "+t)}),e["item_description_"+i]=a.join(", ")}),{action:n,method:r,data:e}},AmazonPayments:function(t){if(!t.merchant_signature)return L.error("No merchant signature provided for Amazon Payments");if(!t.merchant_id)return L.error("No merchant id provided for Amazon Payments");if(!t.aws_access_key_id)return L.error("No AWS access key id provided for Amazon Payments");var e={aws_access_key_id:t.aws_access_key_id,merchant_signature:t.merchant_signature,currency_code:L.currency().code,tax_rate:L.taxRate(),weight_unit:t.weight_unit||"lb"},n="https://payments"+(t.sandbox?"-sandbox":"")+".amazon.com/checkout/"+t.merchant_id,r="GET"===t.method?"GET":"POST";return L.each(function(n,r){var i=r+1,a=[];e["item_title_"+i]=n.get("name"),e["item_quantity_"+i]=n.quantity(),e["item_price_"+i]=n.price(),e["item_sku_ "+i]=n.get("sku")||n.id(),e["item_merchant_id_"+i]=t.merchant_id,n.get("weight")&&(e["item_weight_"+i]=n.get("weight")),F.shippingQuantityRate&&(e["shipping_method_price_per_unit_rate_"+i]=F.shippingQuantityRate),L.each(n.options(),function(t,e,n){var r=!0;L.each(F.excludeFromCheckout,function(t){t===n&&(r=!1)}),r&&"weight"!==n&&"tax"!==n&&a.push(n+": "+t)}),e["item_description_"+i]=a.join(", ")}),{action:n,method:r,data:e}},SendForm:function(t){if(!t.url)return L.error("URL required for SendForm Checkout");var e={currency:L.currency().code,shipping:L.shipping(),tax:L.tax(),taxRate:L.taxRate(),itemCount:L.find({}).length},n=t.url,r="GET"===t.method?"GET":"POST";return L.each(function(t,n){var r,i=n+1,a=[];e["item_name_"+i]=t.get("name"),e["item_quantity_"+i]=t.quantity(),e["item_price_"+i]=t.price(),L.each(t.options(),function(t,e,n){r=!0,L.each(F.excludeFromCheckout,function(t){t===n&&(r=!1)}),r&&a.push(n+": "+t)}),e["item_options_"+i]=a.join(", ")}),t.success&&(e["return"]=t.success),t.cancel&&(e.cancel_return=t.cancel),t.extra_data&&(e=L.extend(e,t.extra_data)),{action:n,method:r,data:e}}}),x={bind:function(t,e){if(!s(e))return this;this._events||(this._events={});var n=t.split(/ +/);return L.each(n,function(t){this._events[t]===!0?e.apply(this):u(this._events[t])?this._events[t]=[e]:this._events[t].push(e)}),this},trigger:function(t,e){var n,r,i=!0;if(this._events||(this._events={}),!u(this._events[t])&&s(this._events[t][0]))for(n=0,r=this._events[t].length;r>n;n+=1)i=this._events[t][n].apply(this,e||[]);return i===!1?!1:!0}},x.on=x.bind,L.extend(x),L.extend(L.Item._,x),C={beforeAdd:null,afterAdd:null,load:null,beforeSave:null,afterSave:null,update:null,ready:null,checkoutSuccess:null,checkoutFail:null,beforeCheckout:null,beforeRemove:null},L(C),L.each(C,function(t,e,n){L.bind(n,function(){s(F[n])&&F[n].apply(this,arguments)})}),L.extend({toCurrency:function(t,e){var n=parseFloat(t),r=e||{},i=L.extend(L.extend({symbol:"$",decimal:".",delimiter:",",accuracy:2,after:!1},L.currency()),r),a=n.toFixed(i.accuracy).split("."),o=a[1],c=a[0];return c=L.chunk(c.reverse(),3).join(i.delimiter.reverse()).reverse(),(i.after?"":i.symbol)+c+(o?i.decimal+o:"")+(i.after?i.symbol:"")},chunk:function(t,e){"undefined"==typeof e&&(e=2);var n=t.match(new RegExp(".{1,"+e+"}","g"));return n||[]}}),String.prototype.reverse=function(){return this.split("").reverse().join("")},L.extend({currency:function(t){if(c(t)&&!u(T[t]))F.currency=t;else{if(!l(t))return T[F.currency];T[t.code]=t,F.currency=t.code}}}),L.extend({bindOutlets:function(t){L.each(t,function(t,e,n){L.bind("update",function(){L.setOutlet("."+b+"_"+n,t)})})},setOutlet:function(t,e){var n=e.call(L,t);l(n)&&n.el?L.$(t).html(" ").append(n):u(n)||L.$(t).html(n)},bindInputs:function(t){L.each(t,function(t){L.setInput("."+b+"_"+t.selector,t.event,t.callback)})},setInput:function(t,e,n){L.$(t).live(e,n)}}),L.ELEMENT=function(t){this.create(t),this.selector=t||null},L.extend(_,{MooTools:{text:function(t){return this.attr(E,t)},html:function(t){return this.attr(N,t)},val:function(t){return this.attr(k,t)},attr:function(t,e){return u(e)?this.el[0]&&this.el[0].get(t):(this.el.set(t,e),this)},remove:function(){return this.el.dispose(),null},addClass:function(t){return this.el.addClass(t),this},removeClass:function(t){return this.el.removeClass(t),this},append:function(t){return this.el.adopt(t.el),this},each:function(t){return s(t)&&L.each(this.el,function(e,n,r){t.call(n,n,e,r)}),this},click:function(t){return s(t)?this.each(function(e){e.addEvent(O,function(n){t.call(e,n)})}):u(t)&&this.el.fireEvent(O),this},live:function(t,e){var n=this.selector;s(e)&&L.$("body").el.addEvent(t+":relay("+n+")",function(t,n){e.call(n,t)})},match:function(t){return this.el.match(t)},parent:function(){return L.$(this.el.getParent())},find:function(t){return L.$(this.el.getElements(t))},closest:function(t){return L.$(this.el.getParent(t))},descendants:function(){return this.find("*")},tag:function(){return this.el[0].tagName},submit:function(){return this.el[0].submit(),this},create:function(t){this.el=d(t)}},Prototype:{text:function(t){return u(t)?this.el[0].innerHTML:(this.each(function(e,n){$(n).update(t)}),this)},html:function(t){return this.text(t)},val:function(t){return this.attr(k,t)},attr:function(t,e){return u(e)?this.el[0].readAttribute(t):(this.each(function(n,r){$(r).writeAttribute(t,e)}),this)},append:function(t){return this.each(function(e,n){t.el?t.each(function(t,e){$(n).appendChild(e)}):f(t)&&$(n).appendChild(t)}),this},remove:function(){return this.each(function(t,e){$(e).remove()}),this},addClass:function(t){return this.each(function(e,n){$(n).addClassName(t)}),this},removeClass:function(t){return this.each(function(e,n){$(n).removeClassName(t)}),this},each:function(t){return s(t)&&L.each(this.el,function(e,n,r){t.call(n,n,e,r)}),this},click:function(t){return s(t)?this.each(function(e,n){$(n).observe(O,function(e){t.call(n,e)})}):u(t)&&this.each(function(t,e){$(e).fire(O)}),this},live:function(t,n){if(s(n)){var r=this.selector;e.observe(t,function(t,e){e===d(t).findElement(r)&&n.call(e,t)})}},parent:function(){return L.$(this.el.up())},find:function(t){return L.$(this.el.getElementsBySelector(t))},closest:function(t){return L.$(this.el.up(t))},descendants:function(){return L.$(this.el.descendants())},tag:function(){return this.el.tagName},submit:function(){this.el[0].submit()},create:function(t){c(t)?this.el=d(t):f(t)&&(this.el=[t])}},jQuery:{passthrough:function(t,e){return u(e)?this.el[t]():(this.el[t](e),this)},text:function(t){return this.passthrough(E,t)},html:function(t){return this.passthrough(N,t)},val:function(t){return this.passthrough("val",t)},append:function(t){var e=t.el||t;return this.el.append(e),this},attr:function(t,e){return u(e)?this.el.attr(t):(this.el.attr(t,e),this)},remove:function(){return this.el.remove(),this},addClass:function(t){return this.el.addClass(t),this},removeClass:function(t){return this.el.removeClass(t),this},each:function(t){return this.passthrough("each",t)},click:function(t){return this.passthrough(O,t)},live:function(t,n){return d(e).delegate(this.selector,t,n),this},parent:function(){return L.$(this.el.parent())},find:function(t){return L.$(this.el.find(t))},closest:function(t){return L.$(this.el.closest(t))},tag:function(){return this.el[0].tagName},descendants:function(){return L.$(this.el.find("*"))},submit:function(){return this.el.submit()},create:function(t){this.el=d(t)}}}),L.ELEMENT._=L.ELEMENT.prototype,L.ready(L.setupViewTool),L.ready(function(){L.bindOutlets({total:function(){return L.toCurrency(L.total())},quantity:function(){return L.quantity()},items:function(t){L.writeCart(t)},tax:function(){return L.toCurrency(L.tax())},taxRate:function(){return L.taxRate().toFixed()},shipping:function(){return L.toCurrency(L.shipping())},grandTotal:function(){return L.toCurrency(L.grandTotal())}}),L.bindInputs([{selector:"checkout",event:"click",callback:function(){L.checkout()}},{selector:"empty",event:"click",callback:function(){L.empty()}},{selector:"increment",event:"click",callback:function(){L.find(L.$(this).closest(".itemRow").attr("id").split("_")[1]).increment(),L.update()}},{selector:"decrement",event:"click",callback:function(){L.find(L.$(this).closest(".itemRow").attr("id").split("_")[1]).decrement(),L.update()}},{selector:"remove",event:"click",callback:function(){L.find(L.$(this).closest(".itemRow").attr("id").split("_")[1]).remove()}},{selector:"input",event:"change",callback:function(){var t=L.$(this),e=t.parent(),n=e.attr("class").split(" ");L.each(n,function(n){if(n.match(/item-.+/i)){var r=n.split("-")[1];return L.find(e.closest(".itemRow").attr("id").split("_")[1]).set(r,t.val()),L.update(),void 0}})}},{selector:"shelfItem .item_add",event:"click",callback:function(){var t=L.$(this),e={};t.closest("."+b+"_shelfItem").descendants().each(function(t,n){var r=L.$(n);r.attr("class")&&r.attr("class").match(/item_.+/)&&!r.attr("class").match(/item_add/)&&L.each(r.attr("class").split(" "),function(t){var n,i,a;if(t.match(/item_.+/)){switch(n=t.split("_")[1],i="",r.tag().toLowerCase()){case"input":case"textarea":case"select":a=r.attr("type"),(!a||("checkbox"===a.toLowerCase()||"radio"===a.toLowerCase())&&r.attr("checked")||"text"===a.toLowerCase()||"number"===a.toLowerCase())&&(i=r.val());break;case"img":i=r.attr("src");break;default:i=r.text()}null!==i&&""!==i&&(e[n.toLowerCase()]=e[n.toLowerCase()]?e[n.toLowerCase()]+", "+i:i)}})}),L.add(e)}}])}),e.addEventListener?t.DOMContentLoaded=function(){e.removeEventListener("DOMContentLoaded",DOMContentLoaded,!1),L.init()}:e.attachEvent&&(t.DOMContentLoaded=function(){"complete"===e.readyState&&(e.detachEvent("onreadystatechange",DOMContentLoaded),L.init())}),o(),L};t.simpleCart=h()}(window,document);var JSON;JSON||(JSON={}),function(){function k(t){return 10>t?"0"+t:t}function o(t){return p.lastIndex=0,p.test(t)?'"'+t.replace(p,function(t){var e=r[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function l(t,r){var a,c,u,s,f,h=e,d=r[t];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(t)),"function"==typeof i&&(d=i.call(r,t,d)),typeof d){case"string":return o(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(e+=n,f=[],"[object Array]"===Object.prototype.toString.apply(d)){for(s=d.length,a=0;s>a;a+=1)f[a]=l(a,d)||"null";return u=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+h+"]":"["+f.join(",")+"]",e=h,u}if(i&&"object"==typeof i)for(s=i.length,a=0;s>a;a+=1)"string"==typeof i[a]&&(c=i[a],(u=l(c,d))&&f.push(o(c)+(e?": ":":")+u));else for(c in d)Object.prototype.hasOwnProperty.call(d,c)&&(u=l(c,d))&&f.push(o(c)+(e?": ":":")+u);return u=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+h+"}":"{"+f.join(",")+"}",e=h,u}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,n,r={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,r,a){var o;if(n=e="","number"==typeof a)for(o=0;a>o;o+=1)n+=" ";else"string"==typeof a&&(n=a);if((i=r)&&"function"!=typeof r&&("object"!=typeof r||"number"!=typeof r.length))throw Error("JSON.stringify");return l("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(a,e){function c(t,n){var r,i,a=t[n];if(a&&"object"==typeof a)for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=c(a,r),void 0!==i?a[r]=i:delete a[r]);return e.call(t,n,a)}var d,a=String(a);if(q.lastIndex=0,q.test(a)&&(a=a.replace(q,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d=eval("("+a+")"),"function"==typeof e?c({"":d},""):d;throw new SyntaxError("JSON.parse")})}(),function(){if(!this.localStorage)if(this.globalStorage)try{this.localStorage=this.globalStorage}catch(t){}else{var e=document.createElement("div");if(e.style.display="none",document.getElementsByTagName("head")[0].appendChild(e),e.addBehavior){e.addBehavior("#default#userdata");var n=this.localStorage={length:0,setItem:function(t,n){e.load("localStorage"),t=r(t),e.getAttribute(t)||this.length++,e.setAttribute(t,n),e.save("localStorage")},getItem:function(t){return e.load("localStorage"),t=r(t),e.getAttribute(t)},removeItem:function(t){e.load("localStorage"),t=r(t),e.removeAttribute(t),e.save("localStorage"),this.length=0},clear:function(){e.load("localStorage");for(var t=0;attr=e.XMLDocument.documentElement.attributes[t++];)e.removeAttribute(attr.name);e.save("localStorage"),this.length=0},key:function(t){return e.load("localStorage"),e.XMLDocument.documentElement.attributes[t]}},r=function(t){return t.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g,"-")};e.load("localStorage"),n.length=e.XMLDocument.documentElement.attributes.length}}}();
\ No newline at end of file