function countWords(element) {
	//alert(element.value);
	var words = element.value.split(' ');
	var errorMessage = document.getElementById('tieBreakError');
	if (words.length-1 >= 50) {
		errorMessage.firstChild.nodeValue = 'You must use 50 words or less, current number of words is: ' +(words.length);
		errorMessage.style.display = 'block';
		return false;
	} else {
		errorMessage.style.display = 'none';
	}
}
function clearField(field) {
	field.value = '';
}
function newWindow(url,name,w,h,scroll) {
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
	if (w) {
		newWin = window.open(url, name, settings);
	} else {
		newWin = window.open(url,name);
	}
	newWin.focus();
	return false;
}