var akv_feature_hover = 0;
function rotateFeature() {
    // don't rotate if the mouse cursor is hovering over the features
    if (akv_feature_hover) return;
    
    var selected_title = cssQuery('#feature-titles a.selected')[0];
    var selected_image = cssQuery('#feature-images a.selected')[0];
    var current_id = new Number(selected_title.id.substring(14));

    // out with the old
    selected_title.className = '';
    selected_image.className = '';

    // try to find the new
    var new_id = current_id+1;
    new_id = new_id.toString();

    var selector = '#feature-title-' + new_id
    var new_titles = cssQuery(selector);
    if (new_titles.length==0){
        new_titles = cssQuery('a#feature-title-0');
        var new_images = cssQuery('a#feature-image-0');
    }
    else {
        var new_images = cssQuery('a#feature-image-' + new_id);
    }

    // "select" the new
    new_titles[0].className = 'selected';
    new_images[0].className = 'selected';
}
