// JavaScript Document
$(document).ready(function() {
						   
	jQuery.fn.fadeIn = function(speed, callback) { 
		return this.animate({opacity: 'show'}, speed, function() { 
			if (jQuery.browser.msie)  
				this.style.removeAttribute('filter');  
			if (typeof callback == 'function')  
				callback();  
		}); 
	}; 
	 
	jQuery.fn.fadeOut = function(speed, callback) { 
		return this.animate({opacity: 'hide'}, speed, function() { 
			if (jQuery.browser.msie)  
				this.style.removeAttribute('filter');  
			if (typeof callback == 'function')  
				callback();  
		}); 
	}; 
	 
	jQuery.fn.fadeTo = function(speed,to,callback) { 
		return this.animate({opacity: to}, speed, function() { 
			if (to == 1 && jQuery.browser.msie)  
				this.style.removeAttribute('filter');  
			if (typeof callback == 'function')  
				callback();  
		}); 
	}; 						   
						   
	// MENU HOME					   
	$("#home a span").addClass("jQuery");
	$("#home a span").hide();
	$("#home a").hover(function() {
		 $(this).find('span').animate({ opacity: 'show' }, 'fast');
	   },function(){
		 $(this).find('span').animate({ opacity: 'hide' }, 'fast');
	   });						   
						   
	// MENU INTERNAS					   
	$("#menu li").not(".selected").find('a').addClass("jQuery");
	$("#menu li").not(".selected").find('a').hide();
	$("#menu li").not(".selected").hover(function() {
		 $(this).find('a').animate({ opacity: 'show' }, 'slow');
	   },function(){
		 $(this).find('a').animate({ opacity: 'hide' }, 'slow');
	   });
	
	// SUBMENU INTERNAS					   
	$("#submenu li").hover(function() {
		 $(this).siblings().find("a[@href^='seccion']").fadeTo("fast",0.3);
	   },function(){
		 $(this).siblings().find("a[@href^='seccion']").fadeTo("fast",1);
	   });	
	
 });