$(document).ready(function(){
  $('a.refresh_imgchk').click(function(){
    refreshVcode();
  });
});

function insertComment(msgJson){
  var liObj = $('ul.wall_list').find('li').eq(0);
  var _li = liObj.clone();
  _li.find('.appleap_username').html(msgJson.username);
  _li.find('.appleap_user_face img').attr('src', msgJson.user_face);
  _li.find('.appleap_create_time').html(msgJson.create_time);
  _li.find('.main').html(msgJson.content);
  var href = _li.find('.appleap_username').attr('href').replace(/\d+/g, msgJson.uid);
  _li.find('.appleap_username, .appleap_user_face').attr('href', href);
  _li.fadeIn("slow");
  liObj.parent().prepend(_li);
}
function refreshVcode(){
  var img = $('img.refresh_imgchk');
  var src = img.attr('src')+'?'+Date.parse(new Date());
  img.attr('src', src);
}
function clickObj(o){
  if( document.all && typeof( document.all ) == "object" ){
    o.fireEvent("onclick");
  }else{
  var e = document.createEvent('MouseEvent');
    e.initEvent('click',false,false);
    o.dispatchEvent(e);
  }
}
function goUrl(url, time){
  if(time==undefined){
    window.location.href = url;
  }else{
    setTimeout(function(){
      window.location.href = url;
    }, time);
  }
}
