/**
 * Created by Administrator on 2016/11/29.
 */
$(function(){
    //12.22后加
    $('.qmain1_l1').hover(function(){
        $(this).find('.title').stop(true,true).fadeToggle();
    })

    //TAB切换
    $('.title').each(function(){
         $(this).children('.title1').eq(0).addClass('xz');
    })

    $('.title_nr').each(function(){
         $(this).children('.title_nr1').eq(0).show();
    })

    $('.title1').hover(function(){
        $(this).addClass('xz').siblings().removeClass('xz');
        $(this).parents().siblings('.title_nr').children('.title_nr1').eq($(this).index()).show().siblings().hide();
    })


    //导航点击文字变色
    $('.nav .container ul > li').click(function(){
        $(this).children('a').addClass('xz');
        $(this).siblings('li').children('a').removeClass('xz');
    })



    //导航产品与服务部分tab标题栏目切换点击改变样式
    $('.nav ul > li').hover(function(){
        $(this).children('.tb').show();
        $(this).children('i').css('display','block');
        $(this).children('.drop_down').fadeIn();
        $(this).siblings('li').children('.drop_down').fadeOut();
    },function(){
        //var timer = null;
        //clearTimeout(timer);
        //timer = setTimeout(function(){
        //    $('.tb').hide();
        //    $('i').css('display','none');
        //},500)
        $(this).children('.tb').hide();
        $(this).children('i').css('display','none');
        $(this).children('.drop_down').fadeOut();
    })
    var $tab_a1 = $('.tab_title1 > a');
    $tab_a1.hover(function(){
        $(this).children('img').show();
        $(this).siblings('.tab_cont1').find('.gengduo1').show();
        var index = $tab_a1.index(this);
        //alert(index);
        $('div.tab_cont1 > div').eq(index).show().siblings().hide();
    },function(){
        $(this).children('img').hide();
    })


    $('.tab_cont1').hover(function(){
        $('.gengduo1').click(function(){
            $(this).parents('.left1').parents('div').parents('.tab_cont1').css({
                'height':'auto'
            });
            $(this).hide();
        })
    },function(){
        $(this).css({
            'height': '240px',
            'overflow':'hidden'
        })
        $('.gengduo1').show();
    })


    //首页悬浮框部分
    $(window).load(function(){
        $('.xuanfu').animate({
            top: '50%',
            marginTop: '-95px',
            left: '50%',
            marginLeft: '-153px'
        },2000,function(){
            $(this).animate({
                top: '100%',
                marginTop: '-190px',
                left: '0',
                marginLeft: '0'
            },2000)
        })
    })

    $('.xuanfu > a').click(function(){
        $(this).parents('.xuanfu').fadeOut();
    })


    //tab标题栏目切换点击改变样式
    var $tab_a = $('.tab_title a');
    $tab_a.hover(function(){
        $(this).addClass('xz');
        $(this).siblings('a').removeClass('xz');
        var index = $tab_a.index(this);
        $('div.tab_cont > div').eq(index).show().siblings().hide();
    })
    //首页主要部门鼠标经过出现蒙层
    $('.main3_picScroll .bd ul > li').hover(function(){
        $(this).children('.mc').show();
        $(this).children('.pic').find('.layer3').hide();
    },function(){
        $(this).children('.mc').hide();
        $(this).children('.pic').find('.layer3').show();
    })
    //首页鼠标经过图片变亮
    // $('.main5_picMarquee .bd ul li').hover(function(){
    //         $(this).children('.pic').children('a').children('img').removeClass('desaturate');
    //         $(this).siblings('li').find('img').addClass('desaturate');
    // },function(){
    //     $(this).children('.pic').children('a').children('img').addClass('desaturate');
    // })

    //鼠标点击关于长安标题栏字体变色出现下划线
    $('.list ul li').click(function(){
        $(this).children('a').addClass('xz');
        $(this).siblings('li').children('a').removeClass('xz');
    })

    //荣誉资质鼠标经过出现蒙层
    $('.main-5_b ul li').hover(function(){
        $(this).children('a').children('span').css('display','block');
    },function(){
        $(this).children('a').children('span').css('display','none');
    })

    //分页点击变色
$('.page a').click(function(){
    $(this).addClass('strong');
    $(this).siblings('a').removeClass('strong');
})

    //产品与服务鼠标经过图片出现蒙层
    $('.main-8_b_b ul li').hover(function(){
        $(this).children('.mc').show();
        $(this).children('a').children('span').hide();
    },function(){
        $(this).children('.mc').hide();
        $(this).children('a').children('span').show();
    })

    // 产品与服务鼠标点击效果
    $('.main-8_b_t ul li').click(function(){
        $(this).addClass('xz');
        $(this).siblings('li').removeClass('xz');
    })

    //09-产品与服务  鼠标经过出现下拉框
    $('.main-8_b_t ul li.chanpin').hover(function(){
        $(this).children('.drop_down1').stop().slideDown();
    },function(){
        $(this).children('.drop_down1').stop().slideUp();
    })
    $('.main-8_b_t ul li.fuwu').hover(function(){
        $(this).children('.drop_down1').stop().slideDown();
    },function(){
        $(this).children('.drop_down1').stop().slideUp();
    })
    //16-合作伙伴鼠标经过图片变亮
    // $('.main-14_b ul li').hover(function(){
    //     $(this).children('a').children('img').removeClass('desaturate');
    //     $(this).siblings('li').find('img').addClass('desaturate');
    // },function(){
    //     $(this).children('a').children('img').addClass('desaturate');
    // })

    //招聘信息点击出现下拉框
    var i =1;
    $('.main-11_b_b ul > li > .cont1').click(function(){
        var sub = $(this).siblings('.drop_down2');
        if(sub.is(":hidden")){
            $(this).parents('li').children('.drop_down2').stop().slideDown();
            $(this).parents('li').siblings('li').children('.drop_down2').stop().slideUp();

            $(this).find('i').css(
                'background','url(/Public/Home/images/icon10.png) no-repeat left center'
            );
            $(this).parents('li').siblings('li').find('i').css(
                'background','url(/Public/Home/images/icon9.png) no-repeat left center'
            );
            i=0;
        }else{
            $(this).parents('li').children('.drop_down2').stop().slideUp();
            $(this).find('i').css(
                'background','url(/Public/Home/images/icon10.png) no-repeat left center'
            );

            i=1;
        }

    })


    //主要部门鼠标经过蒙层显示  文字消失

    $('.main-16_b ul li').hover(function(){
        $(this).children('.mc1').show();
        $(this).children('span').hide();
    },function(){
        $(this).children('.mc1').hide();
        $(this).children('span').show();
    })
    //var i=1;
 //$('.main-11_b_b ul > li > .cont1').click(function(){
 //    if(i==1){
 //        $(this).parents('li').children('.drop_down2').stop().slideDown();
 //        $(this).parents('li').siblings('li').children('.drop_down2').stop().slideUp();
 //
 //        $(this).find('i').css(
 //            'background','url(images/icon10.png) no-repeat left center'
 //        );
 //        i=2;
 //    }else{
 //        $(this).parents('li').children('.drop_down2').stop().slideUp();
 //        $(this).find('i').css(
 //            'background','url(images/icon9.png) no-repeat left center'
 //        );
 //        //$(this).parents('li').siblings('li').children('.cont1').find('i').css(
 //        //    'background','url(images/icon10.png) no-repeat left center'
 //        //);
 //        i=1;
 //    }
 //
 //})


    //var subNW = 0;
    //$('.nav > ul > li').hover(function(){
    //    //var subNW = chi.find('.tb_title1').width();
    //   $(this).find('.tb').show();
    //    //var w2 = chi.find('.tb_cont1').actual('width');
    //    //$('.tb_cont1 .tab_cont1_l').eq(index).find('div').each(function(){
    //        //        w +=$(this).width();
    //        //        $(this).parents('.tab_cont1_l').width(w);
    //        //    })
    //
    //},function(){
    //    $(this).find('.tb').hide();
    //})

    ////var w = 0 ;
    //$('.tb_title1 a').hover(function(){
    //    var index = $(this).index();
    //    $('.tb_cont1 > div').eq(index).show().siblings().hide();
    //    //$('.tb_cont1 .tab_cont1_l').eq(index).find('div').each(function(){
    //    //    w +=$(this).width();
    //    //    $(this).parents('.tab_cont1_l').width(w);
    //    //})
    //    //$('.tb').width(subNW + w +200);
    //},function(){
    //    //w=0;
    //    //var index = $(this).index();
    //    //$('.tb').width(subNW);
    //   //$(this).parents('.tb_title1').siblings()
    //   // $('.tb_cont1 .tab_cont1_l').hide();
    //})




    //var w = 0 ;
    //var h = 0 ;
    //$('.tb_title1 a').hover(function(){
    //    var index = $(this).index();
    //    $('.tb_cont1 .tab_cont1_l').eq(index).show().siblings().hide();
    //    var w1 = $(this).parents(tb_title1).outerWidth();
    //    var w2 = $('.tb_cont1 .tab_cont1_l').eq(index).outerWith();
    //    $('.tb').width(w1+w2);
    //},function(){
    //    w =0;
    //})

    //var w = 0 ;
    //var h = 0 ;
    //$('.tb_title1 a').hover(function(){
    //    var index = $(this).index();
    //    $('.tb_cont1 .tab_cont1_l').eq(index).show().siblings().hide();
    //    $('.tb_cont1 .tab_cont1_l').eq(index).find('div').each(function(){
    //        w +=$(this).width();
    //        $(this).parents('.tab_cont1_l').width(w);
    //    })
    //    h = $(this).parents('.tb_title1').height();
    //    var sh = $('.tb_cont1 .tab_cont1_l').eq(index).height();
    //    var max = Math.max(sh,h);
    //    $('.tb').height(max);
    //},function(){
    //    w =0;
    //})
    ////导航部分鼠标滑过出现下拉
    //    var w =0;
    //    var h = 0;
    //$('.nav_menu > ul > li').hover(function(){
    //    $(this).children('.menu').show();
    //    w = 0;
    //    $(this).children('.menu').find('p').each(function(){
    //        w += $(this).width();
    //        $(this).parent('.menu').width(w);
    //        h = $(this).children('.menu').height();
    //        //$(this).height(h - 34);
    //    })
    //},function(){
    //    $(this).children('.menu').hide();
    //    w =0 ;
    //    h =0;
    //})



//    var w =0;
//    var h = 0;
//$('.nav_menu > ul > li').hover(function(){
//        $(this).children('.menu').show();
//        w = 0;
//        $(this).parents('.nav_menu').siblings('.menu_main').find('p').each(function(){
//            w += $(this).width();
//            $(this).parent('.menu_main').width(w);
//        })
//        h = $(this).parents('.nav_menu').siblings('.menu_main').height();
//        $(this).parents('.nav_menu').height(h - 34);
//},function(){
//    $(this).parents('.nav_menu').siblings('.menu_main').hide();
//    w =0 ;
//    h =0;
//})

})
