
// function is needed to create scope - do not want to muck up the global namespace
(function() {

    // code to allo wexclution of sifr 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;
      }
    }

    var sheratonGraphBook = {
        src: '/sheraton/sIFR/SheratonGraphBook.swf'
    };

    var sheratonGraphExtraLight = {
        src: '/sheraton/sIFR/SheratonGraphExtraLight.swf'
    };

    var sheratonGraphMedium = {
        src: '/sheraton/sIFR/SheratonGraphMedium.swf'
    };

    sIFR.activate(sheratonGraphBook, sheratonGraphExtraLight, sheratonGraphMedium);

    sIFR.replace(sheratonGraphExtraLight, {
        selector: '#contentArea h1:not(#CCTTitle)',
        forceSingleLine: false,
        fitExactly :false,
        offsetTop : 0,
        offsetLeft : 0,
        tuneHeight : -5,
        transparent: true,
        sharpness: 10,
        forceWidth:true,
        css: ['.sIFR-root { color: #653C33;letter-spacing: -1},a {color: #3D8A87; text-decoration: none},a:hover {color: #3D8A87; text-decoration: underline;}']
    });

    sIFR.replace(sheratonGraphExtraLight, {
        selector: 'div#primaryHeader div#standardView h2',
        forceSingleLine: false,
        fitExactly :false,
        offsetTop : 0,
        offsetLeft : 0,
        tuneHeight : -5,
        transparent: true,
        sharpness: 10,
        forceWidth:true,
        css: ['.sIFR-root { color: #653C33;}']
    });
    sIFR.replace(sheratonGraphExtraLight, {
        selector: 'h2.rateListDetailHead',
        forceSingleLine: false,
        fitExactly :false,
        offsetTop : 0,
        offsetLeft : 0,
        tuneHeight : -5,
        transparent: true,
        sharpness: 10,
        forceWidth:true,
        css: ['.sIFR-root { color: #653C33;}']
    });

    sIFR.replace(sheratonGraphExtraLight, {
        selector: 'div#genericHeader h2',
        forceSingleLine: false,
        fitExactly :false,
        offsetTop : 0,
        offsetLeft : 0,
        tuneHeight : -5,
        transparent: true,
        sharpness: 10,
        forceWidth:true,
        css: ['.sIFR-root { color: #653C33;}']
    });

sIFR.replace(sheratonGraphExtraLight, {
        selector: 'h2.bookingFlowH2AltDisplay',
        forceSingleLine: false,
        fitExactly :false,
        offsetTop : 0,
        offsetLeft : 0,
        tuneHeight : -5,
        transparent: true,
        sharpness: 10,
        forceWidth:true,
        css: ['.sIFR-root { color: #653C33;}']
    });

    sIFR.replace(sheratonGraphExtraLight, {
        selector: '#sectionHeaderTitle',
        forceSingleLine: false,
        fitExactly :false,
        offsetTop : 0,
        offsetLeft : 0,
        tuneHeight :-8,
        transparent: true,
        sharpness: 10,
        leading: -10,
        forceWidth:true,
        css: ['.sIFR-root { color: #EFEFE4;letter-spacing: -2}']
    });

        sIFR.replace(sheratonGraphMedium, {
        selector: '#topNavitems ul li.locked',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop :0,
        offsetLeft : 1,
        transparent: true,
        forceWidth:true,
        tuneWidth: 1,
        css: ['.sIFR-root { color: #458183;}, a:link{color: #458183;text-decoration: none;}, a:hover{color: #458183;}'],
        ratios: [8, 1.43, 11, 1.38, 16, 1.33, 23, 1.32, 24, 1.29, 28, 1.3, 36, 1.29, 41, 1.28, 44, 1.27, 45, 1.28, 69, 1.27, 72, 1.26, 73, 1.27, 1.26]
    });

    sIFR.replace(sheratonGraphMedium, {
        selector: '#topNavitems ul li',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop :0,
        offsetLeft : 1,
        transparent: true,
        forceWidth:true,
        tuneWidth: 1,
        css: ['.sIFR-root { color: #77392A; }, a:link{color: #77392A;text-decoration: none;}, a:hover{color: #3D8A87;}'],
        ratios: [8, 1.43, 11, 1.38, 16, 1.33, 23, 1.32, 24, 1.29, 28, 1.3, 36, 1.29, 41, 1.28, 44, 1.27, 45, 1.28, 69, 1.27, 72, 1.26, 73, 1.27, 1.26]
    });

    sIFR.replace(sheratonGraphExtraLight, {
        selector: '#searchContainer h3',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop :0,
        offsetLeft : 1,
        transparent: true,
        forceWidth:true,
        tuneWidth: 1,
        css: ['.sIFR-root { color: #EFEFE4;}']        
    });
    
    sIFR.replace(sheratonGraphMedium, {
        selector: 'div.communityArea-sifr-count',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop : 7,
        offsetLeft : 0,
        transparent: true,
        forceWidth:true,
        tuneWidth: -1,
        css: ['.sIFR-root { leading: 10; color: #653C33;}'],
        ratios: [9, 1.16, 16, 1.09, 24, 1.06, 37, 1.04, 74, 1.02, 1.01]
    });
    
    sIFR.replace(sheratonGraphMedium, {
        selector: 'div.communityArea-sifr-title',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop : 7,
        offsetLeft : 0,
        transparent: true,
        forceWidth:true,
        css: ['.sIFR-root {leading: 10; color: #653C33;}'],
        ratios: [9, 1.16, 16, 1.09, 24, 1.06, 37, 1.04, 74, 1.02, 1.01]
    });

    sIFR.replace(sheratonGraphMedium, {
        selector: 'div.communityArea-sifr-region',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop : 5,
        offsetLeft : 0,
        transparent: true,
        forceWidth:true,
        css: ['.sIFR-root {leading: 10; color: #653C33;}'],
        ratios: [9, 1.16, 16, 1.09, 24, 1.06, 37, 1.04, 74, 1.02, 1.01]
    });

 /*   sIFR.replace(sheratonGraphMedium, {
        selector: '#leftNavitems ul li a.locked',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop :0,
        offsetLeft : 1,
        transparent: true,
        forceWidth:true,
        tuneWidth: 1,
        css: ['.sIFR-root { color: #3D8A87; cursor: pointer;}']
    });

    sIFR.replace(sheratonGraphMedium, {
        selector: '#leftNavitems ul li a',
        forceSingleLine: true,
        fitExactly :true,
        offsetTop :0,
        offsetLeft : 1,
        transparent: true,
        forceWidth:true,
        tuneWidth: 1,
        css: ['.sIFR-root { color: #653C33; cursor: pointer;}']
    });*/
})();
