/*2015.7.22*/
$(document).ready(function(){
    
    //图片列表效果
    $(".img-box ul li").hover(
        function(){
            $(this).children(".mask").css({"display":"block"})
    },  function(){
            $(this).children(".mask").css({"display":"none"})
    });
    
    //全屏遮罩
        //获取视口高度
        var wHeight = $(window).height();         
        var eHeight = $(".view-port").height();
        var mTop = (wHeight-eHeight)/2;
        $(".view-port").css({"marginTop":mTop+"px"});  //垂直方向居中；
    
    //弹出遮罩
    $(".img-box li").click(function(){
        $(".full-screen-mask").css({"display":"block"});
    });
    //关闭
    $(".close").click(function(){
        $(".full-screen-mask").css({"display":"none"});
    });
    //图片显示
    $(".img-box ul li").click(function(){
        var index = $(this).index();
         num = index+1;
        $(".pic img").attr("src","images/pic-"+num+".png")
    });
    //上一张 
    function pre(){ 
        $(".pic img").attr("src","images/pic-"+num+".png");
        num--;
        if(num==0){
            num=8
        }
    }
    $(".pre").click(pre);
    //下一张
    function next(){ 
        $(".pic img").attr("src","images/pic-"+num+".png");
        num++;
        if(num==9){
            num=1
        }
    }
    $(".next").click(next);
    
});