function Anthem_PreCallBack() {
			var loading = document.createElement("div");
			loading.id = "loading";
			loading.style.color = "black";
			loading.style.backgroundColor = "#e8e4cb";
			loading.style.position = "absolute";
                        loading.style.width="150px";
                        loading.style.left = findPosX(document.getElementById("guia")) +370 +"px";
			loading.style.top = findPosY(document.getElementById("guia")) +60 +"px";
			loading.style.zIndex = "9999";
                        loading.style.padding="10px";
                        loading.style.border = "solid 1px #000000";
			loading.innerHTML = "Cargando datos,<br>Espere un momento,<br>por favor...";
			document.body.appendChild(loading);
		}

		function Anthem_PostCallBack() {
			var loading = document.getElementById("loading");
			document.body.removeChild(loading);
		}

function Anthem_Error(result) {
alert('Anthem_Error was invoked with the following error message: ' + result.error);
}


function cargarseccion(pagina,lblsec,principal) {
//window.location.hash=pagina;
 Anthem_InvokePageMethod(
 'seccion',
     [pagina,lblsec,principal],
            function(result) {
              hallarbarra();
            }
        );
}

function chkbk(){
		if (window.location.hash!=""){
		cargarbk(window.location.hash.replace("#",""))
		}		
		}

function cargarbk(pagina) {
		
				Anthem_InvokePageMethod(
            'cargarbk',
            [pagina],
            function(result) {
                
            }
        );
    }

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	window.status = printstring;
	return curtop;
}

function envconsulta(){
	Anthem_InvokePageMethod(
 'consulta',
     [document.getElementById("empresa").value,document.getElementById("nombre").value,document.getElementById("apellidos").value,document.getElementById("direccion").value,document.getElementById("poblacion").value,document.getElementById("pais").value,document.getElementById("telefono").value,document.getElementById("mail").value,document.getElementById("comentarios").value],
            function(result) {
            
            }
        );
	}
function alerta(mensaje) {
alert(mensaje);
}
