﻿/*首页头部广告*/

jQuery.fn.floatdiv = function() {
    var isIE6 = false;
    if ($.browser.msie && $.browser.version == "6.0") {
        isIE6 = true;
    };

    return this.each(function() {
        var loc;

        var l = 0;
        var t = 0;
        var windowWidth, windowHeight;

        if (self.innerHeight) {
            windowWidth = self.innerWidth;
            windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) {
            windowWidth = document.documentElement.clientWidth;
            windowHeight = document.documentElement.clientHeight;
        } else if (document.body) {
            windowWidth = document.body.clientWidth;
            windowHeight = document.body.clientHeight;
        }
        l = windowWidth / 2 - $(this).width() / 2 + 480;
        t = 0;
        loc = { left: l + "px", top: t + "px" };

        $(this).css("z-index", "9999").css(loc).css("position", "fixed");
        if (isIE6) {
            if (loc.right != undefined) {
                $(this).css("right", "18px");
            }
            $(this).css("position", "absolute");
        }
    });
};