$(function(){	
	if (jQuery.fn.lightBox) $('.lightbox').lightBox();
	if (jQuery.fn.validate) $('form').each(function(){$(this).validate()});
	if (typeof swfobject != 'undefined') $('object').each(function(){if(this.id)swfobject.registerObject(this.id);});
	
	$('#search').autocomplete({ source: '/bin/ajax/search.php', minLength: 3, select: function(event, ui) { location.href = '/news/' + ui.item.id + '/' + ui.item.value; } });
	
	$('.button#meta').toggle(function(event){ $('.meta').slideDown(); }, function(event){ $('.meta').slideUp(); });
	
	$('[name=delete]').click(function(event){ if (!confirm('Are you sure?')) event.preventDefault(); });
	$('a[rel=external]').click(function(event){ event.preventDefault(); window.open(this.href); });
	$('a[rel=popup]').click(function(event){ event.preventDefault(); window.open(this.href, 'TutaAbsoluta', 'width=300,height=100'); });
	$('a.disabled').click(function(event){ event.preventDefault() });
});
