function emptyMe(box)
{
    box.value = "";
}

function amIEmpty(box, value)
{
    if(box.value == '')
	box.value = value;
}

// $(function () {
//     // Add to cart with javascript function from product list
//     $('.js-buy_button').click(function (event) {
//         var amount = $(this).siblings('input[name=amount]').val();
//         if(put_in_cart(this, amount)) {
//             event.preventDefault();
//         }
//     });

//     // Add to cart with javascript function from product page
//     $('#add-to-cart-form').submit(function (event) {
//         var amount = $('input[name=amount]', this).val();
//         $(this).attr('data-product-id', $('input[name=cartString]').val());
//         put_in_cart(this, amount);
//         event.preventDefault();
//     });
// });

// function put_in_cart(sender, amount)
// {
//     var productId = $(sender).attr('id').replace('product_', '');
//     var result = null;
//     $.ajax({
//         type: "POST",
//         url: BASE_URL+"ajax/add_to_cart.php",
//         data: "product_id="+productId+"&amount="+amount,
//         async: false,
//         success: function(msg){
//             if(msg == "SUCCESS") {
//                 put_in_cart_success(sender);
//                 result = true;
//             } else {
//                 result = false;
//             }
//         }
//     });
//     return result;
// }

// function put_in_cart_success(sender)
// {
//     $.get(BASE_URL+'ajax/cart.php', function(data) {
//         var parent = $(sender).parent().parent();
//         console.log(parent);
//         $(parent).effect('transfer',{ to: "#cart", className: 'js-cart-transition' },500, function() {
//             $('#cart').html(data);
//         });
//     });
// }

// function put_in_cart_error(sender, msg)
// {
//     return false;
// }


