//get the subdir...
var url = window.location.href;
var url_parts = url.split('/');
var subdir = "";
url_parts.each(function(name, number) {
	//add more names here if needed!
	if ( name == "freddys" || name == "site" || name == "demo" || name == "tlab" ) {
		subdir = name;
	}
});

var path = '';
if ( subdir != "" ) {
	path = '/';
}

path += subdir + '/swf/';

//Freddys Outline And Dots 
var freddysdots = {
      src: path + 'freddysdots.swf'
};
 
//Freddys Outline
var freddysoutline = {
      src: path + 'freddysoutline.swf'
};


function do_flash_replace() {
	sIFR.activate(freddysoutline);
	sIFR.activate(freddysdots);

	sIFR.replace(freddysdots, {
	      selector: '.MainContainer h2.foo',
	      css: [
	      '.sIFR-root { text-align:center; font-size:50px; font-weight:normal; color:#000; text-transform: uppercase;}'
	      ],
	      wmode: 'transparent'
	});

	sIFR.replace(freddysdots, {
	      selector: '.MainContainer h2',
	      css: [
	      '.sIFR-root { font-size:50px; font-weight:normal; color:#000; text-transform: uppercase;}'
	      ],
	      wmode: 'transparent'
	});
	
	sIFR.replace(freddysoutline, {
	      selector: '.MainContainer h3',
	      css: [
	      '.sIFR-root { font-size:40px; font-weight:normal; color:#000; text-transform: uppercase;}'
	      ],
	      wmode: 'transparent'
	});

	sIFR.replace(freddysoutline, {
	      selector: '.MainContainer h4',
	      css: [
	      '.sIFR-root { font-size:30px; font-weight:normal; color:#000; text-transform: uppercase;}'
	      ],
	      wmode: 'transparent'
	});

	sIFR.replace(freddysoutline, {
	      selector: '.MainContainer h2 em',
	      css: [
	      '.sIFR-root { text-align:center; font-size:50px; font-weight:normal; color:#000; text-transform: uppercase;}'
	      ],
	      wmode: 'transparent'
	});

	//Freddys Black
	var freddysblack = {
	      src: path + 'freddysblack.swf'
	}; 

	sIFR.activate(freddysblack);

	sIFR.replace(freddysblack, {
	      selector: '.MainContainer p.foo',
	      css: [
	      '.sIFR-root { text-align:center; font-size:20px; font-weight:normal; color:#000; text-transform: uppercase; }'
	      ],
	      wmode: 'transparent'
	});


	sIFR.replace(freddysblack, {
	      selector: '.MainContainer p',
	      css: [
	      '.sIFR-root { font-size:20px; font-weight:normal; color:#000; text-transform: uppercase; }',
		  'a { text-align:center; font-weight:bold; color:#000000; padding: 0; }',
		  'a:link { text-align:center; font-weight:bold; color:#000000; }',
	      'a:hover { text-align:center; font-weight:bold; color:#ff6600; }',
	      'em { text-align:center; font-weight:bold; color:#ff6600; }'
	      ],
	      wmode: 'transparent'
	});


	sIFR.replace(freddysblack, {
	      selector: '.MainContainer h5',
	      css: [
	      '.sIFR-root { text-align:center; font-size:30px; font-weight:normal; color:#000; text-transform: uppercase; }'
	      ],
	      wmode: 'transparent'
	});

	sIFR.replace(freddysblack, {
	      selector: '.MainContainer h6',
	      css: [
	      '.sIFR-root { text-align:center; font-size:20px; font-weight:normal; color:#000; text-transform: uppercase; }'
	      ],
	      wmode: 'transparent'
	});

	sIFR.replace(freddysblack, {
	      selector: '.BlogBoxPostForm li label',
	      css: [
	      '.sIFR-root { font-size:16px; font-weight:normal; color:#000; text-transform: uppercase; }'
	      ],
	      wmode: 'transparent'
	});

	sIFR.replace(freddysblack, {
	      selector: '.ContactBox .BoxFirst label',
	      css: [
	      '.sIFR-root { font-size:16px; font-weight:normal; color:#000; text-transform: uppercase; }'
	      ],
	      wmode: 'transparent'
	});

	sIFR.replace(freddysblack, {
	      selector: '.MainContainer h2 strong',
	      css: [
	      '.sIFR-root { font-size:50px; font-weight:normal; color:#000; text-transform: uppercase;}'
	      ],
	      wmode: 'transparent'
	});	
}
do_flash_replace();