// JavaScript Document
addEvent = function(o, e, f, s){
    var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;
    r[r.length] = [f, s || o], o[e] = function(e){
        try{
            (e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});
            e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});
            e.target || (e.target = e.srcElement || null);
            e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;
        }catch(f){}
        for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.apply ? c = a.apply(o, arguments) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));
        return e = null, !!d;
    }
};

removeEvent = function(o, e, f, s){
    for(var i = (e = o["_on" + e] || []).length; i;)
        if(e[--i] && e[i][0] == f && (s || o) == e[i][1])
            return delete e[i];
    return false;
};



var indice = 0;


function li_active_class( ul_id ) {
	var class_name = "current";
	var menu = (typeof(ul_id)=="string")?(getById( ul_id )):(ul_id);	
	var self = this;
	this.cancel_bool = false;
	
	this.run = function(){
		var lis = getChildsByTag( menu, "LI" );
		var current_href = new String( document.location );
		var a = null;
		for( var i=0; i < lis.length; i++ ){
			if(lis[i].className == class_name)
				lis[i].removeAttribute("class");
			a = lis[i].getElementsByTagName("a")[0];			
			a.lis = lis;
			if( self.cancel_bool ) {
				addEvent( a, "click", function(e){
					var evt = new ev( e );
					evt.bloquear();
					for( var i=0; i < this.lis.length; i++ ) {
						this.lis[i].className = "";
					}
					var li = this.parentNode;
					li.className = class_name;
				}, a );
			} else {
				if( current_href.indexOf(a.href) > -1 )
					lis[i].className = class_name;
			}
		}	
	}
}

/*
function li_active_class( ul_id ) {
	var class_name = "current";
	var menu = (typeof(ul_id)=="string")?(getById( ul_id )):(ul_id);	
	var self = this;
	this.cancel_bool = false;
	
	this.run = function(){
		var lis = getChildsByTag( menu, "LI" );
		var current_href = new String( document.location );
		var a = null;
		for( var i=0; i < lis.length; i++ ){
			if(lis[i].className == class_name)
				lis[i].removeAttribute("class");
			a = lis[i].getElementsByTagName("a")[0];			
			a.lis = lis;
			if( self.cancel_bool ) {
				addEvent( a, "click", function(e){
					var evt = new ev( e );
					evt.bloquear();
					for( var i=0; i < evt.e.target.lis.length; i++ ) {
						evt.e.target.lis[i].className = "";
					}
					var li = evt.e.target.parentNode;
					li.className = class_name;
				}, a );
			} else {
				if( current_href.indexOf(a.href) > -1 )
					lis[i].className = class_name;
			}
		}	
	}
}

*/