

(function($){











})(window.jQuery);



window.log = function(){
    log.history = log.history || [];
    log.history.push(arguments);
    if (this.console) {
        console.log(Array.prototype.slice.call(arguments));
    }
};

(function(doc){
    var write = doc.write;
    doc.write = function(q){
        log('document.write(): ', arguments);
        if (/docwriteregexwhitelist/.test(q)) 
            write.apply(doc, arguments);
    };
})(document);

$(document).ready(function(){
	
		var sp = $('.right-menu').attr('data-id');
		$('div#'+sp).addClass('show');
		$('div.show').css({'display':'block','visibility':'visible'});
		
		var sp2 = $('.right-menu').attr('name');
		$('div.#'+sp2).addClass('show');
		$('div.show').css({'display':'block','visibility':'visible'});
	
	
    $('.toValidate').validate();
    $('a.fancyimage').fancybox({
        'zoomSpeedIn': 300,
        'zoomSpeedOut': 300,
        'overlayShow': true,
        'zoomOpacity': true,
        'overlayOpacity': 0.8
    });
	var ra = $('.right-menu').height();
	var ch = $('.left-home').height();
	
	if (ra<ch)
		($('.right-menu').css('height',ch));
	
	
	function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

equalHeight($(".pit"));
	
	
	
	
/*	$('div#pippo').accordion({
        event: 'click',
        animated: 'easeslide',
		active: false,
		alwaysOpen: false,
		header: 'a.ac',
		autoheight:false
 
    });*/
		$('.SECTION .ac2 ul.ul-level-3').accordion({
        event: 'click',
        animated: 'easeslide',
		active: false,
		alwaysOpen: false,
		header: 'a.level-3',
		autoheight:false,
		navigation: true
    
    });
		$('.PRODUCT .ac2 ul.ul-level-3').accordion({
        event: 'click',
        animated: 'easeslide',
		active: '.in-path',
		alwaysOpen: false,
		header: 'a.level-3',
		autoheight:false,
		navigation: true,
		selectedClass: 'in-path'
    
    });
	 $(".ac2 ul.ul-level-3 a.noacc").click(function() {
      window.location = $(this).attr('href');
      return false;
   });

	
	
    $('.cycle-pad').cycle();
    $('ul.sf-menu').superfish();
    
});


$(window).load(function(){
	$('.prod-item:odd').addClass('odd');
	$('table.data tr:even').addClass('even');
	$('table.data tr:last').addClass('last');

});



