function text(){
    var stp = $('.top-text-place'),
            st = $('.top-text'),
            position = stp.offset(),
            top = position.top,
            left = position.left;

    st.css({
            width: stp.outerWidth(),
            top: top,
            left: left
    });
    stp.css('paddingTop',st.height());
}

function intval (mixed_var, base) {
 
    var tmp;
 
    var type = typeof(mixed_var);
 
    if (type === 'boolean') {
        return +mixed_var;
    } else if (type === 'string') {
        tmp = parseInt(mixed_var, base || 10);
        return (isNaN(tmp) || !isFinite(tmp)) ? 0 : tmp;
    } else if (type === 'number' && isFinite(mixed_var)) {
        return mixed_var | 0;
    } else {
        return 0;
    }
}

function speed_count_change(){
    var count = $('#speed_count').val();
    var sizeFlowers_id = $('#speed_sizeFlowers_id').val();
    $.post("/ajax/catalog/speed/getPrice.php?rand="+Math.random(), 
    {'sizeFlowers_id':sizeFlowers_id,'count':count},
    function(data,status) {
        if(status =='success') {
           
           if(data.result == 1){
                
                 $("#price_speed").text(data.price);


             } else {
                 alert('нет цены');


             }
             return false;
         }
    }
);
}




function basket_count_change(sizeFlowers_id,count){
     $.post("/ajax/catalog/basket/getPrice.php?rand="+Math.random(), 
    {'sizeFlowers_id':sizeFlowers_id,'count':count},
    function(data,status) {
        if(status =='success') {
           if(data.result == 1){
                $("#price").text(data.price);
                $("#price-"+sizeFlowers_id).text(data.price_flower);
            } else {
                 alert('нет цены');
            }
             return false;
         }
    }
);
}
