/*****************************************************************************
It is adviced to place the sIFR JavaScript calls in this file, keeping it
separate from the `sifr.js` file. That way, you can easily swap the `sifr.js`
file for a new version, while keeping the configuration.

You must load this file *after* loading `sifr.js`.

That said, you're of course free to merge the JavaScript files. Just make sure
the copyright statement in `sifr.js` is kept intact.
*****************************************************************************/

// Make an object pointing to the location of the Flash movie on your web server.
// Try using the font name as the variable name, makes it easy to remember which
// object you're using. As an example in this file, we'll use Futura.
// var futura = { src: '/path/to/futura.swf' };

var arnoProBoldItalic = { src: '/flash/sIFR/fonts/arnoProBoldItalic.swf' };
var arnoProBoldSubhead = { src: '/flash/sIFR/fonts/arnoProBoldSubhead.swf' };
var arnoProBoldCaption = { src: '/flash/sIFR/fonts/arnoProBoldCaption.swf' };
var arnoProBoldSmText = { src: '/flash/sIFR/fonts/arnoProBoldSmText.swf' };
var arnoProBoldItalicCaption = { src: '/flash/sIFR/fonts/arnoProBoldItalicCaption.swf' };

// Now you can set some configuration settings.
// See also <http://wiki.novemberborn.net/sifr3/JavaScript+Configuration>.
// One setting you probably want to use is `sIFR.useStyleCheck`. Before you do that,
// read <http://wiki.novemberborn.net/sifr3/DetectingCSSLoad>.

sIFR.useStyleCheck = true;


// Next, activate sIFR:

sIFR.activate(arnoProBoldItalic, arnoProBoldSubhead, arnoProBoldCaption, arnoProBoldSmText, arnoProBoldItalicCaption);

// If you want, you can use multiple movies, like so:
//
//    var futura = { src: '/path/to/futura.swf' };
//    var garamond = { src '/path/to/garamond.swf' };
//    var rockwell = { src: '/path/to/rockwell.swf' };
//    
//    sIFR.activate(futura, garamond, rockwell);
//
// Remember, there must be *only one* `sIFR.activate()`!

// Now we can do the replacements. You can do as many as you like, but just
// as an example, we'll replace all `<h1>` elements with the Futura movie.
// 
// The first argument to `sIFR.replace` is the `futura` object we created earlier.
// The second argument is another object, on which you can specify a number of
// parameters or "keyword arguemnts". For the full list, see "Keyword arguments"
// under `replace(kwargs, mergeKwargs)` at 
// <http://wiki.novemberborn.net/sifr3/JavaScript+Methods>.
// 
// The first argument you see here is `selector`, which is a normal CSS selector.
// That means you can also do things like '#content h1' or 'h1.title'.
//
// The second argument determines what the Flash text looks like. The main text
// is styled via the `.sIFR-root` class. Here we've specified `background-color`
// of the entire Flash movie to be a light grey, and the `color` of the text to
// be red. Read more about styling at <http://wiki.novemberborn.net/sifr3/Styling>.

var oursIFR = {
	go: function() {
		sIFR.replace(arnoProBoldItalic, {
			selector: 'h1, .mainbox_middle .list_su h2, .mainbox_middle_blue .list_su h2, h3.em, h4.em',
			transparent: true,
			offsetTop: 2,
			tuneHeight: 2,
			css: [
				'.sIFR-root { text-align: center; color: #FFFFFF; leading: 5; }',
				'.left { text-align: left; }'
			],
			filters: { 
				DropShadow: { 
					distance: 1.5,
					color: '#000000',
					strength: 1.1,
					blurX: 8,
					blurY: 8,
					alpha: .9
				}
			}
		});
		
		sIFR.replace(arnoProBoldItalic, {
			selector: '.nav .item_heading, #nav_journey .item, .nav .lev1_subtitle, #sidebar h2',
			transparent: true,
			css: [
				'.sIFR-root { color: #ECDB92; }',
				'a:link { color: #ECDB92; text-decoration: none; }',
				'a:hover { color: #FFED9E; text-decoration: none; }',
				'.separator { display: inline; }',
				'.subtitle { text-align: center; }',
				'.title { font-size: 26px; text-align: center; leading: 3; }',
				'.title_smaller { font-size: 25px; text-align: center; leading: 3; }'
			],
			filters: {
				DropShadow: {
					distance: 1,
					color: '#000000',
					strength: 1.5,
					blurX: 6,
					blurY: 6,
					alpha: 1
				},
				Bevel: {
					type: 'inner',
					angle: 35,
					strength: 1,
					distance: 1,
					shadowAlpha: .6
				}
			}
		});
		
		
		sIFR.replace(arnoProBoldSubhead, {
			selector: 'h2',
			transparent: true,
			offsetTop: 2,
			tuneHeight: 2,
			css: [
				'.sIFR-root { text-align: center; color: #FFFFFF; }'
			],
			filters: {
				DropShadow: {
					distance: 1.5,
					color: '#000000',
					strength: 1.1,
					blurX: 8,
					blurY: 8,
					alpha: .9
				}
			}
		});
		
		sIFR.replace(arnoProBoldCaption, {
			selector: '#nav_journey .lev3_item, #nav_mw .item, #nav_connecting .cat_heading, #nav_articles li.level_3, #nav_mw li.level_3, #nav_distance li.level_3, #nav_in-person li.level_3, .nav .info p, #sidebar h3',
			transparent: true,
			css: [
				'.sIFR-root { color: #D6C673; leading: 3; margin-left: 10; text-indent: -10; letter-spacing: -.3; }',
				'a:link { color: #D6C673; text-decoration: none; }',
				'a:hover { color: #D6C673; text-decoration: underline; }',
				'.alert { color: #F9E488; }'
			]
		});
		
		sIFR.replace(arnoProBoldCaption, {
			selector: 'h3, h4:not(.no-sIFR)',
			transparent: true,
			css: [
				'.sIFR-root { color: #FFFFFF; }',
				'.center { text-align: center; }'
			],
			filters: {
				DropShadow: {
					distance: 1,
					color: '#000000',
					strength: 1,
					blurX: 6,
					blurY: 6,
					alpha: .9
				}
			}
		});
		
		sIFR.replace(arnoProBoldSubhead, {
			selector: '.nav .lev1_item',
			transparent: true,
			css: [
				'.sIFR-root { text-align: center; color: #ECDB92; text-transform: uppercase; font-size: 18; letter-spacing: .8; }',
				'.big { display: inline; font-size: 145%; }',
				'a:link { color: #ECDB92; text-decoration: none; }',
				'a:hover { color: #FFED9E; text-decoration: none; }'
			],
			filters: {
				DropShadow: {
					distance: 1.5,
					color: '#000000',
					strength: 1.5,
					blurX: 8,
					blurY: 8,
					alpha: 1
				},
				Bevel: {
					type: 'inner',
					angle: 35,
					strength: 2,
					distance: 1,
					shadowAlpha: .6
				}
			}
		});
		
		
		
		sIFR.replace(arnoProBoldSmText, {
			selector: '#nav_journey li.level_4, #nav_connecting li.level_4, .nav .info_bul',
			transparent: true,
			css: [
				'.sIFR-root { color: #D6C673; margin-left: 10; text-indent: -10; letter-spacing: -.1; leading: 2; }',
				'a:link { color: #D6C673; text-decoration: none; }',
				'a:hover { color: #D6C673; text-decoration: underline; }',
				'.flush { margin-left: 0; text-indent: 0; }',
				'.multi { leading: 0; }'
			]
		});
		
		sIFR.replace(arnoProBoldItalicCaption, {
			selector: '#nav_connecting .item_action, #nav_connecting .lev3_item',
			transparent: true,
			css: [
				'.sIFR-root { color: #D6C673; margin-left: 10; text-indent: -10; leading: 3; letter-spacing: -.3; }',
				'a:link { color: #D6C673; text-decoration: none; }',
				'a:hover { color: #D6C673; text-decoration: underline; }'
			]
		});
		
		sIFR.replace(arnoProBoldSubhead, {
			selector: '#nav_connecting .lev2_item',
			transparent: true,
			onReplacement: $(window).trigger('resize'),
			css: [
				'.sIFR-root { color: #D6C673; leading: 3; letter-spacing: .3; margin-left: 10; text-indent: -10; }',
				'a:link { color: #ECDB92; text-decoration: none; }',
				'a:hover { color: #FFED9E; text-decoration: underline; }'
			],
			filters: {
				DropShadow: {
					distance: 1,
					color: '#000000',
					strength: 1.5,
					blurX: 6,
					blurY: 6,
					alpha: 1
				},
				Bevel: {
					type: 'inner',
					angle: 35,
					strength: 1,
					distance: 1,
					shadowAlpha: .6
				}
			}
		});
	}
}

oursIFR.go();

