function DoSearch(param)
{
    var frm = document.frmSearch;
    frm.REQUEST.value = param;
    frm.submit();
}

var current_n;
var bg;
var mark_list = new Array();
var color_list = new Array(20);
for (i=0; i < color_list.length; i++)
    color_list[i]=new Array(2)

color_list[0][0] = 'G';
color_list[0][1] = '#EBEBEB';
color_list[1][0] = 'P';
color_list[1][1] = '#DC9682';
color_list[2][0] = 'A';
color_list[2][1] = '#C8C8C8';
color_list[3][0] = 'V';
color_list[3][1] = '#0F820F';
color_list[4][0] = 'L';
color_list[4][1] = '#0F820F';
color_list[5][0] = 'I';
color_list[5][1] = '#0F820F';
color_list[6][0] = 'M';
color_list[6][1] = '#E6E600';
color_list[7][0] = 'C';
color_list[7][1] = '#E6E600';
color_list[8][0] = 'F';
color_list[8][1] = '#3232AA';
color_list[9][0] = 'Y';
color_list[9][1] = '#3232AA';
color_list[10][0] = 'W';
color_list[10][1] = '#B45AB4';
color_list[11][0] = 'H';
color_list[11][1] = '#8282D2';
color_list[12][0] = 'K';
color_list[12][1] = '#145AFF';
color_list[13][0] = 'R';
color_list[13][1] = '#145AFF';
color_list[14][0] = 'Q';
color_list[14][1] = '#00DCDC';
color_list[15][0] = 'N';
color_list[15][1] = '#00DCDC';
color_list[16][0] = 'E';
color_list[16][1] = '#E60A0A';
color_list[17][0] = 'D';
color_list[17][1] = '#E60A0A';
color_list[18][0] = 'S';
color_list[18][1] = '#FA9600';
color_list[19][0] = 'T';
color_list[19][1] = '#FA9600';


Array.prototype.getIndex=function(val)
{
    for(i=0;i<this.length;i++){
        if(this[i]==val) return i;
    }
    return -1;
}

function  getColor(p) 
{
    for(i=0; i < color_list.length; i++){
        if (color_list[i][0] == p) 
            return color_list[i][1];
    }
    return 'yellow';    
}

function n(n)
{
    current_n = n;
    bg = document.getElementById('n' + current_n).style.backgroundColor;
    document.getElementById('n' + current_n).style.backgroundColor = 'yellow';
}

function p(n)
{
    current_n = n;    
    bg = document.getElementById('p' + current_n).style.backgroundColor;
    document.getElementById('p' + current_n).style.backgroundColor = 'yellow';
}

function t(n)
{
    current_n = n;    
    bg = document.getElementById('t' + current_n).style.backgroundColor;
    document.getElementById('t' + current_n).style.backgroundColor = 'yellow';
}

function w(n)
{
    if (current_n == undefined) 
        return;
    var i = mark_list.getIndex(current_n);
    if (i == -1) {    
        document.getElementById('n' + current_n).style.backgroundColor = 'white';
        document.getElementById('p' + current_n).style.backgroundColor = 'white';
        if (document.getElementById('t' + current_n) != undefined) {
            document.getElementById('t' + current_n).style.backgroundColor = 'white';
        }
    } else {
        document.getElementById('n' + current_n).style.backgroundColor = bg;
        document.getElementById('p' + current_n).style.backgroundColor = bg;
        if (document.getElementById('t' + current_n) != undefined) {
            document.getElementById('t' + current_n).style.backgroundColor = bg;
        }
    }
}

function nw(n)
{
    document.getElementById('n'+n).style.backgroundColor = 'white';
}

function m(n,p) {

    var i = mark_list.getIndex(n);
    if (i == -1) {
        mark_list.push(n);
        bg = getColor(p);
    } else {
        mark_list.splice(i, 1);
        bg = 'white';    
    }
    document.getElementById('n' + n).style.backgroundColor = bg;
    document.getElementById('p' + n).style.backgroundColor = bg;
    if (document.getElementById('t' + n) != undefined) {
        document.getElementById('t' + n).style.backgroundColor = bg;
    }

}

