var top_image_array = new Array();
var top_image_array_cur_index = 0;

function init_rotate_top_images(){
    var t = setInterval(
        function(){
            _rotate_top_images();
        },
        4000
    );
}

function _rotate_top_images(){
    var el = null;
    
    if (top_image_array.length > 0){
        /* display */
        el = document.getElementById(top_image_array[top_image_array_cur_index]);
        if (el != null){
            el.className = 'banner';
        }
            
        /* hide the other */
        for (var i =0; i < top_image_array.length; ++i){
            el = document.getElementById(top_image_array[i]);
            if (el != null){
                if (i != top_image_array_cur_index){                    
                    el.className = 'banner hidden';
                }
            }
        }
    
        if (++top_image_array_cur_index >= top_image_array.length){
            top_image_array_cur_index = 0;
        }
    }
}

function template_hint(s){
    alert(s);
}

JKow.Event.addEvent('load', window, init_rotate_top_images);