
function jsTools(reference){
  // reference: name of the variable containing a reference to this object;
  if (!reference) return(false);
  this.reference=reference;
  this.browser='';
  this.browserVersion=0;
  var FF = /(Firefox)[\/\s](\d+\.\d+)/;
  var IE = /MS(IE) (\d+\.\d+)/;
  var Opera = /(Opera)[\/\s](\d+\.\d+)/;
  var Safari = /(Safari)[\/\s](\d+\.\d+)/;
  result=FF.exec(navigator.userAgent);
  if (!result) result=IE.exec(navigator.userAgent);
  if (!result) result=Opera.exec(navigator.userAgent);
  if (!result) result=Safari.exec(navigator.userAgent);
  if (result) {
    this.browser=result[1];
    this.browserVersion=result[2];
  }

  this.bookmark = function(title, url) {
    if(this.browser=='IE') {
	    window.external.AddFavorite(url, title);
	    return;
    }

    if (this.browser=='Firefox') {
      window.sidebar.addPanel(title, url,"");
      return;
    }

    if(this.browser=='Opera'){
	    var elem = document.createElement('a');
	    elem.setAttribute('href',url);
    	elem.setAttribute('title',title);
	    elem.setAttribute('rel','sidebar');
	    elem.click();
	    return;
    }
  }

  this.email = function(title, link) {
    if (isBlank(title)) title = document.title;
    if (isBlank(link)) link = window.location;
    link = escape(link);
    title = escape(title);
    window.location='mailto:?subject='+title+'&body='+link;
    return;
  }

  this.rss = function() {
    alert('RSS Feeds are coming soon!');
    return;
  }
}
