// @gotcha due to timing issues in safari, we actually wait to make sure the CSS file is loaded and ready before triggering SIFR
YAHOO.util.Event.onContentReady("main_css",function() {
    
  //Ok, here's the fun part - we need to find out what the highlight color for this section is. 
  //Theres no consistent xbrowser way to pull info from a CSS, so we will make an element, 
  //and apply the class, and get the colour from there.  
      //Make sure the blackboard
      YAHOO.namespace('SEGAL.bb');

      YAHOO.SEGAL.bb.hiliteColour = function() {

        var el = document.createElement('div');
        // @gotcha We have to append it, because safari wont give us the colour if its not inserted into DOM
        //move this whole bit into onDOmReady to avoid the trigger befroe document ready
        
        document.body.appendChild(el);

        YAHOO.util.Dom.addClass(el, 'color_'+document.body.id);
        //Stub class will float it, and move it away, just to be safe. 
        YAHOO.util.Dom.addClass(el, 'hide');

        var colourRegEx = /(\d{0,3}), (\d{0,3}), (\d{0,3})/i;

        var colour = YAHOO.util.Dom.getStyle(el, 'color');
        
        // Difference in how getStyle.color returns results - ie reutrns #rrggbb FF rgb(). 
        // http://sourceforge.net/tracker/index.php?func=detail&aid=2114410&group_id=165715&atid=836476
        if(colour.indexOf('#') > -1) {
          return colour;
        }

        var colourParts = colourRegEx.exec(colour);

        //Remove the el...
        document.body.removeChild(el);

        if(YAHOO.util.Lang.isNull(colourParts)) { return '#ffffff';}
        
        return "#".concat(YAHOO.util.Color.rgb2hex(colourParts[1],colourParts[2],colourParts[3]));
      };

      sIFR.replaceElement("p.tagline_one", named(
        {
          sFlashSrc: "./_javascript/sifr/tradegothicbold.swf", 
          sColor: "#ffffff", 
          sCase: "upper", 
          sWmode:"transparent",
          sHoverColor : "#ffffff",
          sLinkColor : "#ffffff"
        }
      ));
      
      sIFR.replaceElement("p.tagline_two", named(
        {
          sFlashSrc: "./_javascript/sifr/tradegothicbold.swf", 
          sColor: "#ffffff", 
          sCase: "upper", 
          sWmode:"transparent",
          sHoverColor : "#ffffff",
          sLinkColor : "#ffffff"
        }
      ));
});
