/**
 * @author isaac
 */
var xmlHttp;
function pelicula(index){
  xmlHttp=getXmlHttpObject();
  if(xmlHttp==null) { return; }
  var url='./configdatos/CinepolisElPozo/datos/datos.php?index='+index;
  url=url+'&sid='+Math.random();
  xmlHttp.onreadystatechange=function()
  {
    if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete')
    {
        document.getElementById('ocio').innerHTML=xmlHttp.responseText;

    }else{
		document.getElementById('ocio').innerHTML="<img src=\"./images/cargando.gif\"><span style=\"color:#f00;\">Cargando...</span>";	
	}
  };
  xmlHttp.open('GET',url,true);
  xmlHttp.send(null);
}


function enviarmail(){
  
 var mail;
  mail=document.getElementById('txtmail').value;
  if(mail=="" || mail.charAt(0)==" " || mail.indexOf("@")==-1) {
    document.getElementById('respuestasubmitmail').innerHTML="<label style=\"color:#f00;font-size:11px;\">correo incorrecto!</label>";    
    return;
  }
  
  xmlHttp=getXmlHttpObject();
  if(xmlHttp==null){
    return;
  }
  
  var url;
  url="./configdatos/cliente/registromail.class.php";
  xmlHttp.open("POST",url,true);
  xmlHttp.onreadystatechange=function(){
    if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete'){
      document.getElementById('respuestasubmitmail').innerHTML="<label style=\"color:#f00;font-size:10px;\">"+xmlHttp.responseText+"</label>";
    }
    else{
      document.getElementById('respuestasubmitmail').innerHTML="<img src=\"./images/cargando.gif\"><label style=\"color:#f00;font-size:10px;\">registrando...</label>";    
    }    
  };
  xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  xmlHttp.send("mail="+mail);

}




function stateChanged()
{
  if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete')
    document.getElementById('ocio').innerHTML=xmlHttp.responseText;
  else
    document.getElementById('ocio').innerHTML='procesando...';
}

function getXmlHttpObject()
{
  var xmlHttp=null;
  try
  {
    xmlHttp= new XMLHttpRequest();
  }
  catch(e)
  {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  return xmlHttp;
  
}
