/* ------------------------------------------------------------------
Global Javascripts
Scripts to be used globally throughout a site
------------------------------------------------------------------ */


/* addLoadEvent() - Allows multiple javascript functions to be 
called when the document loads.
------------------------------------------------------------------ */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


/* externalLinks() - Causes any anchor tag with rel="external" to be 
opened in a new window.
------------------------------------------------------------------ */
function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
      anchor.target = "_blank";
    }
  }
}


/* Call JS Functions
------------------------------------------------------------------ */
addLoadEvent(function() {
  
 // sIFR Calls
  if(typeof sIFR == "function"){
    sIFR.replaceElement(named({sSelector:".title",
sFlashSrc:"/swf/tradegothicbold.swf", sColor:"#8fa1ac",
sLinkColor:"#8fa1ac", sBgColor:"#ffffff", sHoverColor:"#8fa1ac",
sCase: "upper"}));
    sIFR.replaceElement(named({sSelector:".title-red",
sFlashSrc:"/swf/tradegothicbold.swf", sColor:"#8d1c00",
sLinkColor:"#8d1c00", sBgColor:"#ffffff", sHoverColor:"#8d1c00",
sCase: "upper"}));
  };
  
  // External Links
  externalLinks();
  
});

