var hoy = new Date();
if(hoy.getDate()<10) diaHoy="0"+hoy.getDate()
else diaHoy=hoy.getDate()
if((hoy.getMonth()+1)<10) mesActual="0"+(hoy.getMonth()+1)
else mesActual=(hoy.getMonth()+1)
var fecha_hoy = diaHoy + "-" + mesActual + "-" + hoy.getFullYear();
var estilo_menu='<link rel="STYLESHEET" type="text/css" href="../css/menu.css" media="all" />'
var ultima='<span>Updated: '+fecha_hoy+'</span>'
var impri='<p id="imprimir"><a title="Print page contents" href="#" id="imprime">Print&nbsp;&nbsp;<span class="noVis">page contents</span></a></p>'
var video='<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" src="../video/fcc2005ing.wmv" width="320" height="250" autostart="True" filename="../video/fcc2005ing.wmv" showcontrols="True" showstatusbar="True" showdisplay="False" autorewind="True"></embed>'
var inicioDivGrafica='<div class="grafic">'
var finDivGrafica='</div>'
var divTarta='<div id="miTarta" class="grafic tarta"></div>'

var carrusel='<div id="carr_container"><div id="marcoCarr"><img src="../img/marcoCarrusel.gif" width="163" height="200" alt="" /></div><div id="carr_imagen_container"><img src="../img/dot_no.gif" alt="" width="163" height="200" id="mooshow_image" /></div><div id="carr_loading"><img src="../img/dot_no.gif" alt="" /></div><div id="carr_pie"></div></div><br class="clear" />'


window.onload = valiendo


function valiendo()
{		



 if (document.getElementsByTagName)
 {
  var allacron = document.getElementsByTagName("acronym")
  var allLinks = document.getElementsByTagName("a");
  var allInput = document.getElementsByTagName("input");  
  var allTextarea = document.getElementsByTagName("textarea"); 
  var allListas = document.getElementsByTagName("li");   
  
  for (i=0; i< allacron.length; i++){
  	allacron[i].onmouseover = function()
	    {
		if (this.parentNode.tagName!='A') this.style.cursor="help"
		}
  }
  
  for (var i = 0; i < allInput.length; i++)
  {
  allInput[i].onfocus = function()
	  	{
		this.select();
		}
  }
  
  for (var i = 0; i < allTextarea.length; i++)
  {
  allTextarea[i].onfocus = function()
	  	{
		this.select();
		}
  }  
  
  /* */
  for (var i = 0; i < allLinks.length; i++)
  {
  
  allLinks[i].onfocus = function()
		{
			if(document.getElementById("nav")) nav2Matriz = document.getElementById("nav")
			else nav2Matriz = document.getElementById("nav2")
			items2=nav2Matriz.getElementsByTagName("li")
				for(en=0;en<items.length;en++){
				items2[en].className=items2[en].className.replace("On", "Off");
				}
		}
  
  if(allLinks[i].id == "imprime"){
  	allLinks[i].onclick = function() {
	window.print()
	}
  }
  
   if (allLinks[i].className == "hover" )
   {
    allLinks[i].onmouseover = function()
	    {
	     var thisImgs = this.getElementsByTagName("img");
	     for (var idx = 0; idx < thisImgs.length; idx++)
	      thisImgs[idx].src = thisImgs[idx].src.replace('.gif', '_hover.gif');
	    }
    allLinks[i].onmouseout = function()
	    {
	     var thisImgs = this.getElementsByTagName("img");
	     for (var idx = 0; idx < thisImgs.length; idx++)
	      thisImgs[idx].src = thisImgs[idx].src.replace('_hover.gif', '.gif');
	    }
   }
	
  }
  if(document.getElementById('nav')) {
	menu=document.getElementById('nav')
	menu.className='menu2'
	}
	if(document.getElementById('nav2')){
	menu=document.getElementById('nav2')
	menu.className='menu'
	}
  	listaMenu=menu.getElementsByTagName('li')
		for(p=0;p< listaMenu.length;p++){
			if(listaMenu[p].childNodes[0].className=='linkItem'){
				listaMenu[p].className='itOff'
				hijosLista=listaMenu[p].getElementsByTagName('ul')
				hijosLista[0].className='submenu'
			}
			if(listaMenu[p].childNodes[0].className=='subit'){
				listaMenu[p].className='subitOff'
			}
		}
  for (var i=0; i< allListas.length;i++){
  	if (allListas[i].className == "hover2" )
   {
    allListas[i].onmouseover = function()
	    {
		this.style.cursor='hand'
	    this.id=this.id.replace('it', 'onit')
	    }
    allListas[i].onmouseout = function()
	    {
	    this.id=this.id.replace('onit', 'it')
	    }
   }
  }
   /* */ 
  
  
 }
 
 if(document.getElementById){
 
 	if(document.getElementById("servHome")){
	pad=document.getElementById('areasNeg')
	pad.className='posAbs'
	linServ=document.getElementById('itServHome')
	ultLinServ=document.getElementById('ultItServHome')
	itemHome=document.getElementById('serviHome')
	subitHome=document.getElementById('servHome')
	subitHome.className='SubServHome'
		linServ.onfocus=function(){
		document.getElementById('servHome').style.display='block'
		}
		ultLinServ.onblur=function(){
		document.getElementById('servHome').style.display='none'
		}
		subitHome.onmouseout= function(){
		this.style.display='none'
		}
		itemHome.onmouseover= function(){
		itemHome.className='chap'
		document.getElementById('servHome').style.display='block'
		}
		itemHome.onmouseout= function(){
		itemHome.className=''
		document.getElementById('servHome').style.display='none'
		}
		for(en=0;en<subitHome.length;en++){
			subitHome[en].onmouseover= function(){
			itemHome.className='chap'
			this.parentNode.style.display='block'
			}
			subitHome[en].onmouseout= function(){
			itemHome.className=''
			this.parentNode.style.display='none'
			}
		}		

	}
 
 	if(document.getElementById("nav")) navMatriz = document.getElementById("nav")
	else navMatriz = document.getElementById("nav2")
 items=navMatriz.getElementsByTagName("li");
	for(n=0;n<items.length;n++){
		items[n].onmouseover=function() {
		this.className=this.className.replace("Off", "On");
		this.style.cursor='hand'
		}
		items[n].onmouseout=function() {
		this.className=this.className.replace("On", "Off");
		}
		quien=items[n].getElementsByTagName('a')
		quien[0].onfocus=function(){
			if(this.className!='subit'){
			if(document.getElementById("nav")) nav2Matriz = document.getElementById("nav");
			else  nav2Matriz = document.getElementById("nav2");
			items2=nav2Matriz.getElementsByTagName("li")
				for(en=0;en<items.length;en++){
				items2[en].className=items2[en].className.replace("On", "Off");
				}
			this.parentNode.className=this.parentNode.className.replace("Off", "On");
			}
			else{
			this.parentNode.className=this.parentNode.className.replace("Off", "On");
			
			}
		}
		quien[0].onblur=function(){
			if(this.className=='subit'){
			this.parentNode.className=this.parentNode.className.replace("On", "Off");
			}
		}	
	}
 }
 	
	
	 if(document.getElementById('menuPrin')){
	menuInterior=document.getElementById('menuPrin')
	 todosLinkItem=menuInterior.getElementsByTagName('a')
	 	for(p=0;p<todosLinkItem.length;p++){
		enlaceItem=todosLinkItem[p].href
		enlacePDF=enlaceItem.split('.pdf')
			if(enlacePDF.length>1){
			todosLinkItem[p].setAttribute("target", "_blank");
			todosLinkItem[p].blur()
			}
		}
	 }
	
	
	 if(document.getElementById('menuInt')){
	 menuInterior=document.getElementById('menuInt')
	 todosLinkItem=menuInterior.getElementsByTagName('a')
	 	for(p=0;p<todosLinkItem.length;p++){
		enlaceItem=todosLinkItem[p].href
		enlacePDF=enlaceItem.split('.pdf')
			if(enlacePDF.length>1){
			todosLinkItem[p].setAttribute("target", "_blank");
			todosLinkItem[p].blur()
			}
		}
	 }
 
 }