function login(){
	var loading = WST.msg('加载中', {icon: 16,time:60000});
	var params = WST.getParams('.ipt');
	$.post(WST.U('admin/index/checkLogin'),params,function(data,textStatus){
		layer.close(loading);
		var json = WST.toAdminJson(data);
		if(json.status=='1'){
			WST.msg("登录成功",{icon:1},function(){
				location.href=WST.U('admin/index/index');
			});
		}else{
			getVerify('#verifyImg');
			WST.msg(json.msg,{icon:2});			
		}
	});
}
getVerify = function(img){
	$(img).attr('src',WST.U('admin/index/getVerify','rnd='+Math.random()));
}
$(document).keypress(function(e) { 
	if(e.which == 13) {  
		login();  
	} 
}); 
$(window).resize(function() {
   layout();
});
function layout(){
  var w = WST.pageWidth();
  $('.wst-lo').css('left',(w-330)/2);
  $('#particles-js').height(WST.pageHeight()-10);
  particlesJS('particles-js', {
  particles: {
    color: '#eee',
    shape: 'circle', 
    opacity: 0.4,
    size: 4,
    size_random: true,
    nb: 200,
    line_linked: {
      enable_auto: true,
      distance: 100,
      color: '#eee',
      opacity: 1,
      width: 1,
      condensed_mode: {
        enable: false,
        rotateX: 600,
        rotateY: 600
      }
    },
    anim: {
      enable: true,
      speed: 3
    }
  },
  interactivity: {
    enable: true,
    mouse: {
      distance: 300
    },
    detect_on: 'canvas',
    mode: 'grab',
    line_linked: {
      opacity: .5
    },
    events: {
      onclick: {
        enable: true,
        mode: 'push', 
        nb: 4
      }
    }
  },
  retina_detect: true
});
}
$(function(){
  layout();
})