jQuery.extend({
setHomepage: function(url) {
if (document.all) {
 document.body.style.behavior = 'url(#default#homepage)';
 document.body.setHomePage(url);
}
else if (window.sidebar) {
 if (window.netscape) {
  try {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  }
  catch (e) {
   var strTemp = "Your browser does not allow websites to change your homepage." +
   "To make this page your home page, just drag the icon to the left of the " +
   "URL in your location bar onto the 'Home' icon in " +
   "your toolbar. Some browsers do this differently. You can always set your " +
   "home page through the preferences of your browser.";
   alert(strTemp);
  }
 }
 var prefs = Components.classes['@mozilla.org/preferences-service;1']
     .getService(Components.interfaces.nsIPrefBranch);
 prefs.setCharPref('browser.startup.homepage', url);
}
}
});

