//added code for excluding certain text from replacement
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;
  }
}

//Variables for the fonts and swf file locations
var jrwelter = { src: '/wp-content/themes/metromont/sifr3/knockout_jrwelter2.swf', ratios: [6, 1.24, 11, 1.13, 12, 1.12, 21, 1.07, 29, 1.04, 30, 1.05, 49, 1.03, 53, 1.02, 54, 1.03, 74, 1.02, 77, 1.01, 78, 1.02, 83, 1.01, 84, 1.02, 89, 1.01, 90, 1.02, 95, 1.01, 96, 1.02, 1.01] };
var fullwelter = { src: '/wp-content/themes/metromont/sifr3/knockout_fullwelter2.swf', ratios: [6, 1.24, 11, 1.13, 12, 1.12, 21, 1.07, 29, 1.04, 30, 1.05, 49, 1.03, 53, 1.02, 54, 1.03, 74, 1.02, 77, 1.01, 78, 1.02, 83, 1.01, 84, 1.02, 89, 1.01, 90, 1.02, 95, 1.01, 96, 1.02, 1.01] };
var lightweight = { src: '/wp-content/themes/metromont/sifr3/knockout_lightweight.swf', ratios: [6, 1.24, 11, 1.13, 12, 1.12, 21, 1.07, 29, 1.04, 30, 1.05, 49, 1.03, 53, 1.02, 54, 1.03, 74, 1.02, 77, 1.01, 78, 1.02, 83, 1.01, 84, 1.02, 89, 1.01, 90, 1.02, 95, 1.01, 96, 1.02, 1.01] };

//Said to speed up loading in Opera and Safari
sIFR.useStyleCheck = true;

//Activate sifr3
sIFR.activate(jrwelter, fullwelter, lightweight);

//Element Replacements
// sIFR.debug.ratios
// , ratios: [�paste here�] << goes in var declarations above ^

sIFR.replace(fullwelter, {
  selector: '.box h2',
  css: ['.sIFR-root { font-size:31px; leading:-9; color: #FFFFFF; text-transform: uppercase; }','.sIFR-root a { color: #FFFFFF; text-decoration:none; }','.sIFR-root a:hover { color: #FFFFFF; }'],
  transparent: true
});

sIFR.replace(fullwelter, {
  selector: '.title p',
  css: ['.sIFR-root { font-size:50px; leading:-12; color: #FFFFFF; text-transform: uppercase; }','.sIFR-root a { color: #FFFFFF; text-decoration:none; }','.sIFR-root a:hover { color: #FFFFFF; }'],
  transparent: true
});

sIFR.replace(fullwelter, {
  selector: '#engineeringdetails .entry h2',
  css: ['.sIFR-root { font-size:26px; color: #59636E; text-transform: uppercase; }','.sIFR-root a { color: #59636E; text-decoration:none; }','.sIFR-root a:hover { color: #59636E; }'],
  transparent: true,
  tuneWidth: 1
});

sIFR.replace(fullwelter, {
  selector: '.entry h2',
  css: ['.sIFR-root { font-size:34px; color: #FFFFFF; text-transform: uppercase; }','.sIFR-root a { color: #FFFFFF; text-decoration:none; }','.sIFR-root a:hover { color: #FFFFFF; }'],
  transparent: true,
  tuneWidth: 1
});

sIFR.replace(fullwelter, {
  selector: '.entry h5',
  css: ['.sIFR-root { font-size:30px; color: #FFFFFF; }','.sIFR-root a { color: #FFFFFF; text-decoration:none; }','.sIFR-root a:hover { color: #FFFFFF; }'],
  transparent: true
});

sIFR.replace(fullwelter, {
  selector: '#halfbg .division h4',
  css: ['.sIFR-root { font-size:20px; color: #FFFFFF; text-transform: uppercase; }','.sIFR-root a { color: #FFFFFF; text-decoration:none; }','.sIFR-root a:hover { color: #FFFFFF; }'],
  transparent: true,
  forceSingleLine: true
});

sIFR.replace(fullwelter, {
  selector: '#page-131 h3, #contactus h2 span, .division h4',
  css: ['.sIFR-root { font-size:20px; color: #59636E; text-transform: uppercase; }','.sIFR-root a { color: #59636E; text-decoration:none; }','.sIFR-root a:hover { color: #59636E; }'],
  transparent: true,
  forceSingleLine: true
});

sIFR.replace(fullwelter, {
  selector: 'span#ancestor, span.ancestor',
  css: ['.sIFR-root { font-size:34px; color: #59636E; text-transform: uppercase; }','.sIFR-root a { color: #59636E; text-decoration:none; }','.sIFR-root a:hover { color: #59636E; }'],
  transparent: true,
  offsetLeft: 12,
  offsetTop: 19,
  tuneHeight: 19,
  tuneWidth: 20,
  forceSingleLine: true
});

sIFR.replace(fullwelter, {
  selector: 'span#parent, span.parent',
  css: ['.sIFR-root { font-size:34px; color: #E2E2E2; text-transform: uppercase; }','.sIFR-root a { color: #E2E2E2; text-decoration:none; }','.sIFR-root a:hover { color: #E2E2E2; }'],
  transparent: true,
  offsetLeft: 12,
  offsetTop: 19,
  tuneHeight: 19,
  tuneWidth: 20,
  forceSingleLine: true
});

sIFR.replace(fullwelter, {
  selector: '.entry .additional-content h3, .narrowcolplain h3',
  css: ['.sIFR-root { font-size:20px; color: #59636E; text-transform: uppercase; }','.sIFR-root a { color: #59636E; text-decoration:none; }','.sIFR-root a:hover { color: #59636E; }'],
  transparent: true,
  forceSingleLine: true,
  tuneWidth: 20
});

sIFR.replace(fullwelter, {
  selector: '#sidebar.awards h3',
  css: ['.sIFR-root { font-size:20px; color: #FFFFFF; text-transform: uppercase; }','.sIFR-root a { color: #FFFFFF; text-decoration:none; }','.sIFR-root a:hover { color: #FFFFFF; }'],
  transparent: true,
  forceSingleLine: true,
  tuneWidth: 20
});

sIFR.replace(fullwelter, {
  selector: '.entry h3',
  css: ['.sIFR-root { font-size:20px; color: #59636E; text-transform: uppercase; }','.sIFR-root a { color: #59636E; text-decoration:none; }','.sIFR-root a:hover { color: #59636E; }'],
  transparent: true,
  forceSingleLine: true,
  tuneWidth: 20
});


//added as a function for jquery hidden content
function readmoresifr() {
	sIFR.replace(fullwelter, {
	  selector: '.additional-content h3',
	  css: ['.sIFR-root { font-size:20px; color: #59636E; text-transform: uppercase; }','.sIFR-root a { color: #59636E; text-decoration:none; }','.sIFR-root a:hover { color: #59636E; }'],
	  transparent: true,
	  forceSingleLine: true,
	  tuneWidth: 20
	});
}

sIFR.replace(fullwelter, {
  selector: '.narrowcol1 h3',
  css: ['.sIFR-root { font-size:20px; color: #C0C4CA; text-transform: uppercase; }','.sIFR-root a { color: #C0C4CA; text-decoration:none; }','.sIFR-root a:hover { color: #C0C4CA; }'],
  transparent: true,
  forceSingleLine: true,
  tuneWidth: 10
});

/* setTimeout(function() { //set timer for css to load */

	sIFR.replace(jrwelter, {
	  selector: 'ul#secondarymenu li.item1',
	  css: ['.sIFR-root { font-size:20px; color: #A7ABB3; border-right: 1px solid #a7abb3; text-transform: uppercase; text-align:center; margin-bottom:0px; }','.sIFR-root a { color: #A7ABB3; text-decoration:none; }','.sIFR-root a:hover { color: #A7ABB3; }'],
	  transparent: true,
	  forceSingleLine: true,
	  offsetTop: 8,
	  tuneHeight: 10,
	  tuneWidth: 10
	});
	
	sIFR.replace(jrwelter, {
	  selector: 'ul#secondarymenu li.item2',
	  css: ['.sIFR-root { font-size:20px; color: #A7ABB3; text-transform: uppercase; text-align:center; margin-bottom:0px; }','.sIFR-root a { color: #A7ABB3; text-decoration:none; }','.sIFR-root a:hover { color: #A7ABB3; }'],
	  transparent: true,
	  forceSingleLine: true,
	  offsetTop: 8,
	  tuneHeight: 10,
	  tuneWidth: 10
	});
	
	sIFR.replace(jrwelter, {
	  selector: 'ul#secondarymenu4 li.item1',
	  css: ['.sIFR-root { font-size:20px; color: #A7ABB3; border-right: 1px solid #a7abb3; text-transform: uppercase; text-align:center; margin-left:auto; margin-right:auto; margin-bottom:0px; }','.sIFR-root a { color: #A7ABB3; text-decoration:none; }','.sIFR-root a:hover { color: #A7ABB3; }'],
	  transparent: true,
	  forceSingleLine: true,
	  offsetTop: 8,
	  tuneHeight: 10,
	  tuneWidth: 10
	});
	
	sIFR.replace(jrwelter, {
	  selector: 'ul#secondarymenu4 li.item2',
	  css: ['.sIFR-root { font-size:20px; color: #A7ABB3; border-right: 1px solid #a7abb3; text-transform: uppercase; text-align:center; margin-left:auto; margin-right:auto; margin-bottom:0px; }','.sIFR-root a { color: #A7ABB3; text-decoration:none; }','.sIFR-root a:hover { color: #A7ABB3; }'],
	  transparent: true,
	  forceSingleLine: true,
	  offsetTop: 8,
	  tuneHeight: 10,
	  tuneWidth: 10
	});
	
	sIFR.replace(jrwelter, {
	  selector: 'ul#secondarymenu4 li.item3',
	  css: ['.sIFR-root { font-size:20px; color: #A7ABB3; text-transform: uppercase; text-align:center; margin-left:auto; margin-right:auto; margin-bottom:0px; }','.sIFR-root a { color: #A7ABB3; text-decoration:none; }','.sIFR-root a:hover { color: #A7ABB3; }'],
	  transparent: true,
	  forceSingleLine: true,
	  offsetTop: 8,
	  tuneHeight: 10,
	  tuneWidth: 10
	});
	
	sIFR.replace(jrwelter, {
	  selector: 'ul#secondarymenu4 li.item4',
	  css: ['.sIFR-root { font-size:20px; color: #A7ABB3; border-right: 1px solid #a7abb3; text-transform: uppercase; text-align:center; margin-left:auto; margin-right:auto; margin-bottom:0px; }','.sIFR-root a { color: #A7ABB3; text-decoration:none; }','.sIFR-root a:hover { color: #A7ABB3; }'],
	  transparent: true,
	  forceSingleLine: true,
	  offsetTop: 8,
	  tuneHeight: 10,
	  tuneWidth: 10
	});

/* }, 1000); end timer*/

sIFR.replace(jrwelter, {
  selector: '.division2 h2',
  css: ['.sIFR-root { font-size: 18px; color: #59636E; text-align: center; }','.sIFR-root a { color: #59636E; text-decoration:none; }','.sIFR-root a:hover { color: #59636E; }'],
  transparent: true,
  forceSingleLine: true,
  offsetTop: 3,
  tuneHeight: 4
});

sIFR.replace(jrwelter, {
  selector: '.division h2, #sidebar h2, .testimonials h3',
  css: ['.sIFR-root { text-align:center; font-size: 20px; color: #A7ABB3; text-transform: uppercase; }','.sIFR-root a { color: #A7ABB3; text-decoration:none; }','.sIFR-root a:hover { color: #A7ABB3; }'],
  transparent: true,
  forceSingleLine: true,
  offsetTop: 3,
  tuneHeight: 0
});

sIFR.replace(jrwelter, {
  selector: '.project h3, .project h5, h3.susth3',
  css: ['.sIFR-root { font-size:16px; color: #ffffff; text-transform: uppercase; }','a { font-size:16px; color: #FFFFFF; text-decoration:none; }','a:hover { font-size:16px; color: #FFFFFF; text-decoration:none; }'],
  transparent: true,
  offsetTop: 3,
  tuneHeight: 0
});

/* sIFR.replace(jrwelter, {
  selector: '.project h5',
  css: '.sIFR-root { font-size:16px; color: #ffffff; text-transform: uppercase; display:block; }',
  transparent: true
});
*/

