var oldid = 0;

function changeBorder(idnr, firstid) {
	document.getElementById('thumbimageid'+firstid).style.border = '2px solid transparent';
	document.getElementById('thumbimageid'+idnr).style.border = '2px solid #c51108';

	if(oldid == 0) {
		oldid = idnr;
	} else {
		document.getElementById('thumbimageid'+oldid).style.border = '2px solid transparent';
		oldid = idnr;
	}
}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}