$(function() {
    $('.form.search. input[type=reset]').not('.custom').click(function() {
        $(this).parents('form').find("input[type=text]").attr('value',"");
        $(this).parents('form').find("input[type=checkbox]").attr('checked',"");
        $(this).parents('form').find("select").find('option:first').attr('selected','selected');
        $(this).parents('form').submit();
        return false;
    });
	
	$('tr.ignored').each(function(i,e) {
		$(e).find('td').not('td:last').css('opacity',0.5);
	})
	$('.vec-status-odskrtnuta').css('opacity',0.7);

	$('a.markSeen').click(function() {
		var o = $(this);
		$.get($(this).attr('href')+'?&ajax',function(data) {
			if(data == 'OK') {
				$(o).parents('tr').removeClass('unseen');
				$(o).parents('tr').find('a').removeClass('unseen');
				$(o).fadeOut();
			}
		});
		return false;
	})
	
	/*$('a.toggleIgnore').click(function() {
		var o = $(this);
		$.get($(this).attr('href')+'?&ajax',function(data) {
			if(data == 'OK') {
				$(o).parents('tr').removeClass('ignored').find('td').css('opacity',1);
				//$(o).fadeOut();
			}
		});
		return false;
	})	*/
	
	/*$('.tip,a[title],abbr').qtip({
        'position': {
            my: 'top center',
            at: 'bottom center'
        }
    });*/
    $('.shortenedTip').qtip({
        content: {
            text: function() {
                return $(this).text();
            }
        },
        'position': {
            my: 'top left',
            at: 'bottom left'
        }
    });
	
	$('.tip,a[title],abbr').live('mouseover',function() {
		if($(this).data('qtip') ) { 
			return true; 
		}		
		$(this).qtip({
			'position': {
				my: 'top center',
				at: 'bottom center'
			},
			show: {
				ready: true
			}
		});	
	})
	
	$('.shortenedTip').live('mouseover',function() {
		if($(this).data('qtip') ) { 
			return true; 
		}				
		$('.shortenedTip').qtip({
			content: {
				text: function() {
					return $(this).text();
				}
			},
			'position': {
				my: 'top left',
				at: 'bottom left'
			},
			show: {
				ready: true
			}			
		});
		
	})
	
})



