$(document).ready(function() {
	
	$('#header ul.menu li a').hover(function() {
		
		// && !$(this).parent().parent().hasClass('sub-menu')
		
		if($(this).parent().find('ul.sub-menu').length == 0)
		{				
			return;
		}
		
		$('#header ul.sub-menu').hide();
		
		$(this).parent().find('ul.sub-menu').show();
		
	});
	
	$('#header h1, #header ul.menu li.current, .no-sub-menu').hover(function() {
	
		$('#header ul.sub-menu').hide();
		
	});
	
	$('#contents ul.job-list li div.holder a img').hover(
		function(){
			$(this).parent().parent().find('p.title a').addClass('active');
		},
		function(){
			$(this).parent().parent().find('p.title a').removeClass('active');
		}
	);
	
	//$('div.etc-sidebar').stickyfloat({ duration: 400 });
	
	//$('#header ul.menu li ul.sub-menu').mouseleave(function() { $(this).hide(); });
	
	//$('ul.menu li.current').css('margin-right', 360 - $('ul.menu li.current').width());
	
	$('img[hspace]').each(function() { $(this).css('margin-left', $(this).attr('hspace') ); });
	$('img[vspace]').each(function() { $(this).css('margin-top', $(this).attr('vspace') ); });
	
	// garantia de remoção das tags do microsoft word já que não adianta pedir para não colar direto dele no tinymce
	$('#contents div.description, #contents div.description div, #contents div.description p, #contents div.description span, #contents div.description p p, #contents div.description p span, #contents div.description div p, #contents div.description div span').children().each(function(){
		
		$(this).removeAttr('style');
		
		$(this).children().each(function(){

			$(this).removeAttr('style');

			$(this).children().each(function(){

				$(this).removeAttr('style');

			});

		});
		
	});
	
});
