// FUNCIION PARA VER BOTONERA FLOTANTE

function botonera(){

if(document.getElementById("bot_flotante").style.display=="block"){
document.getElementById("bot_flotante").style.display="none"
}else{
	document.getElementById("bot_flotante").style.display="block"
}

}//function botonera(){

function botonera1(){
	
document.getElementById("bot_flotante").style.display="none";		
}
	



// FIN FUNCION PARA VER BOTONERA FLOTANTE

//funcion q llama funciones
	
	function funciones(){
		
	ajaxFunction(1);
	//rota1();
	                    }				
	
	// fin funcion q llama funciones


// rota calesita del fondo


//------------------------------------------------ajax encabezado

enc = 1;
foty = 1;

function ajaxFunction_encabezado(hor1){

foty = foty + 5;
if(foty < 206){

document.getElementById("foto_enca").style.backgroundPosition="0 -" + foty + "px";

}else{//if(foty < 206){

foty = 1;

try{
 //Firefox, Opera 8.0+, Safari
  xml_encabezados=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_encabezados=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_encabezados=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_encabezados.onreadystatechange=function(){
    if(xml_encabezados.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_encabezado").innerHTML=xml_encabezados.responseText
	  }
    }



enc = enc + 1;

if(enc > hor1){
enc = 1;
}


 xml_encabezados.onreadystatechange=function(){
    if(xml_encabezados.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_encabezado").innerHTML=xml_encabezados.responseText
	  }
    }




  xml_encabezados.open("GET","encabezado.php?clave="+ enc);
  xml_encabezados.send(null);
  
}//if(foty < 206){
 
  }//function ajaxFunction_encabezado(hor1){


//------------------------------------------------fin ajax encabezado



//------------------------------------------------ajax horarios

cale = 1;


function ajaxFunction_horarios(hor){


try{
 //Firefox, Opera 8.0+, Safari
  xml_horarios=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_horarios=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_horarios=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_horarios.onreadystatechange=function(){
    if(xml_horarios.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_hora").innerHTML=xml_horarios.responseText
	  }
    }



cale = cale + 1;

if(cale > hor){
cale = 1;
}


 xml_horarios.onreadystatechange=function(){
    if(xml_horarios.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_hora").innerHTML=xml_horarios.responseText
	  }
    }




  xml_horarios.open("GET","horarios.php?clave="+ cale);
  xml_horarios.send(null);
  

  
  }


//------------------------------------------------fin ajax horarios





//------------------------------------------------ajax noticias

cta_not = 1;


function ajaxFunction_noticias(valor0){
try{
 //Firefox, Opera 8.0+, Safari
  xml_noticias=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_noticias=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_noticias=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_noticias.onreadystatechange=function(){
    if(xml_noticias.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_noti").innerHTML=xml_noticias.responseText
	  }
    }







/*
if(i==4){
      i=1;
        }
*/
//alert(lo);
 xml_noticias.onreadystatechange=function(){
    if(xml_noticias.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_noti").innerHTML=xml_noticias.responseText
	  }
    }

cta_not = valor0;


  xml_noticias.open("GET","noticias.php?pagineo0="+ cta_not);
  xml_noticias.send(null);
  

  
  }


//------------------------------------------------fin ajax noticias




//------------------------------------------------ajax noticias varias

cta_not = 1;


function ajaxFunction_noticias1(valor0,valor1){



try{
 //Firefox, Opera 8.0+, Safari
  xml_noticias1=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_noticias1=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_noticias1=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_noticias1.onreadystatechange=function(){
    if(xml_noticias1.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_noti_1").innerHTML=xml_noticias1.responseText
	  }
    }







/*
if(i==4){
      i=1;
        }
*/
//alert(lo);
 xml_noticias1.onreadystatechange=function(){
    if(xml_noticias1.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_noti_1").innerHTML=xml_noticias1.responseText
	  }
    }

cta_not_1 = valor0;
sec_not = valor1;

  xml_noticias1.open("GET","noticias_varias.php?pagineo0=" + cta_not_1  + "&seccion_t=" + sec_not);
  xml_noticias1.send(null);
  


  }


//------------------------------------------------fin ajax noticias varias


//------------------------------------------------ajax pagineo x3

cta_pag_prog = 1;


function ajaxFunction_pag_x3(valorcta_pag_x3){



try{
 //Firefox, Opera 8.0+, Safari
  xml_pag_x3=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_pag_x3=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_pag_x3=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_pag_x3.onreadystatechange=function(){
    if(xml_pag_x3.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_x3").innerHTML=xml_pag_x3.responseText
	  }
    }







/*
if(i==4){
      i=1;
        }
*/
//alert(lo);
 xml_pag_x3.onreadystatechange=function(){
    if(xml_pag_x3.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_x3").innerHTML=xml_pag_x3.responseText
	  }
    }

cta_pag_x3 = valorcta_pag_x3


  xml_pag_x3.open("GET","x3_2.php?pagineo0="+ cta_pag_x3);
  xml_pag_x3.send(null);
  

  
  }


//------------------------------------------------fin ajax pagineo x3





//------------------------------------------------ajax seccion fotos




function ajaxFunction3(valor1){
try{
 //Firefox, Opera 8.0+, Safari
  xml=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml.onreadystatechange=function(){
    if(xml.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("foto").innerHTML=xml.responseText
	  }
    }



 xml.onreadystatechange=function(){
    if(xml.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("foto").innerHTML=xml.responseText
	  }
    }






clave = valor1;

  xml.open("GET","fotos_ajax.php?clave=" + clave);
  xml.send(null);
  
//ajaxFunction1(num_video);
  
  }


//------------------------------------------------fin ajax seccion fotos

//------------------------------------------------ajax videito PROGRAMAS

num_video= 1;


function ajaxFunction_videito(valor1,valor2){
try{
 //Firefox, Opera 8.0+, Safari
  xml_videito=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_videito=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_videito=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_videito.onreadystatechange=function(){
    if(xml_videito.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("videito").innerHTML=xml_videito.responseText
	  }
    }



 xml_videito.onreadystatechange=function(){
    if(xml_videito.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("videito").innerHTML=xml_videito.responseText
	  }
    }






if(valor1 == "avanza"){
num_video= num_video + 1;
}

if(valor1 == "retrocede"){
num_video= num_video - 1;
}



if(num_video > valor2){
num_video=1
}

if(num_video == 0){
num_video= valor2;
}

  xml_videito.open("GET","videitos.php?numero=" + num_video);
  xml_videito.send(null);
  
//ajaxFunction1(num_video);
  
  }


//------------------------------------------------fin ajax videito PROGRAMAS

//------------------------------------------------ajax videito ONBOARD

num_video1= 1;


function ajaxFunction_videito1(valor1,valor2){
try{
 //Firefox, Opera 8.0+, Safari
  xml_videito=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_videito=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_videito=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_videito.onreadystatechange=function(){
    if(xml_videito.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("videito1").innerHTML=xml_videito.responseText
	  }
    }



 xml_videito.onreadystatechange=function(){
    if(xml_videito.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("videito1").innerHTML=xml_videito.responseText
	  }
    }






if(valor1 == "avanza"){
num_video1= num_video1 + 1;
}

if(valor1 == "retrocede"){
num_video1= num_video1 - 1;
}



if(num_video1 > valor2){
num_video1=1
}

if(num_video1 == 0){
num_video1= valor2;
}

  xml_videito.open("GET","videitos1.php?numero=" + num_video1);
  xml_videito.send(null);
  
//ajaxFunction1(num_video);
  
  }


//------------------------------------------------fin ajax videito ONBOARD


//------------------------------------------------ajax videito VARIOS

num_video2= 1;


function ajaxFunction_videito2(valor1,valor2){
try{
 //Firefox, Opera 8.0+, Safari
  xml_videito=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_videito=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_videito=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_videito.onreadystatechange=function(){
    if(xml_videito.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("videito2").innerHTML=xml_videito.responseText
	  }
    }



 xml_videito.onreadystatechange=function(){
    if(xml_videito.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("videito2").innerHTML=xml_videito.responseText
	  }
    }






if(valor1 == "avanza"){
num_video2= num_video2 + 1;
}

if(valor1 == "retrocede"){
num_video2= num_video2 - 1;
}



if(num_video2 > valor2){
num_video2=1
}

if(num_video2 == 0){
num_video2= valor2;
}

  xml_videito.open("GET","videitos2.php?numero=" + num_video2);
  xml_videito.send(null);
  
//ajaxFunction1(num_video);
  
  }


//------------------------------------------------fin ajax videito VARIOS





//------------------------------------------------ajax video progrma




function ajaxFunction_video(valor00){
//alert(valor00);
try{
 //Firefox, Opera 8.0+, Safari
  xml_video=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_video=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_video=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_video.onreadystatechange=function(){
    if(xml_video.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("video_programa").innerHTML=xml_video.responseText
	  }
    }







/*
if(i==4){
      i=1;
        }
*/
//alert(lo);
 xml_video.onreadystatechange=function(){
    if(xml_video.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("video_programa").innerHTML=xml_video.responseText
	  }
    }

video = valor00;


  xml_video.open("GET","video_programa.php?clave="+ video);
  xml_video.send(null);
  

  
  }


//------------------------------------------------fin ajax video programa

    
//------------------------------------------------ajax counter

//la= 1;

/*
function ajaxFunction4(){
try{
 //Firefox, Opera 8.0+, Safari
  xml=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml.onreadystatechange=function(){
    if(xml.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("counter").innerHTML=xml.responseText
	  }
    }






*/
/*
if(i==4){
      i=1;
        }
*/

/*
//alert(lo);
 xml.onreadystatechange=function(){
    if(xml.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("counter").innerHTML=xml.responseText
	  }
    }


la = la + 1;

if(la == 4){
la=1
}

if(la == 0){
la=3
}

  xml.open("GET","counter.php?clave="+ la);
  xml.send(null);
  

 
  }
*/

//------------------------------------------------fin ajax counter

//------------------------------------------------ajax videos varios




function ajaxFunction_otros(valor00){
//alert(valor00);
try{
 //Firefox, Opera 8.0+, Safari
  xml_otros=new XMLHttpRequest();
  }
catch (e){
 // Internet Explorer
  try{
    xml_otros=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e){
    try{
      xml_otros=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Tu navegador no soporta Ajax");
       }
    }
  }
xml_otros.onreadystatechange=function(){
    if(xml_otros.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_prog1").innerHTML=xml_otros.responseText
	  }
    }







/*
if(i==4){
      i=1;
        }
*/
//alert(lo);
 xml_otros.onreadystatechange=function(){
    if(xml_otros.readyState==4){
      
	 // document.write(xml.responseText);
       document.getElementById("pp_prog1").innerHTML=xml_otros.responseText
	  }
    }

video = valor00;


  xml_otros.open("GET","otros_videos1.php?clave="+ video);
  xml_otros.send(null);
  

  
  }


//------------------------------------------------fin ajax video varios



//CODIGO PARA EVITAR EL CLICK PARA ACTIVAR

var jActivating =
{

	/**
	 * Declare constants
	 * IS_MSIE	checks for Internet Explorer 6 and later versions
	 * TAGS		array with affected HTML tags
	 */
	IS_MSIE : (document.removeNode && document.createAttribute) ? true : false,
	TAGS : ['object', 'embed', 'applet'],
	
	
	/**
	 * Activates embedded content reinserting it.
	 * @return void
	 */
	activateContent : function()
	{
		var i = 0;
		for(var _tagName; _tagName = jActivating.TAGS[i]; i++)
		{
			var j = 0;
			for(var _node; _node = document.getElementsByTagName(_tagName)[j]; j++)
			{
				if(jActivating.IS_MSIE)
				{
					jActivating.reinsertHtml(_node);
				}
				else
				{
					jActivating.reinsertNode(_node);
				}
			}
			
		}
		jActivating = null;
	},
	
	
	/**
	 * Sets outerHTML property.
	 * @param object	- The node
	 * @return void
	 */
	reinsertHtml : function(_node)
	{
		var _htmlCode = jActivating.getHtmlCode(_node);
		if(_htmlCode)
		{
			_node.outerHTML = _htmlCode;
		}
	},
	
	
	/**
	 * Replaces the node for a clone.
	 * @param object - The original node
	 * @return void
	 */
	reinsertNode : function(_node)
	{
		var _clone = _node.cloneNode(true);
		var _parent = _node.parentNode;
		if(_clone && _parent)
		{
			_parent.replaceChild(_clone, _node);
		}
	},
	
	
	/**
	 * Retrieves the object and its content in HTML.
	 * @param object - The analyzed node
	 * @return string - The HTML received, NULL for malformed syntax (end tag)
	 */
	getHtmlCode : function(_node)
	{
		var _htmlCode = _node.outerHTML;
		var _name = _node.nodeName.toLowerCase();
		if(_name == 'embed')
		{
			return _htmlCode;
		}
		if(_name == 'object' || _name == 'applet')
		{
			var _startTag = _htmlCode.substr(0, _htmlCode.indexOf('>') + 1);
			var _endTag = _htmlCode.substr(_htmlCode.length - 9).toLowerCase();
			// Filters malformed syntax for avoid unexpected results
			if(_endTag != '</object>' && _endTag != '</applet>')
			{
				return null;
			}
			var _innerHtml = jActivating.getInnerHtml(_node);
			_htmlCode = _startTag + _innerHtml + _endTag;
			return _htmlCode;
		}
	},
	
	
	/**
	 * Retrieves the HTML between start and end tags of the object.
	 * @param object - The analyzed node
	 * @return string - The HTML received
	 *
	 * NOTE: the innerHTML property isn't used because Internet Explorer
	 * sometimes returns a empty result.
	 */
	getInnerHtml : function(_node)
	{
		var _innerHtml = '';
		var i = 0;
		for(var _childNode; _childNode = _node.childNodes[i]; i++)
		{
			_innerHtml += _childNode.outerHTML;
		}
		return _innerHtml;
	}
}

// Execute script only for Internet Explorer (6+) and Opera (9+)
if(jActivating.IS_MSIE)
{
	jActivating.activateContent();
}
else if(window.opera)
{
	document.addEventListener('DOMContentLoaded', jActivating.activateContent, false);
}


//FIN CODIGO PARA EVITAR EL CLICK PARA ACTIVAR



//-----------------envia mail

function envia(){

if (document.gorally.nombre.value.length==0){
alert("debe colocar un nombre");
document.gorally.nombre.focus();
document.gorally.nombre.className="borde1";
return 0;
}else{
    document.gorally.nombre.className="borde2";
     }



if (document.gorally.mail.value.length==0){
alert("debe colocar un mail");
document.gorally.mail.focus();
document.gorally.mail.className="borde1";
return 0;
}else{
//    alert(document.gorally.mail.value);
	document.gorally.mail.className="borde2";
    
	}

if(validacion(document.gorally.mail.value)==false){
return 0;
}
//valida direccion de mail-------------------------------------

function validacion(dire)
{
var email = dire;
var verif = /^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
if (verif.exec(email) == null)
{
alert("Su email es incorrecto");
document.gorally.mail.focus();
return false;
}
else
{
//alert("Su email es correcto");

return true;
}

}



//fin valida direccion de mail-------------------------------------



if (document.gorally.cuerpo.value.length==0){
alert("debe colocar un texto");
document.gorally.cuerpo.focus();
document.gorally.cuerpo.className="borde1";
return 0;
}else{
    document.gorally.cuerpo.className="borde2";
     }



document.gorally.submit();




 
}

//-------------------------fin envia mail


//----------ROBA PANTALLA

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

//----------FIN ROBA PANTALLA



