function something()
{
	var x = window.localStorage.getItem('bbb');
	x = x*1 + 1;
	window.localStorage.setItem('bbb', x);
	alert(x);
};



function add_to_cart(id)
{
  var key = 'product_' + id
var x = window.localStorage.getItem(key);
x = x*1 + 1;
window.localStorage.setItem(key, x);
}
@@ -163,10 +163,8 @@
 )%0A%7B%0A
-  
 var 
@@ -184,16 +184,18 @@
 t_' + id
+ %0A
 %0Avar x =
@@ -242,16 +242,16 @@
 *1 + 1;%0A
-
 window.l
@@ -275,13 +275,454 @@
 em(key, x);%0A
+//number of items in the cart%0Aalert('Items in your cart: ' +cart_get_number_of_items());%0A%7D;%0A%0Afunction cart_get_number_of_items()%0A%7B%0A%0A  var cnt = 0;%0A  for(var i = 0; i %3C window.localStorage.length; i++)%0A  %7B%0A    var key = window.localStorage.key(i); // we get the key%0A    var value = window.localStorage.getItem(key); // get value, ruby: hh%5Bkey%5D = value%0A%0A    if(key.indexOf('product_') == 0)%0A   %7B%0A%0A    cnt = cnt + value*1;%0A%0A%0A   %7D%0A%7D%0Areturn cnt;%0A
 %7D

Add cart_get_number_of_items