var enProceso = false;

function nuevoAjax()
{ 
	/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo */
	var xmlhttp=false;
	try
	{
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			// Creacion del objet AJAX para IE
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(E)
		{
			if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
		}
	}
	return xmlhttp; 
}

function cargaContenido( div, url ) {
	var valor ;
	var url ;
	var http=nuevoAjax();
	if (!enProceso && http) {
		document.getElementById(div).style.visibility="visible";
		document.getElementById(div).innerHTML = "<table><tr><td width='100%'  height='100%' align='center' valign='middle' bgcolor='#FFFFFF' ><img src='loading5.gif'></td></tr></table>"
		//url = "ajax.carga.php?ID=" + param; 
   		http.open("GET", url); 
   		http.onreadystatechange = function() { 
		   		if (http.readyState == 4) {
					document.getElementById(div).innerHTML = http.responseText;
        		} 
		   	} 
		http.send(null); 
	}
}

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight) {
	var a_bool_scrollbars =1;
	var a_bool_resizable =1;
	var a_bool_menubar =0;
	var a_bool_toolbar =0;
	var a_bool_addressbar =0;
	var a_bool_statusbar =1;
	var a_bool_fullscreen =0;
	var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
	var int_windowTop = (screen.height - a_int_windowHeight) / 2;
	var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
	var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
	if (parseInt(navigator.appVersion) >= 4) {
		obj_window.window.focus();
	}
}
function popup(url, width, height)
{
    if (!width) {
        width = 600;
    }
    if (!height) {
        height = 500;
    }

    var name = (new Date()).getTime();
    var param = "toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",left=0,top=0";
    var win = window.open(url, name, param);
    if (!win) {
        alert("A popup window could not be opened. Your browser may be blocking popups for this application.");
    } else {
        if (typeof win.name == 'undefined') {
            win.name = name;
        }
        if (typeof win.opener == 'undefined') {
            win.opener = self;
        }
    }

    return win;
}











