      $(document).ready(function(){
  
      var match = 'input.default[@type=text]';
  
      $(match).focus(function(){
  
      this.valuedefault = this.valuedefault || this.value;
  
      if (this.value == this.valuedefault)
  
      this.value = '';
  
      $(this).css('color','#000');
  
      });
  
      $(match).blur(function(){
  
      if (this.value.length == 0 || this.value == this.valuedefault)
  
      $(this).css('color','#aaa');
  
      if (this.valuedefault && this.value.length==0)
  
      this.value = this.valuedefault;
  
    });
  
      });
      
      // ====================== EFECTO HOVER LOGOS COLABORADORES ===================== //
      
      $(document).ready(function () {

	//Append a div with hover class to all the LI
	$('#col_icons li, a.link_col').append('<div class="hover"><\/div>');


	$('#col_icons li, a.link_col').hover(
		
		//Mouseover, fadeIn the hidden hover class	
		function() {
			
			$(this).children('div').fadeIn('1000');	
		
		}, 
	
		//Mouseout, fadeOut the hover class
		function() {
		
			$(this).children('div').fadeOut('1000');	
		
	}).click (function () {
	
		//Add selected class if user clicked on it
		$(this).addClass('selected');
		
	});

});

// ====================== Botón regresar a inicio de página ======================== //
$(function ()
{
	var scroll_timer;
	var displayed = false;
	var $message = $('#message');
	var $window = $(window);
	var top = $(document.body).children(0).position().top;
	$window.scroll(function ()
	{
	window.clearTimeout(scroll_timer);
	scroll_timer = window.setTimeout(function ()
	{ 
		if($window.scrollTop() <= top) 
		{
			displayed = false;
			$message.fadeOut(500);
		}
		else if(displayed == false)
		{
			displayed = true;
			$message.stop(true, true).fadeIn(500).click(function () { $message.fadeOut(500); });
		}
	}, 100);
});

$('#top-link').click(function(e)
{
	e.preventDefault();
	$.scrollTo(0,300);
});

});


// ====================== Desplegable ============================ //
$(function(){
	$('nav ul>li').hover(
		function(){
		$('.sub',this).stop(true,true).slideDown('fast');
		},
		function(){
		$('.sub',this).slideUp('fast');
		}
	);
 
	$('.sub li a').css( {backgroundPosition: "0px 0px"} ).hover(
		function(){
		$(this).stop().animate({backgroundPosition: "(0px -99px)"}, 250);
		},
		function(){
		$(this).stop().animate({backgroundPosition: "(0px 0px)"}, 250);
		}
	);			
});

// ====================== Menu-Tabs ============================ //
$(document).ready(function() {
	$('#sidebarMaster > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
	
})


