    var color = new Array(2);
    color[0] = 'white';
    color[1] = 'yellow';


function Flip_It(name)  {

var theTd = document.getElementById(name + "_td");
var val    = document.getElementById(name);

// alert("the color is " + theTd.style.backgroundColor);

var value = val.getAttribute('value');

value =  value - 0;

var boolsw = ((value + 1) % 2);

// alert("element " + name + " value=" + value + "   boolsw=" + boolsw);

theTd.style.backgroundColor = color[boolsw];
val.setAttribute('value',boolsw);

}



function Page_It(page_num)  {

Page_element = document.getElementById("Paging");
Page_element.setAttribute("value",page_num);

document.forms['dmgform'].submit();

}


var reset_list = new Array( "New_Merch", 1, "Available", 1, "Special", 1, "Pre_Order", 1, "Cd_Sale", 1, "Used_Stock", 1, "Work", 0, "fmt_CD", 0, "fmt_LP", 0, "fmt_VHS", 0, "fmt_Cassette", 0, "fmt_DVD", 0, "fmt_Miscellany", 0);

function ClearForm()  {

var i = 0;

while ( i < reset_list.length )  {

    var theTd = document.getElementById(reset_list[i] + "_td");
    var val    = document.getElementById(reset_list[i]);
    var next = i + 1;
    var color_num = reset_list[next];
    theTd.style.backgroundColor = color[color_num];
    val.setAttribute('value',color_num);
    // do first row input field
    var theTd = document.getElementById("search_01");
    theTd.setAttribute('value',"");
    i++; i++;
}

}







//
// Make the search form vanish. This is invoked when there are search results
//
function toogle_search()  {

    var theTd = document.getElementById("searchform");
    // alert("theTd = '" + theTd + "'")
    // var val   = theTd.style.display;
    theTd.style.display = "none";
    var theTd = document.getElementById("expandsearchform");
    theTd.style.display = "block";

}

function toggleback()  {

    var theTd = document.getElementById("searchform");
    theTd.style.display = "block";
    var theTd = document.getElementById("expandsearchform");
    theTd.style.display = "none";
    // alert("toggleback() exiting");

}
