$(document).ready(function(){ 
	var myElement = $('#footer');
		myElement.css({
	    	position: 'absolute',
	    	left: '50%',
	    	'margin-left': 0 - (myElement.width() / 2)
		});
		
		
		if ($('.current-menu-parent').length) { 
		$('.current-menu-parent').addClass('active');
		$('.current-menu-parent').prepend('<p class="nav_start"></p>');
		$('.current-menu-parent').prepend('<p class="nav_end"></p>');
 		} else {
 		$('.current-menu-item').addClass('active');
		$('.current-menu-item').prepend('<p class="nav_start"></p>');
		$('.current-menu-item').prepend('<p class="nav_end"></p>');
  		}

	
	$('.nav > li').mouseenter(function() {
    $(this).find('ul').css('visibility', 'visible');
	if (!($(this).hasClass('active'))) {
    $(this).css("background", "url(wp-content/themes/Allwin/images/nav.jpg) left center repeat-x");
	$(this).prepend('<p class="nav_end"></p>');
	$(this).prepend('<p class="nav_start"></p>');
	$(this).find('a').css({'margin' : '0 25px', 'color' : 'white'});
	};
	$('.sub-menu li a').css({'margin' : '0', 'color' : '#4d4d4d'});
	
  }).mouseleave(function() {
    $(this).find('ul').css('visibility', 'hidden');
	if (!($(this).hasClass('active'))) {
	$(this).css("background", "none");
	$(this).find('.nav_end, .nav_start').remove();
	$(this).find('a').css({'margin' : '0 25px', 'color' : '#DB001A'});
	};
  });
  
  $('.share_menu').mouseenter(function() {
    $(this).find('ul').css('visibility', 'visible');
  }).mouseleave(function() {
    $(this).find('ul').css('visibility', 'hidden');
  });


});

var addthis_config = {
     ui_language: "sv"
}


