
var validarContrato;
function desplazamientoBiografia(pFile,pDiv,identificador)
	{

       var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request(pFile+"?identificador="+identificador+"&nocache=" + Math.random(), opciones);

	}

function pruebaLink()
	{

       alert("hola");

	}






function desplazamiento(pFile,pDiv,identificador)
	{
       
       var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request(pFile+"?identificador="+identificador+"&nocache=" + Math.random(), opciones);

	}
	
	
	
	function desplazamientoFotos(pFile,pDiv)
	{
       
       var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request(pFile+"?nocache=" + Math.random(), opciones);

	}

        function cargar_popup(contador)
	{

                 div = document.getElementById('txt_acceso_video');
                 div.style.display='none';
                               
                  document.getElementById('light'+contador).style.display='block';
                  document.getElementById('fade').style.display='block';
                 
                  
	}


        
	        function registro()
	{


       div = document.getElementById('txt_acceso_video');
       div.style.display='none';

                                document.getElementById('lightRegistro').style.display='block';
                                document.getElementById('fade').style.display='block';


	}




	        function cerrar(contador)
	{

       div = document.getElementById('txt_acceso_video');
       div.style.display='block';
                               
                                document.getElementById('light'+contador).style.display='none';
                                document.getElementById('fade').style.display='none';


	}


function guardarRegistro(parametro){
var valor=parametro.validate();

if(valor==true){

var nombre=document.test.field1.value;

var apellido=document.test.field2.value;

var email=document.test.field8.value;

var dia=document.test.field59.value;

var mes=document.test.field57.value;

var departamento=document.test.departamento.value;

var provincia=document.test.provincia.value;

var movil=document.test.field3.value;

var opcion1=document.test.opcion1.checked;

var opcion2=document.test.opcion2.checked;

var opcion3=document.test.opcion3.checked;

var opcion4=document.test.opcion4.checked;



doAjax('insertarRegistro.php','nombre='+nombre+'&apellido='+apellido+'&email='+email+'&dia='+dia+'&mes='+mes+'&departamento='+departamento+'&provincia='+provincia+'&movil='+movil+'&opcion1='+opcion1+'&opcion2='+opcion2+'&opcion3='+opcion3+'&opcion4='+opcion4,'f_resultado','post','-1',null);


}



}


function guardarContacto(){
var valor=validarContrato.validate();

if(valor==true){

var nombres=document.contrato.nombres.value;

var email=document.contrato.email.value;

var departamento=document.contrato.departamento.value;


var distrito=document.contrato.distrito.value;


var provincia=document.contrato.provincia.value;

var mensaje=document.contrato.mensaje.value;

var asunto=document.contrato.asunto.value;


doAjax('insertarRegistroContacto.php','nombres='+nombres+'&email='+email+'&distrito='+distrito+'&departamento='+departamento+'&provincia='+provincia+'&mensaje='+mensaje+'&asunto='+asunto,'f_resultadoContacto','post','-1',null);


}



}


 function f_resultadoContacto(jsonText){

 var jsonDataText=JSON.parse(jsonText);
 var registro=jsonDataText.success;
 //if(registro='true'){
 //alert('Los datos se ingresaron correctamente');
 //document.contrato.nombres.value="";
 //document.contrato.email.value="";
 //document.contrato.mensaje.value="";
 //document.test.departamento.selectedIndex=0;
 //document.test.provincia.selectedIndex=0;
 //}else if(registro='false'){
 //alert('Error al ingresar informacion');
 //}

if(registro='true'){
       var opciones = {
			onSuccess: function(respuesta){
				$('parte_noticia').innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request("contactoExito.php?nocache=" + Math.random(), opciones);

}else if(registro='false'){
  alert('Error al ingresar informacion');
 }


}




 function f_resultado(jsonText){

 var jsonDataText=JSON.parse(jsonText);
 var registro=jsonDataText.success;
if(registro='true'){
   alert('Los datos se ingresaron correctamente');
   div = document.getElementById('txt_acceso_video');
   div.style.display='block';

   document.getElementById('lightRegistro').style.display='none';
   document.getElementById('fade').style.display='none';

document.test.field1.value="";

document.test.field2.value="";

document.test.field8.value="";

document.test.field59.value="";

document.test.field57.value="";

document.test.departamento.value="";

document.test.provincia.value="";

document.test.field3.value="";

document.test.opcion1.checked=false;

document.test.opcion2.checked=false;

document.test.opcion3.checked=false;

document.test.opcion4.checked=false;

document.test.field9.value="";


}else if(registro='false'){
   alert('Error al ingresar informacion');
   
}

}



 function cancelarRegistro(){


   div = document.getElementById('txt_acceso_video');
   div.style.display='block';

   document.getElementById('lightRegistro').style.display='none';
   document.getElementById('fade').style.display='none';

document.test.field1.value="";

document.test.field2.value="";

document.test.field8.value="";

document.test.field59.value="";

document.test.field57.value="";

document.test.departamento.value="";

document.test.provincia.value="";

document.test.field3.value="";

document.test.opcion1.checked=false;

document.test.opcion2.checked=false;

document.test.opcion3.checked=false;

document.test.opcion4.checked=false;

document.test.field9.value="";



}






	
	 function desplazamientoFoto(pFile,pDiv,identificador)
	{

       var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';
                                			}
		}
    new Ajax.Request(pFile+"?identificador="+identificador+"&nocache=" + Math.random(), opciones);

	}
	
function validar(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/\d/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
}

 function desplazamientoPrograma(pFile,pDiv,identificador)
	{
     
       var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request(pFile+"?identificador="+identificador+"&nocache=" + Math.random(), opciones);

	}

 function desplazamientoPartido(pFile,pDiv,identificador)
	{
        
        var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request(pFile+"?identificador="+identificador+"&nocache=" + Math.random(), opciones);

	}

function cargar_noticias(pFile,pDiv,pagina)
	{

        var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                        document.getElementById('parte_banner').style.display='none';
                                        document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request(pFile+"?pagina="+pagina+"&nocache=" + Math.random(), opciones);
	}

        function cargar_noticias_busqueda(pFile,pDiv,pagina,fecha)
	{

        var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                
                      document.getElementById('parte_banner').style.display='none';
                      document.getElementById('noticiasHistoricas').style.display='none';
			}
		}
    new Ajax.Request(pFile+"?pagina="+pagina+"&fecha=" +fecha+"&nocache=" + Math.random(), opciones);
	}

function noticia_completa(pFile,pDiv,codigo,anterior,actual,siguiente,valor)
	{
    
        var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                location.hash = "#codigo=" + codigo;
                                    document.getElementById('parte_banner').style.display='none';
                                    document.getElementById('noticiasHistoricas').style.display='none';

(function() {
   var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
   dsq.src = 'http://miguelhilario2.disqus.com/embed.js';
   (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();


var disqus_shortname = 'miguelhilario2';
(function () {
  var s = document.createElement('script'); s.async = true;
  s.src = 'http://disqus.com/forums/miguelhilario2/count.js';
  (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());

      var disqus_developer  = true;
			}
		}
    new Ajax.Request(pFile+"?codigo="+codigo+"&anterior=" + anterior+"&actual=" + actual+"&siguiente=" +siguiente+"&valor="+valor+"&nocache=" + Math.random(), opciones);
	}


function desplazamiento_noticia(pFile,pDiv,codigo,idNoticia,anterior,siguiente,actual,valor)
	{

        var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
location.hash = "#codigo=" + codigo;
                                                        document.getElementById('parte_banner').style.display='none';
                                                        document.getElementById('noticiasHistoricas').style.display='none';

(function() {
   var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
   dsq.src = 'http://miguelhilario2.disqus.com/embed.js';
   (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();


var disqus_shortname = 'miguelhilario2';
(function () {
  var s = document.createElement('script'); s.async = true;
  s.src = 'http://disqus.com/forums/miguelhilario2/count.js';
  (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());

      var disqus_developer  = true;

                        }
        }
    new Ajax.Request(pFile+"?codigo="+codigo+"&idNoticia="+idNoticia+"&anterior="+anterior+"&siguiente="+siguiente+"&actual="+actual+"&valor="+valor+"&nocache=" + Math.random(), opciones);
	}

        function noticia_completa_busqueda(pFile,pDiv,codigo,anterior,actual,siguiente,valor,fecha)
	{

        var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                location.hash = "#codigo=" + codigo;
                                    document.getElementById('parte_banner').style.display='none';
                                    document.getElementById('noticiasHistoricas').style.display='none';

(function() {
   var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
   dsq.src = 'http://miguelhilario2.disqus.com/embed.js';
   (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();


var disqus_shortname = 'miguelhilario2';
(function () {
  var s = document.createElement('script'); s.async = true;
  s.src = 'http://disqus.com/forums/miguelhilario2/count.js';
  (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());

      var disqus_developer  = true;
			}
		}
    new Ajax.Request(pFile+"?codigo="+codigo+"&anterior=" + anterior+"&actual=" + actual+"&siguiente=" +siguiente+"&valor="+valor+"&fecha="+fecha+"&nocache=" + Math.random(), opciones);
	}


function desplazamiento_noticia_busqueda(pFile,pDiv,codigo,idNoticia,anterior,siguiente,actual,valor,fecha)
	{

        var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
location.hash = "#codigo=" + codigo;
                                                        document.getElementById('parte_banner').style.display='none';
                                                        document.getElementById('noticiasHistoricas').style.display='none';

(function() {
   var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
   dsq.src = 'http://miguelhilario2.disqus.com/embed.js';
   (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();


var disqus_shortname = 'miguelhilario2';
(function () {
  var s = document.createElement('script'); s.async = true;
  s.src = 'http://disqus.com/forums/miguelhilario2/count.js';
  (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());

      var disqus_developer  = true;

                        }
        }
    new Ajax.Request(pFile+"?codigo="+codigo+"&idNoticia="+idNoticia+"&anterior="+anterior+"&siguiente="+siguiente+"&actual="+actual+"&valor="+valor+"&fecha="+fecha+"&nocache=" + Math.random(), opciones);
	}



        function desplazamientoContacto(pFile,pDiv,identificador)
	{

       var opciones = {
			onSuccess: function(respuesta){
				$(pDiv).innerHTML = respuesta.responseText;
                                document.getElementById('parte_banner').style.display='none';
                                document.getElementById('noticiasHistoricas').style.display='none';



                              validarContrato = new Validation('contrato', {immediate : true, onFormValidate : formCallback});

                                

			}
		}
    new Ajax.Request(pFile+"?identificador="+identificador+"&nocache=" + Math.random(), opciones);

	}
