$(function(){
	
	var first_paragraph = $('.intro')[0];
	if (!first_paragraph) return false;
	var node = first_paragraph;
	while (node.childNodes.length) {
	  node = node.firstChild;
	}

	var text = node.nodeValue;
	var first_letter = text.substr(0,1);
	var match = /[a-zA-Z]/.test(first_letter);
	if ( match ) {
	  node.nodeValue = text.slice(1);
	  $('<img />')
	      .attr('src',webroot + 'images/tpl/alphabet/' + first_letter.toLowerCase() + '.gif')
	      .attr('alt',first_letter)
	      .addClass('dropcap')
	      .prependTo( first_paragraph ); 
	}

});

var perpetua = {
  src: webroot + 'swf/perpetua.swf'
};

sIFR.activate(perpetua);

sIFR.replace(perpetua, {
  selector: '#header h1',
  wmode: 'transparent'
  ,css: [
    '.sIFR-root { color: #ffffff }'
  ]
  ,filters: {
    DropShadow: {
      color: '#000000'
	  ,distance: .5
      ,strength: .2
    }
  }
});