/**
 * This function will add a target _blank effect with the onclick attribute
 * on any css selector (i.e a.blank => all the a with the class blank)
 *
 * @author Francois Lavertu
 */

addTargetBlank = function(sCssSelector){
    $$(sCssSelector).invoke('observe', 'click', function(e){
        // check if the element as the href attribute
        if(this.href){
            window.open(this.href);
            Event.stop(e);
        }
    });
}

/*
chgMedia = function(sCssSelector){
	 var els = document.getElementsByClassName(sCssSelector);
   $$('.' + sCssSelector).invoke('observe', 'click', function(e){
		 for(i=0; i< els.length; i++){
			 $(els[i].rel).addClassName('hide');
			 $(els[i]).removeClassName('selected');
		 }
		 $(this).addClassName('selected');
		 $$('#' + this.rel).invoke('removeClassName', 'hide');
     Event.stop(e);
	});
}
*/

document.observe('dom:loaded', function() {

	/* ajouter une classe à un lien pour simuler un target=blank */
	addTargetBlank('a.blank');
	//chgMedia('chgMedia');
	
	/* ajouter une classe pour simuler un pseudo-selector pour IE */
	$$('.contentHolder li:first-child').invoke('addClassName', 'noBorder');
	
	// imagerotator on home page
		var flashvars = {
			file: '/swf/phaneuf.xml',
			width: '475',
			height: '345',
			screencolor: '0x67b100',
			shuffle: 'true',
			transition: 'fade',
			overstretch: 'false',
			showicons: 'false',
			shownavigation: 'false',
			rotatetime: '3'
	    }
	    var params = {wmode: 'transparent', allowFullScreen: 'true'};
	   	swfobject.embedSWF("/swf/imagerotator.swf", "bannieres", "475", "345", "9.0.0", "/Commun/js/swfobject/2.0/expressInstall.swf", flashvars, params);

});