//Most of the Code for kMaxLength functions comes
//from http://www.siteexperts.com/ie5/htc/ts08/page2.asp
//These only work in IE 5,6
function kMaxLengthKeyPress(eField,iLength) {
	//No max length if iLength = 0
	if(iLength == 0) return;
	//This method is actully called before the keypress actually
	//puts a value in the field so see if one more char can be added
	if(eField.value.length+1 <= iLength) return;
	//Stops event from propogating to the field and adding another char
	event.returnValue = false;
}
function kMaxLengthBeforePaste(eField,iLength) { event.returnValue = false; }
function kMaxLengthPaste(eField,iLength) {
	event.returnValue = false;
	//Get the selected text (will be part of the passed in eField)
	var oTR = document.selection.createRange();
	//Calculates how many chars can be inserted into the field
	//taking into account characters replaced in the selection
	var iInsertLength = iLength - eField.value.length + oTR.text.length;
	//Truncates the pasting data based on # chars left
	var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
	//Sets the pasted text in the selected text range
	oTR.text = sData;
}