function getData() {
    var current_row_id = parseInt($('.row:first').attr('id'));
    var next_row = $('#all_rows').find('#base_'+current_row_id).prev();
    if (next_row.length) {
        next_row_id = next_row.attr('id').split('_')[1];
    } else {
        next_row_id = 14;
    };

    $('.row:last').remove();

    $('.row').animate({
        top: '+=45',
        },
        'fast',
        function() {
            row_position = $('.row').index($(this));
            $(this).css('background-color', row_colors[row_position + 1]);
        }
    );

    new_current_row = $('#all_rows').find('#base_'+next_row_id).clone();
    new_current_row.addClass('row');
    new_id = new_current_row.attr('id').split("_")[1];
    new_current_row.attr('id', new_id);
    new_current_row.removeClass('novisible');
    new_current_row.addClass('visible');

    if ($('.row:first').hasClass('align_left')) {
        new_current_row.removeClass('align_left');
        new_current_row.addClass('align_right');
        new_current_row.css('left', '50px');
    } else {
        new_current_row.removeClass('align_right');
        new_current_row.addClass('align_left');
        new_current_row.css('left', '40px');
    };

    $('#rows_container').prepend(new_current_row);
    new_current_row.show();

    setTimeout("getData()",3000);
};

function getHomeData() {
    var current_row_id = parseInt($('.row:first').attr('id'));
    var next_row = $('#all_rows').find('#base_'+current_row_id).prev();
    if (next_row.length) {
        next_row_id = next_row.attr('id').split('_')[1];
    } else {
        next_row_id = 14;
    };
    $('.row:last').remove();

    $('.row').animate({
        top: '+=45',
        },
        'fast',
        function() {
            //var row = $(this);
            //$.each(['news_row', 'events_row', 'hotels_row', 'tickets_row', 'transmitions_row'], function(index, value) {
            //    row.removeClass(value);
            //});
            //row_position = $('.row').index(row);
            //row.addClass(row_types[row_position + 1]);
        }
    );

    new_current_row = $('#all_rows').find('#base_'+next_row_id).clone();
    new_current_row.addClass('row');
    new_id = new_current_row.attr('id').split("_")[1];
    new_current_row.attr('id', new_id);
    new_current_row.removeClass('novisible');
    new_current_row.addClass('visible');

    if ($('.row:first').hasClass('align_left')) {
        new_current_row.removeClass('align_left');
        new_current_row.addClass('align_right');
        new_current_row.css('left', '50px');
    } else {
        new_current_row.removeClass('align_right');
        new_current_row.addClass('align_left');
        new_current_row.css('left', '40px');
    };

    $('#rows_container').prepend(new_current_row);
    new_current_row.show();

    setTimeout("getHomeData()",3000);
};

