function Anthem_PreCallBack() {
			var centroh=getPageSize();
var scr=getPageScroll();
var centrohor=scr[1]+(centroh[3]/2)-75;
			var loading = document.createElement("div");
			loading.id = "cargando";
			loading.style.color = "black";
			loading.style.backgroundColor = "#e8e4cb";
			loading.style.position = "absolute";
            loading.style.width="150px";
            loading.style.left = (centroh[0]/2)-75+"px";
			loading.style.top = centrohor +"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() {
			if (document.getElementById("cargando")){
				var loading = document.getElementById("cargando");
			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) {

		Anthem_InvokePageMethod(
            'seccion',
            [pagina,lblsec],
            function(result) {
 
            }
        );
    }
	

function sendconsulta(){
	Anthem_InvokePageMethod(
            'consulta',
            [document.getElementById("nombre").value,document.getElementById("apellidos").value,document.getElementById("telefono").value,document.getElementById("mail").value,document.getElementById("comentario").value],
            function(result) {
 alert("Su consulta se ha enviado correctamente");
            }
        );	
}

function alerta(mensaje){
alert(mensaje);
}





function getPageScroll(){

	var xScroll, yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;	
	}

	arrayPageScroll = new Array(xScroll,yScroll) 
	return arrayPageScroll;
}
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

//	console.log("xScroll " + xScroll)
//	console.log("windowWidth " + windowWidth)

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
//	console.log("pageWidth " + pageWidth)

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

