//Allows us to not replace certain elements
//see: http://wiki.novemberborn.net/sifr3/Tricks
parseSelector.pseudoClasses = {
  'not': function(nodes, selector) {
    var result = [];
    each: for(var i = 0, node; i < nodes.length; i++) {
      node = nodes[i];
      var ignore = parseSelector(selector, node.parentNode);
      for(var j = 0; j < ignore.length; j++) {
        if(ignore[j] == node) continue each;
      }
      result.push(node);
    }
    return result;
  }
}


//Where is our font embedded flash file?
var gothambook = { src: '/swf/gothambook.swf' };
var gothambold = { src: '/swf/gothambold.swf' };
var gothambookitalic = { src: '/swf/gothambookitalic.swf' };
var gothamlight = { src: '/swf/gothamlight.swf' };
var gothammedium = { src: '/swf/gothammedium.swf' };

//Activate (Load) the font
sIFR.activate(gothambook);
sIFR.activate(gothambold);
sIFR.activate(gothambookitalic);
sIFR.activate(gothamlight);
sIFR.activate(gothammedium);

//Set our sIFR options
sIFR.repaintOnResize = false;

//Begin replacing our elements


// Quick Links
sIFR.replace(gothammedium, {
	selector: '#quickLinks h3',
	css: '.sIFR-root { font-size: 22px; color: #ffffff; }',
	wmode: 'transparent'
});

sIFR.replace(gothammedium, {
	selector: '#quickLinks ul li',
	css: [
		'.sIFR-root { font-size: 14px; color: #ffffff;}',
		'a { color: #ffffff; text-decoration: none; }',
		'a:hover { color: #ffffff; text-decoration: underline; }'
	],	wmode: 'transparent',
	antialiasType: 'advanced',
	thickness: '-100'
});

sIFR.replace(gothamlight, {
	selector: '#utilityBar strong',
	css: [
		'.sIFR-root { color: #92B909; }',
		'.rsquo { letter-spacing: -25; }'
	],
	wmode: 'opaque'
});

sIFR.replace(gothamlight, {
    selector: '#utilityBar h1',
    css: [
		'.sIFR-root { color: #92B909; }',
		'.rsquo { letter-spacing: -25; }'
	],
    wmode: 'opaque'
});

sIFR.replace(gothamlight, {
    selector: '.col h2',
    css: [
		'.sIFR-root { color: #92B909; }',
		'.rsquo { letter-spacing: -25; }'
	],
    wmode: 'opaque'
});

// Modules
sIFR.replace(gothammedium, {
	selector: 'div.questionForm h3',
	css: '.sIFR-root { color: #0090B4; }',
	wmode: 'transparent'
});

sIFR.replace(gothammedium, {
	selector: 'div.nextSteps h3',
	css: '.sIFR-root { color: #0090B4; }',
	wmode: 'transparent'
});

sIFR.replace(gothammedium, {
	selector: 'div.thankYou h3',
	css: [
		'.sIFR-root { color: #db5a1d; }',
		'.rsquo { letter-spacing: -10 }'
	],
	wmode: 'transparent'
});



sIFR.replace(gothamlight, {
	selector: 'div.yourStory h3',
	css: [
		'.sIFR-root { color: #db5a1d; }',
		'.rsquo { letter-spacing: -10 }'
	],
	wmode: 'transparent'
});

sIFR.replace(gothammedium, {
	selector: 'div.module:not(.profile) h3',
	css: [
		'.sIFR-root { color: #92B909; }',
		'.rsquo { letter-spacing: -10 }'
	],
	wmode: 'transparent'
});

//Main content headings  | NO LONGER NEEDED DUE TO HEADER CHANGES 4/15/2009
//sIFR.replace(gothamlight, {
	//selector: '#main h3:not(.subTitle)',
	//css: [
		//'.sIFR-root { color: #92B909; }',
		//'.rsquo { letter-spacing: -20; }'
	//],
	//wmode: 'transparent'
//});


sIFR.replace(gothamlight, {
selector: 'div:not(.altHeadings)>h2',
    css: [
        '.sIFR-root { color: #92B909; font-size: 32px;}'
    ],
    wmode: 'transparent',
    antialiasType: 'advanced'
});



sIFR.replace(gothamlight, {
	selector: '#home #content #main div.properNouns ul li h4',
	css: [
		'.sIFR-root { font-size: 20px; color: #3F4450; }',
		'a { color: #3F4450; text-decoration: none; }',
		'a:hover { color: #3F4450; text-decoration: underline }'
	],
	wmode: 'transparent',
	antialiasType: 'advanced',
	thickness: '100'
});

sIFR.replace(gothammedium, {
	selector: '#knowAbout div.child h4',
	css: [
		'.sIFR-root { font-size: 22px; color: #ffffff; }',
		'.rsquo { letter-spacing: -13; }'
	],
	wmode: 'transparent'
});

sIFR.replace(gothamlight, {
	selector: '#knowAbout div.team h4',
	css: [
		'.sIFR-root { font-size: 18px; color: #ffffff; }',
		'.rsquo { letter-spacing: -11; }'
	],
	wmode: 'transparent'
});
sIFR.replace(gothamlight, {
    selector: '#knowAbout div.uwpeds div a',
    css: [
		'.sIFR-root { font-size: 18px; color: #ffffff; cursor:pointer;}',
		'.rsquo { letter-spacing: -11; }'
	],
    wmode: 'transparent'
});
sIFR.replace(gothambook, {
	selector: '#largeLinks div h4',
	css: [
		'.sIFR-root { font-size: 20px; color: #ffffff; }',
		'.rsquo { letter-spacing: -13; }'
	],
	wmode: 'transparent'
});

sIFR.replace(gothambook, {
	selector: '#referringNewPatients div.title h3.subTitle',
	css: [
		'.sIFR-root { color: #92B909; }',
		'.rsquo { letter-spacing: -10 }'
	],
	wmode: 'transparent'
});

sIFR.replace(gothammedium, {
	selector: '#TB_window h3',
	css: [
		'.sIFR-root { color: #92B909; }',
		'.rsquo { letter-spacing: -10 }'
	],
	wmode: 'transparent'
});

//Page Title headings
sIFR.replace(gothamlight, {
	selector: '#pageTitle:not(.longTitle) h1:not(.detailTitle)',
	css: [
	    '.sIFR-root { color: #ffffff; font-size: 42px; }',
	    '.rsquo { letter-spacing: -20 }'
	],
	wmode: 'transparent',
	antialiasType: 'advanced',
	thickness: '-50'
});

sIFR.replace(gothamlight, {
	selector: '#pageTitle.longTitle h1',
	css: [
	    '.sIFR-root { color: #ffffff; font-size: 32px; }',
	    '.rsquo { letter-spacing: -20 }'
	],
	wmode: 'transparent',
	antialiasType: 'advanced',
	thickness: '-50'
});

sIFR.replace(gothamlight, {
	selector: '#pageTitle strong.detailTitle',
	css: [
		'.sIFR-root { color: #ffffff; font-size: 18px;display:block; }',
		'.rsquo { letter-spacing: -20 }'
	],
	wmode: 'transparent'
});

sIFR.replace(gothamlight, {
	selector: '#detail #content #main #pageTitle h1.subTitle',
	css: [
		'.sIFR-root { color: #ffffff; font-size: 42px; }',
		'.rsquo { letter-spacing: -10 }'
	],
	wmode: 'transparent',
	antialiasType: 'advanced',
	thickness: '-50'
});

sIFR.replace(gothamlight, {
	selector: '#index #content #main #pageTitle h1.subTitle',
	css: [
		'.sIFR-root { color: #ffffff; font-size: 18px; }',
		'.rsquo { letter-spacing: -10 }'
	],
	wmode: 'transparent',
	antialiasType: 'advanced',
	thickness: '-50'
	
});

sIFR.replace(gothamlight, {
	selector: '#main #pageTitle h4',
	css: [
		'.sIFR-root { color: #FFFFFF; font-size: 29px; }',
		'.rsquo { letter-spacing: -20 }'
	],
	wmode: 'transparent'
});

//Home page feature
sIFR.replace(gothamlight, {
	selector: '#home #content #main #feature div.full h3',
	css: [
		'.sIFR-root { color: #FFFFFF; letter-spacing: -2; }'
	],
	wmode: 'transparent'
});

