/*****************************************************************************
It is adviced to place the sIFR JavaScript calls in this file, keeping it
separate from the `sifr.js` file. That way, you can easily swap the `sifr.js`
file for a new version, while keeping the configuration.

You must load this file *after* loading `sifr.js`.

That said, you're of course free to merge the JavaScript files. Just make sure
the copyright statement in `sifr.js` is kept intact.
*****************************************************************************/

// Make an object pointing to the location of the Flash movie on your web server.
// Try using the font name as the variable name, makes it easy to remember which
// object you're using. As an example in this file, we'll use Futura.

var bello = { src: '/resources/ui/flash/Bello.swf' };
var belloScript = { src: '/resources/ui/flash/BelloScript.swf' };
var trixie = { src: '/resources/ui/flash/Trixie.swf' };
var clarendon = { src: '/resources/ui/flash/Clarendon.swf' };


// Now you can set some configuration settings.
// See also <http://wiki.novemberborn.net/sifr3/JavaScript+Configuration>.
// One setting you probably want to use is `sIFR.useStyleCheck`. Before you do that,
// read <http://wiki.novemberborn.net/sifr3/DetectingCSSLoad>.

// sIFR.useStyleCheck = true;

// Next, activate sIFR:

sIFR.activate(bello, belloScript, trixie);



var makeLinksWorkPlease = function(e) {
	var node =  document.getElementById(e.id+"_alternate");
	while (node.tagName != "BODY") {
		if (node.href) {
			window.location.href = node.href;
		}
		node = node.parentNode;
	}
}

// If you want, you can use multiple movies, like so:
//
//    var futura = { src: '/path/to/futura.swf' };
//    var garamond = { src '/path/to/garamond.swf' };
//    var rockwell = { src: '/path/to/rockwell.swf' };
//    
//    sIFR.activate(futura, garamond, rockwell);
//
// Remember, there must be *only one* `sIFR.activate()`!

// Now we can do the replacements. You can do as many as you like, but just
// as an example, we'll replace all `<h1>` elements with the Futura movie.
// 
// The first argument to `sIFR.replace` is the `futura` object we created earlier.
// The second argument is another object, on which you can specify a number of
// parameters or "keyword arguemnts". For the full list, see "Keyword arguments"
// under `replace(kwargs, mergeKwargs)` at 
// <http://wiki.novemberborn.net/sifr3/JavaScript+Methods>.
// 
// The first argument you see here is `selector`, which is a normal CSS selector.
// That means you can also do things like '#content h1' or 'h1.title'.
//
// The second argument determines what the Flash text looks like. The main text
// is styled via the `.sIFR-root` class. Here we've specified `background-color`
// of the entire Flash movie to be a light grey, and the `color` of the text to
// be red. Read more about styling at <http://wiki.novemberborn.net/sifr3/Styling>.

sIFR.replace(bello, {
   selector: 'h2.bello'
  ,wmode: 'transparent'
  ,css: '.sIFR-root { leading: -10; color: #30373c; font-size: 30px; }'
      
});


sIFR.replace(bello, {
   selector: '.wideModuleStartPage h3'
  ,wmode: 'transparent'
  ,tuneHeight: '-2'
  ,css: '.sIFR-root { color: #30373c; font-size: 18px;}'

});

sIFR.replace(belloScript, {
   selector: '.wideModuleStartPage h4'
  ,wmode: 'transparent'
  ,css: '.sIFR-root { font-size: 40px;}'
});

sIFR.replace(belloScript, {
   selector: 'h3.belloscriptLarge, .matsmartModuleStartPageLeft h3, .matsmartModuleStartPageRight h3'
  ,wmode: 'transparent'
  ,css: [
        '.sIFR-root {text-align: center; leading: -5; font-size: 30px; letter-spacing: -1; }'
        ]
});

sIFR.replace(belloScript, {
   selector: 'h3.belloscript'
  ,wmode: 'transparent'
  ,css: '.sIFR-root { font-size: 24px;}'
});

/* Added by MH 2009-08-27 for Cookalong */
sIFR.replace(belloScript, {
   selector: 'h3.belloscriptWhite'
  ,wmode: 'transparent'
  ,css: '.sIFR-root { font-size: 26px; color: #ffffff; line-height: 28px; leading:-5;}'
});


sIFR.replace(trixie, {
   selector: '.wideModuleStartPage span '
  ,wmode: 'transparent'
  ,fitExactly : true
  ,css: [
        '.sIFR-root { background-color: transparent; font-size: 15px; }'
        ,'a { text-decoration: none;}'
        ,'a:link { color: #30373c; }'
        ,'a:hover { color:#0170c7; }'
        ]
	,onRelease: makeLinksWorkPlease
});

sIFR.replace(trixie, {
    selector: '#mainContent div#searchBox div#searchButton'
  , wmode: 'transparent'
  , tuneHeight: '-2'
  , forceSingleLine: true
  , css: [
        '.sIFR-root{font-size:16px;}'
        , 'a{color:#000; text-decoration:none;}'
        , 'a:hover{color:#CCCCCC}'
        ]
  ,onRelease: makeLinksWorkPlease
});

sIFR.replace(trixie, {
    selector: '.matsmartModuleStartPageRight a, .matsmartModuleStartPageLeft a, .matSmartTvModuleLeft a, .matSmartTvModuleRight a'
  , wmode: 'transparent'
  , tuneHeight: '-2'
  , css: '.sIFR-root { color: #30373c; cursor: pointer;  font-size: 14px;}'
  ,onRelease: makeLinksWorkPlease
});




sIFR.replace(trixie, {
selector: '#searchButtonHeader'
  , wmode: 'transparent'
  , tuneHeight: '-4'
  , css: [ 
            '.sIFR-root { color: #30373c; font-size: 15px;}'     
            , 'a{color:#000; text-decoration:none;}'
            , 'a:hover{color:#CCCCCC}'
         ]
  ,onRelease: makeLinksWorkPlease
});

sIFR.replace(trixie, {
    selector: '#loginBox a'
  , wmode: 'transparent'
  , tuneHeight: '-2'
  , css: '.sIFR-root { color: #30373c; font-size: 14px;}'
  ,onRelease: makeLinksWorkPlease
});

sIFR.replace(trixie, {
    selector: '#loginBox .title'
  , wmode: 'transparent'
  , tuneHeight: '-2'
  , css: '.sIFR-root { color: #fff; font-size: 14px;}'
  ,onRelease: makeLinksWorkPlease
});

sIFR.replace(trixie, {
    selector: '#cookalongArea p, #cookalongEpisodeArea .episodeRecipeBrowser p'
  , wmode: 'transparent'
  , tuneHeight: '-2'
  , css: '.sIFR-root { color: #000000; font-size: 14px;}'
  ,onRelease: makeLinksWorkPlease
});

sIFR.replace(bello, {
   selector: '#controlsAreaStartpage h3'
  ,wmode: 'transparent'

  ,tuneHeight: '-2'
  ,css: '.sIFR-root { color: #30373c; font-size: 26px;}'
});

sIFR.replace(bello, {
   selector: '#selectStoreSubPage h3'
  ,wmode: 'transparent'
  ,tuneHeight: '2'
  ,css: '.sIFR-root { color: #30373c; text-align: center; font-size: 26px;}'
});

sIFR.replace(bello, {
   selector: 'h3.belloSmall, h4.belloSmall'
  ,wmode: 'transparent'
  ,tuneHeight: '-2'
  ,css: '.sIFR-root { color: #30373c; font-size: 20px;}'

});

sIFR.replace(bello, {
    selector: 'h3.belloMediumCenter, h4.belloMediumCenter'
  , wmode: 'transparent'
  , tuneHeight: '-2'
  , css: '.sIFR-root { color: #30373c; text-align: center; font-size: 26px;}'
});

sIFR.replace(bello, {
   selector: 'h5#navigationHeader span'
  ,wmode: 'transparent'
  ,tuneHeight: '-2'
  ,css: '.sIFR-root { color: #30373c; font-size: 16px;}'
});


sIFR.replace(bello, {
   selector: '#managerInform h4'
  ,wmode: 'transparent'
  ,tuneHeight: '-2'
  ,css: '.sIFR-root { color: #006fb7; font-size: 16px;}'
});

sIFR.replace(bello, {
   selector: 'ul#matSmartNavigation li a span'
  ,wmode: 'transparent'
  ,tuneHeight: '-6'
  ,fitExactly : true
  ,css: '.sIFR-root { color: #ffffff; cursor: pointer; font-size: 18px;}'
  ,onRelease: makeLinksWorkPlease
  
});

sIFR.replace(trixie, {
   selector: '#mainNav ul li.topNavigationItem, #mainNav ul li.topNavigationItem a'
  ,tuneHeight: '-3'
  ,fitExactly : true
  ,wmode: 'transparent'
  ,css: [
        '.sIFR-root { background-color: transparent; text-align: center; font-size: 16px; color:#000000;}'
        ,'a { text-decoration: none; color:#000000;}'
        , 'a:hover { color:#0170c7; }'
        ]

});

sIFR.replace(clarendon, {
    selector: 'h2.clarendon'
  , wmode: 'transparent'
  , fitExactly: true
  , css: '.sIFR-root { leading: 0; color: #e2007a; font-size: 24px; }'

});

sIFR.replace(clarendon, {
    selector: '#layoutHolder .tinaModuleStartPageLeft h3, #layoutHolder .tinaModuleStartPageRight h3'
  , wmode: 'transparent'
  ,css: [
        '.sIFR-root {text-align: center; leading: 0; color: #e2007a; font-size: 24px; }'
        ]
});

sIFR.replace(clarendon, {
    selector: 'h3.clarendonSmall, h4.clarendonSmall'
  , wmode: 'transparent'
  , tuneHeight: '-2'
  , css: '.sIFR-root { color: #e2007a; font-size: 18px;}'
});
  
 
   sIFR.replace(bello, {
   selector: 'ul#matSmartStartPuffar li span.title, .matSmartStartPuffarTitel'
  ,wmode: 'transparent'
  ,tuneHeight: '-2'
  ,css: '.sIFR-root { cursor: pointer; leading: -10px; color: #000000; font-size: 18px;}'
  ,onRelease: makeLinksWorkPlease

});
  
  