
        
        $(function(){
            var image = new Image();
            image.onload = function() {
                var imgWidth=$('.ty-banner-1 img').width();
               var windowWidth=$(window).width();
               var length = (imgWidth-windowWidth)/2;
               if(length>0){
                    $('.ty-banner-1 img').attr('style','margin-left:'+ (-length) + 'px');
               }
               $('.ty-banner-1 img').addClass('show');
            }
            image.src = $('.ty-banner-1 img').attr('src');
           
        });
    

       var key = document.getElementById("key");

            function searchInfo() {
                var base = $('head').data('base');
                if (key.value) {
                    location.href = base + "search.php?key=" + key.value;
                } else {
                    alert('请输入您要搜索的关键词！');
                }
            }
            key.addEventListener('keypress', function(event) {
                var keycode = event.keycode || event.which;
                if (keycode == "13") {
                    searchInfo();
                }
            });

        function searchLink(el) {
            var href = $(el).attr("href");
            location.href = href ? href : "/search.php?key=" + $(el).html();
        }
    

        $("[navcrumbs]").find("dd a").last().addClass('cur');
    

        $(".k12-gl-gslb-3nf1-1-01-left .p2imga").fancybox({
            'transitionIn': 'elastic',
            'transitionOut': 'elastic',
            'titlePosition': 'inside'
        });
    

        function clickIE4(e) {
            var e = e || window.event;
            if (e.button && e.button == "2") {
                return false;
            }
        }

        function clickNS4(e) {
            var e = e || window.event;
            if (document.layers || document.getElementById && !document.all) {
                if (e.which == 2 || e.which == 3) {
                    return false;
                }
            }
        }

        function OnDeny() {
            if (event.ctrlKey || event.keyCode == 78 && event.ctrlKey || event.altKey || event.altKey && event.keyCode == 115) {
                return false;
            }
        }

        /*try {
            if (document.layers) {
                document.captureEvents(Event.MOUSEDOWN);
                document.onmousedown = clickNS4;
                document.onkeydown = OnDeny();
            } else if (document.all && !document.getElementById) {
                document.onmousedown = clickIE4;
                document.onkeydown = OnDeny();
            }
        } catch (e) {}

        try {
            document.oncontextmenu = function() {
                return false;
            };
        } catch (e) {}

        try {
            document.body.onselectstart = function() {
                return false;
            }
        } catch (e) {}

        try {
            document.body.oncopy = function() {
                return false;
            }
        } catch (e) {}*/
    
