﻿var sp_coverage_list = 1;

/*
function change_div(id,name,font,total) {
    for (i=1; i<=total; i++) {
        document.getElementById(name+i).style.display = "none";
        document.getElementById(font+i).color = "#0044A9";
    }
    document.getElementById(name+id).style.display = "block";
    document.getElementById(font+id).color = "red";
    current = id;
}
*/

function change_sp_coverage_div(id,name,font,total,on_css,off_css) {
    $(name+sp_coverage_list).style.display = "none";
    $(font+sp_coverage_list).removeClassName(on_css);
    $(font+sp_coverage_list).addClassName(off_css);
    $(name+id).style.display = "block";
    $(font+id).removeClassName(off_css);
    $(font+id).addClassName(on_css);
    sp_coverage_list = id;
}
                                      
function go_sp_coverage_left_right(position,name,font,total,on_css,off_css) {
    var next_current = 0;
    if (position == 'left') {
        if (sp_coverage_list > 1) {
            next_current = sp_coverage_list - 1;
            change_sp_coverage_div(next_current,name,font,total,on_css,off_css);
        }
    } else if (position == 'right') {
        if (sp_coverage_list < total) {
            next_current = sp_coverage_list + 1;
            change_sp_coverage_div(next_current,name,font,total,on_css,off_css);
        }
    }
}
                                        
//change_div(1);