function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function EvaluarCampos(formulario) {	
	camposTexto = document.getElementById(formulario).elements;	
	switch(formulario){		
		case 'frmboletin':
			nfoconom=0;
			nfocoema=0;
			errbole = new Array("Los Siguientes Errores se Presentaron\n");
			nerr=0;
			//nombre obligatorio
			if(ValidarVacio(camposTexto[0].value)==false){				
				nerr++;
				nfoconom=1;
				errbole[nerr]="- Nombre es un campo obligatorio\n";
			}
			if(ValidarVacio(camposTexto[1].value)==false){				
				nerr++;
				nfocoema=1;
				errbole[nerr]="- Correo es un campo obligatorio\n";
			}else{
				//El valor debe ser mayor a 0
				if(ValidarEmail(camposTexto[1].value)==false){
					nerr++;
					nfocoema=1;
					errbole[nerr]="- Correo tiene formato incorrecto\n";
				}
				
			}
			if(nerr>0){				
				ManejoErrores(errbole);
				if(nfoconom==1){
					TomarFoco(camposTexto[0].name);
				}else if(nfocoema==1){					
					TomarFoco(camposTexto[1].name);					
				}
			}else{
				//alert('Correcto todo y envia');
				enviarDatosBoletin(); return false
			}
		break;
		case 'frmbuscar':
			nfocobus=0;
			errbusc = new Array("Los Siguientes Errores se Presentaron\n");
			nerr=0;
			//nombre obligatorio
			if(ValidarVacio(camposTexto[0].value)==false){				
				nerr++;
				nfocobus=1;
				errbusc[nerr]="- Buscar es un campo obligatorio\n";
			}
			if(nerr>0){				
				ManejoErrores(errbusc);
				if(nfocobus==1){
					TomarFoco(camposTexto[0].name);
				}
			}else{
				//alert('Correcto todo Buscar y hace el submit. Existe formulario: '+document.getElementById('frmbuscar'));
				document.getElementById('frmbuscar').action="buscar.php";
				document.getElementById('frmbuscar').submit();
			}
		break;
		case 'frmcontact':
		
			nfoconom=0;
			nfocoema1=0;
			nfocotel=0;
			nfocociu=0;
			nfocodep=0;
			nfocomen=0;
			nfococel=0;
			
			errcont = new Array("Los Siguientes Errores se Presentaron\n");
			nerr=0;
			//nombre obligatorio
			if(ValidarVacio(camposTexto[0].value)==false){				
				nerr++;
				nfoconom=1;
				errcont[nerr]="- Nombre es un campo obligatorio\n";
			}
			if(ValidarVacio(camposTexto[2].value)==false){				
				nerr++;
				nfocoema1=1;
				errcont[nerr]="- Correo es un campo obligatorio\n";
			}else{
				//El valor debe ser mayor a 0
				if(ValidarEmail(camposTexto[2].value)==false){
					nerr++;
					nfocoema1=1;
					errcont[nerr]="- Correo tiene formato incorrecto\n";
				}
				
			}
			if(ValidarVacio(camposTexto[3].value)==false){				
				nerr++;
				nfocotel=1;
				errcont[nerr]="- Telefono es un campo obligatorio\n";
			}else{
				//El valor debe ser mayor a 0
				if(ValidarTipo(camposTexto[3].value)==false){
					nerr++;
					nfocotel=1;
					errcont[nerr]="- Telefono tiene formato incorrecto\n";
				}
				
			}
			if(ValidarVacio(camposTexto[4].value)==false){				
				nerr++;
				nfocociu=1;
				errcont[nerr]="- Ciudad es un campo obligatorio\n";
			}
			if(ValidarTipo(camposTexto[5].value)==false){				
				nerr++;
				nfococel=1;
				errcont[nerr]="- Celular tiene formato incorrecto\n";
			}
			if(ValidarVacio(camposTexto[7].value)==false){				
				nerr++;
				nfocomen=1;
				errcont[nerr]="- Mensaje es un campo obligatorio\n";
			}
			
			if(nerr>0){				
				ManejoErrores(errcont);
				if(nfoconom==1){
					TomarFoco(camposTexto[0].name);
				}else if(nfocoema1==1){					
					TomarFoco(camposTexto[2].name);					
				}else if(nfocotel==1){					
					TomarFoco(camposTexto[3].name);					
				}else if(nfocociu==1){					
					TomarFoco(camposTexto[4].name);					
				}else if(nfocomen==1){					
					TomarFoco(camposTexto[7].name);					
				}else if(nfococel==1){					
					TomarFoco(camposTexto[5].name);					
				}
			}else{
				//alert('Correcto todo y envia Contactenos');
				enviarDatosContactenos(); return false
			}
		break;
	}
		
}



function muestraFecHorBon(idlang)   
  {   
	//alert('Entro a hora');
	//Asignar fecha y hora actual al documento	
	if(idlang==1){
		//Ingles
		var diaarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		var mesarray=new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
		var sepde="of";
		var sephor="Time";
	}else if(idlang==2){
		var diaarray=new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
		var mesarray=new Array("Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin","Juillet", "Août", "Septembre", "Octobre","Novembre","Decembre");
		var sepde="de";
		var sephor="Heure";
	}else{
		var diaarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado");
		var mesarray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
		var sepde="de";
		var sephor="Hora";
	}
	var FecActGen=new Date();
	dia  = FecActGen.getDate();
	ndia = FecActGen.getDay();
	mes  = FecActGen.getMonth();
   	ano  = FecActGen.getFullYear();
	hor  = FecActGen.getHours();
	min  = FecActGen.getMinutes();
	seg  = FecActGen.getSeconds();
  	if (dia < 10)   
        	dia = '0' + dia;
	if (hor < 10)   
        	hor = '0' + hor;
	if (min < 10)   
        	min = '0' + min;
	if (seg < 10)   
        	seg = '0' + seg;
	
	FecAct = diaarray[ndia]+', '+dia+' '+sepde+' '+mesarray[mes]+' '+sepde+' '+ano+' '+sephor+' '+hor+':'+min+':'+seg;
	/*FecAct=diaarray[ndia]+','+dia+' de '+mesarray[mes]+' de '+ano;
	HorAct='Hora: 'hor+':'+min+':'+seg;*/
	colfec = document.getElementById('Hora');
	colfec.innerHTML = FecAct;
	setTimeout("muestraFecHorBon('"+idlang+"')",1000); 
  } 

var ArrTit = new Array();
var ArrDes = new Array();
conteven=0;
function visualizaEventos(canteven,encab)   
  {   
	//alert('Total Eventos: '+canteven+ ' Encabezado: '+encab+' - Existe Result: '+document.getElementById('ResultadoEventos')+ 'Existe Titulo: '+document.getElementById('TituloEven'));
	mw=220;
	mh=160;
	ms=6;
	
	conteven++;
	if(conteven<=canteven){		
		if(document.getElementById('ResultadoEventos')){			
			divResulTit = document.getElementById('TituloEven');
			divResulEve = document.getElementById('ResultadoEventos');
			CadEnc = '<b>'+encab+'</b>';
			CadDes = '<b>'+ArrTit[conteven]+'</b><br><br>'+ArrDes[conteven];	
			divResulTit.innerHTML = CadEnc;
			divResulEve.innerHTML = CadDes;		
			
			setTimeout("visualizaEventos("+canteven+",'"+encab+"')",10700); 
		}
	}else{
		conteven=0;
		visualizaEventos(canteven,encab);
	}
}

function asignarEventos(vtitu,vdesc,vcont){
	ArrTit[vcont]=vtitu;
	ArrDes[vcont]=vdesc;
}

contnoti=0;
function muestNotic()   
  {   
	//alert('Entro al menu de mostrar las Noticias: '+num+ 'Existe: '+document.getElementById('ModuloNoticias'));
	contnoti++;
	if(contnoti<=7){
		if(document.getElementById('ModNotic')){
			divNotic = document.getElementById('ModNotic');
		
			//instanciamos el objetoAjax
			ajax=objetoAjax();
			//usando del medoto POST
			ajax.open("POST", "scripts/consultadatosnoticias.php",true);	
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					divNotic.innerHTML = ajax.responseText
					document.getElementById('b'+contnoti).style.backgroundColor="#B1C651";
					document.getElementById('b'+contnoti).style.color="#FFFF00";
					document.getElementById('b'+contnoti).style.borderColor="#FFFFFF";
					setTimeout("muestNotic()",6000); 
				}
			}
			//muy importante este encabezado ya que hacemos uso de un formulario
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			//enviando los valores
			ajax.send("cod="+contnoti)
		}
	}else{
		contnoti=0;
		//setTimeout("muestraNoticias()",3000); 
		muestNotic();
	}
  }
 
 
 function enviarDatosContactenos()   
  {   
	//alert('Entro Enviar contacte');
	if(document.getElementById('RespContac')){
			//alert('Entro Ecxiste respuesta correo'+document.getElementById('RespContac'));
			divResp = document.getElementById('RespContac');
			nom = document.frmcontact.txtnombre.value;			
			emp = document.frmcontact.txtempresa.value;
			ema = document.frmcontact.txtemail.value;
			tel = document.frmcontact.txttelefono.value;
			ciu = document.frmcontact.txtciudad.value;
			cel = document.frmcontact.txtcelular.value;
			//alert('PAso Asigno campos Antes entidad');
			ent = document.frmcontact.txtentidad.value;
			//alert('PAso Asigno campos Despues entidad');
			mens = document.frmcontact.txtmensaje.value;
			//alert('El mensaje no pasa: '+mens);
			//instanciamos el objetoAjax
			ajax=objetoAjax();
			//usando del medoto POST
			ajax.open("POST", "scripts/enviardatoscorreo.php",true);	
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					divResp.innerHTML = ajax.responseText
				}
			}
			//muy importante este encabezado ya que hacemos uso de un formulario
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			//enviando los valores
			cadenv="nombre="+nom+'&empresa='+emp+'&email='+ema+'&telefono='+tel+'&ciudad='+ciu+'&celular='+cel+'&entidad='+ent+'&mensaje='+mens;
			//alert('Envia Cadena: '+cadenv);
			ajax.send(cadenv)
	}
  } 
  
  function FunTrad(vid,txt,sl,dl){	
	  // llamada al traductor
	//alert('Existe Resultado: '+document.getElementById(vid)+' - Nombre: '+vid+' - Texto: '+txt+' - Origen: '+sl+' - Destino: '+dl);
	google.language.translate(txt, sl, dl, function(result) 
		{
		  if (!result.error) 
		  {    
			var resultado = document.getElementById(vid); 
			//alert('Traduccion: '+result.translation);
			resultado.innerHTML = result.translation;  
		  }
		  else alert(result.error.message);
		}
	  );
	}

	
	function FunTradTxt(txt,sl,dl){	
		// llamada al traductor
		//alert('Entro - Texto: '+txt+' - Origen: '+sl+' - Destino: '+dl);
		google.language.translate(txt, sl, dl, function(result) 
			{
			  if (!result.error) 
			  { 
				return result.translation;				
			  }
			  else alert(result.error.message);
			}
		);
	}
	
  
 ContVec=0;
 CodVid=0;
 ConSigAnt=0;
 function muestraVideos(InSiAn,NumReg)   
  {   
  	//alert('Indicador: '+InSiAn+' - Registros: '+NumReg);
  	ContVec++;
	if(ContVec==1){
		//Muestro el ultimo video que es el mas reciente		
		ConSigAnt=NumReg;
		CodVid=1;
	}else{
		//Muestro segun el boton que haya oprimido
		if(InSiAn==1){
			//siguiente	
			ConSigAnt--;
			CodVid++;
			if(ConSigAnt==0){
				ConSigAnt=NumReg;
				CodVid=1;
			}
			
		}else{
			//Anterior
			ConSigAnt++;
			CodVid--;
			if(ConSigAnt>NumReg){
				ConSigAnt=1;
				CodVid=NumReg;
			}
		}
	}
  	//alert('Indicador: '+InSiAn+' - Existe o no: '+document.getElementById('contenidoalbum'));
	if(document.getElementById('contenidoalbum')){
			divResultado = document.getElementById('contenidoalbum');
	
			//instanciamos el objetoAjax
			ajax=objetoAjax();
			//usando del medoto POST
			ajax.open("POST", "scripts/consultadatosvideo.php",true);	
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					divResultado.innerHTML = ajax.responseText
				}
			}
			//muy importante este encabezado ya que hacemos uso de un formulario
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			//enviando los valores
			//alert('Envia Codigo video: '+ConSigAnt+' - Veces: '+ContVec);
			ajax.send("codv="+ConSigAnt+"&convid="+CodVid)
	}
  }

var ArrCodGal= new Array();
var ArrNomGal= new Array();
var ArrDesGal= new Array();
var ArrUrlGal= new Array();
DatAsig=0;
function asignarDatosGaleria(vcodi,vnomb,vdesc,vurli){
	DatAsig++;
	ArrCodGal[DatAsig]=vcodi;
	ArrNomGal[DatAsig]=vnomb;
	ArrDesGal[DatAsig]=vdesc;
	ArrUrlGal[DatAsig]=vurli;
}

recArr=0;
function muestraGaleriaSig(IndSigAnt) 
  {   
	//alert('Indicador SigAnt: '+IndSigAnt+ ' Exuste recorrido: '+document.getElementById('textorecorrido'));
	if(IndSigAnt==1){
		recArr++;
		if(recArr==1){
			//alert('Recorrido es 1 : '+recArr);
			if(document.getElementById('textorecorrido')){
				//alert('Recorrido va en : '+recArr+' - Arreglo 1: '+ArrUrlGal[recArr]);
				document.getElementById('textorecorrido').innerHTML= '<b>Foto '+recArr+' de '+DatAsig+'</b>';
				document.getElementById('titulofoto').innerHTML= '<b>'+ArrNomGal[recArr]+'</b>';				
				document.getElementById('fotopropia').src=ArrUrlGal[recArr];
				document.getElementById('textoimg').style.visibility="visible";
			}
		}else{
			if(recArr>DatAsig){
				recArr=1;
			}
			document.getElementById('textorecorrido').innerHTML= '<b>Foto '+recArr+' de '+DatAsig+'</b>';
			document.getElementById('titulofoto').innerHTML= '<b>'+ArrNomGal[recArr]+'</b>';	
			document.getElementById('fotopropia').src=ArrUrlGal[recArr];
		}
	}else{
		recArr--;
		if(recArr<1){
			recArr=DatAsig;
		}
		document.getElementById('textorecorrido').innerHTML= '<b>Foto '+recArr+' de '+DatAsig+'</b>';
		document.getElementById('titulofoto').innerHTML= '<b>'+ArrNomGal[recArr]+'</b>';	
		document.getElementById('fotopropia').src=ArrUrlGal[recArr];		
	}//Corchete sino va en uno
}



function asignarTexto(vid,texto){
	//alert('Existe: '+document.getElementById(vid)+' - Titulo: '+vid+' - Texto: '+texto);
	//alert('Titulo: '+vtitu+' - Descripcion: '+vdesc+' - Va en: '+vcont);
	if(document.getElementById(vid)){
			document.getElementById(vid).innerHTML=texto;
	}
}

function asignarMensaje(texto){
	alert('Titulo: '+texto);
}

function CambNotic(numnoti) {
	//alert('Entro al menu de mostrar las Noticias: '+num+ 'Existe: '+document.getElementById('ModuloNoticias'));
		if(document.getElementById('ModNotic')){
			divResul = document.getElementById('ModNotic');
		
			//instanciamos el objetoAjax
			ajax=objetoAjax();
			//usando del medoto POST
			ajax.open("POST", "scripts/consultadatosnoticias.php",true);	
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					divResul.innerHTML = ajax.responseText
					document.getElementById('b'+numnoti).style.backgroundColor="#B1C651";
					document.getElementById('b'+numnoti).style.color="#FFFF00";
					document.getElementById('b'+numnoti).style.borderColor="#FFFFFF";
					contnoti=numnoti;
				}
			}
			//muy importante este encabezado ya que hacemos uso de un formulario
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			//enviando los valores
			ajax.send("cod="+numnoti)
		}
}


function muestraFecHorAct(fecha,hora)   
  {   
	//Asignar fecha y hora actual al documento			
	var FecActGen=new Date();
	dia = FecActGen.getDate();
	mes = FecActGen.getMonth() + 1;
   	ano = FecActGen.getFullYear();
	hor = FecActGen.getHours();
	min = FecActGen.getMinutes();
	seg = FecActGen.getSeconds();
	if (mes < 10)   
  		mes = '0' + mes;
  	if (dia < 10)   
        	dia = '0' + dia;
	if (hor < 10)   
        	hor = '0' + hor;
	if (min < 10)   
        	min = '0' + min;
	if (seg < 10)   
        	seg = '0' + seg;
	
	FecAct=dia+'/'+mes+'/'+ano;
	HorAct=hor+':'+min+':'+seg;
	document.getElementById(fecha).value=FecAct;
	document.getElementById(hora).value=HorAct;
	cmpfecha=fecha;
	cmphora=hora;
	setTimeout("muestraFecHorAct(cmpfecha,cmphora)",1000);   
  }

function ValidarVacio(valcampo) {
	for(i=0;i<valcampo.length;i++){   
        	if(valcampo.charAt(i)!=" "){   
                	return true   
                }   
        }   
        return false
}

function ValidarTipo(valcampo) {	
	if(valcampo!=''){
		if(!isNaN(valcampo)){
	              	return true
        	}
        	return false
	}else{
        	return false
	}
}
//Validar Email
function ValidarEmail(Cadena) {   
  
    Punto = Cadena.substring(Cadena.lastIndexOf('.') + 1, Cadena.length) 
    Dominio = Cadena.substring(Cadena.lastIndexOf('@') + 1, Cadena.lastIndexOf('.'))
    Usuario = Cadena.substring(0, Cadena.lastIndexOf('@'))                  
    Reserv = "@/º\"\'+*{}\\<>?¿[]áéíóú#·¡!^*;,:"                      
       
    valido = true   
       
    for (var Cont=0; Cont<Usuario.length; Cont++) {   
        X = Usuario.substring(Cont,Cont+1)   
        if (Reserv.indexOf(X)!=-1)   
                    valido = false   
    }   
  
    for (var Cont=0; Cont<Punto.length; Cont++) {   
        X=Punto.substring(Cont,Cont+1)   
        if (Reserv.indexOf(X)!=-1)   
            valido = false   
    }   
                           
    for (var Cont=0; Cont<Dominio.length; Cont++) {   
        X=Dominio.substring(Cont,Cont+1)   
        if (Reserv.indexOf(X)!=-1)   
            valido = false   
        }   
  
    if (Punto.length<2 || Dominio <1 || Cadena.lastIndexOf('.')<0 || Cadena.lastIndexOf('@')<0 || Usuario<1) {   
        valido = false   
    }   
       
    if (valido) {   
        //alert('Email válido.')   
        return true   
    } else {   
        //alert('Email no válido.')   
        return false   
    }   
}   



function ManejoErrores(arerr) {
	var Errores='';	
	for(i=0;i<=arerr.length-1;i++){		
		Errores+=arerr[i];
	}
	alert(Errores);
}

//Dela forma de sires
function Cambia(varid,numimg) {
	if(numimg=='1'){
		document.getElementById(varid).style.backgroundImage="url('images/secciones.gif')";
		document.getElementById(varid).style.backgroundColor="#B1C651";
		document.getElementById(varid).style.color="#FFFF00";
	}
	if(numimg=='2'){
		//document.getElementById(varid).style.backgroundImage="url('imagenes/imgA.gif')";
		document.getElementById(varid).style.cursor="pointer";
		document.getElementById(varid).style.backgroundColor="#669933";
		document.getElementById(varid).style.color="#FFFFFF";
	}
	if(numimg=='3'){
		document.getElementById(varid).style.backgroundImage="url('')";
	}
}

function AsignarImagen(varid,urlimg) {
	//alert('Entra asigna img: '+varid+' - Url: '+urlimg+' - Existe: '+document.getElementById(varid));
	//document.getElementById(varid).style.backgroundImage="url("+urlimg+")";
	document.getElementById('mostrarfoto').style.display='block'
	document.getElementById('mostrarfoto').style.visibility="visible";
	document.getElementById(varid).src=urlimg;
	document.getElementById(varid).style.display='block'
	document.getElementById('textoimg').style.visibility="hidden";
	//.style.visibility="visible"
	//document.getElementById(varid).width=656;
	//document.getElementById(varid).height=400;
	//document.getElementById(varid).style.backgroundImage="url('images/secciones.gif')";
}

function NavegadorBtn(varid,numimg) {
	document.getElementById(varid).style.cursor="pointer";
	if(numimg=='1'){
		document.getElementById(varid).style.backgroundColor="#669933";
		document.getElementById(varid).style.color="#FFFFFF";
	}
	if(numimg=='2'){
		document.getElementById(varid).style.backgroundColor="#B1C651";
		document.getElementById(varid).style.color="#FFFF00";
		document.getElementById(varid).style.borderColor="#FFFFFF";
	}
}

function VerUrl(vid,mispag) {
	//alert(document.getElementById(varid));	
	//window.location=varid;
	window.open(vid,mispag); 

}
function NavegarInteres(vid) {
	document.getElementById(vid).style.cursor="pointer";
}
function NavegadorMenu(varid,numimg) {
	document.getElementById(varid).style.cursor="pointer";
	if(numimg=='1'){
		document.getElementById(varid).style.backgroundColor="#E9ECD7";
		document.getElementById(varid).style.color="#000000";
	}
	if(numimg=='2'){
		document.getElementById(varid).style.backgroundColor="#B1C651";
		document.getElementById(varid).style.color="#FFFF00";
		document.getElementById(varid).style.borderColor="#FFFFFF";
	}
}
function NavegadorAlbum(varid,numimg) {
	document.getElementById(varid).style.cursor="pointer";
	if(numimg=='1'){
		document.getElementById(varid).style.backgroundColor="#FFFFFF";
	}
	if(numimg=='2'){
		document.getElementById(varid).style.backgroundColor="#CCCCCC";
		document.getElementById(varid).style.color="#117700";
	}
}
function NavegadorGaleria(varid,numimg) {
	document.getElementById(varid).style.cursor="pointer";
	if(numimg=='1'){
		document.getElementById(varid).style.backgroundColor="#669933";
		document.getElementById(varid).style.color="#FFFFFF";
	}
	if(numimg=='2'){
		document.getElementById(varid).style.backgroundColor="#CCCCCC";
		document.getElementById(varid).style.color="#000000";
	}
}
function NavegadorRegAlb(varid,numimg) {
	document.getElementById(varid).style.cursor="pointer";
	if(numimg=='1'){
		document.getElementById(varid).style.color="#ffffff";
	}
	if(numimg=='2'){
		document.getElementById(varid).style.backgroundColor="#CCCCCC";
		document.getElementById(varid).style.color="#000000";
	}
}

function CreSubMenPag(nom,sec,vid){
	//alert('Entro Nom: '+nom+' - Seccion: '+sec+' Identificador: '+vid);
	if(document.getElementById(nom+sec).style.display == 'none'){
		divRespMen = document.getElementById(nom+sec);
		//alert('Existe Respuesta MEnsaje: '+divRespMen);
		//instanciamos el objetoAjax
		ajax=objetoAjax();
		//alert('Ajax: '+ajax);
		//usando del medoto POST
		ajax.open("POST", "scripts/consultadatossubmenu.php",true);	
		//alert('Abrio el archivo');
		ajax.onreadystatechange=function() {
			//alert('Entro a function...');
			if (ajax.readyState==4) {
				//alert('CArgo....: ');
				document.getElementById(vid).style.backgroundImage="url('images/csecciones.png')";
				//alert('Respondio: '+ajax.responseText);
				divRespMen.innerHTML = ajax.responseText
				document.getElementById(nom+sec).style.display = 'block';
			}
		}
		//muy importante este encabezado ya que hacemos uso de un formulario
		ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		//enviando los valores
		cadenv="codsecc="+sec;
		//alert('Envia Cadena: '+cadenv);
		//ajax.send("seccion="+sec)
		ajax.send(cadenv)


  		//document.getElementById(divid).style.display = 'block';
    	}else{
			document.getElementById(vid).style.backgroundImage="url('images/secciones.png')";
      		document.getElementById(nom+sec).style.display = 'none';
 	}
}

function TomarFoco(campo){
	if(campo!=''){
		document.getElementById(campo).focus();
		document.getElementById(campo).select();
	}
	/*else{
		alert('Campo Vacio');
	}*/
}
function Errores(mensaje){
	alert(Mensaje);
}

//********** MODULO DE BOLETINES *********//
function enviarDatosBoletin(){
	//donde se mostrará lo resultados
	//divResultado = document.getElementById('resboletin');
	divResultado = document.getElementById('TxtBoletin');
	divFormulario = document.getElementById('frmboletin');

	//valores de los cajas de texto
	nom=document.frmboletin.nombre.value;
	ema=document.frmboletin.email.value;
	
	//instanciamos el objetoAjax
	ajax=objetoAjax();
	//usando del medoto POST
	ajax.open("POST", "scripts/creacionboletin.php",true);
	
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//alert('Respondio ajax:'+ajax.responseText);
			//mostrar los nuevos registros en esta capa			
			//una vez actualizacion ocultamos formulario
			if(ValidarVacio(ajax.responseText)==false)
				alert('Error: '+ajax.responseText);
			else{
				if(ajax.responseText=='NO'){
					alert('Email ya se encuentra registrado. Gracias');
				}else{
					alert('Gracias por registrarse en el boletin de la Gobernacion del Vichada\npronto recibira un mensaje');					
				}
				document.frmboletin.nombre.value="";
				document.frmboletin.email.value="";
			}
			//divResultado.style.display="none";
		}
	}
	//muy importante este encabezado ya que hacemos uso de un formulario
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	//enviando los valores
	ajax.send("nombre="+nom+"&email="+ema)
}
//********** FINAL MODULO DE BOLETINES *********//