function tc_onload(){
  if(!(/msie/i.test(navigator.userAgent) && !window.opera)){
    var cssRules = document.all?'rules':'cssRules'; //x-browser bs
    for (var S = 0; S < document.styleSheets.length; S++){
      for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
        if (document.styleSheets[S][cssRules][R].selectorText == 'img.png') {
          document.styleSheets[S][cssRules][R].style['visibility'] = "";
        }
      }
    }
  }
  if (isTipCupUser()){
    //todo: something
    //document.getElementById("tipcupuserspace").innerHTML="we really dig that you use tipcup!";
  }
  tc_addTipListener();
}

function tipcup_ontip(amt){
  document.getElementById("tipcupuserspace").innerHTML = "You are awesome! Thanks for the $" + amt + " tip!";
}

function install (aEvent){
  if (navigator.userAgent.indexOf("Firefox") == -1){
    alert("Sorry... Tipcup is only for firefox at the moment!");
    return false;
  }
  alert("Tipcup is under development.  Please consider it no more than a toy at this point.");
  //alert("Please note that tipcup is not a payment service.  There is no guarantee that your tip is going to the person you imagine it will.");
  InstallTrigger.install({"tipcup": "tipcup.xpi"});
  return false;
}
