var topLines = function() {

topBarUpdate();

var docWidth = $(window).width();
if ( docWidth > 500 ) {

function mMouseOver() { $(this).stop().animate({ backgroundPosition:'(0px 0px)'},100); };
function mMouseOut() { $(this).stop().animate({ backgroundPosition:'(0px -40px)'},"swing"); };


var nav =  $("nav ul li a").not(".current-menu-item");
for ( i = 0; i < nav.length; i++ ) {
		$(nav[i]).bind( 'mouseover', mMouseOver );
		$(nav[i]).bind( 'mouseout', mMouseOut );
		/* $(nav[i]).bind( 'click', mClick ); */
	}

} else { backgroundPosition:'(0px 0px)'; }




	var prezzoMenu = jQuery(".category-content .prezzo");
	prezzoMenu.each( function() { jQuery(this).html( jQuery(this).html().replace(/\./g, '<span class="decimali">.')  ) });
	prezzoMenu.append("</span>");

};




		var pictBounce = function() {


		
		var qualityTags = $("#featured-boxes article figure");
		
		qualityTags.hover(function() {
		$(this).stop().animate({top:"-20px"}, "fast") }, function () {
		$(this).stop().animate({top:"0"}, "fast");
		});



};


var promoSlide = function() {
var promo = $("#gadgets .promo-banner img");
promo.hover( function() {
$(this).animate({marginTop:"-=296px"}, 120);
}, function() {
$(this).animate({marginTop:"0px"}, 400);
}
);


};


				var slideBig = function () {
				
				
//			$('.slidewrap').carousel({
//				slider: '.slider',
//				slide: '.slide',
//				slideHed: '.slidehed',
//				nextSlide : '.next',
//				prevSlide : '.prev',
//				addPagination: true,
//				addNav : false
//			});			
			
				$('.slidewrap').flexslider({
				  animation: "slide",
				  controlsContainer: "#slider"
				 });

			 
    $('.entry-content img').each(function(){
        $(this).removeAttr('width')
        $(this).removeAttr('height');
    });

			
			
		};
 
var topBarUpdate = function() {
	var check = jQuery.Storage.get("qtyProdotti");
	if (check) {
	var quantities = jQuery.Storage.get("qtyProdotti").split(",").slice(0,-1);
	
	var ordered = 0;
	
	jQuery.each(quantities, function(){
		ordered += Number(this);
	});
	
	
	if ( ordered > 0 ) {
		jQuery("#barra-top-content .didnotorder").hide();
		jQuery("#barra-top-content .didorder").show();
		jQuery("#barra-top .top-qty").text(ordered);
		}
	}
	else {
		jQuery("#barra-top-content .didorder").hide();
		jQuery("#barra-top-content .didnotorder").show();		
		}
}


var fuckTwitter = function() {

	jQuery("#twtr-widget-1 .twtr-doc").css({"background":"transparent !important"});
	jQuery("#twtr-widget-1 .twtr-hd a").css({"background":"transparent !important"});
	jQuery("#twtr-widget-1 h3").css({"background":"transparent !important"});
	jQuery("#twtr-widget-1 h4").css({"background":"transparent !important"});

}

var mobileMenu = function() {
if ( jQuery(window).width() < 480 ) {
	var puls = jQuery("#espandi-menu");
	var txt = jQuery("#espandi-menu b");
	var nav = jQuery("header nav");
	nav.hide();
	puls.click( function(){
		nav.slideToggle();
		txt.toggle();
	});
	jQuery("#ass-txt").hide();	
}
}
