If conditions with jQuery objects

If conditions with jQuery objects

Hello,
im new to jQuery and i am trying to use an if condition to not set back the styles
from the html element with the class of selected.
So im trying to compare the selected element with the element that is selected on hover.
But it doesnt works.

Here ist the code:
  1. $(document).ready(function(){
  2.   var selected = $('.selected');

  3.   $('a').mouseenter(function(){
  4.   $(this).animate({
  5.   backgroundColor: '#47F5FE',
  6.   boxShadow: '0 0 5px #47F5FE',
  7.   borderTopRightRadius: '5px',
  8.   borderTopLeftRadius: '5px'
  9.   });
  10.   });
  11.   $('a').mouseleave(function(){
  12.   if(  $(this) != selected ){
  13. $(this).animate({
  14. backgroundColor: 'transparent',
  15. boxShadow: 'none',
  16. borderTopRightRadius: 'none',
  17. borderTopLeftRadius: 'none'
  18. });
  19.   }
  20.   });
  21.   }); 
I hope you understand my problem.
Can anyone help?

PS: Sorry for my bad english im german.