$(function(){
    var imgBoxImgLength = $(".imgBoxImg").length;

    if(imgBoxImgLength > 1){
        $(".imgBoxImg").each(function(i){
            $(this).attr("id","imgBoxImg"+i);
        });
        headerImageInterval = window.setInterval("rotateHeaderImage()", 5000)
    }
});
var j = 0;
function rotateHeaderImage(){
    $("#imgBoxImg"+j).fadeOut("slow");
    j = (j+1) > ($(".imgBoxImg").length-1) ? 0 : j+1;
    $("#imgBoxImg"+j).fadeIn("slow");

}