Can I change the caption color of Tab in CRM?

By | December 14, 2010
Seems like a bit strange question right? Why would someone change the caption color of the Tab in CRM, given the Themes provided do this job very well and some googling around can get me many suggestions to design the custom themes? One thing we always believe is that the requirement never has bounds and hence some of them deserve to be considered out of boxJ. We came across one such requirement where tab caption color needed to be changed based on the status value in the Status field on screen. Here is the script we had designed to achieve the same.
Script

function fn_onload()
{
   var da=document.all;
   for(var i=0;i< da.length;i++)
  {
       if(da[i].className==”TABOFF”)
      {
          if(da[i].innerHTML == “Relationships”)
         {
              var TabHTML = da[i].innerHTML;
              TabHTML = “< font color=Red >”+TabHTML+”< /font >”;
              da[i].innerHTML=TabHTML;
         }
      }
   }
}

Note: Here we changed the color of Relationship tab when Opportunity summary is loaded.