// JavaScript Document

function EstiloCredtos(colorlinea,ColorFondo,ColorText)
{
var estilos = document.createElement("style");  
estilos.type = "text/css";   
/*colorlinea = "#0066cc";
ColorFondo="#0052A4";
ColorText="#FFFFFF";*/

codigo = "#P6 {	border-bottom-color: "+colorlinea+";} #Line1, #Line2, #Line3, #Line4,#Line5 {border-bottom-color: "+colorlinea+";	} #P1, #P2, #P3 , #P4,  #P5{background-color: "+ColorFondo+" ;	border-bottom-width: 1px;	border-bottom-style: solid; border-bottom-color: "+colorlinea+"; 	color:  "+ColorText+" ;} #P1.active, #P2.active, #P3.active, #P4.active, #P5.active{	border-top-color: "+colorlinea+";	border-right-color: "+colorlinea+";	border-bottom-color: "+colorlinea+";	border-left-color: "+colorlinea+";color:  "+colorlinea+" ;}";    

if (estilos.styleSheet){     
	estilos.styleSheet.cssText = codigo;  
	} 
else {     
	estilos.appendChild(document.createTextNode(codigo));   }   
document.getElementsByTagName("head")[0].appendChild(estilos);
}


function switchMain(NumTotal,NumPos)
  {
	for(i=1;i<NumTotal+1;i++)
{

      if( i == NumPos )
       {
         document.getElementById("ContCred"+i).style.visibility = "visible";
		 document.getElementById('P'+i).className=  'active';
       }
       else
       {
         document.getElementById("ContCred"+i).style.visibility = "hidden";
		 document.getElementById('P'+i).className=  '';
       }
}

  }
  

function MenRRHH(NumTotal,NumPos)
  {
	for(i=1;i<NumTotal+1;i++)
{

      if( i == NumPos )
       {
         document.getElementById("RRHH"+i).style.visibility = "visible";
		 document.getElementById('Pag0'+i).className=  'active';
       }
       else
       {
         document.getElementById("RRHH"+i).style.visibility = "hidden";
		 document.getElementById('Pag0'+i).className=  '';
       }
}

  }
  

function MenServ(NumTotal,NumPos)
  {
	for(i=1;i<NumTotal+1;i++)
{

      if( i == NumPos )
       {
         document.getElementById("servrec"+i).style.visibility = "visible";
		 document.getElementById('Hoja0'+i).className=  'active';
       }
       else
       {
         document.getElementById("servrec"+i).style.visibility = "hidden";
		 document.getElementById('Hoja0'+i).className=  '';
       }
}

  }
  
  
function MenEstadistica(NumTotal,NumPos)
  {
	for(i=1;i<NumTotal+1;i++)
{

      if( i == NumPos )
       {
         document.getElementById("Imgpatrimonio"+i).style.visibility = "visible";
		 document.getElementById('PagEsta0'+i).className=  'active';
       }
       else
       {
         document.getElementById("Imgpatrimonio"+i).style.visibility = "hidden";
		 document.getElementById('PagEsta0'+i).className=  '';
       }
}

  }
  
 

function MenGen(Cuerpo,Pags,NumTotal,NumPos)
  {
	for(i=1;i<NumTotal+1;i++)
{

      if( i == NumPos )
       {
         document.getElementById(""+Cuerpo+i).style.visibility = "visible";
		 document.getElementById(''+Pags+i).className=  'active';
       }
       else
       {
         document.getElementById(""+Cuerpo+i).style.visibility = "hidden";
		 document.getElementById(''+Pags+i).className=  '';
       }
}

  }
  
    

function ImgAleatoria(NumImg, DirImg)
  {

var numeroImagenes = NumImg ;

var numeroAleatorio = Math.floor(Math.random() * numeroImagenes ) + 1;

document.write('<img src="'+DirImg+'Img' + numeroAleatorio + '.jpg">');

  }

