/* Funciones necesarias para el funcionamiento del portal de FONATUR */
//window.name="homefonatur";
var attr = "resizable=no,scrollbars=no,status=no"
var g_wndSupport = null;
urlext = function(v){
	//alert("hola   "+v);
	if(v){
		var nuevo = window.open(v);
	}
}

function fon_video(){
	win_video=window.open("fon_video.html","fon_video","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=150");
	win_video.focus()
}
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 fmt.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 + "&amp;cve_sec=" + sec + "&amp;inciso=" + ind1 + "&amp;indice=" + ind2 + "&amp;subindice=" + ind3  + "&amp;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_pi()
{
win_pi=window.open("/es/PI/PI_banner_promo.html","pipromo","resizable=no,menubar=no,location=No,toolbar=no,scrollbars=No,status=no,width=470,height=320");
win_pi.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()
}
function MM_openWindow(mod,sec,ind1,ind2,ind3,bases) { //v2.0
  var theURL = "/es/_soporte/abre_contenido_ind_frame.asp?modulo=" + mod + "&amp;cve_sec=" + sec + "&amp;inciso=" + ind1 + "&amp;indice=" + ind2 + "&amp;subindice=" + ind3  + "&amp;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 MM_openWindowNormInt(sec) { //v2.0
//  var theURL = "abre_contenido.asp?pro_sec=" + sec ;
  var theURL = "/es/_soporte/pop_procedimiento.asp?pro_sec=" + sec ;
//  alert("theURL="+theURL); 
  var ventana = window.open(theURL,'POLITICAS','resizable=yes,screenX=10,screenY=10,width=700,height=600');
  ventana.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); 
	}
} 
/******/
function Abre_doc_bar(v_doc,v1,v2,scr,loc,st,res,tool,menu) { //v2.0
  //Prametro para liga con apertura de window.open                     Abre_doc_bar(v_doc,v1,v2, scrollbars, location, status, resizable, toolbar, menubar) { //v2.0
  //                                                                                Abre_doc_bar(v_doc,v1,v2, scr, loc, st, res, tool, menu) { //v2.0
  //window.open(v_doc,'docnuevo','toolbar=no,location=NO,scrollbars=no,resizable=no,width='+v1+',height='+v2);
  win_bar=window.open(v_doc,'docnuevo','toolbar='+tool+',menubar='+menu+',location='+loc+',scrollbars='+scr+',resizable='+res+',status='+st+',width='+v1+',height='+v2);
  win_bar.focus()
}
