// JavaScript Document
var xmlHttp
var div2show

function ajaxGetObject(pag, resDiv, sendParams)
{ 
	div2show = resDiv;
	//probar con text.length() > 50;
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
	  alert ("Your browser does not support AJAX!");
	  return;
	}
		var url = pag + sendParams;
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);

}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById(div2show).innerHTML=xmlHttp.responseText;
if (div2show == 'contenidoCentral') {
	document.getElementById('contenidoCentral').style.height = (document.getElementById(div2show).scrollHeight + 20) + "px";
	document.getElementById('divcentral').style.height = (document.getElementById(div2show).scrollHeight + 20) + "px";
	document.getElementById('columnaIzq').style.height = (document.getElementById(div2show).scrollHeight + 20) + "px";
}

}
}

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;
}
