//************************************************************************
// HTTP REQUEST **********************************************************
//************************************************************************
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var AjaxA = getHTTPObject();

//************************************************************************
// HTTP REQUEST **********************************************************
//************************************************************************

//*********************************************************************************

// PRELOAD DE IMAGENS ----------------------------------------------
<!--
<!-- Begin
image1 = new Image();
image1.src = "images/2009/bg_menu.gif";
image2 = new Image();
image2.src = "images/2009/bg_menu2.gif";
image3 = new Image();
image3.src = "images/2009/bg_menu3.gif";
image4 = new Image();
image4.src = "images/2009/bg_menu_ativo.gif";
image5 = new Image();
image5.src = "images/2009/bg_menu2_ativo.gif";
image6 = new Image();
image6.src = "images/2009/bg_menu3_ativo.gif";
// End -->
//-->
//*********************************************************************************

//*********************************************************************************
// BUSCAR NOTÍCIAS ----------------------------------------------
function busca_not(){

if(document.busca.word_key.value == ''){
	alert('Digite alguma palavra para pesquisar');
	document.busca.word_key.focus;
}else{
   
	if (document.busca.col[0].checked == true){
	document.location.href = 'pesquisa.php?word_key='+document.busca.word_key.value+'&col_id=0';
	}
	if (document.busca.col[1].checked == true){
	document.location.href = 'http://www.google.com/search?q='+document.busca.word_key.value+'&hl=pt-BR';
	}	
}
}
//*********************************************************************************

// POP-UPS ----------------------------------------------
function page_less(url, largura, altura) {
  var url;
  
  var esquerda = (screen.width - largura)/2;
  var topo = (screen.height - altura)/2;
  window.open(url,'win','height=' + altura + ', width=' + largura + ', top=' + topo + ', left=' + esquerda);
}
//*********************************************************************************


// COMENTAR ----------------------------------------------
function comentar2009() {

	document.getElementById('nome').focus();
}

function comentar(col_id, mat_id,mat_titulo) {

  var url;
  var largura = 250;
  var altura = 450;
  
  url = "comentar.php?col_id="+col_id+"&mat_id="+mat_id+"&mat_titulo="+mat_titulo;

  var esquerda = (screen.width - largura)/2;
  var topo = (screen.height - altura)/2;
  window.open(url,'win','height=' + altura + ', width=' + largura + ', top=' + topo + ', left=' + esquerda); 
}
//*********************************************************************************


// INDICAR ----------------------------------------------
function indicar2009() {

	document.getElementById('indicar').style.visibility="visible";
}
function indicar(col_id, mat_id,mat_titulo) {

  var url;
  var largura = 250;
  var altura = 370;
  
  url = "indicar.php?col_id="+col_id+"&mat_id="+mat_id+"&mat_titulo="+mat_titulo;

  var esquerda = (screen.width - largura)/2;
  var topo = (screen.height - altura)/2;
  window.open(url,'win','height=' + altura + ', width=' + largura + ', top=' + topo + ', left=' + esquerda); 
}
//*********************************************************************************



// NOTÍCIAS ANTERIORES ----------------------------------------------
function noticias_col(col_id,page)
{
	
	document.getElementById("anteriores_col").innerHTML = "<p>Carregando...</p>";
	AjaxA.open("GET", "noticias_ant.php?id="+col_id+"&page="+page, true);
    AjaxA.onreadystatechange=function(){
        if(AjaxA.readyState==4){
	document.getElementById("anteriores_col").innerHTML = '';
	document.getElementById("anteriores_col").innerHTML = AjaxA.responseText;
        }
    }
    AjaxA.send(null)
}
//*********************************************************************************
