/*****************************************************************************
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' };

// 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(futura);

// 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>.
/* sIFR.replace(futura, {
  selector: 'h1',
  css: '.sIFR-root { background-color: #F9F9F9; color: #FF0000; }'
}); */

var amwayOpti = { src: '/flash/amwayopti.swf' };
var amwayOptiBold = { src: '/flash/amwayoptibold.swf' };
var helveticaNeueLtStd = { src: '/flash/helveticaneueltstd.swf' };

sIFR.activate(amwayOpti, amwayOptiBold, helveticaNeueLtStd);

$(document).ready(function(){

	if($('div#bgNav ul li').length){
		// Global nav states.
		sIFR.replace(amwayOpti, {
		  selector: 'div#bgNav ul li',
		  css: [
				'.sIFR-root { text-transform: uppercase; letter-spacing: 1.2; font-size: 12px; }',
				'a { color: #999999; text-decoration: none; }',
				'a:hover { color: #ffffff; }',
				'.navOn { color: #ffffff }'
			],
			wmode: 'transparent',
			forceSingleLine: true,
			tuneHeight: -7,
			offsetTop: 2
		});
	}

	if($('h1.colour').length){	
		// Product page headings.
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.colour',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #cd5a13; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
	}

	if($('h1.colour2').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.colour2',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #cd5a13; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});
	}
	
	if($('h1.frizz').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.frizz',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #003592; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
	}
	
	if($('h1.frizz2').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.frizz2',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #003592; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});
	}
	
	if($('h1.lusciousLong').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.lusciousLong',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #ad1015; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});	
	}
	
	if($('h1.lusciousLong2').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.lusciousLong2',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #ad1015; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});
	}
		
	if($('h1.miracleMoist').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.miracleMoist',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #0072b1; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
		
	}
	
	if($('h1.miracleMoist2').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.miracleMoist2',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #0072b1; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});
	}
	
	if($('h1.miracleMoist3').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.miracleMoist3',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 28px; color: #0072b1; text-align: right; leading: -18; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
	}
		
	if($('h1.miracleReconstructor').length){	
		sIFR.replace(amwayOptiBold, {
			selector: 'h1.miracleReconstructor',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #ad1015; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
	}
		
	if($('h1.mega').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.mega',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #96004b; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
	}
	
	if($('h1.mega2').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.mega2',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #96004b; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});
	}
	
	if($('h1.volume2').length){	
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.volume2',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #006579; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'		
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});
	}
	
	if($('h1.volume').length){		
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.volume',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #006579; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
	}
	
	if($('h1.aussome').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1.aussome',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #317023; text-align: right; leading: -26; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -12,
			offsetTop: -5,
			offsetLeft: 3
		});
	
	}
	
	if($('div#containerAddHairMustHaves a').length){
		// Add to my Hair Must-Haves link.
		sIFR.replace(amwayOptiBold, {
		  selector: 'div#containerAddHairMustHaves a',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 19px; color: #970bb3; leading: -7; }'
			],
			wmode: 'transparent',
			tuneHeight: -10,
			offsetTop: -5
		});
	
	}
	
	if($('div#containerAlsoLike h3').length){
		// You may also like... heading.
		sIFR.replace(amwayOptiBold, {
		  selector: 'div#containerAlsoLike h3',
		  css: [
				'.sIFR-root { font-size: 20px; color: #999999; }'
			],
			wmode: 'transparent',
			tuneHeight: -10,
			offsetTop: -5
		});
	
	}
	
	if($('div#calloutFrizzForecast a').length){
		// Frizz forecast callout.
		sIFR.replace(helveticaNeueLtStd, {
		  selector: 'div#calloutFrizzForecast a',
		  css: [
				'.sIFR-root { font-size: 13px; font-weight: bold; color: #ffffff; leading: -4; cursor: pointer; }',
				'.span { font-size: 10px; }'
			],
			wmode: 'transparent',
			tuneHeight: -8,
			offsetTop: -3
		});	
	}
	
	if($('div#calloutFrizzForecast2 a').length){
		// Frizz forecast callout 2.
		sIFR.replace(helveticaNeueLtStd, {
		  selector: 'div#calloutFrizzForecast2 a',
		  css: [
				'.sIFR-root { font-size: 29px; font-weight: bold; color: #ffffff; leading: -8; cursor: pointer; }',
				'.span { font-size: 17px; }',
				//'.break { font-size: 12px; }',
				'.download { font-size: 17px; leading: -14; }'
			],
			wmode: 'transparent',
			tuneHeight: -20,
			offsetTop: -16
		});
	}
	
	if($('h1#collectionsFrizz').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1#collectionsFrizz',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 36px; color: #003592; leading: -26; }',
			],
			wmode: 'transparent',
			tuneHeight: -21,
			offsetTop: -9,
			offsetLeft: 0
		});	
	}
	
	if($('h1#collectionsColour').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1#collectionsColour',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 36px; color: #cd5a13; leading: -26; }',
			],
			wmode: 'transparent',
			tuneHeight: -21,
			offsetTop: -9,
			offsetLeft: 0
		});	
	}
	
	if($('p#collectionsColourSub').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'p#collectionsColourSub',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 15px; color: #cd5a13; }',
			],
			wmode: 'transparent'
			
		});	
	}
	
	if($('h1#collectionsLusciousLong').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1#collectionsLusciousLong',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 36px; color: #ad1015; leading: -26; }',
			],
			wmode: 'transparent',
			tuneHeight: -21,
			offsetTop: -9,
			offsetLeft: 0
		});	
	}
	
	if($('h1#collectionsMiracleMoist').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1#collectionsMiracleMoist',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 36px; color: #0072b1; leading: -26; }',
			],
			wmode: 'transparent',
			tuneHeight: -21,
			offsetTop: -9,
			offsetLeft: 0
		});
	}
	
	if($('h1#collectionsMega').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1#collectionsMega',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 36px; color: #96004b; leading: -26; }',
			],
			wmode: 'transparent',
			tuneHeight: -21,
			offsetTop: -9,
			offsetLeft: 0
		});	
	}
	
	if($('h1#collectionsVolume').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1#collectionsVolume',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 36px; color: #006579; leading: -26; }',
			],
			wmode: 'transparent',
			tuneHeight: -21,
			offsetTop: -9,
			offsetLeft: 0
		});	
	}
	
	if($('h1#collectionsAussome').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'h1#collectionsAussome',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 36px; color: #317023; leading: -26; }',
			],
			wmode: 'transparent',
			tuneHeight: -21,
			offsetTop: -9,
			offsetLeft: 0
		});
	}
	
	if($('div#scrollPane h1').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'div#scrollPane h1',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 39px; color: #ad1015; }',
			],
			wmode: 'transparent',
			tuneHeight: -15,
			offsetTop: -9,
			offsetLeft: 4
		});
	}
	
	if($('div#buy-online-content h1').length){
		sIFR.replace(amwayOptiBold, {
		  selector: 'div#buy-online-content h1',
		  css: [
				'.sIFR-root { text-transform: uppercase; font-size: 39px; color: #ad1015; }',
			],
			wmode: 'transparent',
			tuneHeight: -15,
			offsetTop: -9,
			offsetLeft: 4
		});
	}
	
	if($('h1#hdrYourHairMustHaves').length){
		// Your Hair Must-Haves header.
		sIFR.replace(amwayOptiBold, {
			selector: 'h1#hdrYourHairMustHaves',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 19px; color: #970bb3; }'
			],
			wmode: 'transparent',
			tuneHeight: -14,
			offsetTop: -4
		});	
	}
	
	if($('h3.myHdr').length){
		// Your Hair Must-Haves Product headers
		sIFR.replace(amwayOptiBold, {
			selector: 'h3.myHdr',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 14px; color: #666666; leading: -8; background-color: #00ff00; }',
				'.txtBtm { font-size: 11px; }'
			],
			wmode: 'transparent',
			tuneHeight: -9,
			offsetTop: -4
		});	
	}
	
	if($('h3.myHdr2').length){
		sIFR.replace(amwayOptiBold, {
			selector: 'h3.myHdr2',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 14px; color: #666666; leading: -8; background-color: #00ff00; }',
				'.txtTop { font-size: 12px; leading: -5; }',
				'.txtBtm { font-size: 11px; }'
			],
			wmode: 'transparent',
			tuneHeight: -9,
			offsetTop: -5
		});	
	}
	
	if($('h3.myHdr3').length){
		sIFR.replace(amwayOptiBold, {
			selector: 'h3.myHdr3',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 13px; color: #666666; leading: -6; background-color: #00ff00; }',
				'.txtBtm { font-size: 11px; }'
			],
			wmode: 'transparent',
			tuneHeight: -7,
			offsetTop: -3
		});	
	}
	
	if($('div#calloutsProducts h2#hdrShareIt').length){
		// Share It header.
		sIFR.replace(amwayOptiBold, {
			selector: 'div#calloutsProducts h2#hdrShareIt',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 19px; color: #970bb3; }'
			],
			wmode: 'transparent',
			tuneHeight: -14,
			offsetTop: -4
		});	
	}
	
	if($('.matchHeader h1').length){
		// meet your match header
		sIFR.replace(amwayOptiBold, {
			selector: '.matchHeader h1',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 18px; color: #9900cc; }'
			],
			wmode: 'transparent'
			
		});	
	}
	
	if($('h1.colour3New').length){
		// New 3MM Product Color
		sIFR.replace(amwayOptiBold, {
			selector: 'h1.colour3New',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #d63a20; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});	
	}
	
	if($('h1.aussomeNew').length){
		sIFR.replace(amwayOptiBold, {
			selector: 'h1.aussomeNew',
			css: [
				'.sIFR-root { text-transform: uppercase; font-size: 35px; color: #317023; text-align: right; leading: -26; }',
				'.txtTop { font-size: 25px; leading: -13; display: block; }',
				'.txtBtm { font-size: 15px; display: block; }'
			],
			wmode: 'transparent',
			tuneHeight: -22,
			offsetTop: -15,
			offsetLeft: 3
		});	
	}


});











	