$(document).ready(function(){
	
        $('#header .menu').css({display:'none',opacity:0});
        
    	$('#header .menu:eq(0)').css({display:'block'}).animate({opacity:1}, 1000);

    	$('#header ul:not(.menu2, #lang) a:not(.sel)').hover(
    			function(){
    				$(this).stop().animate({'padding-left':5}, 350);
    			},
    			function(){
    				$(this).stop().animate({'padding-left':0}, 500);
    			}
    	);
    	
        /*
    	$('#m-collections').click(function(){
    		//alert($('#sub-collections').is(':visible'));
    		if(!$('#sub-collections').is(':visible')){
	    		$('#sub-reference, #sub-archiutti, #sub-sales, #sub-press').css({display:'none'});
	        	$('#sub-collections').css({display:'block'}).stop().animate({opacity:1}, 1500);
	        	//return false;
    		}
        });
        */
    	/*
    	if($('#p-collection').length < 1 && $('#p-product').length < 1){
    		
            $('#header .menu:eq(0) a:not(#m-collections)').mouseover(function(){
            	
            	$('#m-collections').blur();
            	$('#header #sub-collections').stop().animate({opacity:0}, 350, function(){
            		$(this).css({display:'none'});
            	});
            	
            });
    		
    	}
        */
    	$('#m-reference').click(function(){
    		$('#sub-collections, #sub-archiutti, #sub-sales, #sub-products, #sub-press').css({display:'none'});
        	$('#sub-reference').css({display:'block'}).stop().animate({opacity:1}, 1500);
        });
        /*
    	if($('#p-portfolio').length < 1 && $('#p-clients').length < 1){
    		
            $('#header .menu:eq(0) a:not(#m-reference)').mouseover(function(){
            	
            	$('#m-reference').blur();
            	$('#header #sub-reference').stop().animate({opacity:0}, 350, function(){
            		$(this).css({display:'none'});
            	});
            	
            });
    		
    	}
        */
    	$('#m-archiutti').click(function(){
    		$('#sub-collections, #sub-reference, #sub-sales, #sub-products, #sub-press').css({display:'none'});
        	$('#sub-archiutti').css({display:'block'}).stop().animate({opacity:1}, 1500);
        });
        /*
    	if($('#p-quality').length < 1 && $('#p-values').length < 1 && $('#p-communication').length < 1 && $('#p-timeline').length < 1){
    		
            $('#header .menu:eq(0) a:not(#m-archiutti)').mouseover(function(){
            	
            	$('#m-archiutti').blur();
            	$('#header #sub-archiutti').stop().animate({opacity:0}, 350, function(){
            		$(this).css({display:'none'});
            	});
            	
            });
    		
    	}
    	*/
    	$('#m-sales').click(function(){
    		$('#sub-collections, #sub-reference, #sub-archiutti, #sub-products, #sub-press').css({display:'none'});
        	$('#sub-sales').css({display:'block'}).stop().animate({opacity:1}, 1500);
        });
        /*
    	if($('#p-dealers').length < 1 && $('#p-showroom').length < 1 ){
    		
            $('#header .menu:eq(0) a:not(#m-sales)').mouseover(function(){
            	
            	$('#m-sales').blur();
            	$('#header #sub-sales').stop().animate({opacity:0}, 350, function(){
            		$(this).css({display:'none'});
            	});
            	
            });
    		
    	}
    	*/
    	

    	$('#m-press').click(function(){
    		$('#sub-collections, #sub-reference, #sub-sales, #sub-products, #sub-archiutti').css({display:'none'});
        	$('#sub-press').css({display:'block'}).stop().animate({opacity:1}, 1500);
        });
    	
    	$('.menu2 li:last').css({background:'none'});
        
        $('#m-privacy').fancybox({
        	width:	600,
        	height:	550,
        	type:	'iframe',
        	padding:	20
        });
        
        $('#m-career').fancybox({
        	width:	400,
        	height:	550,
        	type:	'iframe',
        	padding:	20
        });
        
        $('#m-newsletter').fancybox({
        	width:	500,
        	height:	260,
        	type:	'iframe',
        	padding:	20
        });
        
});

function clearBanner(){
	if( $('a[href*="webfonts.fonts.com"]').length > 0){
		$('a[href*="webfonts.fonts.com"]').remove();
		clearInterval ( setIntervalId );
		//alert('iii');
	}
	
}

setIntervalId = setInterval ( "clearBanner()", 50 );
