var lastpanel;
var lastpromo;

var pink = '#cc00cc';
var blue = '#3366ff';
var grey = '#999999';
var khaki = '#dfd9c5';
var brick = '#e1bf93';


// FUNCTION: rollover colours on the panel tables
function panelroll (panel, colour)
{
	lastroll();
	tableCellColour(panel, 0, colour);
	lastpanel = panel;
}


// FUNCTION: rollover colours on the promo tables
function promoroll (promo)
{
	lastroll();
	tableCellColour(promo, 2, blue);
	tableCellColour(promo, 3, brick);
	lastpromo = promo;
}


// FUNCTION: revert colours on the last panel and promo
function lastroll()
{
	if (lastpanel) tableCellColour(lastpanel, 0, grey);
	if (lastpromo) tableCellColour(lastpromo, 2, grey), tableCellColour(lastpromo, 3, khaki);
}


// FUNCTION: utility function to change a table cells background colour
function tableCellColour (table, cell, colour)
{
	if (table.getElementsByTagName) table.getElementsByTagName('td')[cell].style.backgroundColor = colour;
}