var highlights;

//Add highlight to field with error
function addHighlight(onErrorField) {
	var element;
	if( document.getElementById ) // this is the way the standards work
		element = document.getElementById(onErrorField);
	else if( document.all ) // this is the way old msie versions work
		element = document.all[onErrorField];
	else if( document.layers ) // this is the way nn4 works
		element = document.layers[onErrorField];

	element.className='form-highlight';
	
	highlights = highlights + 1;
}

//Remove highlight from white field with error
function removeHighlightWhite(onBlurField) {
	var element;
	if( document.getElementById ) // this is the way the standards work
		element = document.getElementById(onBlurField);
	else if( document.all ) // this is the way old msie versions work
		element = document.all[onBlurField];
	else if( document.layers ) // this is the way nn4 works
		element = document.layers[onBlurField];

	element.className='form-unhighlight-white';
}

//Remove highlight from gray field with error
function removeHighlightGray(onBlurField) {
	var element;
	if( document.getElementById ) // this is the way the standards work
		element = document.getElementById(onBlurField);
	else if( document.all ) // this is the way old msie versions work
		element = document.all[onBlurField];
	else if( document.layers ) // this is the way nn4 works
		element = document.layers[onBlurField];

	element.className='form-unhighlight-gray';
}

function zeroHighlights() {
	highlights = 0;
	return true;
}

//Check for highlighted fields
function checkHighlights() {
	if (highlights > 0)	
		{ 
			return false;
		}
	else
		{
			return true;	
		}
	
}
