// JavaScript Document

function ShowNoticias(){
	if (document.getElementById('noticiasTodas').style.display=='inline') {
		document.getElementById('noticiasTodas').style.display='none';
		document.getElementById('g_body').style.display='inline';
		} else {
		document.getElementById('g_body').style.display='none';
		document.getElementById('noticiasTodas').style.display='inline';
		}
}
function cambiaColor(src,flag) {
	//src.style.cursor='pointer';
	if (flag) {
		color =  '#EBECF3';
		border = '#666666';
	}
	else {
		color =  '#FFFFFF';
		border = '#FFFFFF';
	}
	src.style.backgroundColor = color;
	src.style.borderColor = border;
}

//Buscador
var xmlHttp

function showResult(str)
{
	if (str.length == 0) { 
	 //document.getElementById("g_body").innerHTML="";
	 //document.getElementById("g_body").style.border="0px";
	document.forms.f_buscar.q.focus();
	document.forms.f_buscar.q.focus();
	 return
	 } else {
		xmlHttp=GetXmlHttpObject()
		
		if (xmlHttp==null) {
		 alert ("Browser does not support HTTP Request")
		 return
		 } 
		
		var url="buscador.php"
		url=url+"?q="+str
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=stateChanged 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("g_body").innerHTML=xmlHttp.responseText;
	//document.getElementById("g_body").style.border="1px solid #A5ACB2";
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

//Buscador
