// Functions for mouseover effects on tables
var strMouseOverColor = "#BBCCDD";

function doHeaderTDMouseOver(objTD)
{
	// Change color & border
	objTD.style.backgroundColor = strMouseOverColor;
	objTD.style.borderColor = '#000000';
}

function doHeaderTDMouseOut(objTD, strBGColor)
{
	// Change color & border back to normal
	objTD.style.backgroundColor = strBGColor;
	objTD.style.borderColor = strBGColor;
}

function doReviewTRMouseOver(strReview_ID)
{

	var trReview;
	var tdReviewLeft;
	var tdReviewRight;
	
	if (document.all) 
	{
		// Get the objects
		trReview = eval("document.all.trReview" + strReview_ID);
		tdReviewLeft = eval("document.all.tdReviewLeft" + strReview_ID);
		tdReviewRight = eval("document.all.tdReviewRight" + strReview_ID);

	} else {
	
		trReview = document.getElementById("trReview" + strReview_ID);
		tdReviewLeft = document.getElementById("tdReviewLeft" + strReview_ID);
		tdReviewRight = document.getElementById("tdReviewRight" + strReview_ID);
	
	}
	
	// Change color & border of TR
	trReview.style.backgroundColor = strMouseOverColor;
	trReview.style.borderColor = '#000000';
	
	// Change color and border of TD cells
	tdReviewLeft.style.backgroundColor = strMouseOverColor;
	tdReviewLeft.style.borderColor = '#000000';
	tdReviewRight.style.backgroundColor = strMouseOverColor;
	tdReviewRight.style.borderColor = '#000000';
	
	// Show the shadow underneath video image
	showShadow(strReview_ID);

}

function doReviewTRMouseOut(strReview_ID, strBGColor)
{

	var trReview;
	var tdReviewLeft;
	var tdReviewRight;
	var objToElement;
	var fromElementReviewID;
	var toElementReviewID;
	var fromElement;
	var toElement;
	
	if (window.event)
	{

		fromElement = window.event.fromElement;
		toElement = window.event.toElement;
	
		// If just moving around within the row, then return
		// This improves performance and avoids a flicker
		if ((fromElement != null) && (toElement != null))
		{
			fromElementReviewID = fromElement.id;
			fromElementReviewID = fromElementReviewID.substr(fromElementReviewID.length - 3, 3);
			
			toElementReviewID = toElement.id;
			toElementReviewID = toElementReviewID.substr(toElementReviewID.length - 3, 3);
			
			if (fromElementReviewID == toElementReviewID)
				return;
		}

	}
		 
	if (document.all) 
	{
		// Get the objects
		trReview = eval("document.all.trReview" + strReview_ID);
		tdReviewLeft = eval("document.all.tdReviewLeft" + strReview_ID);
		tdReviewRight = eval("document.all.tdReviewRight" + strReview_ID);

	} else {
	
		trReview = document.getElementById("trReview" + strReview_ID);
		tdReviewLeft = document.getElementById("tdReviewLeft" + strReview_ID);
		tdReviewRight = document.getElementById("tdReviewRight" + strReview_ID);
	
	}

	// Change color & border of TR
	trReview.style.backgroundColor = strBGColor;
	trReview.style.borderColor = strBGColor;
			
	// Change color and border of TD cells
	tdReviewLeft.style.backgroundColor = strBGColor;
	tdReviewLeft.style.borderColor = strBGColor;
	tdReviewRight.style.backgroundColor = strBGColor;
	tdReviewRight.style.borderColor = strBGColor;

	// Hide the shadow underneath video image
	hideShadow(strReview_ID);

}

function showShadow(strReview_ID)
{
	var imgVideoBox;
	var imgShadow;

	if (document.all) 
	{
		// Get the image objects
		imgVideoBox = eval("document.all.imgVideoBox" + strReview_ID);
		imgShadow = eval("document.all.imgShadow" + strReview_ID);

	} else {
	
		imgVideoBox = document.getElementById("imgVideoBox" + strReview_ID);
		imgShadow = document.getElementById("imgShadow" + strReview_ID);
	
	}

	// Move box image up and left 5 pixels
	with (imgVideoBox.style)
	{
		position = "absolute";
		top = imgShadow.offsetTop - 5;
		left = imgShadow.offsetLeft - 5;
	}

}

function hideShadow(strReview_ID)
{
	var imgVideoBox;
	var imgShadow;
	
	if (document.all) 
	{
		// Get the image objects
		imgVideoBox = eval("document.all.imgVideoBox" + strReview_ID);
		imgShadow = eval("document.all.imgShadow" + strReview_ID);
		
	} else {
	
		imgVideoBox = document.getElementById("imgVideoBox" + strReview_ID);
		imgShadow = document.getElementById("imgShadow" + strReview_ID);
	
	}

	// Move box right over shadow to hide it
	with (imgVideoBox.style)
	{
		position = "absolute";
		top = imgShadow.offsetTop;
		left = imgShadow.offsetLeft;
	}
}


function doReviewCellResize(strReview_ID) {

	var divCell;
	var divDesc;
	
	if (document.all) 
	{

		divCell = eval("document.all.divCell" + strReview_ID);
		divDesc = eval("document.all.divDesc" + strReview_ID);
		
	} else {
	
		divCell = document.getElementById("divCell" + strReview_ID);
		divDesc = document.getElementById("divDesc" + strReview_ID);
	
	}

	divCell.innerHTML += (" " + divCell.offsetHeight);
	
	// If description is taller than cell, resize it
	if (divCell.offsetHeight < divDesc.offsetHeight + 30)
		divCell.style.height = divDesc.offsetHeight + 30;
		
}

function divCellMouseOver(divCell, imgVideoBox)
{
	divCell.style.borderColor = "#000000";
	divCell.style.backgroundColor = strMouseOverColor;
	videoBoxMouseOver(imgVideoBox);
}

function divCellMouseOut(divCell, strBGColor, imgVideoBox)
{
	divCell.style.borderColor = strBGColor;
	divCell.style.backgroundColor = strBGColor;
	videoBoxMouseOut(imgVideoBox);
}

function videoBoxMouseOver(imgVideoBox)
{
	imgVideoBox.style.right = "134px";
	imgVideoBox.style.top = "5px";
}

function videoBoxMouseOut(imgVideoBox)
{
	imgVideoBox.style.right = "129px";
	imgVideoBox.style.top = "10px"; 
}
