// JavaScript Document
$(function(){
		   
	// Redondeamos bordes para IE7 y 8
	DD_roundies.addRule('#contenidos', '15px', false);
	DD_roundies.addRule('#slider, #colaboradores, .publi', '10px', false);
	DD_roundies.addRule('.resto', '5px', false);
	
	// Iconos de funcion
	$('.func, .flecha').children('img').css('opacity', 0.8);
	$('.func').hover(function() { 
		$(this).children('img').stop().animate({'width':'50px', 'height':'50px', 'opacity':'1'},120);
	},function() {
		$(this).children('img').stop().animate({'width':'38px', 'height':'38px', 'opacity':'0.8'},120);
	});
	
	// Animación de menú de empresas
	$('.links ul li span').css('opacity', 0.8);
	$('.links ul li span').hover(function() {
		$(this).css({'opacity':'1', 'color':'#FFF'});
		$(this).animate({'backgroundColor': '#333'}, 10);
	},function() {
		$(this).css({'opacity':'0.8', 'color':'#000'});
		$(this).animate({'backgroundColor': '#FFF'}, 220);
	});
	
	// Opacidad de texto forum dezae
	$('.textoforum').css('opacity', 0.8);
	
	// Animación de noticias
	$('.noticia').hover(function() { 
    	$(this).css('opacity', 0.8);
		$(this).children('span').children('span').css('backgroundColor', '#666');
		$(this).css('fontSize', '20px');
	},function() {
    	$(this).css('opacity', 1);
		$(this).children('span').children('span').css('backgroundColor', '#2c4b9a');
		$(this).css('fontSize', '11px');
	});
	
	// Animación de actividades
	$('.actividad').hover(function() { 
		$(this).stop().animate({'height':'180px', 'backgroundColor': '#FFF'},200);
	},function() {
		$(this).stop().delay(100).animate({'height':'25px', 'backgroundColor': '#F5F5F5'},400);
	});
	
	// Animación de menú principal
	$('#menu a.bnormal')
		.css( {backgroundPosition: "-20px 35px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "-20px 35px"})
			}})
	});
});
