$(document).ready(function() {
  $("a.fancybox").fancybox();

 	$('.news li').each(function() {
 		$(this).bind('mouseover', function(){
			$(this).find('a').css('color', '#313233');
 		});
 	});
 	
 	$('.news li').each(function() {
 		$(this).bind('mouseout', function(){
			$(this).find('a').css('color', '#636466');
 		});
 	});

 
  $('#mainmenu ul li:last').css('background','none');
  var x = '-10';
  var animate = false;
  $('#mainmenu ul').css( {backgroundPosition: "-10px 47px"} )
  $('#mainmenu ul li').bind('mouseover', function(){
      //add hover image

      var width = $(this).children('a').width();
      x = $(this).children('a').position().left-67+(width/2);
      
      if(animate){
        $('#mainmenu ul').stop().animate({backgroundPosition: x+"px 47px"},{duration:500});
      }else{
       $('#mainmenu ul').stop().css( {backgroundPosition: x+"px 47px"});
       animate = true;
      }

 });

 $('#mainmenu').bind('mouseleave', function(){
   $('#mainmenu ul').stop().css( {backgroundPosition: x+"px 55px"} )
   animate = false;
 });
 

 $('.read-more').bind('click', function(){

    var id = $(this).attr('id').split('read-more-')[1];
    $('#full-text-'+id).slideToggle(function() {
       
       if(langname == 'nl') {
         if($('#read-more-'+id).html() == 'lees meer »') {
          $('#read-more-'+id).html('&laquo; verbergen');
         }else{
          $('#read-more-'+id).html('lees meer »');
         }
       }

       if(langname == 'fr') {
         if($('#read-more-'+id).html() == 'lisez plus »') {
          $('#read-more-'+id).html('&laquo; cacher');
         }else{
          $('#read-more-'+id).html('lisez plus »');
         }
       }

       if(langname == 'en') {
         if($('#read-more-'+id).html() == 'read more »') {
          $('#read-more-'+id).html('&laquo; hide');
         }else{
          $('#read-more-'+id).html('read more »');
         }
       }
       
       
    });
 })
})

