$(document).ready(function()
{
	$(".tr-table").hover(function () {
		var tr = this;
		$(this).children().each(function (i) {
			this.style.backgroundColor = $(tr).attr('rollOverColor');
		});
    }, function () { 
    	var tr = this;
		$(this).children().each(function (i) {
			this.style.backgroundColor = $(tr).attr('rollOutColor');
		});
    });
    
    $(".tr-table").click(function () { 
		var id = this.id.split('td-table-').join('');
		window.location.replace('index.php?id=' + id);
    });
    
    $(".header-table-div > img").click(function () 
    {
    	var nr = $(this).attr('src').split('images/a').join('').split('images/b').join('').split('.jpg').join('');
    	var array = 'ASC';
    	if(nr == '2') array = 'DESC';
    	$('#interface-array').val(array);
    	$('#interface-col').val($(this).parent().attr('id'));
		$('#interface-table').submit();
    });
    
    $(".tr-table").click(function () 
    { 
		var id = this.id.split('td-table-').join('');
		$('#interface-id').val(id);
		$('#interface-table').submit();
    });
    
     $(function() {
       $('#gallery a').lightBox();
	});
    
});