YAHOO.namespace("BASE.util.NavigationSelect");

YAHOO.BASE.util.NavigationSelect = function(theSelect){
    
    this.select = YAHOO.util.Dom.get(theSelect);
    this.nullOption = this.select.options[0];
    YAHOO.util.Event.addListener(this.select, "change", this.go, this, true);
    
}

YAHOO.BASE.util.NavigationSelect.prototype = {
    go : function(e){
        if(this.select.selectedIndex !=0){
            var selectedOption = this.select.options[this.select.selectedIndex];
            var destination = this.select.value;
            this.select.selectedIndex = 0;
            if(YAHOO.util.Dom.hasClass(selectedOption, 'popup')){
                return window.open(destination, '_blank');
            }else{
                window.location.href = destination;
            }
        }
    }
};