function verificarform(idioma,cant_encabezado)
{

    var correctas = 0;
    var totales = 0;
    var objeto = "resu-1";
    var objetodiv = document.getElementById(objeto); 
    var objetoresultado = document.getElementById("resultado");
    var mensaje= "";
    //alert("entre al verificar");
    var okey= "<IMG src=\'/images_config/tilde.gif\' border=0>";
    var notokey= "<IMG src=\'/images_config/cruz.gif\' border=0>";

    for (i=cant_encabezado;i<document.encuesta.elements.length;i=i+7) 
    {

       totales ++;

       id =document.encuesta.elements[i+6].value;
     
       objeto = "resu-" + id
       objetodiv = document.getElementById(objeto); 
       if ((document.encuesta.elements[i+1].value =="VERDADERO")&(document.encuesta.elements[i].checked))
       {
         correctas ++;   
      
         //objetodiv.innerHTML = okey + objetodiv.innerHTML;
         objetodiv.innerHTML = okey ;
       }
       else if ((document.encuesta.elements[i+3].value =="VERDADERO")&(document.encuesta.elements[i+2].checked))
       {
         correctas ++;   
         objetodiv.innerHTML = okey ;
       }
       else if ((document.encuesta.elements[i+5].value =="VERDADERO")&(document.encuesta.elements[i+4].checked))
       {
         correctas ++;   
         objetodiv.innerHTML = okey ;
       }
       else 
       {
         objetodiv.innerHTML = notokey ;
       }

    }
    if (idioma == "ingles")
    {
        mensaje = "You have "+correctas+" right answers of "+totales ;
    }
    else
    {
        mensaje = "Tienes "+correctas+" respuestas correctas de "+totales ;
    }
    objetoresultado.innerHTML = mensaje;

    
} 


function subirform(idioma,cant_encabezado)
{

 	 	 var x=document.forms.encuesta;
                 verificarform(idioma,cant_encabezado);
                 var action = "/subirform.cgi";
                 x.action=action;       
                 x.submit();
          
}


function Abrir_ventana (pagina) {
var opciones="toolbar=no, location=no, directories=no, titlebar=no,toolbar=no,status=no, menubar=no, scrollbars=no, resizable=no, width=300, height=265, top=140, left=140";
window.open(pagina,"",opciones);
}

function mostrar_capa (capa) {
  document.getElementById(capa).style.display="inline";
}

function ocultar_capa (capa) {
  document.getElementById(capa).style.display="none";
}

function mostrar_foto (foto) {
var i = 0;
var salir = 0;
  document.getElementById("capafotos").style.display="inline";
  document.getElementById("capatransparente").style.display="inline";
  document.images['imagen'].src=foto;
  while ((i <= album.length - 1) & (salir == 0))
  {
     if (album[i]== foto)
     {
	salir = 1;
	indice_album = i;
     }
     i++;
  }
  

}

function ocultar_foto () {
  document.getElementById("capafotos").style.display="none";
  document.getElementById("capatransparente").style.display="none";

  window.clearInterval(intval);
  intval = 0;
  indice_album=0;

}


    var album = new Array();
    var i = 0;


function album_insertar_foto (foto) {
   album[album.length]=foto;
   i = album.length;
}

function album_siguiente_foto () {
  i ++;
  document.images['imagen'].album[i];
}


var album = new Array();
var album_indice = new Array();
var indice_album = 0;
var intval=0;
   




function album_insertar_foto (foto) 
{
album[album.length]=foto;
}

function album_foto (comando) {

	if (comando == "next")
	{
		
		if ((indice_album != album.length-1) & (intval == 0))
 		{
			indice_album ++;
			document.images['imagen'].src=album[indice_album];
		}
		else if ((indice_album == album.length-1) & (intval != 0))
 		{
			indice_album = 0;
			document.images['imagen'].src=album[indice_album];
		}
		else if ((indice_album != album.length-1) & (intval != 0))
 		{
			indice_album ++;
			document.images['imagen'].src=album[indice_album];
		}

 	}
	else if (comando == "previous")
	{
		if ((indice_album != 0)&(intval ==0))
 		{
			indice_album =	indice_album -1;
			document.images['imagen'].src=album[indice_album];
	
		}
		else if ((indice_album == 0)&(intval != 0))
 		{
			indice_album = album.length-1;
			document.images['imagen'].src=album[indice_album];	
		}
		else if ((indice_album != 0)&(intval != 0))
 		{
			indice_album =	indice_album -1;
			document.images['imagen'].src=album[indice_album];
		}

	}
	else if (comando == "first")
	{
			indice_album =	0;
			document.images['imagen'].src=album[indice_album];
	}
	else if (comando == "last")
	{
			indice_album =	album.length-1;
			document.images['imagen'].src=album[indice_album];
	
	}
	else if (comando == "play")
	{
		intval = setInterval("album_foto('next')",3000)
	}		
	else if (comando == "pause")
	{
		window.clearInterval(intval);
		intval = 0;
	}




}









