function MarcarCheckBoxImagen(ValorCombo,Posicion,Pos2){
    var cbx = eval("document.f1.opcionimagen" + Posicion)
    var txt = eval("document.f1.ruta" + Pos2);
    var pos = eval("document.f1.posicion" + Posicion);
    if(ValorCombo != ""){
        cbx.checked = true;
        txt.readOnly = false;
        pos.readOnly = false;
    }
    else{
        cbx.checked = false;
        txt.readOnly = true;
        pos.readOnly = true;
    }
}
function MarcarCheckBoxVideo(ValorCombo,Posicion,Pos2){
    var cbx = eval("document.f1.opcionvideo" + Posicion)
    var txt = eval("document.f1.url" + Pos2);
    if(ValorCombo != ""){
        cbx.checked = true;
        txt.readOnly = false;
    }
    else{
        cbx.checked = false;
        txt.readOnly = true;
    }
}


function Mostrar(id,id2){
  var txt=document.getElementById(id);
  var txt2=document.getElementById(id2);
  despl=txt.style.display;
  if(despl=="none"){
    txt.style.display="block";
    txt2.className="sprite1 despl";
  }
  else{
    txt.style.display="none";
    txt2.className="sprite1 repl";
  }
    
}

function InsertarComentario(IDEntrada,Tipo) 
{
  var url = 'http://www.seriesypeliculasonline.com/general.php?tipo=1';
  comp=Comprobar();
  if(comp==true){
    user=document.getElementById('autor');
    email=document.getElementById('email');
    comentario=document.getElementById('comentario');
    val_com=comentario.value;
    while (val_com.indexOf("\n") > -1)
      val_com = val_com.replace("\n","<br />");
    var pars='identrada='+IDEntrada+'&tipo='+Tipo+'&usuario='+user.value+'&email='+email.value+'&comen='+val_com;
    var myAjax = new Ajax.Updater( 'nuevoComen', url, { method: 'get', parameters: pars});
    Limpiar('autor');
    Limpiar('email');
    Limpiar('comentario');
  }
}

function Comprobar(){
  retorno=true;
  txt_user=document.getElementById('autor');
  txt_email=document.getElementById('email');
  txt_comen=document.getElementById('comentario');
  if(txt_user.value.length<3){
    txt_user.style.borderColor="#FF0000";
    retorno=false;
  }
  else{
    txt_user.style.borderColor="#666";
  }
  if(txt_comen.value.length<10){
    txt_comen.style.borderColor="#FF0000";
    retorno=false;
  }
  else{
    txt_comen.style.borderColor="#666";
  }
  if((txt_user.value.toLowerCase()=="admin")||(txt_user.value.toLowerCase()=="sypo")){
    alert("Este nombre de usuario no está permito, inténtalo con otro.");
    txt_user.style.borderColor="#D60415";
    retorno=false;
  }
  return retorno;
}

function Limpiar(id){
  var txt=document.getElementById(id);
  txt.value="";
}

function PonerValor(id,lit){
  var txt=document.getElementById(id);
  if(txt.value.length<1){
    txt.value=lit;
  }
}

	
