var timer = null;
var offset = 10000;
var index = 0;

//slider
function slideImage(i){
	var id = 'topSlider'+ i;
    $('#'+ id).animate(
		{opacity: 1}, 500, function(){
            $(this).find('.word').animate({height: 'show'}, 'slow');
        }).show()
        .siblings(':visible')
        .find('.word').animate({height: 'show'},'fast',function(){$(this).parent().animate({opacity: 0}, 500).hide();});
}

//get index
function getIndex(v){
    for(var i=0; i < i.length; i++){
		if (i == v) return i;
    }
}
function auto(){
    index++;
    if (index > 4){
        index = 0;
    }
    slideImage(index);
    timer = window.setTimeout(auto, offset);
}
$(function(){    
    auto();
});
