$(document).ready(function() {
	//hover 4 table_matches
	$('.table_matches tr[name="tm"]').hover(function() {
		$(this).css({
			backgroundColor: 'silver'
		});
		var t1 = $(this).find('td').eq(2).find('span').eq(0).text();
		var t2 = $(this).find('td').eq(2).find('span').eq(2).text();
		$('.table_tabelle tr td a:contains('+t1+')').parent().parent().css({
			backgroundColor: 'silver'
		});
		$('.table_tabelle tr[name="tt"] td a:contains('+t2+')').parent().parent().css({
			backgroundColor: 'silver'
		});
	},
	function() {
		if($(this).attr('id').substring(2, $(this).attr('id').length) != location.hash.substring(2, location.hash.length)) {
			$(this).css({
				backgroundColor: 'transparent'
			});
		}
		$('.table_tabelle tr').css({
			backgroundColor: 'transparent'
		});
	});
	
	//hover 4 table_points
	$('.table_tabelle tr[name="tt"]').hover(function() {
		$(this).css({
			backgroundColor: 'silver'
		});
		var t = $(this).find('td').eq(1).find('a').eq(0).text();
		$('.table_matches tr[name="tm"] td a span:contains('+t+')').parent().parent().parent().css({
			backgroundColor: 'silver'
		});
	},
	function() {
		if($(this).attr('id').substring(2, $(this).attr('id').length) != location.hash.substring(2, location.hash.length)) {
			$(this).css({
				backgroundColor: 'transparent'
			});
		}
		$('.table_matches tr').css({
			backgroundColor: 'transparent'
		});
	});
});

