
function menu(UB_X,UB_URL,div_id){
	document.getElementById(div_id).style.display = "block";	
}

function VER_EXT(CAD){  //Funcion para sacar las extenciones de los archivos
		if (CAD.substring(CAD.length-4,CAD.length-3)=='.')
		{
			return CAD.substring(CAD.length-3,CAD.length);
		}
		if (CAD.substring(CAD.length-5,CAD.length-4)=='.')
		{
			return CAD.substring(CAD.length-4,CAD.length);
		}
		return '';
}
	
function menu_on(div,ubi_td){			
	menu_off_all()
	document.getElementById(div).style.display = "block";
	MM=0;
	if (div == 'menu_div_unid') MM=125;
	document.getElementById(div).style.left = findPosX(ubi_td) - MM  + "px";
}	
function menu_pos(obj_div,pos) {
	obj_div.style.left = pos + "px";
}	
function menu_off_all(){	
	document.getElementById('menu_div_inst').style.display = "none";	
	document.getElementById('menu_div_admi').style.display = "none";
	document.getElementById('menu_div_line').style.display = "none";
	document.getElementById('menu_div_salu').style.display = "none";
	document.getElementById('menu_div_unid').style.display = "none";	
}	

function noti_ver(info_cod,info_fot_cod,info_titu){	
	document.getElementById("TX_index").innerHTML = info_titu;
	document.getElementById("TB_index").style.background='url(fotos_ivr/foto_' + info_fot_cod + '.jpg)';
}		


function ir(donde){
	window.location=donde;
}
function ir_new(donde){
	window.open(donde,"");
}

function findPosX(obj) {
	  var curleft = 0;	
	  if(obj.offsetParent) {
		while(1) {
		  curleft += obj.offsetLeft;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	  } else if(obj.x) {
		curleft += obj.x;
	  }
	
	  	obj.style.position = "static";		
		
	  	return curleft;
	}
