/*****************************************************************************
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 futura = { src: '/path/to/futura.swf' };
var HTTP_HOST = document.location.href.split('/')[2];
var futura = { src: 'http://'+HTTP_HOST+'/swf/FuturaMojo.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(futura);

// 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>.
// .cblock h3,h2,h1 is inside anchor; href needs to be in sIFR-ed tag aswell

sIFR.replace(futura, {selector: '.cblock h3'
	,wmode		: 'transparent' /* transparent or opaque or *comment* for default */
//	,fixHover	: true
	,selectable	: false
	,css: ['.sIFR-root { color: #B3B3B3; text-transform: uppercase; font-size: 15px}'
	       ,'a { text-decoration: none; }'
	       ,'a:link { color: #B3B3B3; }'
	       ,'a:active { color: #C1272D; }'
	       ,'a:hover { color: #C1272D; }'
	       ]
});
sIFR.replace(futura, {selector: '.event.aanvragen div, .event.download div'
	,wmode		: 'transparent' /* transparent or opaque or *comment* for default */
//	,fixHover	: true
	,selectable	: false
	,offsetTop	: 3
	,css: ['.sIFR-root { color: #B3B3B3; text-transform: uppercase; font-size: 13px; }'
	       ,'a { text-decoration: none; }'
	       ,'a:link { color: #B3B3B3; }'
	       ,'a:active { color: #c1272d; }'
	       ,'a:hover { color: #c1272d; }'
	       ]
});
/**
 * add daggerDbl character: is arrow-right in futuraMojo.swf
 * rather nastily hacked because we can't use jQuery -yet- with sIFR3 onload-handler
 * @param contentNode
 * @param selector
 * @return
 */
var pre_sIFR_subnav = function(contentHtml, selector){
	var rep = /">(\w)+/; // find innerHTML
	var iHtml1stWord = rep.exec(contentHtml)[0].substring(2);
	return (contentHtml.replace(rep,'">‡ '+iHtml1stWord));
}
sIFR.replace(futura, {selector: '#sub-nav li.active'
//	,wmode		: 'opaque' /* transparent or opaque or *comment* for default */
//	,fixHover	: true
	,modifyContentString: pre_sIFR_subnav
	,selectable	: false
	,offsetTop	: 9
	,tuneHeight	: 9
	,css: ['.sIFR-root { background-color: #333333; color: #FFFFFF; text-transform: uppercase; font-size: 13px; text-indent: 5; }'
	       ,'.sIFR-root a { text-decoration: none; }'
	       ,'.sIFR-root a:link { color: #FFFFFF; }'
	       ,'.sIFR-root a:active { color: #FFFFFF; }'
	       ,'.sIFR-root a:hover { color: #FFFFFF; }'
	       ]
});
sIFR.replace(futura, {selector: '#sub-nav li'
//	,wmode		: 'opaque' /* transparent or opaque or *comment* for default */
//	,fixHover	: true
	,modifyContentString: pre_sIFR_subnav
	,selectable	: false
	,offsetTop	: 9
	,tuneHeight	: 9
	,css: ['.sIFR-root { background-color: #1A1A1A; color: #B3B3B3; text-transform: uppercase; font-size: 13px; text-indent: 5; }'
	       ,'.sIFR-root a { text-decoration: none; }'
	       ,'.sIFR-root a:link { color: #B3B3B3; }'
	       ,'.sIFR-root a:active { color: #FFFFFF; }'
	       ,'.sIFR-root a:hover { color: #FFFFFF; }'
	       ]
});
sIFR.replace(futura, {selector		: '#main-nav.menu li.active'
//	,wmode			: 'transparent'
	,forceSingleLine	: true
//	,fixHover		: true
	,selectable		: false
	,css: ['.sIFR-root { background-color: #000000; color: #C1272D; text-transform: uppercase; font-size: 17px; }'
	       ,'a { text-decoration: none; }'
	       ,'a:link { color: #C1272D; }'
	       ,'a.active { color: #C1272D; }'
	       ,'a:active { color: #C1272D; }'
	       ,'a:hover { color: #C1272D; }'
	       ]
});
sIFR.replace(futura, {selector		: '#main-nav.menu li'
//	,wmode			: 'transparent'
	,forceSingleLine	: true
//	,fixHover		: true
	,selectable		: false
	,css: ['.sIFR-root { background-color: #000000; color: #B3B3B3; text-transform: uppercase; font-size: 17px; }'
	       ,'a { text-decoration: none; }'
	       ,'a:link { color: #B3B3B3; }'
	       ,'a.active { color: #C1272D; }'
	       ,'a:active { color: #C1272D; }'
	       ,'a:hover { color: #C1272D; }'
	       ]
});
sIFR.replace(futura, {selector: 'h1'
	,wmode: 'transparent' /* transparent or opaque or *comment* for default */
	,fixHover		: true
	,selectable		: false
	,css: ['.sIFR-root { color: #808080; text-transform: uppercase; font-size: 30px}'
	       ,'a { text-decoration: none; }'
	       ,'a:link { color: #808080; }'
	       ,'a:active { color: #FFFFFF; }'
	       ,'a:hover { color: #FFFFFF; }'
	       ]
});
sIFR.replace(futura, {selector: '.third-pane h2, .half-pane h2, form h2'
	,wmode: 'transparent' /* transparent or opaque or *comment* for default */
	,css: ['.sIFR-root { color: #FFFFFF; text-transform: uppercase; font-size: 20px}'
	       ,'a { text-decoration: none; }'
	       ,'a:link { color: #FFFFFF; }'
	       ,'a:active { color: #C1272D; }'
	       ,'a:hover { color: #C1272D; }'
	       ]
});
sIFR.replace(futura, {selector: 'h2'
	,wmode: 'transparent' /* transparent or opaque or *comment* for default */
		,css: ['.sIFR-root { color: #808080; text-transform: uppercase; font-size: 20px}'
		       ,'a { text-decoration: none; }'
		       ,'a:link { color: #808080; }'
		       ,'a:active { color: #FFFFFF; }'
		       ,'a:hover { color: #FFFFFF; }'
		       ]
});
sIFR.replace(futura, {selector: 'h3.futura'
	,wmode		: 'transparent' /* transparent or opaque or *comment* for default */
	,fixHover	: true
	,selectable	: false
	,css: ['.sIFR-root { color: #B3B3B3; text-transform: uppercase; font-size: 15px}'
	       ,'a { text-decoration: none; }'
	       ,'a:link { color: #B3B3B3; }'
	       ,'a:active { color: #C1272D; }'
	       ,'a:hover { color: #C1272D; }'
	       ]
});
