	warenkorb= "";

	jQuery.get("/cart_count.php", function(data){
		warenkorb = data;
		jQuery("#menu-item-28 a").html("Warenkorb ("+warenkorb+")");
	});
	
	jQuery(".product_form").live("submit", function() {
		
		warenkorb = parseInt(jQuery("[name='wpsc_quantity_update']").val())+parseInt(warenkorb);
		jQuery("#menu-item-28 a").html("Warenkorb ("+warenkorb+")");
	});
	
	
	// update the price when the variations are altered.
	
jQuery(".wpsc_select_variation").live("change", function() {
		parent_form = jQuery(this).parents("form.product_form");
		if ( parent_form.length == 0 )
			return;		
			
		form_values =jQuery("input[name='product_id'], .wpsc_select_variation",parent_form).serialize( );
		jQuery.post( 'index.php?update_product_price=true', form_values, function(returned_data) {
			variation_msg = '';
			eval(returned_data);
				if( typeof(price) !== 'undefined' && typeof(old_price) !== 'undefined' && typeof(you_save) !== 'undefined' && typeof(numeric_price) !== 'undefined' ) {
					target_id = "product_price_"+product_id;
					price_target_selector = "#" + target_id + ".pricedisplay, ." + product_id + " .currentprice";
					second_target_id = "donation_price_"+product_id;
					third_target_id = "old_product_price_"+product_id;
					yousave_target_id = "yousave_"+product_id;
					buynow_id = "BB_BuyButtonForm"+product_id;
					if(jQuery("input#"+target_id).attr('type') == 'text') {
						jQuery("input#"+target_id).val(numeric_price);
					} else {
						jQuery(price_target_selector).html(price);
						jQuery("#"+third_target_id).html(old_price);
						jQuery("#"+yousave_target_id).html(you_save);
					}
					jQuery("input#"+second_target_id).val(numeric_price);
				}
				$(".currentprice").css("opacity", "1");


			}
			)
	});
