
function hoverRow(obj)
{
	obj.style.background='#EEEED3';
}

function unhoverRow(obj)
{
	if (obj.className.toLowerCase().indexOf('odd') > -1)
	{
		obj.style.background='#DDDDDD';
	}else{
		obj.style.background='transparent';
	}
}


function hoverTable(elem, numrows)
{
	j = 0;
	
	for (i = 1; i <= elem.parentNode.childNodes.length; i++)
	{
		if (elem.parentNode.childNodes[i].nodeType == 1)
		{
			j++;
			
			hoverRow(elem.parentNode.childNodes[i]);
		}
		
		if (j == numrows)
		{
			i = (elem.parentNode.childNodes.length + 1);
		}
	}
}

function unHoverTable(elem, numrows)
{
	j = 0;
	
	for (i = 1; i <= elem.parentNode.childNodes.length; i++)
	{
		if (elem.parentNode.childNodes[i].nodeType == 1)
		{
			j++;
			
			unhoverRow(elem.parentNode.childNodes[i]);
		}
		
		if (j == numrows)
		{
			i = (elem.parentNode.childNodes.length + 1);
		}
	}
}

function showElement(id, mode)
{
	// Default mode
	var mode = (mode == null) ? 'inline' : mode;
	
	if (document.getElementById(id))
	{
		document.getElementById(id).style.display = mode;
	}else{
//		alert('not found: '+id);
	}
}

function hideElement(id)
{
	if (document.getElementById(id))
	{
		document.getElementById(id).style.display = 'none';
	}else{
//		alert('not found: '+id);
	}
}

function toggleElement(id)
{
	if ($(id))
	{
		if ($(id).style.display == 'none')
		{
			$(id).show();
		}else{
			$(id).hide();
		}
	}else{
//		alert('not found: '+id);
	}
}

function isNumeric(vTestValue)
{
	// put the TEST value into a string object variable
	var sField = new String(vTestValue);
	
	// check for a length of 0 - if so, return false
	if(sField.length==0) { return false; }
	else if(sField.length==1 && (sField.charAt(0) == '.' || sField.charAt(0) == ',' || (sField.charAt(0) == '-'))) { return false; }
	
	// loop through each character of the string
	for(var x=0; x < sField.length; x++) {
		// if the character is < 0 or > 9, return false (not a number)
		if((sField.charAt(x) >= '0' && sField.charAt(x) <= '9') || sField.charAt(x) == '.' || sField.charAt(x) == ',' || (sField.charAt(x) == '-' && x==0)) { /* do nothing */ }
		else { return false; }
	}
	
	// made it through the loop - we have a number
	return true;
}
