﻿var search_current = 1;

/*
function change_search_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_search_div(id,name,font,total,on_css,off_css) {
    $(name+search_current).style.display = "none";
    $(font+search_current).removeClassName(on_css);
    $(font+search_current).addClassName(off_css);
    $(name+id).style.display = "block";
    $(font+id).removeClassName(off_css);
    $(font+id).addClassName(on_css);
    search_current = id;
}
                                      
function go_search_left_right(position,name,font,total,on_css,off_css) {
    var next_current = 0;
    if (position == 'left') {
        if (search_current > 1) {
            next_current = search_current - 1;
            change_search_div(next_current,name,font,total,on_css,off_css);
        }
    } else if (position == 'right') {
        if (search_current < total) {
            next_current = search_current + 1;
            change_search_div(next_current,name,font,total,on_css,off_css);
        }
    }
}
                                        
//change_div(1);