function ifProductCanBeAdded(link, prod_id, cat_id) {
    if (0 == prod_id || 0 == cat_id) {
        alert('This product can\'t be added');
        return false;
    }

    if (5 == cat_id) {
        if (parseFloat($('#gift_card_price_'+prod_id).val()).toFixed(2) == 0 || isNaN(parseFloat($('#gift_card_price_'+prod_id).val()))) {
            alert('Please enter desired price for your gift card');
            return false;
        } else if (parseFloat($('#gift_card_price_'+prod_id).val()).toFixed(2) < 10 || parseFloat($('#gift_card_price_'+prod_id).val()).toFixed(2) > 500) {
            alert('Please enter price for your gift card between 10 and 500 dollars');
            return false;
        } else {
            document.location.href = $(link).attr('href') + '&price=' + parseFloat($('#gift_card_price_'+prod_id).val()).toFixed(2);
            return false;
        }
    }

    document.location.href = $(link).attr('href');
    return false;
}
