function rand_BG(xFondo) {
  //xFondo Valores posibles 0, 1 y 2 ; 0 random de 1 - 10 ; 1 random de 1 - 6 ; 2 random de 7 - 10
  var a;
  var varFondo;
  switch(xFondo){
    case 0:  a = 1*Math.round(Math.random()* 10); 
			 break; 
    case 1:  a = 1*Math.round(Math.random()* 6); 
			 break; 
    case 2:  a = 1*Math.floor(Math.random()* 4)
             if (a == 0){ //validación adicional en caso de cargar el número 0
			     a++; 
			 }
  		     a = a + 6; 
			 break; 
    default: a = 1*Math.round(Math.random()* 10); 
			 break; 
  }

  switch (a){
   case 1:  varFondo = "imatges/fondos/fondo1.jpg";
  	        break;
   case 2:  varFondo = "imatges/fondos/fondo2.jpg";  
 	        break;  
   case 3:  varFondo = "imatges/fondos/fondo3.jpg";  
 	        break;  
   case 4:  varFondo = "imatges/fondos/fondo4.jpg";
  	        break;
   case 5:  varFondo = "imatges/fondos/fondo5.jpg";  
	        break;  
   case 6:  varFondo = "imatges/fondos/fondo6.jpg";  
	        break;  
   case 7:  varFondo = "imatges/fondos/fondo7.jpg";
  	        break;
   case 8:  varFondo = "imatges/fondos/fondo8.jpg";
	        break;  
   case 9:  varFondo = "imatges/fondos/fondo9.jpg";
  	        break;
   case 10: varFondo = "imatges/fondos/fondo10.jpg";  
	        break;  
   case 11: varFondo = "imatges/fondos/fondo11.jpg";  
	        break;  
   default: varFondo = "imatges/fondos/fondo1.jpg";
  	        break;
  }
  document.body.background = varFondo;
}

function galeriasPop (xURL) {
  popVentana = window.open(xURL,"PALS","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=589,height=470,top='top',left='center'");
  popVentana.focus();
}

function customPop(xURL, varWidth, varHeight) {
  popVentana = window.open(xURL,"PALS","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars,resizable=no,width="+varWidth+",height="+varHeight+",top='top',left='center'");
  popVentana.focus();
}

function cargarGaleria (parFoto, ParTitulo){
  frames['foto'].location.href= parFoto; 
  frames['title'].location.href= ParTitulo; 
}

function LimpiarFondo(varPosicion, varLocation){
 var thestyle = eval ('document.all.enl_'+varLocation+'.style'); 
  if (varPosicion !=varLocation){
    thestyle.color="#848484";
    thestyle.backgroundColor="#FFFFFF";
  } else {
   thestyle.color="#FFFFFF";
   thestyle.backgroundColor="#933f00";
  }
}