

//vip_list
var _room = document.getElementById("vipImgList");

var _u = _room.getElementsByTagName("ul");
var _t = 0;
function listLayout() {
  for (var i = 0; i < _u.length; i++) {

    var cols = _u[i].getAttribute("col");
    _u[i].style.left = cols * 246 + "px";

    if (i <= 3) {
      _u[i].style.top = "0px";
    } else {
      var h = parseInt(_u[i - 4].offsetTop + _u[i - 4].scrollHeight);
      _u[i].style.top = h + "px";
    }
    if (i > 0) {
      var _newT = 0;
      var _cur = parseInt(_u[i].offsetTop + _u[i].scrollHeight);
      var _pro = parseInt(_u[i - 1].offsetTop + _u[i - 1].scrollHeight);
      if (_cur > _pro) {
        _newT = _cur;
        if (_newT > _t) _t = _newT;
      }
    } else {
      _t = parseInt(_u[i].offsetTop + _u[i].scrollHeight);
    }
  }
  _room.style.height = parseInt(_t) + "px";
  window.setTimeout(function(){
    _room.style.display = "block";
    document.getElementById("vipLoad").style.height = "auto";
    document.getElementById("vipLoad").style.display = "none";
  },300)
}
window.setInterval(listLayout, 200);