var whitney = { src: '/sifr/flash/whitney.swf' };
var whitneybold = { src: '/sifr/flash/whitneybold.swf' };
var dakota = { src: '/sifr/flash/dakota.swf' };
sIFR.activate(whitney, whitneybold, dakota);
$(document).ready(function(){
	replaceFonts();
	$(".minislideshow").each(function(j,slideshow) {
		$(".minislideshowheader a",slideshow).each(function(i,item){
				$(item).mouseover(function() {
					//find the old and new slides
					var currentSelectedLink = $("a.current",$(this).parent());
					var oldTarget = ($(currentSelectedLink).attr('href'));
					var newTarget = ($(this).attr('href'));
					//change the link colors
					currentSelectedLink.removeClass('current');
					$(this).addClass('current');
					//hide and show the slides
					$(oldTarget).hide();
					$(newTarget).show();
					replaceFonts();
					
					
					//dont propagate the event
					return false;
				});
				$(item).click(function() {return false});
		});
		$("a.next",slideshow).each(function(i,item){
				$(item).click(function() {
					//a click on a next link simulates a click on the relevant header
					var newTarget = ($(this).attr('href'));
					var link = $(".minislideshowheader a[href="+newTarget+"]",slideshow);
					if (link) {
						link.mouseover();
					}
					return false;
				});
		});
	});
});
function replaceFonts() {
	
	sIFR.replace(whitney, {
	  selector: 'h1',
	  css: '.sIFR-root { color: #000000;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitney, {
	  selector: 'h2.big',
	  css: '.sIFR-root { color: #000000;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitney, {
	  selector: '.headerblock h2.bizsphere',
	  css: '.sIFR-root { color: #000000;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitney, {
	  selector: '.headerblock h2',
	  css: '.sIFR-root { color: #ffffff;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitneybold, {
	  selector: '.followers h2',
	  css: '.sIFR-root { color: #464646;}',
	  wmode: 'transparent'
	});
	sIFR.replace(dakota, {
	  selector: 'h2.handwritten',
	  css: '.sIFR-root { color: #000000;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitney, {
	  selector: 'h2.upper',
	  css: '.sIFR-root { color: #000000;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitneybold, {
	  selector: 'h2.lower',
	  css: '.sIFR-root { color: #000000;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitney, {
	  selector: '.block h2',
	  css: '.sIFR-root { color: #447ABC;}   a {text-decoration:none; color:#447ABC;} a:hover {color: #000000;text-decoration:none;} a:active {color: #000000;text-decoration:none;}',
	  wmode: 'transparent'
	});
	sIFR.replace(whitneybold, {
	  selector: 'h2',
	  css: '.sIFR-root { color: #000000;}',
	  wmode: 'transparent'
	});
}