/**
 * 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);
        }
    });
}

function emptyField(){
	if(this.value != ""){
		this.oldVal = this.value;
		this.value = "";
		this.onblur = function(){
			if(this.value == "")
				this.value = this.oldVal;
			}
		//Event.stop(e);
  }
}

document.observe('dom:loaded', function() {
	/* ajouter une classe à un lien pour simuler un target=blank */
	addTargetBlank('a.blank');
	
	/* ajouter une classe pour simuler un pseudo-selector pour IE */
	$$('.content_holder li:first-child').invoke('addClassName', 'noBorder');
	
	$$('#subscribe_form input').invoke('observe', 'click', emptyField);
		
	


	if($('flashHeader')){
		var flashvars = {
		Speed: '4',
		Start: '0'
		}					
		var params = { wmode: "transparent" };
		
		swfobject.embedSWF("/swf/ste-agathe_flashHeader.swf", "flashHeader", "684", "240", "9.0.0", "/Commun/js/swfobject/2.1/expressInstall.swf", flashvars, params);
	}

});

