$(document).ready(function(){
	
	$.fn.BorderRadiusImage = function(sides){
		var self = this;
		return this.each(function(){	
			var $this = $(this);
			$.each(sides, function(i){
				$this.append('<span class="'+sides[i]+'"></span>');
			});
		});
	}

	$('#map').BorderRadiusImage(['bl', 'br']);
	$('#calls, #twitter, #invite, #print, #downloads').BorderRadiusImage(['tl', 'tr', 'bl', 'br']);
	
	
	
	
	
	
	// external links
	$('a[rel=external]').attr('target','_blank');
	
	
	
	// logo link
	$('#unimed-rio').bind({
		click: function(){
			location.href="http://www.unimedrio.com.br";
		}
	});
	
	
	
	
	// tracking
	$('a','#footer > div > ul').live('click',function(e){
		var text = $(this).text();
		Tracking.trackPage(text+'/clicou');
	});
	
	
	
	
	// simple efx
	$('li','#footer > div > ul').hover(function(){
		$('li','#footer > div > ul').not(this).stop().animate({opacity: .6},400);
		$(this).stop().animate({opacity: 1},400);
	},function(){
		$('li','#footer > div > ul').stop().animate({opacity: 1},400);
	});
	
	
	// lightbox footer
	$("#footer nav ul li a").colorbox({
		width: 740,
		height: 500,
		onComplete: function(){
			$('.popup .content .holder').jScrollPane({
				showArrows: true,
				scrollbarWidth: 50
			});
		}
	});
	
	
	
	
});
