/* Table function to add row and _row classes to alternating rows */

document.observe('dom:loaded', function() {

    $$('table.alternate_rows tr:nth-child(odd)').invoke('addClassName', 'row');
    //this adds class="row" to every odd instance of <tr> on tables that have the class name "alternate_rows"
    $$('table.alternate_rows tr:nth-child(even)').invoke('addClassName', '_row');
    //this adds class="_row" to every even instance of <tr> on tables that have the class name "alternate_rows"	
    //classes are put on both instead of just alternate rows to account for the CSS hover effect when JavaScript is turned off
});


/* Forms A - Z filter function */


function hide_all(){

	$('accommodation', 'advertising', 'aircraft', 'animalmanagement', 'automotive', 'beaches', 'building', 'camping', 'charity', 'cosmetic', 'council', 'entertainment', 'environment', 'flammable', 'food', 'funding', 'film', 'health', 'idas', 'infrastructure', 'maps', 'operational', 'parks', 'pension', 'planning', 'plumbing', 'requests', 'roads', 'safety', 'search', 'sewerage', 'sundry', 'pools', 'waste', 'water').invoke('hide');
}
function show_individual(){
	
	if ($F('categories') =='show_all'){
		
		window.location.reload();	
		
	} else 	{
		
		hide_all();
		$($F('categories')).show();
	
	}
}


