group_width = 280;
position = 0;

function moveRight(){
    groups = $(".gallery .text").children().length;
    if (position < groups-1){
        position += 1;
        $(".gallery .text").animate({left: "-"+position*group_width+"px"}, "normal");
    }
    if (position == groups-1){
        $(".gallery .next").addClass("inactive");
    }
    $(".gallery .prev").removeClass("inactive");
}
function moveLeft(){
    if (position >= 1){
        position -= 1;
        $(".gallery .text").animate({left: "-"+position*group_width+"px"}, "normal");
    }
    if (position == 0){
        $(".gallery .prev").addClass("inactive");
    }
    $(".gallery .next").removeClass("inactive");
}
