
// JavaScript Document
var ER_EMAIL = /^[a-z0-9_\.\-]+@[a-z0-9_\-]+(\.[a-z0-9_\-]{2,20})*\.[a-z]{2,4}$/;
var ER_STR = /^([^ \t\n\r]([ \t\n\r]|[^ \t\n\r])*[^ \t\n\r])+$|^[^ \t\n\r]$/;
var ER_NATURAL_NOCERO = /^[1-9]+[0-9]*$/;
var ER_DECIMAL_FORMATEADO = /^([1-9][0-9]{0,2}){1}((\.[0-9]{3})|[0-9]{3})*(,[0-9]{0,2})?$/;
var SEP_AND = "|&|";
var SEP_IGUAL = "|=|";

var cambiarPaso = function(paso){
	if(paso == 'recuperar'){
		document.getElementById('logeo').style.display = 'none';
		document.getElementById('recuperar').style.display = 'block';
		if($('error'))$('error').style.display = 'none';
		if($('errorRecuperar'))$('errorRecuperar').style.display = 'none';		
	}
	else{
		document.getElementById('logeo').style.display = 'block';
		document.getElementById('recuperar').style.display = 'none';
		if($('error'))document.getElementById('error').style.display = 'none';
		if($('errorRecuperar'))document.getElementById('errorRecuperar').style.display = 'none';		
		
	}
}

function CentrarContenido(contenido){
	contenido.style.top = (YPos() + Math.floor((HScreen() - contenido.offsetHeight) / 2)) + 'px';
	contenido.style.left = (XPos() + Math.floor((WScreen() - contenido.offsetWidth) / 2)) + 'px';
}
//G
function WScreen(){ return (Nav.esIE)? document.documentElement.clientWidth : window.innerWidth; }
function HScreen(){ return (Nav.esIE)? document.documentElement.clientHeight : window.innerHeight; }
function YPos(){ return (Nav.esIE)? document.documentElement.scrollTop : window.pageYOffset; }
function XPos(){ return (Nav.esIE)? document.documentElement.scrollLeft : window.pageXOffset; }
function HBody(){ return document.documentElement.scrollHeight; }
function WBody(){ return document.documentElement.scrollWidth; }
function OcultarContenido(contenido){
	contenido.style.top = '-5000px';
	contenido.style.visibility = 'hidden';
}
function setOpacity(opa, ele){
	if(!window.innerWidth){ ele.style.filter = 'alpha(opacity='+opa+')'; }
	else{ ele.style.opacity = (opa / 100); }
}
	
function strongEaseInOut(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
	return c/2*((t-=2)*t*t*t*t + 2) + b;
}
function getElementPos(ele){
	var p = ele.style.position;
	ele.style.position = 'relative';
	var x = ele.offsetLeft;
	var y = ele.offsetTop;
	ele.style.position = p;
	return {'x':x, 'y':y};
}

