var index = 1;
var indexcount = -1
var rotatespeed = 6000;
var timoutid = -1;

function rotateheader() {
    clearTimeout(timeoutid);

    $(".headeritem:nth-child("+index+")").stop(true, true).fadeOut("normal");

    if (index == indexcount)
        index = 1;
    else
        index++;

    $(".headeritem:nth-child("+index+")").stop(true, true).fadeIn("normal");

    timeoutid = setTimeout("rotateheader()", rotatespeed);
}

$(document).ready(function() {
    indexcount = $(".headeritem").length;
    timeoutid = setTimeout("rotateheader()", rotatespeed);
});
