﻿
    //下面的JS是用JS动态创建DIV，IFRAME
    function createDIV() {
        var o = document.body;
        var div = document.createElement("div");
        div.id = "kf";
        div.style.position = "absolute";
        div.style.width = "120px";
        div.style.height = "166px";
        div.style.top = "115px";
        div.style.z_index = "1000";
        div.style.clear = "both";
        o.appendChild(div); 
        var newiframe = document.createElement("iframe");
        newiframe.src = "kf.htm";
        newiframe.style.width = "120px";
        newiframe.style.height = "166px";
        newiframe.scrolling = "no";
        div.appendChild(newiframe);
    }

    //下面的JS是做那个滚动的
    
    var fixedblock = function(instancename) {
        this.instance = document.getElementById(instancename);
        this.initTop = parseInt(this.instance.style.top);
        this.initialize();
    }
    fixedblock.prototype.initialize = function() {
        var inst = this;
        //滚动事件
        var scrollevent = function() {
            var fblock = inst.instance;
            fblock.style.top = inst.initTop + parseInt(document.documentElement.scrollTop || document.body.scrollTop) + "px";
        };
        //重定义窗口大小
        var resizeevent = function() {
            var fblock = inst.instance;
            fblock.style.left = "2px";
        };
        if (document.body.attachEvent) {
            //IE7
            document.body.attachEvent("onscroll", scrollevent);
            //在IE6里
            window.attachEvent("onscroll", scrollevent);
            window.attachEvent("onresize", resizeevent);
        }
        else {
            document.addEventListener("scroll", scrollevent, false);
            window.addEventListener("resize", resizeevent, false);
        }
        scrollevent();
        resizeevent();
    }
    
    function closecontact() {
        document.getElementById("kf").style.display = "none";
    }

