<!--

// Sort building table dynamically
$(document).ready(function(){
	var url = location.pathname + '?ajax=yes&sort=';
	//Bind to parent so that the behavior also works on the ajax loaded data
	$('#tbuildings').click(function(event){
		if ($(event.target).is('table.building a.name')) {
			$('#tbuildings').load(url + 'name');
			$('#curloc').text('By Name');
			return false;
		}
		if ($(event.target).is('table.building a.height')) {
			$('#tbuildings').load(url + 'height');
			$('#curloc').text('By Height');
			return false;
		}
		if ($(event.target).is('table.building a.year')) {
			$('#tbuildings').load(url + 'year');
			$('#curloc').text('By Year');
			return false;
		}
  });
});

//Display loading image
$(document).ready(function() {
  $('#loading')
    .ajaxStart(function() {
      $(this).show();
    }).ajaxStop(function() {
      $(this).hide();
    });
});
	
function overRow(id){		
	row = document.getElementById(id);	
	if (row != null){	
		row.style.background = "url(/img/th.png) 0 -10px";
	}		
}	
	
function outRow(id, nr){	
	row = document.getElementById(id);	
	if (row != null){	
		var bg = nr / 2 == Math.round(nr / 2) ? "url(/img/td.png)" : "none";
		row.style.background = bg;
	}		
}	

//-->