﻿/************ DROP DOWN FOR IE6 **************************/
/**
 * This function will add className to the LI element
 * @author Eric Shepherd
 * @website http://www.alistapart.com/articles/hybrid
 * @modified by François Lavertu
 */
startList = function(e) {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById(e);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
/**
 * 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() {  
	startList("nav");
    addTargetBlank('a.blank');
});