/* ------------------------------------------------------------------
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:"#487d8c",
sLinkColor:"#487d8c", sBgColor:"#ffffff", sHoverColor:"#487d8c",
sCase: "upper"}));
    sIFR.replaceElement(named({sSelector:".title-red",
sFlashSrc:"/swf/tradegothicbold.swf", sColor:"#e55302",
sLinkColor:"#e55302", sBgColor:"#ffffff", sHoverColor:"#e55302",
sCase: "upper"}));
  sIFR.replaceElement(named({sSelector:".footer-heading",
sFlashSrc:"/swf/tradegothicbold.swf", sColor:"#ffffff",
sLinkColor:"#e55302", sBgColor:"#487d8c", sHoverColor:"#ffffff",
sCase: "upper"}));
  };
  
  // External Links
  externalLinks();
  
});

