// JavaScript Document  For ANCMS  By Alone
window.onerror = function(){return true;}
function an_addfav()
{
  var title = document.title;
  var url = window.location.href;
  if(window.sidebar){window.sidebar.addPanel(title,url,"");}
  else if(document.all){window.external.AddFavorite(url,title);}
  return false;
}

function an_sethome()
{
  var url = window.location.href;
  try{this.style.behavior='url(#default#homepage)';this.setHomePage(url);}
  catch(e)
  {
    if(window.netscape)
    {
      try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}
      catch(e){alert('此操作被浏览器拒绝！\n请手动设置。');}
      var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
      prefs.setCharPref('browser.startup.homepage',url);
    }
  }
  return false;
}