$(document).ready(function(){
	
	
	/*- BUSQUEDA -*/
	$('#s').focus(function(){
		$(this).parents('#search').addClass('searchFocus');
		$(this).val('');
	});
	$('#s').blur(function(){
		$(this).parents('#search').removeClass('searchFocus');
		$(this).val('Buscar');
	});
	
	/*- DEJAR COMENTARIO -*/
	$('#respond input, #respond textarea').focus(function(){$(this).addClass('fieldFocus')});
	$('#respond input, #respond textarea').blur(function(){$(this).removeClass('fieldFocus')});
	
	/*- SUBMENU DESPLEGABLE -*/
	$('#menu ul li ul').each(function(){
		$(this).parent('li').addClass('subNav');
		$(this).parent('li').hover
			(function () {
				$(this).children('ul').show();
				$(this).addClass('subNav-hover');},
			function () {
				$(this).children('ul').hide();
				$(this).removeClass('subNav-hover');
		});	
	});
	
	/*- NUMERAR COMENTARIOS -*/
	$('#commentList div.comment .commentNumber').each(function(i) {
		$(this).text(i+1);
	});
	
	/* ULTIMOS ELEMENTS -*/
	$('#gradeNews .gradeBox').each(function(){
		$(this).find('li:last').addClass('last');
	});
	$('#menu li:last').addClass('last');
	
	/* ATTACHMENT PAGE */
	$('body.attachment .btn').each(function(){
		var btnText = $(this).text();
		if (btnText == ''){$(this).css('display', 'none')};
	});	
		
	/*- FEATURED SLIDER -*/
	$('#featuredNav a').each(function(){
		$(this).attr('href', 'javascript:void:0;');
	});
	var featuredAmount = $('#featuredSlider li').length;
	if (featuredAmount != 1) {
		$('#featuredNav').show();
		$('#featuredSlider ul').goSlider({
			prevId : 'featuredPrev',
			nextId : 'featuredNext',
			stopId : 'featuredStop',
			playId : 'featuredPlay',
			fadeSpeed : 600,
			hideControls : true
		});
	}
	
});

