function findObj(theObj, theDoc){
  var p, i, foundObj;
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  return foundObj;
}


function ajaxobj() {
	/*try {
		_ajaxobj = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			_ajaxobj = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			_ajaxobj = false;
		}
	}

	if (!_ajaxobj && typeof XMLHttpRequest!='undefined') {
		_ajaxobj = new XMLHttpRequest();
	}

	return _ajaxobj;
	*/
	XMLHttp = false;
	if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	}else if(window.ActiveXObject) {
		var versiones = ['Msxml2.xmlhttp.7.0','Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP'];
		for(var i=0;i<versiones.length;i++){
			try
			{
				XMLHttp = new ActiveXObject (versiones[i]);
				if(XMLHttp){
					return XMLHttp;
					break;
				}	
			} catch (e){}; 
			
		}
	}

}

function sinc(URL,DIV) {
	ajax = ajaxobj();
	ajax.open("GET", URL, true);

	ajax.onreadystatechange = function() {
		switch(ajax.readyState) {
			case 1: 
				findObj(DIV).innerHTML = "Cargando...";
				break;
				
			case 4: 
				findObj(DIV).innerHTML = ajax.responseText;
				break;
		}
	}
	ajax.send(null);
}