﻿$(function() {
    $('#download').click(function() {
        var obj = $(this);
        obj.blur();
    });
doDefault();
    //doMenuShow();
    doPicShow();
    doPNGFix();
    doSearchClick();
    doCaseAlpha();
    doPageScroll();
   	doJobShow(); 
   //doTeamHover();
   //doNewsScroll();

});

function doDefault()
{
    $('.teamblock2 .p4inner').find('.p4').hide();
}

function doMenuShow() {

    $('#menuc>dl').mouseenter(function() {
        $(this).addClass('menuhover2');
        var obj = $(this).find('.submenu');
        if (obj != null) {
            //$('#foranimation').stop().animate({ fontSize: '13em' }, 200, function() {
            //obj.slideDown("slow",function(){
                obj.show();
            //});
        //});
        }
    });

    $('#menuc>dl').mouseleave(function() {
        $(this).removeClass('menuhover2');
        var obj = $(this).find('.submenu');
        if (obj != null) {
                obj.slideUp("fast",function(){
                    obj.hide();
                });
        }
    });
   
   
       $('.submenu').mouseleave(function() {
      $(this).hide();
    });

    //doSubMenuLiShow();
}


function doSubMenuLiShow() {
    $('a', '.submenu').hover(function() {
        var newObj = $(this);
        newObj.stop().animate({ "paddingLeft": "20px" }, { duration: 350 });
    }, function() {
        var newObj = $(this);
        newObj.stop().animate({ "paddingLeft": "0px" }, { duration: 350 });
    });
}

function doPNGFix() {
    //$(document).pngFix(); 
}

function doSearchClick() {
    $('#txtkw').click(function() {
        $(this).val("");
    });
    $('#txtkw').blur(function() {
        $(this).val("Search");
    });

}

function doPicShow() {
    $('#company>ul>li').mouseenter(function() {
        var obj = $(this);
        obj.find('.imgshow').css({"z-index":"0","position":"absolute"}).stop().animate({"top":"172"},500);
    });
    $('#company>ul>li').mouseleave(function() {
        var obj = $(this);
        obj.find('.imgshow').css({"z-index":"100","position":"absolute"}).stop().animate({"top":"0"},500);
    });

}




function doCaseAlpha() {
    $('#caselist>ul>li').mouseover(function() {
        var obj = $(this);
        obj.find('.caseshow').css({"z-index":"0","position":"absolute"}).stop().animate({"top":"166"},1000);
        var antiobj = obj.siblings('li');
        antiobj.each(function() {
            var obj2 = $(this).find('img');
            obj2.stop();
            obj2.animate(
            { "opacity": "0.3" }, 500);
        });
    });

    $('#caselist>ul>li').mouseout(function() {
        var obj = $(this);
        obj.find('.caseshow').css({"z-index":"100","position":"absolute"}).stop().animate({"top":"0"},1000);
        var antiobj = obj.siblings('li');
        antiobj.each(function() {
            var obj2 = $(this).find('img');
            obj2.stop();
            obj2.animate(
            { "opacity": "1" }, 500);
        });
    });

}



function doPageScroll() {
    $('#forScroll>ul>li>a,#client>p>a').click(function() {
        var obj = $(this);
        var attr1 = obj.attr('class');
        var attr2 = '.h' + attr1;
        $.scrollTo(attr2, 1000);
        obj.blur();
        });
    
}

function doJobShow()
{
    $('.jobpic','#jobeffect>ul>li').click(function(){
        var obj=$(this);
        var objnext=obj.next('div');
        var parentsiblings=$('.jobpic').next('div');
        parentsiblings.not(objnext).hide("slow");
        var siblings=obj.next('div');
        siblings.toggle("slow");
    });
}
/*
function doTeamHover()
{
    $('.teamblock2','#teamman').click(function(){
        $('.teamblock1').find('.p4inner').css({"width":"80px"}).find('.p4').hide("slow");
        $('.teamblock1').css({"width":"180px"});
        $('.teamblock2').css({"width":"530px"});
        $('.teamblock2').find('.p4inner').animate({"width":"430px"},200).show("slow");
        $('.teamblock2').find('.p4').show().css({"width":"400px"});
        $('.teamblock1').find('.p4inner').css({"width":"80px"}).find('.p4').hide("slow");
    });

   
        $('.teamblock1','#teamman').click(function(){
        $('.teamblock2').find('.p4inner').css({"width":"80px"}).find('.p4').hide("slow");
        $('.teamblock2').css({"width":"180px"});
        $('.teamblock1').css({"width":"530px"});
        $('.teamblock1').find('.p4inner').animate({"width":"430px"},200).show("slow");
        $('.teamblock1').find('.p4').show().css({"width":"400px"});
        $('.teamblock2').find('.p4inner').css({"width":"80px"}).find('.p4').hide("slow");
    });
   

    
    
}*/


function doMenuEffect(obj,h)
{
        $('#menuc>dl').mouseenter(function() {
        $(this).addClass('menuhover2');
        $('#'+obj).stop().animate({"top":h+"px"},300);
    });

    $('#menuc>dl').mouseleave(function() {
        $(this).removeClass('menuhover2');
        var obj = $(this).find('.submenu');
       $('#'+obj).stop().animate({"top":"-"+h+"px"},300);
    });
    
}


var _bdhmProtocol = (("https:" ==document.location.protocol) ? "https://" :" http://");document.write(unescape("%3Cscriptsrc='" + _bdhmProtocol +"hm.baidu.com/h.js%3F66efdddca3d0c607db0570f10da891bc'type='text/javascript'%3E%3C/script%3E"));






