/**
 * 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);
        }
    });
}


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 */
	$$('.contentHolder li:first-child').invoke('addClassName', 'noBorder');

	// search box...
	if($('q')){
		$('q').observe("focus", function(){
			if($F('q') == searchBoxValue){$('q').value = '';}
		});
		$('q').observe("blur", function(){
			if($F('q') == ''){$('q').value = searchBoxValue;}
		});
	}
});
