/*产品目录 begin*/
/*产品目录第一个默认展开*/
$(function(){ $(".cp_type .bd ul li").first().children('div').show();$(".cp_type .bd ul li").first().addClass('on');});

$(".cp_type .bd ul li p span").click(function () {
	if($(this).parents('li').hasClass('on')){
		$(this).parents('li').removeClass('on').find('div').stop().slideUp();
	}else{
		$(this).parents('li').find('div').removeAttr("style");
		$(this).parents('li').addClass('on').find('div').stop().slideDown();
	}
});
if(document.body.clientWidth <= 1024){  
	$(".cp_type .hd").click(function () {
		if($(this).hasClass('on')){
			$(this).next('div').removeAttr("style");
			$(this).removeClass('on').next('div').stop().slideUp();
		}else{
			$(this).next('div').removeAttr("style");
			$(this).addClass('on').next('div').stop().slideDown();
		}
	});
}
/*产品目录 end*/


$(".ly_idxNews .h_news_in .hd span").click(function () {
		$(this).addClass('on').siblings('span').removeClass('on');
		var h_news_index=$(this).index();
		$('.ly_idxNews .h_news_in .r .bd ul').eq(h_news_index).addClass('on').siblings('ul').removeClass('on');
		$('.h_news_scoll .content-slider li').eq(h_news_index).show().siblings('li').hide();
});

/*详情页表格 开始*/      
$(function() {    
var fuji = $('#c_detail_wrap table').parent();
if(fuji.length>0) {  
	$('#c_detail_wrap table').wrap("<section id='new-div'></section>");
	$('#new-div').prepend("<section class='zoom-caret'>+</section>");
}
      
    var h_table;  
    var flag_table=0;  
      
    function setTable() {  
        var lxl=1;  
          
        $('section#new-div').removeClass('on');  
        $('section#new-div').scrollTop(0,0);  
       $("section#new-div table,section#new-div table td").removeAttr("width");  
        $("section#new-div table,section#new-div table td").removeAttr("height");  
        $("section#new-div table").css('width','initial');  
        $("section#new-div table td").css('width','initial');  
        $("section#new-div table td").css('height','initial');  
  
        $('#c_detail_wrap table').each(function() {  
            if ( matchMedia( 'only screen and (max-width:1199px)' ).matches ) {  
                var zclientWidth=$(document).outerWidth();  
                var ztableWidth=$(this).outerWidth();  
                var zscale=zclientWidth/ztableWidth*0.871546673799;  
                lxl=zscale;  
                if(lxl>1){lxl=1;}  
            }  
            $(this).css("transform","scale(" + lxl + ")");   
            var h_table=$(this).height();  
            $(this).parent('section#new-div').height(h_table*lxl+10);  
        });  
    }  
      
    $("#c_detail_wrap table").on('click',function(){  
        if ( matchMedia( 'only screen and (max-width:1199px)' ).matches ) {  
            if(flag_table==0){  
                $(this).parent('section#new-div').addClass('on');  
                $(this).parent('section#new-div').children('table').css("transform","scale(" + 1 + ")");   
                $(this).parent('section#new-div').height(h_table);  
                flag_table=1;  
            }else{  
                setTable();  
                flag_table=0;  
            }  
        }            
});  
 $("#c_detail_wrap #new-div .zoom-caret").on('click',function(){  
        if ( matchMedia( 'only screen and (max-width:1199px)' ).matches ) { 
            if(flag_table==0){  
                $(this).parent('section#new-div').addClass('on');  
                $(this).parent('section#new-div').children('table').css("transform","scale(" + 1 + ")");   
                $(this).parent('section#new-div').height(h_table);  
                flag_table=1;  
            }else{  
                setTable();  
                flag_table=0;  
            }  
        }            
    });  
 
      
    /*调用方法*/  
    setTable();  
      
    $(window).resize(function() {   
        /*调用方法*/  
        setTable();  
    });  
      
    /*产品详情页点击tab切换*/  
    $(".nyprodetail2 .hd span").on('click',function(){  
      var num1=$(this).index();  
      $(".nyprodetail2 .bd>section").eq(num1).show().siblings('.nyprodetail2 .bd>section').hide();  
      $(this).addClass('on').siblings('.nyprodetail2 .hd span').removeClass('on');  
        
      /*调用方法*/  
      setTable()  
    });  
     setTimeout(function(){
		$('#c_detail_wrap table').each(function() {  
			var zclientWidth=$(document).outerWidth();  
			var ztableWidth=$(this).outerWidth();  
			var zscale=zclientWidth/ztableWidth*0.871546673799;  
			lxl=zscale;  
			if(lxl>1){lxl=1;}  
			$(this).css("transform","scale(" + lxl + ")"); 
			var h_table=$(this).height();
			$(this).parent('section#new-div').height(h_table*lxl+10);  
		});  
    },200); 
});   
/*详情页表格 结束*/      