var archerLight = {
  src: '/flash/archer_light_2.swf'
  ,ratios: [6, 0.92, 10, 0.96, 15, 1.05, 20, 1.1, 25, 1.12, 30, 1.14, 40, 1.15, 50, 1.16, 70, 1.17, 74, 1.18, 75, 1.17, 110, 1.18, 111, 1.19, 115, 1.18, 119, 1.19, 120, 1.18, 124, 1.19, 1.18]
};

// You probably want to switch this on, but read <http://wiki.novemberborn.net/sifr3/DetectingCSSLoad> first.
sIFR.useStyleCheck = true;

// Yes there is repeated code here (just for a colour change), but sIFR doesn't currently allow inheritance like in CSS

var wmodeOption = jQuery.browser.msie ? 'transparent' : null;

/*  
    README: 
    Code blocks that applies SIFR are wrapped in functions so they can be called anytime by other scripts.
    One of the reasons for this is because SIFR can't be applied to hidden elements, so these functions need to be called
    once they are made to appear, e.g.
        div.show();
        applyNavigationSIFR();
*/


function applyNavigationSIFR() {
    
    // Primary navigation
    sIFR.replace(archerLight, {
        selector: 'ul#primary li.selected'
  , css: [
    'a { color: #ffffff; text-decoration: none; text-align: center; }'
    , 'a:hover { color: #e4263f; }'
  ]
  , wmode: 'transparent'
    });

    sIFR.replace(archerLight, {
        selector: 'ul#primary li'
  , css: [
    'a { color: #ff353a; text-decoration: none; text-align: center; }'	  
    , 'a:hover { color: #ffffff; }'  ]
  , wmode: 'transparent'
    });

    // Secondary navigation
    sIFR.replace(archerLight, {
        selector: 'ul#secondary li.selected'
  , css: [
  	'.sIFR-root { background-color: #F5F5F5; }'
    , 'a { color: #FFFFFF; text-decoration: none; text-align: center; }'
    , 'a:hover { color: #f9f9f9; }'
  ]
  , wmode: 'transparent'
    });

    sIFR.replace(archerLight, {
        selector: 'ul#secondary li'
  , css: [
  	'.sIFR-root { background-color: #F5F5F5; }'
    , 'a { color: #e4e4e4; text-decoration: none; text-align: center; }'
	  , 'a:hover { color: #333333; }'
  ]
  , wmode: 'transparent'
    });

    // Mini search heading
    sIFR.replace(archerLight, {
        selector: '#content fieldset#mini_search h2'
  , css: [
    '.sIFR-root { color: #333333; text-align: center; }'
  ]
  , wmode: 'transparent'
    });

    // Function bar label
    sIFR.replace(archerLight, {
        selector: '#function_bar fieldset.restaurant_search label.main'
  , css: [
    '.sIFR-root { color: #888888; text-align: center; }'
  ]
  , wmode: 'transparent'
    });

    // Video banner heading
    sIFR.replace(archerLight, {
        selector: '#banner_videos h2'
  , css: [
    '.sIFR-root { color: #a90f6a; }'
  ]
  , wmode: 'transparent'
    });

   // Large banners
    sIFR.replace(archerLight, {
        selector: '#banner .alt_8 h2, #banner .alt_9 h2'
  , css: [
    '.sIFR-root { text-align: right; color: #666666;}'
  ]
  , wmode: 'transparent'
    });
    
    // Large banners
    sIFR.replace(archerLight, {
        selector: '#banner h2'
  , css: [
    '.sIFR-root { text-align: right; color: #FFFFFF;}'
  ]
  , wmode: 'transparent'
    });
    
     sIFR.replace(archerLight, {
        selector: '#banner .alt_11 p'
  , css: [
    'a { text-align: center; color: #b7790d; }'
	  , 'a:hover { color: #b7790d; text-decoration: none; }'
  ]
  , wmode: 'transparent'
    });
    
     sIFR.replace(archerLight, {
        selector: '#banner .alt_8 p, #banner .alt_9 p'
  , css: [
    'a { text-align: right; color: #666666; }'
	  , 'a:hover { color: #666666; text-decoration: none; }'
  ]
  , wmode: 'transparent'
    });

    sIFR.replace(archerLight, {
        selector: '#banner p'
  , css: [
    'a { text-align: right; color: #ffffff; }'
	  , 'a:hover { color: #ffffff; text-decoration: none; }'
  ]
  , wmode: 'transparent'
    });
}
applyNavigationSIFR();

// General headings
function applyGeneralHeadings() {

    // Expandable menu banner headings
    sIFR.replace(archerLight, {
        selector: '#content div.column div.banner h3'
          , css: [
            '.sIFR-root { color: #ffffff; }'
          ]
          , wmode: 'transparent'
    });

    // Talk to us side column heading
    sIFR.replace(archerLight, {
        selector: 'body.service #content #side h2.talk'
          , css: [
            '.sIFR-root { color: #0055a4; }'
          ]
          , wmode: 'opaque'
    });

    // Menu price heading
    sIFR.replace(archerLight, {
        selector: '#content div.menu_price h2'
          , css: [
            '.sIFR-root { text-align: center; color: #a90f6a; }'
          ]
          , wmode: 'opaque'
    });
    	
	sIFR.replace(archerLight, {
	    selector: '#content #side_nav h2, #content div.tips_box h3'
	  ,css: [
	    '.sIFR-root { color: #777; }'
	  ]
	  , wmode: 'transparent'
	});
	
	sIFR.replace(archerLight, {
	    selector: 'body.leggera #content h2, body.nutrition #content h2'
	  ,css: [
	    '.sIFR-root { color: #18b9c7; }'
	  ]
	  , wmode: 'transparent'
	});

	sIFR.replace(archerLight, {
	    selector: '#content div.column div.menu-frame-1 h2'
	  ,css: [
	    '.sIFR-root { text-align: center; color: #a90f6a; }'
	  ]
	  , wmode: 'transparent'
	});

  
   sIFR.replace(archerLight, {
        selector: 'body.bafta #content #bafta-3 h2#orange'
      , css: [
        '.sIFR-root { color: #ff7c00; font-size: 29px;}'
      ]
      , wmode: 'transparent'
    });
    
    sIFR.replace(archerLight, {
        selector: 'body.bafta #content #bafta-3 h2'
      , css: [
        '.sIFR-root {color: #a90f6a; font-size: 29px;}'
      ]
      , wmode: 'transparent'
    });
    
     sIFR.replace(archerLight, {
      selector: 'body.bafta div.signup_panel h3, body.bafta div.signup_panel h4' 
    , css: [ 
    '.sIFR-root { color: #666666; }' 
  ]
  , wmode: 'transparent'
    });
    
     sIFR.replace(archerLight, {
      selector: '#content .menu-frame-2 .wrapper h2' 
    , css: [ 
    '.sIFR-root { color: #ffffff; }' 
  ]
  , wmode: 'transparent'
    });
    
    sIFR.replace(archerLight, {
      selector: 'body.francesco #content #francesco-text-2 h2' 
    , css: [ 
    '.sIFR-root { color: #000000; }' 
  ]
  , wmode: 'transparent'
    });
    
    sIFR.replace(archerLight, {
      selector: 'body.francesco #content h2' 
    , css: [ 
    '.sIFR-root { color: #ff353a; }' 
  ]
  , wmode: 'transparent'
    });
    
     sIFR.replace(archerLight, {
      selector: 'body.francesco #content h3' 
    , css: [ 
    '.sIFR-root { color: #ff353a; font-size: 24px; text-decoration: none}' 
  ]
  , wmode: 'transparent'
    });
    
  sIFR.replace(archerLight, {
      selector: '#content .menu-frame-2 .wrapper h3' 
    , css: [
    '.sIFR-root { color: #ff353a; font-size: 24px; text-decoration: none}' 
    , 'a { color: #ff353a; text-decoration: none; }'
    , 'a:hover { color: #ff353a;}'
  ]
  , wmode: 'transparent'
    });
    
    sIFR.replace(archerLight, {
      selector: '#content h2, #content ol.search_results h3, div.signup_panel h3' 
    , css: [ 
    '.sIFR-root { color: #a90f6a; }' 
  ]
  , wmode: 'transparent'
    });
}
applyGeneralHeadings();

function applyContentSIFR() {
    
    // Menu group pseudo titles
    sIFR.replace(archerLight, {
        selector: '#content #francesco-1 p.intro'
      , css: [
        '.sIFR-root { color: #ff353a; font-size: 24px;}'
      ]
      , wmode: 'transparent'
    });
    
    // Menu group pseudo titles
    sIFR.replace(archerLight, {
        selector: '#content p.group'
      , css: [
        '.sIFR-root { color: #545454; }'
      ]
      , wmode: 'transparent'
    });

    // Menu headings
    sIFR.replace(archerLight, {
        selector: 'body.leggera #content div.column h3'
      , css: [
        '.sIFR-root { color: #18b9c7; }'
      ]
      , wmode: 'opaque'
    });

    sIFR.replace(archerLight, {
        selector: '#content div.column li.new h3'
      , css: [
        '.sIFR-root { background-color: #eeeeee; color: #a90f6a; }'
      ]
      , wmode: 'opaque'
    });

    sIFR.replace(archerLight, {
        selector: '#content div.column h3'
      , css: [
        '.sIFR-root { color: #a90f6a; }'
      ]
      , wmode: 'opaque'
    });
    
    sIFR.replace(archerLight, {
        selector: '#content div.banner_cms.txt_black h3'
      , css: [
        '.sIFR-root { color: #000000; font-size: 24px;}'
      ]
      , wmode: 'transparent'
    });
    
    
    sIFR.replace(archerLight, {
        selector: '#content div.banner_cms.txt_white h3'
      , css: [
        '.sIFR-root { color: #ffffff; font-size: 24px;}'
      ]
      , wmode: 'transparent'
    });
    
    

    // Intro text
    sIFR.replace(archerLight, {
        selector: '#content p.intro_alt, #content div.quick_details p.intro'
      , css: [
        '.sIFR-root { color: #545454; }'
      ]
      , wmode: 'transparent'
    });
    
    //bafta styles
    sIFR.replace(archerLight, {
        selector: '#content #bafta-2 h4'
      , css: [
        '.sIFR-root { color: #ff7c00; font-size: 16px;}'
      ]
      , wmode: 'transparent'
    });
    


    // Footer links
    sIFR.replace(archerLight, {
        selector: '#footer ul.columns h2'
      , css: [
  	    '.sIFR-root { background-color: #F5F5F5; color: #777777; }'
      ]
      , wmode: 'opaque'
    });

    sIFR.activate(archerLight);
}
applyContentSIFR();