var body;
var window_height = $(window).height();
$(function() {
  body = $("body");

    $("div[id^='w_common_text']").each(function() {
    //	$(this).find("span:last").wrap("<div class='w-ani'></div>");
    });
    
    $("img[lazy-src]").each(function() {
    	$(this).attr("src", $(this).attr("lazy-src")).removeAttr("lazy-src");
    });
  
    setTimeout(function() {
      index();    
    }, 500);

});


function index() {
  var anis = [$("#w_grid-1617883118330")];
  anis.push($("#w_grid-1617865024054"));
  anis.push($("#w_grid-1586673487647"));
  anis.push($("#w_grid-1586744501227"));
  anis.push($("#w_grid-1586671516251"));
  anis.push($("#w_fimgbox-1570534385970"));
  anis.push($("#w_fimgbox-1570525375900"));
    anis.push($("#w_grid-1584336608199"));
  anis.push($("#w_grid-1561704304089"));
  anis.push($("#w_grid-1561714421783"));
  anis.push($("#w_grid-1561716677225"));
  anis.push($("#c_portalResNews_list-15843413870187913 .xNewList"));
    anis.push($("#w_grid-1584339634355"));
  anis.push($("#PhotoList_k1"));
  $.each(anis, function(i,v) {
  	v.addClass("w-scroll-ani");
  });
  function handle() {
  	var t = $(window).scrollTop();
    var w = $(".w-scroll-ani:not(.scrolled)");
    w.each(function() {
      var top = $(this).offset().top;
      if(top < (window_height + t - 30)) {
      	$(this).addClass("scrolled");
      }
    });
    if(window_height + t == body.height()) {
    	$(".w-scroll-ani:not(.scrolled)").each(function() {
          var top = $(this).offset().top;
          if(top > (body.height() - window_height)) {
            $(this).addClass("scrolled");
          }
        });
    }
  }
  $(window).scroll(function() {
  	handle();
  });
  handle();
}