$.fn._blank = function() {

	function clickHandler(e) {

		if (e.ctrlKey || e.shiftKey || e.metaKey)
			return;

		var w = window.open(this.href, '_blank', 'top=0,left=0,width=230,height=350');
		if (w && !w.closed) {
			w.focus();
			e.preventDefault();
		}
	}

	this
		.filter('a[@href]')
		.bind('click', clickHandler);

	return this;

}


$(document).ready( function(){ 
							
		$('#banners').innerfade({
			speed: 3000, 
			timeout: 6000, 
			type: 'sequence', 
			containerheight: '390px' 
		}); 	
		
		$('.atras').click(function(){
		    history.back();
		    return false;
		})
		
    $("a[rel*='external']").click(function(){
         this.target = "_blank";
     });
     
     if($.fn.media != undefined){
       $.fn.media.mapFormat('mp3','quicktime');
       $(".media").media({ width: '100%', height: 320 } );
     }
     
     $("a[rel*='nota']")._blank();
     
         $('.envio').tooltip({
           bodyHandler: function() {
           		return $($(this).attr("rel"));
           	},
        		track: true,
        		delay: 0,
        		showURL: false,
        		top: 10,
        		left: 10,
        		extraClass: "stooltip",
        		fade: 250
       	});
     
     
     
			
});

