function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function changeRowColour(rowID,yearID){
	var tds = MM_findObj(rowID).getElementsByTagName("td");
	for(var i=0;i< tds.length;i++){
		var currentTd = tds[i];
		currentTd.style.color = "#EF2501";
		currentTd.style.background = "#FFFFFF";
		currentTd.style.border = "1px solid #F5F5F5";
		currentTd.style.padding = "5px 0px 3px 9px";
	}
	obj = MM_findObj(yearID);
	obj.style.padding = "5px 0px 4px 0px";
}
function changeRowColourBack(rowID,yearID){
	var tds = MM_findObj(rowID).getElementsByTagName("td");
	for(var i=0;i< tds.length;i++){
		var currentTd = tds[i];
		currentTd.style.color = "#666666";
		currentTd.style.background = "#F5F5F5";
		currentTd.style.border = "none";
		currentTd.style.borderRight = "1px solid #FFFFFF";
		currentTd.style.borderBottom = "1px solid #FFFFFF";
		currentTd.style.padding = "6px 0px 4px 10px";
	}
	obj = MM_findObj(yearID);
	obj.style.padding = "6px 0 4px 1px";
}

function validateForm(){
	if(MM_findObj('_firstName').value.length > 0 && MM_findObj('_lastName').value.length > 0 && MM_findObj('_emailAddress').value.length > 0 && MM_findObj('_subject').value.length > 0 && MM_findObj('_message').value.length > 0){
		MM_findObj('contactForm').submit();
	} else {
		obj = MM_findObj('error');
		if (!obj) return;
		obj.style.display = "block";
	}
}
