/*****************************************************************************
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 optima = { src: '/deployedfiles/Organisation OradeaVie/Styles/swf/optima.swf' };
var cochin = { src: '/deployedfiles/Organisation OradeaVie/Styles/swf/cochin.swf' };
var times = { src: '/deployedfiles/Organisation OradeaVie/Styles/swf/times.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(optima);
sIFR.activate(cochin);
sIFR.activate(times);
// 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(optima, {
  selector: '.siabmainmenu ul li',
  wmode:'transparent',
  offsetTop:11,
  tuneHeight :19,
  forceSingleLine:true,
  tuneWidth:1,
  css:['.sIFR-root { }',
	   '.sIFR-root a { display:block; color:#FFFFFF; background-color:transparent; text-decoration:none; font-size:15px; font-weight:bold; width:auto; padding-left:10px; }',
	   '.sIFR-root a:hover { color:#FFFFFF; }']
});
*/

/****************************************************/


/*
sIFR.replace(optima, {
  selector: '.siabmenu ul.authpro li.item2',
  wmode:'transparent',
  forceSingleLine:true,
  offsetLeft:16,
  tuneWidth:16,
  css:['.sIFR-root { }',
	   '.sIFR-root a { color:#FFFFFF; background-color:transparent; text-decoration:none; font-size:14px; font-weight:bold; width:auto; }',
	   '.sIFR-root a:hover { color:#FFFFFF; }']

});
*/

/*******************************************/

sIFR.replace(optima, {
  selector: '.siabmenu ul.authpart li.item1',
  wmode:'transparent',
  forceSingleLine:true,  
  tuneWidth:15,
  css:['.sIFR-root { color:#B9B9B1; background-color:transparent; text-decoration:none; font-size:14px;font-weight:bold;  width:auto; }']
});


sIFR.replace(optima, {
  selector: '.siabmenu ul.authpro li.item2',
  wmode:'transparent',
  forceSingleLine:true,  
  tuneWidth:15,
  css:['.sIFR-root { color:#B9B9B1; background-color:transparent; text-decoration:none; font-size:14px;font-weight:bold;  width:auto; }']
});


sIFR.replace(optima, {
  selector: '.siabmenu ul.authpart li.item1',
  wmode:'transparent',
  forceSingleLine:true,  
  tuneWidth:15,
  css:['.sIFR-root { }',
	   '.sIFR-root a { color:#B9B9B1; background-color:transparent; text-decoration:none; font-size:14px;font-weight:bold;  width:auto; }',
	   '.sIFR-root a:hover { color:#B9B9B1; }']
});


sIFR.replace(optima, {
  selector: '.siabmenu ul.authpart li.item2',
  wmode:'transparent',
  forceSingleLine:true,
  tuneWidth:15,
  css:['.sIFR-root {color:#FFFFFF; font-weight:bold }',
	   '.sIFR-root a { color:#FFFFFF; background-color:transparent; text-decoration:none; font-size:14px;font-weight:bold;  width:auto; }',
	   '.sIFR-root a:hover { color:#FFFFFF; }']
});

sIFR.replace(optima, {
  selector: '.siabmenu ul.noauthpart li.item1',
  wmode:'transparent',
  forceSingleLine:true,
  css:['.sIFR-root { }',
	   '.sIFR-root a { color:#000000; background-color:transparent; text-decoration:none; font-size:14px; font-weight:bold; width:auto; }',
	   '.sIFR-root a:hover { color:#000000; }']
});

sIFR.replace(optima, {
  selector: '.siabmenu ul.noauthpart li.item2',
  wmode:'transparent',
  forceSingleLine:true,
  offsetLeft:5,  
  tuneWidth:5,  
  css:['.sIFR-root { }',
	   '.sIFR-root a { color:#FFFFFF; background-color:transparent; text-decoration:none; font-size:14px; font-weight:bold; width:auto; }',
	   '.sIFR-root a:hover { color:#FFFFFF; }']
});

sIFR.replace(optima, {
  selector: '.siabmenu ul.noauthpro li.item1',
  wmode:'transparent',
  forceSingleLine:true,
  css:['.sIFR-root { }',
	   '.sIFR-root a { color:#FFFFFF; background-color:transparent; text-decoration:none; font-size:14px; font-weight:bold; width:auto; }',
	   '.sIFR-root a:hover { color:#FFFFFF; }']
});

sIFR.replace(optima, {
  selector: '.siabmenu ul.noauthpro li.item2',
  wmode:'transparent',
  forceSingleLine:true,
  css:['.sIFR-root { color:#000000; font-weight:bold}',
	   '.sIFR-root a { color:#000000; background-color:transparent; text-decoration:none; font-size:14px; font-weight:bold; width:auto; }',
	   '.sIFR-root a:hover { color:#000000; }']
});



sIFR.replace(optima, {
  selector: '.siabmenu ul.authpro li.item1',
  wmode:'transparent',
  forceSingleLine:true,
  css:['.sIFR-root { color:#FFFFFF; font-size:14px; font-weight:bold; }',
	   '.sIFR-root a { color:#FFFFFF; background-color:transparent; text-decoration:none; font-size:14px; font-weight:bold; width:auto; }',
	   '.sIFR-root a:hover { color:#FFFFFF; }']
});

sIFR.replace(optima, {
  selector: '.siabmenu ul.authpro li.item2',
  wmode:'transparent',
  forceSingleLine:true,  
  css:['.sIFR-root { color:#B9B9B1; font-weight:bold}',
	   '.sIFR-root a { color:#B9B9B1; background-color:transparent; text-decoration:none; font-size:14px;font-weight:bold;  width:auto; }',
	   '.sIFR-root a:hover { color:#B9B9B1; }']
});

sIFR.replace(optima, {
  selector: '.siabcallouttop h1',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#236C9F; font-size:30px}',
	   '.sIFR-root h1{color:#236C9F; font-size:30px}']
});

sIFR.replace(optima, {
  selector: '.tableau_bord .siabcallouttop h1',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#236C9F; font-size:30px}',
	   '.sIFR-root h1{color:#236C9F; font-size:30px}']
});

sIFR.replace(optima, {
  selector: '.siabpannelhome .callout_outil .callout_outil_title a',
  wmode:'transparent',
  forceWidth : true,
  forceSingleLine:true,
  css:['.sIFR-root {color:#FFFFFF; font-size:20px; font-weight:bold; }']
});

sIFR.replace(optima, {
  selector: '.siabpannelhome .callout_outil h3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#EF8209; font-size:16px; font-weight-bold }']
});

sIFR.replace(optima, {
  selector: '.white_type1 h3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#236C9F; font-size:20px; font-weight-bold }']
});

sIFR.replace(optima, {
  selector: '.white_type4 h3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#236C9F; font-size:20px; font-weight-bold }']
});

sIFR.replace(optima, {
  selector: '.white_type8 h3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#236C9F; font-size:20px; font-weight-bold }']
});

sIFR.replace(optima, {
  selector: '.white_type9 h3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#236C9F; font-size:20px; font-weight-bold }']
});

sIFR.replace(optima, {
  selector: '.white_type4 h3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#236C9F; font-size:20px; font-weight-bold }']
});

sIFR.replace(optima, {
  selector: '.push_text h3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#FFFFFF; font-size:20px; font-weight-bold }']
});


sIFR.replace(optima, {
  selector: '.bloc-categorie-title span',
  wmode:'transparent',
  preventWrap:true,   
  tuneWidth:233,
  css:['.sIFR-root {color:#FFFFFF; font-size:18px; font-weight:bold; width:233px; }',
	   '.sIFR-root span {color:#FFFFFF; font-size:18px; width:233px; visibility: hidden;  }'],
  onReplacement: function(fi) {
	    
		var hauteur = 0;
		var i  = 0;
		
		/*calcul de la hauteur maximale*/
		J('.bloc-categorie-title span object').each(function(){
			h=J(this).height();	
			if(h>hauteur){hauteur=h;};
		});
		
		/*attribution de hauteur a chaque div*/
		J('.bloc-categorie-title').each(function(){
			  J(this).height(hauteur);
		});		
  }
});

sIFR.replace(optima, {
  selector: '.bloc-dossier-title span',
  wmode:'transparent',
  forceSingleLine:true,
  css:['.sIFR-root {color:#8A8778; font-size:18px; font-weight:bold}',
	   '.sIFR-root h1{color:#8A8778; font-size:18px}']
});

sIFR.replace(optima, {
  selector: '.bloc-thematique-title span',
  wmode:'transparent',
  preventWrap:true,   
  tuneWidth:233,
  css:['.sIFR-root {color:#FFFFFF; font-size:18px; font-weight:bold}',
	   '.sIFR-root h1{color:#FFFFFF; font-size:18px}'],
  onReplacement: function(fi) {
	    
		var hauteur = 0;
		var i  = 0;
		
		/*calcul de la hauteur maximale*/
		J('.bloc-thematique-title span object').each(function(){
			h=J(this).height();	
			if(h>hauteur){hauteur=h;};
		});
		
		/*attribution de hauteur a chaque div*/
		J('.bloc-thematique-title').each(function(){
			  J(this).height(hauteur);
		});		
  }
});

sIFR.replace(optima, {
  selector: '.siabsecnav-title ',
  wmode:'transparent',
  forceSingleLine:true,
  css:['.sIFR-root {color:#FFFFFF; font-size:13px;}',
	   '.sIFR-root h1{color:#FFFFFF; font-size:13px}']
});

sIFR.replace(optima, {
  selector: '.blocs-produit-container-title .title-content',
  wmode:'transparent',
  forceSingleLine:true,
  tuneWidth:2,
  offsetTop:5,
  css:['.sIFR-root {color:#FFFFFF; font-size:18px;  width:auto; padding-left:10px; }',
	   '.sIFR-root h1{color:#FFFFFF; font-size:18px;  width:auto; padding-left:10px; }']
});


sIFR.replace(optima, {
  selector: '.tools_bar_top h5',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#FFFFFF; font-size:12px;  text-transform:uppercase; font-weight:bold }']
});

sIFR.replace(optima, {
  selector: '.documents_utiles_top h5',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#FFFFFF; font-size:12px;  text-transform:uppercase; font-weight:bold }']
});

sIFR.replace(optima, {
  selector: '.sogecap_agenda_top h5',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#000000; font-size:12px; text-transform:uppercase; font-weight:bold }']
});

sIFR.replace(optima, {
  selector: '.sogecap_actualites_top h5',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#000000; font-size:12px; text-transform:uppercase; font-weight:bold }']
});

sIFR.replace(optima, {
  selector: 'h2.titre-2',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#252525; font-size:18px; border-bottom:1px solid #252525;font-weight:bold}']
});

sIFR.replace(optima, {
  selector: 'h1.titre-3',
  wmode:'transparent',
  forceSingleLine:false,
  css:['.sIFR-root {color:#000000; font-size:12px; text-transform:uppercase; font-weight:bold }']
});





/* HACK, texte tronqué : + 1 Sur la largeur des menus générés en sifr */
/*
$(window).load(function(){
	var dlay = setInterval(
			function(){if(jQuery('.sIFR-replaced').length>=sIFR.replacements.length){
				$(".sIFR-flash").each(function(){var w=parseInt($(this).attr('width'))+1;$(this).attr('width',w);});
				clearInterval(dlay);}
			},100);                                   
}); 
*/


