function nuevoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}                   
function cargarContenido(){

	var txtResult, txtLogin, txtPassword, IdOpportunity, contenedor;
	txtResult      = document.getElementById('txtResult');
	txtLogin       = document.getElementById('txtLogin').value;
	txtPassword    = document.getElementById('txtPassword').value;
	IdOpportunity  = document.getElementById('IdOpportunity').value;
	
	ajax=nuevoAjax();
	txtResult.innerHTML = "<font color=red>Please wait while processing...</font>";
	document.getElementById('tablalogin').style.display = 'none';
	document.getElementById('txtLogin').value   = '';
	document.getElementById('txtPassword').value= ''
	document.getElementById('txtResult').style.display = 'block';

	ajax.open("POST", "/proactel/admin_executive/ApplyCandidate.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			txtResult.innerHTML = ajax.responseText
			document.getElementById('tablalogin').style.display = 'none';
			document.getElementById('txtLogin').value   = '';
			document.getElementById('txtPassword').value= ''
			document.getElementById('txtResult').style.display = 'block';
	
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("txtLogin="+txtLogin+"&txtPassword="+txtPassword+"&IdOpportunity="+IdOpportunity)
}
function mostrarOcultarTablas(id){
	mostrado=0;
	elem = document.getElementById(id);
	if(elem.style.display=='block')mostrado=1;
		elem.style.display='none';
	if(mostrado!=1)
		elem.style.display='block';
		
	document.getElementById('txtResult').innerHTML='';	
}


