var index = 1;
var msg=0;
window.onload = star;

function star() {
    msg = setInterval(showNext, 5000);
}

function stop(a) {
    clearInterval(msg);
    index = a;
}
function change(a) {
    $("#sub0").hide(2000);
    $("#sub1").hide(2000);
    $("#sub2").hide(2000);
    $("#sub" + a).show(2000);
     
    //$("#" + a).fadeIn(1000);
}
//$("p").animate({
//    left: 50, opacity: 'show'
//}, 500);

function showNext() {
    if (index >= 3) {
        index = 0;
    }
    change(index);
    index++;
}
