function highlightRow(e) {e.style.backgroundColor='#FFCC66';}
function unhighlightRow(e){e.style.backgroundColor='';}

// Open centered window.
// @param target: Target window
// @param w: Width in pixels or percent (0.01 - 1)
// @param h: Height in pixels or percent (0.01 - 1)
// @param href: Hyperlink
// @param features: optional window features
function openCenteredWindow (target, w, h, href, features)
{
	var sw = screen.availWidth;
	var sh = screen.availHeight;
	if (w==null || w<0) w = 0.85;
	if (h==null || h<0) h = 0.85;
	if (w>0 && w<=1) w = sw * w;
	if (h>0 && h<=1) h = sh * h;

	var left = ((sw - w - 10) * .5);
	var top = ((sh - h - 30) * .5);
	if (left<1) left=1;
	if (top<1) top=1;

	openNewWindow(target, w, h, href, left, top, features);
	return (false);
}


// @param features - optional window features
function openNewWindow (winname, width, height, myurl, xpos, ypos, features)
{
	var winref;
	var options;
	//alert(xpos + "," + ypos);

	if (width == "")
	{
		width = 500;
		//width = window.screen.availWidth - 4;
	}

	if (features != null)
	{
		options = features + ",width=" + width;
	}
	else
	{
		options = "toolbar=no,location=no,resizable=yes,scrollbars=yes,width=" + width;
	}

	if (height != "")
	{
		options += ",height=" + height;
	}
	if (xpos != null && xpos != "")
	{
		options += ",left=" + xpos;
	}
	if (ypos != null && ypos != "")
	{
		options += ",top=" + ypos;
	}
	//alert(options);

	try
	{
		winref = window.open("", winname, options);

		if(winref == null || winref.closed)
		{
			showWinError();
			return null;
		}

		if (myurl != null && myurl.length != 0)
		{
			winref.location.replace(myurl);
		}

	}
	catch (e)
	{
		showWinError();
	}

	return false; // for when onlick returns value to anchor tag
}

function showWinError()
{
	alert("Unable to open window.\n\nThis may be caused by pop-up blocker software.\nPlease enable the display of pop-ups from this site.");
}

//-------------------------------------------------------------------
// isBlank(value)
//   Returns true if value only contains spaces
//-------------------------------------------------------------------
function isBlank(val)
{
	if(val==null){return true;}
	for(var i=0;i<val.length;i++)
	{
		var v=val.charAt(i);
		if ((v!=' ')&&(v!="\t")&&(v!="\n")&&(v!="\r")){return false;}
	}
	return true;
}
