function Shop2() {
	/* to allow java-esque self referencing */
	var self = this;
	
	this.add = function( item, option ) {
		if( option != undefined && option != '' ) { bongo.setCookie( 'cart', bongo.getCookie('cart') + item + '.' + option + ';' ); }
		else                                      { bongo.setCookie( 'cart', bongo.getCookie('cart') + item +                ';' ); }
	};
	
	this.edit = function( item, option, num ) {
		/* split up existing cart */
		var items = bongo.getCookie('cart').split(';');
		var cart  = '';
		
		/* re-add any non-related items */
		for( i in items ) {
			if( items[i] ) {
				if( option != undefined && option != '' ) { if( items[i] != item + '.' + option ) { cart += ( items[i] + ';' ); } }
				else                                      { if( items[i] != item                ) { cart += ( items[i] + ';' ); } }
			}
		}
		
		/* add the correct number of items */
		for( n=1; n<=num; n++ ) {
			if( option != undefined && option != '' ) { cart += ( item + '.' + option + ';' ); }
			else                                      { cart += ( item + ';'                ); }
		}
		
		/* store the new cart and reload */
		bongo.setCookie( 'cart', cart );
		location.reload();
	};
}

var shop2 = new Shop2();
