//
// k i l a k  (c) 2007
// http://www.kilak.com/
//

<!--
//
// INICIO FUNCIONES DE VALIDACIÓN
//
function vTuNombre() 
    {
	if (document.frmForm.TuNombre.value == "")
           {
             alert('\nDebes incluir tu nombre.');
             document.frmForm.TuNombre.focus();
             return(false);
           }
             else { return(true); }
    }

function vTuEmail()
    {
	if (document.frmForm.TuEmail.value == "")
           {
             alert('\nDebes ingresar tu e-mail.');
             document.frmForm.TuEmail.focus();
             return(false);
        }

        if (document.frmForm.TuEmail.value.indexOf('@',0)==-1 || document.frmForm.TuEmail.value.indexOf('@',0)== 0 ||
          document.frmForm.TuEmail.value.indexOf('.',0)==-1)
             {
                 alert('\nDirección de e-mail no válido. Por favor verifique el e-mail ingresado.');
                 document.frmForm.TuEmail.focus();
                 return(false);
              }
             else { return(true); }
    }

function vSuNombre() 
    {
	if (document.frmForm.SuNombre.value == "")
           {
             alert('\nDebes incluir el nombre de tu amigo.');
             document.frmForm.SuNombre.focus();
             return(false);
           }
             else { return(true); }
    }

function vSuEmail()
    {
	if (document.frmForm.SuEmail.value == "")
           {
             alert('\nDebes ingresar el e-mail de tu amigo.');
             document.frmForm.SuEmail.focus();
             return(false);
        }

        if (document.frmForm.SuEmail.value.indexOf('@',0)==-1 || document.frmForm.SuEmail.value.indexOf('@',0)== 0 ||
          document.frmForm.SuEmail.value.indexOf('.',0)==-1)
             {
                 alert('\nDirección de e-mail no válido. Por favor verifique el e-mail ingresado.');
                 document.frmForm.SuEmail.focus();
                 return(false);
              }
             else { return(true); }
    }

function vTitulo() 
    {
	if (document.frmForm.Titulo.value == "")
           {
             alert('\nDebes incluir el título de tu cuento.');
             document.frmForm.Titulo.focus();
             return(false);
           }
             else { return(true); }
    }

function vCuento() 
    {
	if (document.frmForm.Cuento.value == "")
           {
             alert('\nDebes incluir tu cuento infantil.');
             document.frmForm.Cuento.focus();
             return(false);
           }
             else { return(true); }
    }


// RADIO VOTACIÓN
function vVotar() 
{
// set var radio_choice to false
var radio_choice = false;

// Loop from zero to the one minus the number of radio button selections
for (counter = 0; counter < frmFormVotar.rbVoto.length; counter++)
{
// If a radio button has been selected it will return true
// (If not it will return false)
if (frmFormVotar.rbVoto[counter].checked)
radio_choice = true; 
}

if (!radio_choice)
{
// If there were no selections made display an alert box 
alert("Debes realizar tu voto.")
return (false);
}
return (true);
}

// FIN FUNCIONES DE VALIDACIÓN


// BOTÓN ENVIAR RECOMENDAR
<!--
function EnviarRecomendar(frmForm) 
   {
       if ( vTuNombre() && vTuEmail() && vSuNombre() && vSuEmail() )
          {
          document.frmForm.submit();
          }
   }
// -->

// BOTÓN ENVIAR RECOMENDAR GAME
<!--
function EnviarRecomendarGame(frmForm) 
   {
       if ( vSuEmail() )
          {
          document.frmForm.submit();
          }
   }
// -->

// BOTÓN ENVIAR CUENTO
<!--
function EnviarCuento(frmForm) 
   {
       if ( vTuNombre() && vTuEmail() && vTitulo() && vCuento() )
          {
          document.frmForm.submit();
          }
   }
// -->

// BOTÓN VOTAR
<!--
function Votar(frmFormVotar) 
   {
       if ( vVotar() )
          {
          document.frmFormVotar.submit();
          }
   }
// -->

//---------------------------------------------------------------------------

setInterval("top.window.status='www.InfantiJuegos.com'",5);

function adjustIFrameSize (iframeWindow) {
	 if(iframeWindow.name!='') {
	  if (iframeWindow.document.height) {
		var iframeElement = document.getElementById(iframeWindow.name);
		iframeElement.style.height = iframeWindow.document.height + 'px';
	  }
	  else if (document.all) {
		var iframeElement = document.all[iframeWindow.name];
		if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') {
		  iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 'px';
		  } else {
		  iframeElement.style.height = iframeWindow.document.body.scrollHeight + 'px';
		}
	  }
	  if (parent.adjustIFrameSize) { parent.adjustIFrameSize(window); }
	}
}


function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
//window.attachEvent("onload", correctPNG);