var curSel = 1;
var color1 = 'linen';
var color2 = '#993333';

function OnMouseOverTD( obj, i )
{
	var id = 'ti' + i;
	var id2 = 'tr' + i;
	var id3 = 'tm' + i;
	var id4 = 'a' + i;
	color2 = obj.style.backgroundColor;
	obj.style.backgroundColor = color1;
	obj.style.border = 'white 1px solid';
	document.getElementById(id4).style.color = 'black';
	
	if ( i != curSel )
	{
		document.getElementById(id).style.backgroundColor = color1;
		document.getElementById(id2).style.backgroundColor = color1;
		document.getElementById(id3).style.backgroundColor = color1;
	}
}
function OnMouseOutTD( obj, i )
{
	var id = 'ti' + i;
	var id2 = 'tr' + i;
	var id3 = 'tm' + i;
	var id4 = 'a' + i;
	obj.style.backgroundColor = color2;
	obj.style.border = 'tan 1px solid';
	document.getElementById(id4).style.color = 'white';
	if ( i != curSel )
	{
		document.getElementById(id).style.backgroundColor = color2;
		document.getElementById(id2).style.backgroundColor = color2;
		document.getElementById(id3).style.backgroundColor = color2;
	}
}
function SetSelected(inIdx)
{
	curSel = inIdx;
	var i = 0;
	for ( i = 1; i <= 100; i++ )
	{
		var id = 'ti' + i;
		var id2 = 'tr' + i;
		var id3 = 't' + i;
		if ( document.getElementById(id) == null || document.getElementById(id2) == null || document.getElementById(id3) == null ) return;
		if ( i == inIdx )
		{
			var bgCol = document.getElementById(id3).bgColor;
			document.getElementById(id).style.filter = 'progid:DXImageTransform.Microsoft.Gradient(startColorStr="Linen", endColorStr="' + bgCol.toString() + '", gradientType="1")';
			document.getElementById(id2).style.filter = 'progid:DXImageTransform.Microsoft.Gradient(startColorStr="' + bgCol.toString() + '", endColorStr="Linen", gradientType="1")';
		}
		else
		{
			var bgCol = document.getElementById(id3).bgColor;
			document.getElementById(id).style.filter = '';
			document.getElementById(id2).style.filter = '';
			document.getElementById(id).style.backgroundColor = bgCol;
			document.getElementById(id2).style.backgroundColor = bgCol;
		}
	}
}
function SearchProduct()
{
	var sText = document.getElementById("txbSearch").value;
	if ( sText == "" )
	{
		alert("You must enter a search word or phrase!");
		return;
	}
	document.location.href = "products.aspx?search=" + sText;
}
