
var currentPath = location.pathname;

function mouseover(thediv) 
{ 
	var thistd =  thediv;
	document.getElementById(thistd).style.backgroundColor='#999'; 
} 

function mouseout(thediv,whichUrl) 
{ 
	var thistd =  thediv;
	if (whichUrl) 
	{
		for (var i=0; i<whichUrl.length; i++)
		{
			if ( whichUrl[i] == currentPath ) {
				document.getElementById(thistd).style.backgroundColor='#F93';
				return;
			}
		}
	}
	document.getElementById(thistd).style.backgroundColor='#CCC';
} 


function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	else 
		countfield.value = maxlimit - field.value.length;
}
