var m;
var max;

function objetoAjax(){
 var xmlhttp=false;
  try{
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  }catch(e){
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   }catch(E){
    xmlhttp = false;
   }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
   xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

function pagina(n,maximo){

max=maximo;

 //alert("corrector:"+corrector+"\nPág: "+nropagina+"\n"+"talla: "+talla+"\n"+"oferta: "+oferta+"\n"+"estilo: "+estilo+"\n"+"marca: "+marca+"\n"+"sexo: "+sexo); 
 //donde se mostrará los registros

 //if (marcaCambia) cambiaMarca(estilo,talla);
 
 divContenido = document.getElementById('noticias');
 
 ajax=objetoAjax();
 
 ajax.open("POST", "noticia.php?id="+n+'&max='+max);

 ajax.onreadystatechange=function() {
  if (ajax.readyState==4) {
   //mostrar resultados en esta capa
	//alert (ajax.responseText);
   divContenido.innerHTML = ajax.responseText
  }
 }

 ajax.send(null);

 if(n==(max)){n=0}
 m=n;

 //var timer = setTimeout("pagina("+(n+1)+")",15000);


}

function timedCount()
{
t=setTimeout("timedCount()",15000)
pagina((m+1),max);
}

var Ventana2;

function openIT(theURL,W,H, wname,S) {
  var prop;
  
  if (S!='no') S="yes"

  prop = "width="+W+",height="+H+",scrollbars="+S;


if (Ventana2) {
    if (Ventana2.closed) {
      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      Ventana2.focus();
    }
    else {
      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      Ventana2.focus();
    }
  }
  else {
      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      Ventana2.focus();
  }
}