function grandPrixViewer(arg) {
	var loc
	if (arg == '') {
		loc = '/grand_prix/';
		target = '_top';
	}
	else if (arg != '') {
		arg_array = arg.split(",");
		year = arg_array[0];
		mode = arg_array[1];
		if (mode == 'scroll') {
			target = '_top';
			//new_window = false;
		}
		else if (mode == 'sort') {
			target = '_blank';
			//new_window = true;
		}
		loc = '/grand_prix/?year='+year+'&mode='+mode;	
	}
	
	if (loc) {
		window.open(loc,target);
	}
	else {
		alert('Please choose an option from the pull down list.');
	}
	
	
}


function colorTable(the_id){
	the_table = document.getElementById(the_id);
	the_tr_list = the_table.getElementsByTagName('tr');
	tr_bg_color = "#eeeeee";
	color_toggle = false;
	for( i=0; i < the_tr_list.length; i++ ) {
		the_td_list = the_tr_list[i].getElementsByTagName('td');
		if (color_toggle) {
			the_tr_list[i].style.backgroundColor = tr_bg_color;
			color_toggle = false;
		}
		else {
			the_tr_list[i].style.backgroundColor = 'white';
			color_toggle = true;
		}
		
		for( j=5; j < the_td_list.length; j++ ) {
			td = the_td_list[j];
			if (!isNaN(td.innerHTML)) {
				if (td.innerHTML <= 1000 && td.innerHTML >= 900) {
					td.style.color = 'red';
					td.style.fontWeight = 'bold';
				}
				if (td.innerHTML < 900 && td.innerHTML >= 800) {
					td.style.color = 'blue';
					td.style.fontWeight = 'bold';
				}
				if (td.innerHTML < 800 && td.innerHTML >= 700) {
					td.style.color = 'green';
					td.style.fontWeight = 'bold';
				}
			}
		}
	}				
}