var ACCE_IMG = 'img/Arrowblack_up.gif';
var DESC_IMG = 'img/Arrowblack_down.gif';

var isDesc = true;
var prior_click;
var prior_img;

function sortColumn (current_click) {
	var current_img = current_click.nextSibling;
	if (prior_click != null && prior_click != current_click ) {
		
		/* need to compensate for the extra padding
		   when the previous sort image is hidden */
		Element.setStyle(prior_click, {paddingRight:'6px'} );
		Element.hide(prior_img);
		
		// so that the new column defaults to descending
		isDesc = true;
	}
	current_img.src = isDesc ? DESC_IMG : ACCE_IMG;
	
	/* similar to above -- need to compensate for the extra
	   padding for when the current sort image is shown */
	Element.setStyle(current_click, {paddingRight:'0px'} );
	Element.show(current_img);

	prior_click = current_click;
	prior_img = current_img;
	isDesc = isDesc ? false : true;	
}

function activateRowHighlighting(table){
		    if(table != null){
			    var rows = table.getElementsByTagName("tr");
			    for (i = 1; i < rows.length; i++) {
				    if((i%2) == 0){
				    	rows[i].className='darkerRow';
				        rows[i].onmouseover = function () {
				            this.className = 'over' ;
				        };
				        
				        rows[i].onmouseout = function () {
				            this.className = 'darkerRow';
				        };
			        }
			        else{
			        	rows[i].className='whiteBack';
			        	rows[i].onmouseover = function () {
				            this.className = 'over' ;
				        };
				        
				        rows[i].onmouseout = function () {
				            this.className = 'whiteBack';
				        };
			        }
			    }
		    }
}