jQuery(document).ready(function() { 
	$j('#image_rotate').innerfade({ 
		speed: 2000, 
		timeout: 6000, 
		type: 'sequence'
	});
});

jQuery(function() {
    var width_body = jQuery('body').width();
    var width_img = width_body - 375; 
    if(width_img < 1100 ){ 
        jQuery('#image_rotate img').width('1100'); 
        //jQuery('body').css('overflow-x','auto');
    }
    else { jQuery('#image_rotate img').width(width_img); }

    if(width_body > 1280 ){
        jQuery('.list-product').css("margin-left","5%");
    	jQuery('.first-li-news').css("margin-left","400px");
    	//jQuery('body').css('overflow-x','hidden');
        jQuery(".home_page .footer-container").css('margin-top','-61px');
        jQuery(".comparison").css('margin-top','200px');
    } else {
        jQuery(".home_page .footer-container").css('margin-top','-54px');
        jQuery(".comparison").css('margin-top','188px');
    }
    	
    jQuery('#image_rotate li').width(width_img);

    var new_width_block = width_body - 378;
    jQuery('#slider1').width(new_width_block);
    jQuery('#slider2').width(new_width_block);
    jQuery('#slider3').width(new_width_block);

    
    jQuery('#opineo_logo').hover(function(){
        jQuery(this).stop().animate({'right':'0px'},500);
    },function(){
        jQuery(this).stop().animate({'right':'-110px'},500);
    });
    
    jQuery(window).resize(function(){
	    var width_body = jQuery('body').width();
	    var width_img = width_body - 375; 
	    if(width_img < 1100 ){ jQuery('#image_rotate img').width('1100'); }
	    else { 
	       jQuery('#image_rotate img').width(width_img); 
	       //jQuery('body').css('overflow-x','auto');
	    }
	    
	    if(width_body > 1280 ){
        	jQuery('.list-product').css("margin-left:","5%;");
    		jQuery('.first-li-news').css("margin-left:","400px;");
    	//	jQuery('body').css('overflow-x','hidden');
    	    jQuery(".home_page .footer-container").css('margin-top','-61px');
            jQuery(".comparison").css('margin-top','200px');
	    }else {
            jQuery(".home_page .footer-container").css('margin-top','-54px');
            jQuery(".comparison").css('margin-top','188px');
	    }

	    jQuery('#image_rotate li').width(width_img);
	    
	    var new_width_block = width_body - 378; 
	    jQuery('#slider1').width(new_width_block);
	    jQuery('#slider2').width(new_width_block);
	    jQuery('#slider3').width(new_width_block);
    });



    jQuery(".hide_menu, .hide_menu > *").hover(
	    function(){
	    	jQuery(".hide_menu").animate({
			    opacity: 1,
			    left: '-100'
  			}, 900);
	    },
	    function(){
	    	jQuery(".hide_menu").animate({
			    opacity: 0.25,
			    left: '-378'
  			}, 500, function(){
  				jQuery(".hide_menu").animate({
			    opacity: 1,
  			}, 0);
  			});
	    }
    );
    
    
    jQuery("#news-main").click(function(){
    	jQuery("#news-block").animate({
		    opacity: 1,
		    left: '378'
  		});
  		return stop;
    });


	jQuery('#nav-tab-news > li > a').click(function(){
		if (jQuery(this).attr('class') != 'active'){
			jQuery('#nav-tab-news li div').fadeOut(0);
			jQuery(this).next().fadeIn();
			jQuery('#nav-tab-news li a').removeClass('active');
			jQuery(this).addClass('active');
		}
	});

    
});

