jQuery(document).ready( function() {
	
	$("img.rounded").load( function () {
		var img = $(this);
	 
		// build wrapper
		var wrapper = $('<div class="rounded_wrapper"></div>');
		wrapper.width(img.width());
		wrapper.height(img.height());
	 
		// move CSS properties from img to wrapper
		wrapper.css('float', img.css('float'));
		img.css('float', 'none')
	 
		wrapper.css('margin-right', img.css('margin-right'));
		img.css('margin-right', '0')
	 
		wrapper.css('margin-left', img.css('margin-left'));
		img.css('margin-left', '0')
	 
		wrapper.css('margin-bottom', img.css('margin-bottom'));
		img.css('margin-bottom', '0')
	 
		wrapper.css('margin-top', img.css('margin-top'));
		img.css('margin-top', '0')
	 
		wrapper.css('display', 'block');
		img.css('display', 'block')
	 
		// wrap image
		img.wrap(wrapper);
	 
		// add rounded corners
		img.after('<div class="tl"></div>');
		img.after('<div class="tr"></div>');
		img.after('<div class="bl"></div>');
		img.after('<div class="br"></div>');
	});
	
	/*category meniu last-item*/
	
	var menuItems = $('.products:visible');
	var object_length = menuItems.length; 
	var lastItem = menuItems[object_length-1];
  $(lastItem).addClass('menu-last');
	
	
});

function showMeniu(e, el_id) {
	var el = $('.'+el_id);
	var inners_el = $('.menu-level3');

  var menuItems = $('.products:visible');
	menuItems.removeClass('menu-last');
  var object_length = menuItems.length;
  var lastItem = menuItems[object_length-1];
  $(lastItem).addClass('menu-last');


	if ($(e.parentNode).hasClass('menu-last')) {
    $(e.parentNode).toggleClass('menu-last-active');                                                
  } else {
    $(e.parentNode).toggleClass('menu-active');
  } 
	
		if ((el.css('display') == 'block') || (el.css('display') == 'list-item') )  {
		el.hide();
		inners_el.hide();
		$('.menu-level2').removeClass('menu-active');
	} else {
		el.show();
	}
}

jQuery(document).ready(function() {
    jQuery('#breadscrumb').find(":contains('Scuba')").replaceWith('Scuba');
    jQuery('#breadscrumb').find(":contains('Povandeninė medžioklė')").replaceWith('Povandeninė medžioklė');
    jQuery('#breadscrumb').find(":contains('Laisvalaikis')").replaceWith('Laisvalaikis');
    jQuery('#breadscrumb').find(":contains('SCUBA @en')").replaceWith('Scuba');
    jQuery('#breadscrumb').find(":contains('Spearfishing')").replaceWith('Spearfishing');
    jQuery('#breadscrumb').find(":contains('Leisure')").replaceWith('Leisure');
    jQuery('#breadscrumb').find(":contains('Prekės')").replaceWith('Prekės');
    jQuery('#breadscrumb').find(":contains('Shop')").replaceWith('Shop');
    
});



