<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html>
<head>
<title id="pageTitle">上海复星星泰医药科技有限公司</title>
<meta name="renderer" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0 user-scalable=no"/>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/axingtai/css/common.css"/>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/axingtai/css/product.css"/>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/axingtai/css/wap.css"/>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/axingtai/css/aos.css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/axingtai/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/axingtai/js/js.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/layer.js"></script>
    <style type="text/css">

        .shane{
            display: block;
        }
    </style>
</head>

<body style="background:#ffffff;">
    <div class="header">
        <jsp:include page='<%="/newshead.html"%>'></jsp:include>
    </div>

<script type="text/javascript">
$(function(){
	var exptopfixed=$(".exp_fixed").offset().top;

    $(".havelevel").hover(function(){
            $(this).children(".levelson").addClass('cur');
            $(this).children(".down_level").stop().slideDown();
            
        },function(){
            $(this).children(".levelson").removeClass('cur');
            $(this).children(".down_level").stop().slideUp();
            Fixed();

        })
	
    $(window).scroll(function(){	
		Fixed()
    });
	
function Fixed(){
	var top = $(document).scrollTop();        
	 //console.log(top+',,'+exptopfixed);
	if(top>=79){
		  $(".top").addClass("top_jl");
          $(".down_level").css("top","70px");
		  }
		  else{
			  $(".top").removeClass("top_jl");
            $(".down_level").css("top","110px");
			  }
	      }

    	$(".wapmenu").click(function(){
    			$(".menucon").show(500);
    			})
    	$(".close").click(function(){
    		$(".menucon").hide(500);
    		})		
	
})
</script>

<div class="nrbanner pro_banner">
    <div class="nrbannercon">
        <p class="banner_tit">产品及服务</p>
        <p class="banner_des">Products and services</p>
    </div>
    <div class="idea_nav">
        <div class="main">
            <c:forEach items="${productclassify}" var="productByids">
                <c:if test="${productByids.id==ppdId}">
                    <a href="productst.html?id=${productByids.id}"   class="cur def" >${productByids.name}</a>
                </c:if>
                <c:if test="${productByids.id!=ppdId}">
                    <a href="productst.html?id=${productByids.id}"  >${productByids.name}</a>
                </c:if>
            </c:forEach>
        </div>
    </div>
</div>


<div class="main product clearfix">
    <div class="pro_side">
        <ul class="pro_ul clearfix">
            <c:forEach items="${productclassify}" var="productSf">
                <li>
                    <a class="level_one">${productSf.name}</a>
                    <dl class="level_two">
                        <c:forEach items="${product}" var="product">
                            <c:if test="${product.pfid==productSf.id}">
                                <c:if test="${product.id==ppdIds}">
                                    <dd class="cur"><a onclick="selProdct(${product.id})" id="tp${product.id}">${product.name}</a></dd>
                                </c:if>
                            <c:if test="${product.id!=ppdIds}">
                                <dd><a  onclick="selProdct(${product.id})" id="tp${product.id}">${product.name}</a></dd>
                            </c:if>
                            </c:if>
                        </c:forEach>

                    </dl>
                </li>
            </c:forEach>

        </ul>
    </div>
    <script type="text/javascript">
        $(function(){
            $(".level_one").click(function(){
                if($(this).hasClass("level_cur")){
                    $(this).removeClass("level_cur");
                    $(this).siblings(".level_two").slideUp();
                }else{
                    $(this).addClass("level_cur");
                    $(this).siblings(".level_two").slideDown();
                    $(this).parent().siblings().children(".level_two").slideUp();
                    $(this).parent().siblings().children(".level_one").removeClass("level_cur");
                }
            })
        })
    </script>

    <div class="pro_right">
        <div class="pro_tab" id="pro_classId">
            <c:forEach items="${productAll}"  var="productAll">
                <a class="weiwe">${productAll.title}</a>
            </c:forEach>

        </div>
        <div id ="pclassifyId">

        <c:forEach items="${productAll}" var="productAlls">
            <div class="pro_con" id="${productAlls.id}">
                <p>${productAlls.details}</p>
            </div>
        </c:forEach>
        </div>


    </div>
</div>
    <jsp:include page='<%="/footer.html"%>'></jsp:include>
</body>
<script>
    function get(abc){
       var ac=abc;
       ac="#wss"+ac;
       var ad="#ws"+abc;
       $(ad).addClass("cur");
        $(ad).siblings().removeClass("cur");
        $(ac).addClass("shane");
        $(ac).siblings().removeClass("shane");
    }
    function selProdct(id) {
        var tp="#tp"+id;
        $(tp).parent().addClass("cur");
        $(tp).parent().siblings().removeClass("cur");
        $.ajax({
            type : "post",
            url : "products.html?id="+id,
            dataType : "json",
            success : function(data){
                if(data!=null){
                    $("#pro_classId").empty();
                    $("#pclassifyId").empty();
                    var hha = "";
                    var hhaa = "";
                    var abc=0;
                    var kk ="";
                    for (var item in data){
                        var title=data[item].title;
                        var details=data[item].details;
                        abc++;
                       if(abc==1){
                           hha='<a class="weiwes cur"  id="ws'+abc+'" onclick="get('+abc+')" >'+title+'</a>';
                           kk = '<div class="pro_con shane" id="wss'+abc+'" >'+details+'</div>';
                       }else{
                           hha+='<a class="weiwes"  id="ws'+abc+'" onclick="get('+abc+')" >'+title+'</a>';
                           kk+='<div class="pro_con "  id="wss'+abc+'" >'+details+'</div>';
                       }
                    }
                    hhaa+=kk;
                    $("#pro_classId").append(hha);
                    $("#pclassifyId").append(hhaa);

            }else{
                $("#searchResult").html("出现错误：" + data.msg);
            }
        },
        error:function(jqXHR){
            aler("发生错误："+ jqXHR.status);
        }
    });
    }


    /*function clickStr(str){

        var items = document.getElementsByClassName("level_one");



        for(var i=0,len=items.length;i<len;i++){

            if(str == items[i].innerHTML){
                items[i].click();
            }
        }



    }*/

    $(function(){

         var defaultStr =  $(".def").html();


        var items = document.getElementsByClassName("level_one");



        for(var i=0,len=items.length;i<len;i++){

            if(defaultStr == items[i].innerHTML){
                items[i].click();
            }
        }


    })


</script>
</html>