if(typeof sIFR == "function"){
  sIFR.replaceElement("#content div.blog_post h3", named({ 
    sFlashSrc: "flash/clarendon_regular.swf", 
    sColor: "#000000", 
    sCase: "upper", 
    nPaddingTop: "6", 
    nPaddingBottom: "8"
  }));
  
  sIFR.replaceElement("#content #archive h3", named({ 
    sFlashSrc: "flash/clarendon_regular.swf", 
    sColor: "#000000", 
    sCase: "upper", 
    nPaddingTop: "6", 
    nPaddingBottom: "8"
  }));

  sIFR.replaceElement("#content h3.alt", named({ 
    sFlashSrc: "flash/clarendon_regular.swf", 
    sColor: "#005536", 
    sCase: "upper", 
    nPaddingTop: "6", 
    nPaddingBottom: "8"
  }));

  sIFR.replaceElement("#pledge_form h3", named({ 
    sFlashSrc: "flash/clarendon_regular.swf", 
    sColor: "#33154a", 
    sBgColor: "#f3e4ff",
    sCase: "upper", 
    nPaddingTop: "6", 
    nPaddingBottom: "8"
  }));
  
  sIFR.replaceElement("#content h3", named({ 
    sFlashSrc: "flash/clarendon_bold.swf", 
    sColor: "#424242", 
    sCase: "upper", 
    nPaddingTop: "6", 
    nPaddingBottom: "8",
    sHoverColor: "#ff0882"
  }));
/*  
  sIFR.replaceElement("#side_bar h4", named({ 
    sFlashSrc: "/flash/clarendon_bold.swf", 
    sColor: "#ff2390", 
    sCase: "upper",
    sWmode: "transparent"
  }));*/
};

window.onload = function() {
  var so = null;
  switch(document.getElementsByTagName('body')[0].className) {
    case 'home':
      so = new SWFObject("flash/nav.swf", "flash_content", "856", "416", "7", "#ffffff");
      so.addVariable("sec", "home");
      break;
    case 'pledge':
    case 'thank you':
      so = new SWFObject("flash/nav.swf", "flash_content", "856", "330", "7", "#ffffff");
      so.addVariable("sec", "pledge");
      break;
    case 'about':
      so = new SWFObject("flash/nav.swf", "flash_content", "856", "330", "7", "#ffffff");
      so.addVariable("sec", "about");
      break;
    case 'media':
      so = new SWFObject("flash/nav.swf", "flash_content", "856", "330", "7", "#ffffff");
      so.addVariable("sec", "media");
      break;
    case 'community':
    case 'account':
    case 'ecards':
    case 'forums':
      so = new SWFObject("flash/nav.swf", "flash_content", "856", "330", "7", "#ffffff");
      so.addVariable("sec", "community");
      break;
    case 'store':
      so = new SWFObject("flash/nav.swf", "flash_content", "856", "330", "7", "#ffffff");
      so.addVariable("sec", "store");
      break;
    case 'pinkertons':
    case 'blog':
      so = new SWFObject("flash/nav.swf", "flash_content", "856", "416", "7", "#ff0882");
      so.addVariable("sec", "pinkertons");
      break;
  }
  if (so) {
    //so.addParam("wmode", "transparent");
    so.addParam("scale", "noscale");
    so.addParam("salign", "lt");
    so.addParam("menu", "false");
    so.addParam("wmode", "transparent");
    so.write("flash_replace");
  }
  
}

function showDates() {
  window.open("pinkerton-tour-dates.php", "pinkertons", "status=0,height=500,width=300,resizable=0")
}
function showDate(date_id) {
  window.open("pinkerton-date.php?id="+ date_id, "pinkertons", "status=0,height=500,width=300,resizable=0")
}
function showVideo(url) {
  window.open(url, "pinkertons", "status=0,height=500,width=500,resizable=0")
}
function showGallery(url) {
  window.open(url, "pinkertons", "status=1,height=660,width=640,resizable1")
}

var Popup = {
  open: function(options)
  {
    this.options = {
      url: '#',
      width: 430,
      height: 480,
      name:"_blank",
      location:"no",
      menubar:"no",
      toolbar:"no",
      status:"yes",
      scrollbars:"yes",
      resizable:"yes",
      left:"",
      top:"",
      normal:false
    }
    Object.extend(this.options, options || {});

    if (this.options.normal){
        this.options.menubar = "yes";
        this.options.status = "yes";
        this.options.toolbar = "yes";
        this.options.location = "yes";
    }

    this.options.width = this.options.width < screen.availWidth?this.options.width:screen.availWidth;
    this.options.height=this.options.height < screen.availHeight?this.options.height:screen.availHeight;
    var openoptions = 'width='+this.options.width+',height='+this.options.height+',location='+this.options.location+',menubar='+this.options.menubar+',toolbar='+this.options.toolbar+',scrollbars='+this.options.scrollbars+',resizable='+this.options.resizable+',status='+this.options.status
    if (this.options.top!="")openoptions+=",top="+this.options.top;
    if (this.options.left!="")openoptions+=",left="+this.options.left;
    window.open(this.options.url, this.options.name,openoptions );
    return false;
  }
}

function calcHeight() {
  //find the height of the internal page
  var the_height= document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('the_iframe').height= the_height;
}
