function over_item(opcion){
	if (opcion.className != 'active'){				
		opcion.className = 'FondoActivo';
		if(opcion.id == 'first_item'){
			var menuleft = document.getElementById("menu_left");
			menuleft.className = 'left_fondo_activo';
		}
		if(opcion.id == 'last_item'){
			var menuright = document.getElementById("menu_right");
			menuright.className = 'right_fondo_activo';
		}
		
	}
}

function out_item(opcion){
	if (opcion.className != 'active'){
		opcion.className = 'FondoNoactivo';
		if(opcion.id == 'first_item'){
			/*colorear izq*/
			var menuleft = document.getElementById("menu_left");
			menuleft.className = 'fNoactivo';
		}
		if(opcion.id == 'last_item'){
			/*colorear izq*/
			var menuright = document.getElementById("menu_right");
			menuright.className = 'frNoactivo';
		}				
	}
}

function activar_item(objeto){
	/*desactivar otros items*/
	var tabla_menu = document.getElementById('menu_opciones');
	
	/*			
	var activos = getElementsByClassName('active',tabla_menu);		
	*/
	
	$j(".active").each(function(){			
		this.className = 'fondoNoActivo';			
	})
	
	/*for each (el in activos){
		el.className = 'fondoNoActivo';
	}*/
	
	/*activar item actual*/			
	objeto.className = 'active';
	
	/*arreglar first item*/
	if (objeto.id == 'first_item'){
		var menuleft = document.getElementById('menu_left');
		menuleft.className = 'fActivo';
	}else{
		var menuleft = document.getElementById('menu_left');
		menuleft.className = 'fNoactivo';
	}
	
	/*arreglar last item*/
	if (objeto.id == 'last_item'){
		var menuright = document.getElementById('menu_right');
		menuright.className = 'frActivo';
	}else{
		var menuright = document.getElementById('menu_right');
		menuright.className = 'frNoactivo';
	}			
	
}

/*retorna elementos con determinada 'clase'*/
function getElementsByClassName(classname, node) {  
  if(!node) 
	node = document.getElementsByTagName("body")[0];
	
	var a = [];
	var re = new RegExp('\\b' + classname + '\\b');
	var els = node.getElementsByTagName("*");
	
	for(var i=0,j=els.length; i<j; i++)
	  if(re.test(els[i].className))a.push(els[i]);
	 
	return a;
}

/*activa el tab de news*/
function activarNews(){
	var mynews = document.getElementById("menu_news");
	activar_item(mynews);
}