function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
  else countfield.value = maxlimit - field.value.length;
}

function popupAnunt(url) {
	newwindow=window.open(url,'name','height=400,width=600,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popupRevista(url) {
	newwindow=window.open(url,'name','height=720,width=900,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function getPost(strURL,qstr,elem) {
  var varReq = false;
  var self = this;
  // Mozilla/Safari
  if (window.XMLHttpRequest) {
      self.varReq = new XMLHttpRequest();
  }
    // IE
    else if (window.ActiveXObject) {
        self.varReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.varReq.open('POST', strURL, true);
    self.varReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    self.varReq.onreadystatechange = function() {
        if (self.varReq.readyState == 4) {
            updatepage(self.varReq.responseText,elem);
        }
    }
    self.varReq.send(qstr);
}

function updatepage(str,e){

    var el= document.getElementById(e); 
    var col='';
    if (el) {
      el.innerHTML = str;
    }
}

setInterval("getPost('/module/randomm_anunt.php','','myBox')",6000);
