function addContactRow ()
{
	var theTable = document.getElementById ('contactstable');
	
	var lastRow = theTable.rows.length;
	
	// we want the row before last
	lastRow -= 1;
	
	var newRow = theTable.insertRow (lastRow);
	
	// now the cells for each row
	var cells = new Array ();
	for (i=0;i<7;i++)
		cells[i] = newRow.insertCell (-1);
	
	cells[6].align='center';	
		
	// and add the fields
	
	lastRow--;
	
	var newtitle = document.createElement('input');
	newtitle.type = 'text';
	newtitle.name = 'contact_' + lastRow + '_title';
	newtitle.id = 'txtRow' + lastRow;
	newtitle.size = 4;	
	
	var newforename = document.createElement('input');
	newforename.type = 'text';
	newforename.name = 'contact_' + lastRow + '_firstname';
	newforename.id = 'txtRow' + lastRow;
	newforename.size = 8;	
	
	var newsurname = document.createElement('input');
	newsurname.type = 'text';
	newsurname.name = 'contact_' + lastRow + '_surname';
	newsurname.id = 'txtRow' + lastRow;
	newsurname.size = 8;
	
	var newjob = document.createElement('input');
	newjob.type = 'text';
	newjob.name = 'contact_' + lastRow + '_job';
	newjob.id = 'txtRow' + lastRow;
	newjob.size = 12;	
	
	var newemail = document.createElement('input');
	newemail.type = 'text';
	newemail.name = 'contact_' + lastRow + '_email';
	newemail.id = 'txtRow' + lastRow;
	newemail.size = 35;	
	
	var newphone = document.createElement('input');
	newphone.type = 'text';
	newphone.name = 'contact_' + lastRow + '_phone';
	newphone.id = 'txtRow' + lastRow;
	newphone.size = 12;
	
	var newdelete = document.createElement('input');
	newdelete.type = 'checkbox';
	newdelete.name = 'contact_' + lastRow + '_delete';
	newdelete.id = 'txtRow' + lastRow;	
	
	cells[0].appendChild (newtitle);	
	cells[1].appendChild (newforename);	
	cells[2].appendChild (newsurname);
	cells[3].appendChild (newjob);	
	cells[4].appendChild (newemail);	
	cells[5].appendChild (newphone);	
	cells[6].appendChild (newdelete);
	
	var numcontacts = document.getElementById ('numcontacts');
	numcontacts.value++;
	
	return false;
}