﻿
$(document).ready(function() {

    NextHeader();
    setInterval("NextHeader()", 15000);

});

function NextHeader() {

    var total = $("#hfHeaderTotal").val();
    var current = $("#hfHedaerCurrent").val();

    //hide all headers
    $('.HeaderImage').hide();

    //show the current header
    $('.HeaderImage:[rel=' + current + ']').fadeIn(750);


    //set current to the next image
    current = parseInt(current) + parseInt(1);

    if (current > total) {
        current = 1;
    }

    $("#hfHedaerCurrent").val(current);

}

