(function($) {
$(document).ready(function () {
	
	/*
	// simplemodal
	if ($.modal) {
		$.extend($.modal.defaults, {
				overlayClose:true,
				//containerCss:{},
				closeHTML: '<a class="modalCloseImg" title="Fechar"></a>',
				maxWidth: 624,
				maxHeight: 500
		});
		
		$("a[rel='simplemodal-img']").click(function (e) {
			e.preventDefault();
			$.modal('<table id="simplemodal-img"><tr><td><img src="'+ this.href +'" /></td></tr></table>');
			return false;
		});
		
		$("a[rel='simplemodal-div']").click(function (e) {
			e.preventDefault();
			$($(this).attr("href")).modal();
			return false;
		});
		
		$("a[rel='news-simplemodal']").click(function (e) {
			e.preventDefault();
			var elid = $(this).attr("href");
			$.modal('<div class="content"><h3>'+$(this).text()+'</h3>'+$(elid).html()+'</div>');
			return false;
		});
	}
	
	$("a[rel='new-dialog']").each(function (e) {
	var elid = $(this).attr("href");
		$(elid).dialog({
				autoOpen: false,
				bgiframe: true,
				modal: true,
				close: function(event, ui) { $(elid).dialog('destroy') },
				title: $(this).text()
		})
		$(this).click(function (e) {
			e.preventDefault();
			$(elid).dialog('open');
			return true;
		});
	});
	
	$("a[rel='noticias-slideToggle']").click(function (e) {
		e.preventDefault();
			$(this).parent().parent().find('div.body').slideToggle("slow");
		return false;
	});
	*/
	// colorbox
	if ($.fn.colorbox) {
		$.extend($.fn.colorbox.settings, {
			current: "{current} de {total}",
			previous: "anterior",
			next: "próximo",
			close: "fechar",
			slideshowStart: "iniciar slideshow",
			slideshowStop: "parar slideshow"
		});
		
		$("a[rel='image-gallery']").colorbox({
				maxWidth:"85%",
				maxHeight:"90%"
		});
		
		$("a[rel='lightbox-gallery']").colorbox({
				maxWidth:"85%",
				maxHeight:"85%"
		});
		
		$("a[rel='colorbox-inline']").each(function (e) {
			var elid = $(this).attr("href");
			$(elid).addClass("hidden");
			$(this).colorbox({
				innerWidth: "560px",
				inline: true,
				href: elid
			});
		});
	}
	
	/*
	'click.colorbox',
	cbox_open = 'cbox_open',
	cbox_load = 'cbox_load',
	cbox_complete = 'cbox_complete',
	cbox_cleanup = 'cbox_cleanup',
	cbox_closed = 'cbox_closed',
	cbox_resize = 'resize.cbox_resize',
	*/
	
	/*
	//TODO: move defaults from assuntos tributarios
	// swfobject defaults
	if ($.flash) {
		$.extend($.flash.defaults, {});
	}
	// flowembed defaults
	if ($.flash) {
		
	}
	*/
	
	
});
})(jQuery);
