﻿//商品浮动
AdsFloat = Class.create();
AdsFloat.prototype = {
    initialize: function(_1, _2, al, vl) {
        this._dstWin = _1;
        this._obj = _2;
        this._fun = false;
        this._align = al ? "r" : "l";
        this._valign = vl ? "t" : "b";
        this.start();
    }
    , start: function() {
        if (this._onScroll) {
            return;
        }
        this._pagePos = getPagePosition(this._dstWin);
        this._onScroll = this.onScroll.bindAsEventListener(this);
        Event.observe(this._dstWin, "scroll", this._onScroll);
        this._onResize = this.onResize.bindAsEventListener(this);
        Event.observe(this._dstWin, "resize", this._onResize);
    }
    , stop: function() {
        if (!this._onScroll) {
            return;
        }
        Event.stopObserving(this._dstWin, "scroll", this._onScroll);
        Event.stopObserving(this._dstWin, "resize", this._onResize);
        this._onScroll = false;
        this._onResize = false;
    }
    , onScroll: function(_5) {
        var _6 = Position.cumulativeOffset(this._obj);
        var _7 = {
            x: _6[0], y: _6[1]
        }
        ;
        var _8 = getPagePosition(this._dstWin);
        var _9 = _7.x + _8.scrollLeft - this._pagePos.scrollLeft;
        var _a = _7.y + _8.scrollTop - this._pagePos.scrollTop;
        this._obj.style.left = _9 + "px";
        this._obj.style.top = _a + "px";
        this._pagePos = _8;
    }
    , onResize: function(_b) {
        var _c = Position.cumulativeOffset(this._obj);
        var _d = {
            x: _c[0], y: _c[1]
        }
        ;
        var _e = getPagePosition(this._dstWin);
        var _f = _d.x + (this._align == "r" ? (_e.clientWidth - this._pagePos.clientWidth) : 0);
        var _10 = _d.y + (this._valign == "b" ? (_e.clientHeight - this._pagePos.clientHeight) : 0);
        this._obj.style.left = _f + "px";
        this._obj.style.top = _10 + "px";
        this._pagePos = _e;
    }
}
;
function openQuick() {
    var o = $("fixLayout");
    var _l = parseInt(o.style.left);
    if (_l > 0 && !o.oldleft) o.oldleft = _l;
    if (o.className == "QuickBig") {
        o.className = "QuickSmall";
        _l = o.oldleft;
    }
    else {
        o.className = "QuickBig";
        if (_l >= 188)
            _l = _l - 188;
    }
  
    o.style.left = _l + "px";
};
webjs.loader.load("initLayout", function() {
    var o = $("fixLayout");
    var _page = getPagePosition(window);
    var _l = (_page.clientWidth - 960) / 2 -24; // - 212
    var _h = (_page.scrollTop + 110);
    if (_l < 0) _l = 0;
    var arVersion = navigator.appVersion.split("MSIE");
    var version = parseFloat(arVersion[1]);
    if (version < 7) {
        o.style.position = "absolute";
        o.style.top = _h + "px";
        o.onscroll = new AdsFloat(window, o);
    }
    o.style.left = _l + "px";
    o.show();
    Event.observe($("fixLayouttitle"), "mousedown", startDragLogin.callWith(o.id));


});

