// JavaScript Document

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;

// Primary navigation

sIFR.replace(archerLight, {
  selector: 'ul#primary li.selected'
  ,css: [
    'a { color: #0055a4; text-decoration: none; text-align: center; }'
    ,'a:hover { color: #0055a4; }'
  ]
  , wmode: 'transparent'
});

sIFR.replace(archerLight, {
  selector: 'ul#primary li'
  ,css: [
    'a { color: #3d3d3d; text-decoration: none; text-align: center; }'
	  ,'a:hover { color: #0055a4; }'
  ]
  , wmode: 'transparent'
});

// Secondary navigation

sIFR.replace(archerLight, {
  selector: 'ul#secondary li.selected'
  ,css: [
  	'.sIFR-root { background-color: #F5F5F5; }'
    ,'a { color: #0055a4; text-decoration: none; text-align: center; }'
    ,'a:hover { color: #0055a4; }'
  ]
  , wmode: 'transparent'
});

sIFR.replace(archerLight, {
  selector: 'ul#secondary li'
  ,css: [
  	'.sIFR-root { background-color: #F5F5F5; }'
    ,'a { color: #3d3d3d; text-decoration: none; text-align: center; }'
	  ,'a:hover { color: #0055a4; }'
  ]
  , 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 h2'
  , css: [
    '.sIFR-root { text-align: right; color: #ffffff; }'
  ]
  , wmode: 'transparent'
});

sIFR.replace(archerLight, {
    selector: '#banner p'
  , css: [
    'a { text-align: right; color: #ffffff; }'
	  ,'a:hover { color: #ffffff; text-decoration: none; }'
  ]
  , wmode: 'transparent'
});

// 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'
});

// General headings

function applyGeneralHeadings() {
// This function is used to force some hidden sifr headings to be visible after a javascript has been triggered, eg: On the House signup panel, Nutrition Top tips
	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 h2, #content ol.search_results h3, div.signup_panel h3' 
    , css: [ 
    '.sIFR-root { color: #a90f6a; }' 
  ]
  , wmode: 'transparent'
    });
}
applyGeneralHeadings(); 

// 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 h3'
  ,css: [
    '.sIFR-root { color: #a90f6a; }'
  ]
  , wmode: 'opaque'
});

// Intro text

sIFR.replace(archerLight, {
    selector: '#content p.intro_alt, #content div.quick_details p.intro'     
  ,css: [
    '.sIFR-root { color: #545454; }'
  ]
  , wmode: 'transparent'
});

// Footer links

sIFR.replace(archerLight, {
  selector: '#footer ul.columns h2'
  ,css: [
  	'.sIFR-root { background-color: #F5F5F5; color: #777777; }'
  ]
  , wmode: 'transparent'
});

sIFR.activate(archerLight);
