/* Funciones necesarias para el funcionamiento del portal de FONATUR */
function Abre_documento(v_doc) { //v2.0
//mms://FONA234/         Difusión_muestra_r0.asx
  window.open(v_doc,'docnuevo','toolbar=no,location=NO,scrollbars=yes,resizable=yes,width=750,height=600');
}
function Abre_documento_2(v_doc) { //v2.0
//mms://FONA234/         Difusión_muestra_r0.asx
  window.open(v_doc,'docnuevo','toolbar=no,location=NO,scrollbars=yes,resizable=yes,width=800,height=700');
}
function Abre_ventana(v_doc,v_1,v_2) { //v2.0
  window.open(v_doc,'ventananva','toolbar=no,location=NO,scrollbars=no,resizable=no,width=' + v_1 + ',height=' + v_2 );
}

/* 	
Abre un documento o sitio fuera del dominio de FONATUR 
previa confirmación del usuario
*/
function abre_doc_ext(v_doc,v1,v2,scr,loc,st,res,tool,menu) {
	if(confirm("Se abrirá un sitio fuera del dominio de FONATURCONSTRUCTORA.gob.mx.\n¿Desea Continuar?")){
		window.open(v_doc,'docnuevo','toolbar='+tool+',menubar='+menu+',location='+loc+',scrollbars='+scr+',resizable='+res+',status='+st+',width='+v1+',height='+v2);
	}
}
/* 	
Abre contenido de un índice en una ventana de  750 x 600
*/
function abre_contenido(mod,sec,ind1,ind2,ind3,bases) {
  var theURL = "/es/_soporte/pop_contenido.asp?modulo=" + mod + "&cve_sec=" + sec + "&inciso=" + ind1 + "&indice=" + ind2 + "&subindice=" + ind3  + "&bases=" + bases ;
  win1=window.open(theURL,'licena','menubar=No,toolbar=No,resizable=yes,screenX=10,screenY=10,width=750,height=600,status=no');
  win1.focus()
}

function open_encuesta()
{
win_encsat=window.open("/es/visitantes/encuesta_de_satisfaccion.htm","encuesta","resizable=yes,menubar=no,location=center,toolbar=no,scrollbars=no,width=350,height=325");
win_encsat.focus()
}

function open_mail()
{
win_mail=window.open("https://correo.fonatur.gob.mx/owa","mailowa","resizable=yes,menubar=no,location=no,toolbar=no,scrollbars=No,width=850,height=700");
win_mail.focus()
}


/* 
** FUNCION QUE VALIDA EL INGRESO DE CARACTERES EN UN TEXT 
** SOLO PASAR COMO PARAMETROS EL EVENTO Y TIPO A VALIDAR
** EJEMPLO: EN EL EVENTO OnKeyPress="return ValidaInput(event,'LETRAS')" DEL TEXT
*/
function ValidaInput(e,tipo)
{ 
	if (tipo == "LETRAS")
	{
    	tecla = (document.all) ? e.keyCode : e.which; 
    	if (tecla==8) return true; 
    	patron =/[A-Za-z\s]/; // solo letras y espacio
    	te = String.fromCharCode(tecla); 
    	return patron.test(te); 
	}
	if (tipo == "NUMEROS")
	{
    	tecla = (document.all) ? e.keyCode : e.which; 
    	if (tecla==8) return true; 
    	patron = /\d/; // Solo números
    	te = String.fromCharCode(tecla); 
    	return patron.test(te); 
	}
	if (tipo == "LETNUM")
	{
    	tecla = (document.all) ? e.keyCode : e.which; 
    	if (tecla==8) return true; 
		patron = /[A-Za-z\s\d]/; // Solo números, letras y espacio
    	te = String.fromCharCode(tecla); 
    	return patron.test(te); 
	}
	if (tipo == "MAIL")
	{
		tecla = (document.all) ? e.keyCode : e.which; 
    	if (tecla==8) return true; 
		patron = /[A-Za-z-@.\s\d\w]/; //letras,numeros,espacio,guion,guion bajo y punto
    	te = String.fromCharCode(tecla); 
		return patron.test(te); 
	}
} 
/******/
