<!DOCTYPE html>
<html></html>
  <head>
    <title>simpleCart</title>
    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.0/css/bootstrap-combined.min.css" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
  </head>
  
  <body>
  <div class="container"><div class="row">
  <div class="span6">
  
    <!-- item -->
    <ul class="products">
       <li class="simpleCart_shelfItem product">
        <p class="item_name">Product one</p>
        <img src="https://dl.dropbox.com/u/23834858/fotos/1928.jpg" alt="Item Alt">
        <br> <span class="item_price">$5.99</span>
        <a href="javascript:;" class="item_add">Add to Cart</a> <br><br>
      </li>
      <li class="simpleCart_shelfItem product">
        <p class="item_name">Product two</p>
        <img  src="https://dl.dropbox.com/u/23834858/fotos/1964.%20Avenida%20Alfonso%20Molina.jpg" alt="Item Alt">
        <br> <span class="item_price">$10</span>
        <a href="javascript:;" class="item_add">Add to Cart</a> <br><br>
      </li>
      <li class="simpleCart_shelfItem product">
        <p class="item_name">Product three</p>
        <img  src="https://dl.dropbox.com/u/23834858/fotos/1968._Paseo_Mar_timo.jpg" alt="Item Alt">
        <br> <span class="item_price">$15.99</span>
        <a href="javascript:;" class="item_add">Add to Cart</a> <br><br>
      </li>
      <li class="simpleCart_shelfItem product">
        <p class="item_name">Product four</p>
        <img  src="https://dl.dropbox.com/u/23834858/fotos/Praza%20de%20Ourense%20%28196...%29.jpg" alt="Item Alt">
        <br> <span class="item_price">$6.99</span>
        <a href="javascript:;" class="item_add">Add to Cart</a> <br><br>
      </li>
    </ul>

    <hr>
    
  </div><!-- /span6 -->
  
  
  <div class="span6">
  
  	<div class="product-Info">
      <span class="simpleCart_quantity"></span> items 
      <a href="#myModal" role="button" class="product-view" data-toggle="modal">View</a>
    </div>
       
    <div id="myModal" class="modal hide fade">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3><span class="simpleCart_quantity"></span> items</h3>
      </div>
      <div class="modal-body">
        <div class="simpleCart_items"></div>
        <!-- Yep it's that simple -->
        <hr>
        <div class="left"><strong>Items: </strong><span class="simpleCart_quantity"></span></div>
				<div class="right"><strong>Total: </strong><span class="simpleCart_total"></span></div>
      </div>
      <div class="modal-footer">
        <a href="javascript:;" class="simpleCart_empty">Empty</a>
        <a href="javascript:;" class="simpleCart_checkout">Checkout</a>
      </div>
    </div>
    
    

    <div class="product-total">
    
      <p><b>Items:</b> <span class="simpleCart_quantity"></span></p>
      <!--number of items in the cart-->
      
      <p><b>Total:</b> <span class="simpleCart_total"></span></p>
      <!-- total cost of cart before tax & shipping-->
      
      <p><b>Tax rate:</b> <span class="simpleCart_taxRate"></span></p>
      <!--will be display as a percentage ( ie 7% )-->
      
      <p><b>Tax:</b> <span class="simpleCart_tax"></span></p>
      <!--taxRate X total displayed as currency-->
      
      <p><b>Final price:</b> <span class="simpleCart_grandTotal"></span> </p>
      <!--total of the cart after tax & shipping -->
      
    </div>
  </div><!-- /span6 -->
    
  </div></div><!-- /container /row -->
  

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.0/js/bootstrap.min.js"></script>
    <script src="simplecart.js"></script>
    <script src="script.js"></script>
  </body>

</html>
body{padding-top:40px;}
/* Products */
.products {
  list-style: none;
  float: left;
  display: inline-block;
}
.product {
  display: inline-block;
  margin-left: 5px;
  background: white;
  padding: 5px;
  margin-bottom: 10px;
  border: 2px solid #FAFAFA;
  box-shadow: 0 1px 2px #7C7C7C;
  border-radius: 3px;
}
.product .item_name {
  text-align: center;
  color: #030303;
  text-shadow: 0 2px 2px #4E4E4E;
  font-family: verdana;
}
.product img {
  width: 150px;
  margin-bottom: 5px;
  padding: 2px 5px 10px 10px;
}
.product .item_add,.product-view,.simpleCart_checkout{
  background: #59BFF8;
  padding: 2px 5px 2px 5px;
  text-decoration: none !important;
  border: 1px solid #53A7E9;
  color: white;
}
.product .item_price,
.simpleCart_empty {
  text-decoration: none !important;
  padding: 2px 5px 2px 5px;
  background: #FD8989;
  color: white;
  border: 1px solid #FC7070;
}
.product-total {
  display: block;
  background: white;
  padding: 5px;
  border: 1px solid whiteSmoke;
  box-shadow: 0 1px 2px #BEBEBE;
  margin-top: 5px;
  margin-bottom: 10px;
}
.product-Info {
  display: block;
  background: white;
  width:110px;
  padding: 5px 0 5px 15px;
  border: 1px solid #E9E9E9;
  box-shadow: 0 1px 2px #B4B4B4;
  margin-top: 5px;
  margin-bottom: 10px;
  color: #919191;
  clear:both;
}
/* Table */
.headerRow th {
  width: 100%;
  background: #5AA6E2;
  color: white;
}
.itemRow td {
  background:#F3F3F3;
  width: 100%;
  padding: 10px;
}

.item-increment a {
  background: #87CAFF;
  padding: 0 3px 0 3px;
  color: black;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #72B9F1;
}
.item-decrement a {
  background: #FD9999;
  padding: 0 5px 0 5px;
  color: black;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #F17272;
}
.item-remove a{
  background: white;
  padding: 5px;
  color: black;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #D5D5D5;
}


simpleCart({
  // array representing the format and columns of the cart,
	// see the cart columns documentation
	cartColumns: [
    { attr: "name" , label: "Name" } ,
    { attr: "price" , label: "Price", view: 'currency' } ,
    { view: "decrement" , label: false , text: "-" } ,
    { attr: "quantity" , label: "Qty" } ,
    { view: "increment" , label: false , text: "+" } ,
    { attr: "total" , label: "SubTotal", view: 'currency' } ,
    { view: "remove" , text: "Remove" , label: false },
  //{ view: 'link' , label: 'Details' , attr: 'pageLink' , text: 'View More' },
    {view:'image' , attr:'tumb', label: false}//,
    //{view:'input', attr:'quantity', label: "Quantity" }

	],

	// "div" or "table" - builds the cart as a 
	// table or collection of divs
	cartStyle: "table", 

	// how simpleCart should checkout, see the 
	// checkout reference for more info 
	checkout: { 
		type: "PayPal" , 
		email: "you@yours.com" 
	},

	// set the currency, see the currency 
	// reference for more info
	currency: "EUR",

	// collection of arbitrary data you may want to store 
	// with the cart, such as customer info
	data: {},

	// set the cart langauge 
	// (may be used for checkout)
	language: "english-us",

	// array of item fields that will not be 
	// sent to checkout
	excludeFromCheckout: [],

	// custom function to add shipping cost
	shippingCustom: null,

	// flat rate shipping option
	shippingFlatRate: 0,

	// added shipping based on this value 
	// multiplied by the cart quantity
	shippingQuantityRate: 0,

	// added shipping based on this value 
	// multiplied by the cart subtotal
	shippingTotalRate: 0,

	// tax rate applied to cart subtotal
	taxRate: 0,

	// true if tax should be applied to shipping
	taxShipping: false,

	// event callbacks 
	beforeAdd			: null,
	afterAdd			: null,
	load				: null,
	beforeSave		: null,
	afterSave			: null,
	update			: null,
	ready			: null,
	checkoutSuccess	: null,
	checkoutFail		: null,
	beforeCheckout		: null,
  beforeRemove           : null
});
(function(m,f){var p="string",i=function(e,f){return typeof e===f},e=function(e){return i(e,"undefined")},h=function(e){return i(e,"function")},v=function(e){return"object"===typeof HTMLElement?e instanceof HTMLElement:"object"===typeof e&&1===e.nodeType&&"string"===typeof e.nodeName},z=function(n){function B(a){return b.extend({attr:"",label:"",view:"attr",text:"",className:"",hide:!1},a||{})}function C(){if(!b.isReady){try{f.documentElement.doScroll("left")}catch(a){setTimeout(C,1);return}b.init()}}
var q={MooTools:"$$",Prototype:"$$",jQuery:"*"},l=0,o={},u=n||"simpleCart",w={},n={},n={},s=m.localStorage,j=m.console||{msgs:[],log:function(a){j.msgs.push(a)}},A={USD:{code:"USD",symbol:"&#36;",name:"US Dollar"},AUD:{code:"AUD",symbol:"&#36;",name:"Australian Dollar"},BRL:{code:"BRL",symbol:"R&#36;",name:"Brazilian Real"},CAD:{code:"CAD",symbol:"&#36;",name:"Canadian Dollar"},CZK:{code:"CZK",symbol:"&nbsp;&#75;&#269;",name:"Czech Koruna",after:!0},DKK:{code:"DKK",symbol:"DKK&nbsp;",name:"Danish Krone"},
EUR:{code:"EUR",symbol:"&euro;",name:"Euro"},HKD:{code:"HKD",symbol:"&#36;",name:"Hong Kong Dollar"},HUF:{code:"HUF",symbol:"&#70;&#116;",name:"Hungarian Forint"},ILS:{code:"ILS",symbol:"&#8362;",name:"Israeli New Sheqel"},JPY:{code:"JPY",symbol:"&yen;",name:"Japanese Yen"},MXN:{code:"MXN",symbol:"&#36;",name:"Mexican Peso"},NOK:{code:"NOK",symbol:"NOK&nbsp;",name:"Norwegian Krone"},NZD:{code:"NZD",symbol:"&#36;",name:"New Zealand Dollar"},PLN:{code:"PLN",symbol:"PLN&nbsp;",name:"Polish Zloty"},GBP:{code:"GBP",
symbol:"&pound;",name:"Pound Sterling"},SGD:{code:"SGD",symbol:"&#36;",name:"Singapore Dollar"},SEK:{code:"SEK",symbol:"SEK&nbsp;",name:"Swedish Krona"},CHF:{code:"CHF",symbol:"CHF&nbsp;",name:"Swiss Franc"},THB:{code:"THB",symbol:"&#3647;",name:"Thai Baht"},BTC:{code:"BTC",symbol:" BTC",name:"Bitcoin",accuracy:4,after:!0}},k={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(i(a,"object"))return b.extend(k,a)},x,y;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=z(a);a.init();return a}});b.extend({isReady:!1,add:function(a,d){var c=new b.Item(a||{}),g=!0,r=!0===d?d:!1;if(!r&&(g=b.trigger("beforeAdd",[c]),!1===g))return!1;(g=b.has(c))?(g.increment(c.quantity()),c=g):o[c.id()]=c;b.update();r||b.trigger("afterAdd",[c,e(g)]);return c},each:function(a,d){var c,g=0,r,e,t;if(h(a))e=a,t=o;else if(h(d))e=d,t=a;else return;for(c in t)if(Object.prototype.hasOwnProperty.call(t,c)){r=e.call(b,t[c],g,c);if(!1===r)break;
g+=1}},find:function(a){var d=[];if(i(o[a],"object"))return o[a];if(i(a,"object"))return b.each(function(c){var g=!0;b.each(a,function(a,b,d){i(a,p)?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||(g=!1)):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||
(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)});o=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=m,c;for(c in q)if(Object.prototype.hasOwnProperty.call(q,c)&&m[c]&&(a=q[c].replace("*",c).split("."),(a=a.shift())&&(d=d[a]),"function"===typeof d)){x=d;b.extend(b.ELEMENT._,w[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())});s.setItem(u+"_items",JSON.stringify(a));b.trigger("afterSave")},load:function(){o={};var a=s.getItem(u+"_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="";i(a,p)?d=a:i(a,"object")&&i(a.message,p)&&(d=a.message);
try{j.log("simpleCart(js) Error: "+d)}catch(c){}b.trigger("error",a)}});b.extend({tax:function(){var a=k.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 k.taxRate||0},shipping:function(a){if(h(a))b({shippingCustom:a});else{var d=k.shippingQuantityRate*b.quantity()+k.shippingTotalRate*b.total()+k.shippingFlatRate;h(k.shippingCustom)&&(d+=k.shippingCustom.call(b));
b.each(function(a){d+=parseFloat(a.get("shipping")||0)});return parseFloat(d)}}});y={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"<a href='"+a.get(b.attr)+"'>"+b.text+"</a>"},decrement:function(a,b){return"<a href='javascript:;' class='"+u+"_decrement'>"+(b.text||"-")+"</a>"},increment:function(a,b){return"<a href='javascript:;' class='"+u+"_increment'>"+(b.text||"+")+"</a>"},image:function(a,b){return"<img src='"+
a.get(b.attr)+"'/>"},input:function(a,b){return"<input type='text' value='"+a.get(b.attr)+"' class='"+u+"_input'/>"},remove:function(a,b){return"<a href='javascript:;' class='"+u+"_remove'>"+(b.text||"X")+"</a>"}};b.extend({writeCart:function(a){var d=k.cartStyle.toLowerCase(),c="table"===d,g=c?"tr":"div",r=c?"th":"div",e=c?"td":"div",t=b.$create(d),d=b.$create(g).addClass("headerRow"),f,h;b.$(a).html(" ").append(t);t.append(d);c=0;for(h=k.cartColumns.length;c<h;c+=1)f=B(k.cartColumns[c]),a="item-"+
(f.attr||f.view||f.label||f.text||"cell")+" "+f.className,f=f.label||"",d.append(b.$create(r).addClass(a).html(f));b.each(function(a,d){b.createCartRow(a,d,g,e,t)});return t},createCartRow:function(a,d,c,g,r){var d=b.$create(c).addClass("itemRow row-"+d+" "+(d%2?"even":"odd")).attr("id","cartItem_"+a.id()),e,f,j;r.append(d);r=0;for(c=k.cartColumns.length;r<c;r+=1)e=B(k.cartColumns[r]),f="item-"+(e.attr||(i(e.view,p)?e.view:e.label||e.text||"cell"))+" "+e.className,j=a,j=(h(e.view)?e.view:i(e.view,
p)&&h(y[e.view])?y[e.view]:y.attr).call(b,j,e),f=b.$create(g).addClass(f).html(j),d.append(f);return d}});b.Item=function(a){function d(){i(c.price,p)&&(c.price=parseFloat(c.price.replace(b.currency().decimal,".").replace(/[^0-9\.]+/ig,"")));isNaN(c.price)&&(c.price=0);0>c.price&&(c.price=0);i(c.quantity,p)&&(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;i(a,"object")&&b.extend(c,a);l+=1;for(c.id=
c.id||"SCI-"+l;!e(o[c.id]);)l+=1,c.id="SCI-"+l;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",[o[this.id()]]))return!1;delete o[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"===k.checkout.type.toLowerCase()&&h(k.checkout.fn))k.checkout.fn.call(b,k.checkout);else if(h(b.checkout[k.checkout.type])){var a=b.checkout[k.checkout.type].call(b,k.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);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]=(a.price()*1).toFixed(2);d["item_number_"+g]=a.get("item_number")||g;b.each(e,function(a,c,e){if(c<10){h=true;
b.each(k.excludeFromCheckout,function(a){a===e&&(h=false)});if(h){f=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(k.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=(a.sandbox?
"https://sandbox.google.com/checkout/":"https://checkout.google.com/")+"cws/v2/Merchant/"+a.merchant_id+"/checkoutForm",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"));k.shippingQuantityRate&&(d["shipping_method_price_per_unit_rate_"+e]=k.shippingQuantityRate);
b.each(c.options(),function(a,d,c){var g=true;b.each(k.excludeFromCheckout,function(a){a===c&&(g=false)});g&&(c!=="weight"&&c!=="tax")&&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(k.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}}});n={bind:function(a,d){if(!h(d))return this;this._events||(this._events={});var c=a.split(/ +/);
b.each(c,function(a){this._events[a]===true?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;g<f;g+=1)c=this._events[a][g].apply(this,b||[])}return!1===c?!1:!0}};n.on=n.bind;b.extend(n);b.extend(b.Item._,n);n={beforeAdd:null,afterAdd:null,load:null,beforeSave:null,afterSave:null,update:null,ready:null,checkoutSuccess:null,
checkoutFail:null,beforeCheckout:null,beforeRemove:null};b(n);b.each(n,function(a,d,c){b.bind(c,function(){h(k[c])&&k[c].apply(this,arguments)})});b.extend({toCurrency:function(a,d){var c=parseFloat(a),g=d||{},g=b.extend(b.extend({symbol:"$",decimal:".",delimiter:",",accuracy:2,after:!1},b.currency()),g),e=c.toFixed(g.accuracy).split("."),c=e[1],e=e[0],e=b.chunk(e.reverse(),3).join(g.delimiter.reverse()).reverse();return(!g.after?g.symbol:"")+e+(c?g.decimal+c:"")+(g.after?g.symbol:"")},chunk:function(a,
b){"undefined"===typeof b&&(b=2);return a.match(RegExp(".{1,"+b+"}","g"))||[]}});String.prototype.reverse=function(){return this.split("").reverse().join("")};b.extend({currency:function(a){if(i(a,p)&&!e(A[a]))k.currency=a;else if(i(a,"object"))A[a.code]=a,k.currency=a.code;else return A[k.currency]}});b.extend({bindOutlets:function(a){b.each(a,function(a,c,e){b.bind("update",function(){b.setOutlet("."+u+"_"+e,a)})})},setOutlet:function(a,d){var c=d.call(b,a);i(c,"object")&&c.el?b.$(a).html(" ").append(c):
e(c)||b.$(a).html(c)},bindInputs:function(a){b.each(a,function(a){b.setInput("."+u+"_"+a.selector,a.event,a.callback)})},setInput:function(a,d,c){b.$(a).live(d,c)}});b.ELEMENT=function(a){this.create(a);this.selector=a||null};b.extend(w,{MooTools:{text:function(a){return this.attr("text",a)},html:function(a){return this.attr("html",a)},val:function(a){return this.attr("value",a)},attr:function(a,b){if(e(b))return this.el[0]&&this.el[0].get(a);this.el.set(a,b);return this},remove:function(){this.el.dispose();
return null},addClass:function(a){this.el.addClass(a);return this},removeClass:function(a){this.el.removeClass(a);return this},append:function(a){this.el.adopt(a.el);return this},each:function(a){h(a)&&b.each(this.el,function(b,c,e){a.call(c,c,b,e)});return this},click:function(a){h(a)?this.each(function(b){b.addEvent("click",function(c){a.call(b,c)})}):e(a)&&this.el.fireEvent("click");return this},live:function(a,d){var c=this.selector;h(d)&&b.$("body").el.addEvent(a+":relay("+c+")",function(a,b){d.call(b,
a)})},match:function(a){return this.el.match(a)},parent:function(){return b.$(this.el.getParent())},find:function(a){return b.$(this.el.getElements(a))},closest:function(a){return b.$(this.el.getParent(a))},descendants:function(){return this.find("*")},tag:function(){return this.el[0].tagName},submit:function(){this.el[0].submit();return this},create:function(a){this.el=x(a)}},Prototype:{text:function(a){if(e(a))return this.el[0].innerHTML;this.each(function(b,c){$(c).update(a)});return this},html:function(a){return this.text(a)},
val:function(a){return this.attr("value",a)},attr:function(a,b){if(e(b))return this.el[0].readAttribute(a);this.each(function(c,e){$(e).writeAttribute(a,b)});return this},append:function(a){this.each(function(b,c){a.el?a.each(function(a,b){$(c).appendChild(b)}):v(a)&&$(c).appendChild(a)});return this},remove:function(){this.each(function(a,b){$(b).remove()});return this},addClass:function(a){this.each(function(b,c){$(c).addClassName(a)});return this},removeClass:function(a){this.each(function(b,c){$(c).removeClassName(a)});
return this},each:function(a){h(a)&&b.each(this.el,function(b,c,e){a.call(c,c,b,e)});return this},click:function(a){h(a)?this.each(function(b,c){$(c).observe("click",function(b){a.call(c,b)})}):e(a)&&this.each(function(a,b){$(b).fire("click")});return this},live:function(a,b){if(h(b)){var c=this.selector;f.observe(a,function(a,e){e===x(a).findElement(c)&&b.call(e,a)})}},parent:function(){return b.$(this.el.up())},find:function(a){return b.$(this.el.getElementsBySelector(a))},closest:function(a){return b.$(this.el.up(a))},
descendants:function(){return b.$(this.el.descendants())},tag:function(){return this.el.tagName},submit:function(){this.el[0].submit()},create:function(a){i(a,p)?this.el=x(a):v(a)&&(this.el=[a])}},jQuery:{passthrough:function(a,b){if(e(b))return this.el[a]();this.el[a](b);return this},text:function(a){return this.passthrough("text",a)},html:function(a){return this.passthrough("html",a)},val:function(a){return this.passthrough("val",a)},append:function(a){this.el.append(a.el||a);return this},attr:function(a,
b){if(e(b))return this.el.attr(a);this.el.attr(a,b);return this},remove:function(){this.el.remove();return this},addClass:function(a){this.el.addClass(a);return this},removeClass:function(a){this.el.removeClass(a);return this},each:function(a){return this.passthrough("each",a)},click:function(a){return this.passthrough("click",a)},live:function(a,b){x(f).delegate(this.selector,a,b);return this},parent:function(){return b.$(this.el.parent())},find:function(a){return b.$(this.el.find(a))},closest:function(a){return b.$(this.el.closest(a))},
tag:function(){return this.el[0].tagName},descendants:function(){return b.$(this.el.find("*"))},submit:function(){return this.el.submit()},create:function(a){this.el=x(a)}}});b.ELEMENT._=b.ELEMENT.prototype;b.ready(b.setupViewTool);b.ready(function(){b.bindOutlets({total:function(){return b.toCurrency(b.total())},quantity:function(){return b.quantity()},items:function(a){b.writeCart(a)},tax:function(){return b.toCurrency(b.tax())},taxRate:function(){return b.taxRate().toFixed()},shipping:function(){return b.toCurrency(b.shipping())},
grandTotal:function(){return b.toCurrency(b.grandTotal())}});b.bindInputs([{selector:"checkout",event:"click",callback:function(){b.checkout()}},{selector:"empty",event:"click",callback:function(){b.empty()}},{selector:"increment",event:"click",callback:function(){b.find(b.$(this).closest(".itemRow").attr("id").split("_")[1]).increment();b.update()}},{selector:"decrement",event:"click",callback:function(){b.find(b.$(this).closest(".itemRow").attr("id").split("_")[1]).decrement();b.update()}},{selector:"remove",
event:"click",callback:function(){b.find(b.$(this).closest(".itemRow").attr("id").split("_")[1]).remove()}},{selector:"input",event:"change",callback:function(){var a=b.$(this),d=a.parent(),c=d.attr("class").split(" ");b.each(c,function(c){c.match(/item-.+/i)&&(c=c.split("-")[1],b.find(d.closest(".itemRow").attr("id").split("_")[1]).set(c,a.val()),b.update())})}},{selector:"shelfItem .item_add",event:"click",callback:function(){var a={};b.$(this).closest("."+u+"_shelfItem").descendants().each(function(d,
c){var e=b.$(c);e.attr("class")&&(e.attr("class").match(/item_.+/)&&!e.attr("class").match(/item_add/))&&b.each(e.attr("class").split(" "),function(b){var c,d;if(b.match(/item_.+/)){b=b.split("_")[1];c="";switch(e.tag().toLowerCase()){case "input":case "textarea":case "select":d=e.attr("type");if(!d||("checkbox"===d.toLowerCase()||"radio"===d.toLowerCase())&&e.attr("checked")||"text"===d.toLowerCase())c=e.val();break;case "img":c=e.attr("src");break;default:c=e.text()}null!==c&&""!==c&&(a[b.toLowerCase()]=
a[b.toLowerCase()]?a[b.toLowerCase()]+", "+c:c)}})});b.add(a)}}])});f.addEventListener?m.DOMContentLoaded=function(){f.removeEventListener("DOMContentLoaded",DOMContentLoaded,!1);b.init()}:f.attachEvent&&(m.DOMContentLoaded=function(){"complete"===f.readyState&&(f.detachEvent("onreadystatechange",DOMContentLoaded),b.init())});(function(){if(f.readyState==="complete")return setTimeout(b.init,1);if(f.addEventListener){f.addEventListener("DOMContentLoaded",DOMContentLoaded,false);m.addEventListener("load",
b.init,false)}else if(f.attachEvent){f.attachEvent("onreadystatechange",DOMContentLoaded);m.attachEvent("onload",b.init);var a=false;try{a=m.frameElement===null}catch(d){}f.documentElement.doScroll&&a&&C()}})();return b};m.simpleCart=z()})(window,document);var JSON;JSON||(JSON={});
(function(){function m(e){return 10>e?"0"+e:e}function f(f){e.lastIndex=0;return e.test(f)?'"'+f.replace(e,function(e){var f=z[e];return"string"===typeof f?f:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function p(e,i){var q,l,o,m,w=h,s,j=i[e];j&&"object"===typeof j&&"function"===typeof j.toJSON&&(j=j.toJSON(e));"function"===typeof n&&(j=n.call(i,e,j));switch(typeof j){case "string":return f(j);case "number":return isFinite(j)?""+j:"null";case "boolean":case "null":return""+
j;case "object":if(!j)return"null";h+=v;s=[];if("[object Array]"===Object.prototype.toString.apply(j)){m=j.length;for(q=0;q<m;q+=1)s[q]=p(q,j)||"null";o=0===s.length?"[]":h?"[\n"+h+s.join(",\n"+h)+"\n"+w+"]":"["+s.join(",")+"]";h=w;return o}if(n&&"object"===typeof n){m=n.length;for(q=0;q<m;q+=1)"string"===typeof n[q]&&(l=n[q],(o=p(l,j))&&s.push(f(l)+(h?": ":":")+o))}else for(l in j)Object.prototype.hasOwnProperty.call(j,l)&&(o=p(l,j))&&s.push(f(l)+(h?": ":":")+o);o=0===s.length?"{}":h?"{\n"+h+s.join(",\n"+
h)+"\n"+w+"}":"{"+s.join(",")+"}";h=w;return o}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+m(this.getUTCMonth()+1)+"-"+m(this.getUTCDate())+"T"+m(this.getUTCHours())+":"+m(this.getUTCMinutes())+":"+m(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var i=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,v,z={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},n;"function"!==typeof JSON.stringify&&(JSON.stringify=function(e,f,i){var l;v=h="";if(typeof i==="number")for(l=0;l<i;l=l+1)v=v+" ";else typeof i==="string"&&(v=i);if((n=f)&&typeof f!=="function"&&(typeof f!=="object"||typeof f.length!=="number"))throw Error("JSON.stringify");return p("",
{"":e})});"function"!==typeof JSON.parse&&(JSON.parse=function(e,f){function h(e,i){var l,m,j=e[i];if(j&&typeof j==="object")for(l in j)Object.prototype.hasOwnProperty.call(j,l)&&(m=h(j,l),m!==void 0?j[l]=m:delete j[l]);return f.call(e,i,j)}var l,e=""+e;i.lastIndex=0;i.test(e)&&(e=e.replace(i,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return l=eval("("+e+")"),typeof f==="function"?h({"":l},""):l;throw new SyntaxError("JSON.parse");})})();
(function(){if(!this.localStorage)if(this.globalStorage)try{this.localStorage=this.globalStorage}catch(m){}else{var f=document.createElement("div");f.style.display="none";document.getElementsByTagName("head")[0].appendChild(f);if(f.addBehavior){f.addBehavior("#default#userdata");var p=this.localStorage={length:0,setItem:function(e,h){f.load("localStorage");e=i(e);f.getAttribute(e)||this.length++;f.setAttribute(e,h);f.save("localStorage")},getItem:function(e){f.load("localStorage");e=i(e);return f.getAttribute(e)},
removeItem:function(e){f.load("localStorage");e=i(e);f.removeAttribute(e);f.save("localStorage");this.length=0},clear:function(){f.load("localStorage");for(var e=0;attr=f.XMLDocument.documentElement.attributes[e++];)f.removeAttribute(attr.name);f.save("localStorage");this.length=0},key:function(e){f.load("localStorage");return f.XMLDocument.documentElement.attributes[e]}},i=function(e){return e.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g,
"-")};f.load("localStorage");p.length=f.XMLDocument.documentElement.attributes.length}}})();