////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PopUpWindow
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
function PopUpWindow(URL,Ancho,Alto) {
	Izquierda = (screen.width-Ancho)/2;
	Arriba= (screen.height-Alto)/2; 
	ventana = window.open(URL, "", 'width='+Ancho+',height='+Alto+',left='+Izquierda+',top='+Arriba+',fullscreen=no,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrolling=0,scrollbars=0');
}
function PopUpWindow2(URL,Ancho,Alto) {
	Izquierda = (screen.width-Ancho)/2;
	Arriba= (screen.height-Alto)/2; 
	ventana = window.open(URL, "", 'width='+Ancho+',height='+Alto+',left='+Izquierda+',top='+Arriba+',fullscreen=no,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrolling=1,scrollbars=1');
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ESTADOS DE LAS TABLAS DEL MENU
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MenuOverImage(Cual,Imagen){
	Cual.style.backgroundImage = "url(layout/"+Imagen+")";
	Cual.style.cursor = 'pointer';	
};
function MenuOverColor(Cual,Color){
	Cual.style.backgroundColor = Color;
	Cual.style.cursor = 'pointer';	
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// VALIDAR EMAIL
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function ValidarEmail(Email){
	if (Email.length <=8 || Email.indexOf('@') < 2 || Email.indexOf('.') > (Email.length-3)){
		return false;
	}else{
		return true;	
	};
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MOSTRAR O ESCONDER ELEMENTOS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*Contador = 0;
function MostrarEsconderr(Esconder,Link,Cuantos){
	//Abierto = (++Contador%2)?true:false;
	//
	Documento=document
	for(i=1;i<=Cuantos;i++){
		Objeto=(Documento.all)?Documento.all[Esconder+"_"+i]:Documento.getElementById(Esconder+"_"+i);	
		Objeto.style.display=(Objeto.style.display == '')?'none':'';
	}
	//
	Html = Link.inn erHTML;
	NewHtml = (Abierto)?Html.replace('open',"close"):Html.replace('close',"open");
	Link.innerHTML = NewHtml;
	NewTitle = (Abierto)?'Cerrar':'Abrir';
	Link.setAttribute('title',NewTitle);
	return false
}*/
function MostrarEsconder(Nombre,Link){
	Objeto=(document.all)?document.all[Nombre]:document.getElementById(Nombre);	
	Abierto = (Objeto.style.display == '')?true:false;
	Objeto.style.display=(Abierto)?'none':'';
	//
	Html = Link.innerHTML;
	NewHtml = (Abierto)?Html.replace('close',"open"):Html.replace('open',"close");
	Link.innerHTML = NewHtml;
	NewTitle = (Abierto)?'Abrir':'Cerrar';
	Link.setAttribute('title',NewTitle);
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LLAMAR CONTENIDO POR DEBAJO DEL AGUA
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function Ajax(){
	// MOSTRAMOS LA PANTALLA TRANSPARENTE
	document.getElementById('Pantalla').style.display = 'block';
	// CACHAMOS EL TIPO DE NAVEGADOR
	var http = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		http = new XMLHttpRequest();
	};
	// FORMAMOS EL URL CON LAS VARIABLES
	var Argumentos;
	var Url = 'ajax.php?';
	Url += 'Do='+arguments[0]+'&';
	for(var i=1; i<arguments.length; i++) {
		Url += 'Arg'+(i)+'='+arguments[i];
		Url += (arguments[i+1])?'&':'';
	};
	//alert(Url);
	//CARGAMOS EL CONTENIDO Y LO MANEJAMOS
	http.abort();
	http.open("GET", Url, true);
	http.onreadystatechange=function() {
		if (http.readyState == 4){
			if (http.status == 200){
				//alert(http.responseText);
				eval(http.responseText);
			}else{
				document.getElementById('Mensaje').innerHTML = '<H2>'+http.statusText+'<H2>';
			};
			// OCULTAMOS LA PANTALLA TRANSPARENTE
			setTimeout("document.getElementById('Pantalla').style.display = ''",500);
		};
		
	};
	http.send(null);
};