﻿
var variable="";var primeravez="si";function mostrarsubmenu(otromenu,nombresubmenu)
{if(variable!=otromenu)
{if(primeravez=="si"){variable=otromenu;primeravez="no";}
document.getElementById(variable+'normal').innerHTML=document.getElementById(variable+'claro').innerHTML;variable=otromenu;document.getElementById('submenu').innerHTML=document.getElementById(nombresubmenu).innerHTML;document.getElementById(otromenu+'normal').innerHTML=document.getElementById(otromenu+'oscuro').innerHTML;}}
function ocultarsubmenu(otromenu,nombresubmenu)
{}
function suministrarFormulario(querystring)
{}
function LimpiarTexto(objeto)
{objeto.value="";}
function limpia(elemento)
{elemento.value="";}
function verifica(elemento)
{}
function VerificarSoloNumeros(e){tecla=(document.all)?e.keyCode:e.which;if(tecla==8)return true;patron=/\d/;te=String.fromCharCode(tecla);return patron.test(te);}
function CargarImagenGrande(elemento)
{document.getElementById('divMostrarImagen').innerHTML=document.getElementById(elemento).innerHTML;}
var nombreUltimoMenu="";var linkImagenUltimoMenu="";function GuardarInfoImagen(nombreObjeto,elemento)
{nombreUltimoMenuClikeado=nombreObjeto;linkImagenUltimoMenu=elemento;}
function LimpiarUltimaImagen()
{try
{CargarImagen(nombreUltimoMenuClikeado,linkImagenUltimoMenu.replace("_a",""));}
catch(e)
{}}
function CargarImagen(nombreObjeto,elemento)
{var arrayVisores;if(document.getElementById(nombreObjeto))
{arrayVisores=document.getElementById(nombreObjeto);arrayVisores.src=elemento;}
else
{try
{arrayVisores=document.getElementsByName(nombreObjeto);}
catch(e){}
var i;i=0;for(i=0;i<arrayVisores.length;i++)
{arrayVisores[i].src=elemento;}}}
function CambiarMenu(nombreObjeto,elemento)
{LimpiarUltimaImagen();CargarImagen(nombreObjeto,elemento);}
function MostrarDivImagenGrande(elemento)
{document.getElementById('divisorMostrarImagen1').innerHTML=document.getElementById('divisorMostrarImagen').innerHTML;document.getElementById('divisorMostrarImagen1').style.display="block";}
function OcultarDivImagenGrande(elemento)
{document.getElementById('divisorMostrarImagen1').style.display="none";}
function TamVentana(){var Tamanyo=[0,0];if(typeof window.innerWidth!='undefined')
{Tamanyo=[window.innerWidth,window.innerHeight];}
else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0)
{Tamanyo=[document.documentElement.clientWidth,document.documentElement.clientHeight];}
else{}
return Tamanyo;}
function GetLeft(ele)
{if(ele.offsetParent)
return ele.offsetLeft+GetLeft(ele.offsetParent);else
return ele.offsetLeft;}
function GetTop(ele)
{if(ele.offsetParent)
return(ele.offsetTop+GetTop(ele.offsetParent));else
return ele.offsetTop;}
var tempX=184;var tempY=200;function MostrarDiv(elemento,mensaje)
{try
{document.getElementById(elemento).style.left=tempX.toString();document.getElementById(elemento).style.top=tempY.toString();try{document.getElementById('Txt'+elemento).innerHTML=mensaje;}catch(e){}
document.getElementById(elemento).innerHTML=mensaje;document.getElementById(elemento).style.zIndex="990";document.getElementById(elemento).style.display="block";setTimeout("OcultarDiv('"+elemento+"');",2500);}catch(e){}}
function MostrarDivXY(elemento,mensaje,tmpX,tmpY,Index,event,objetousado,direImagen)
{var Tam=TamVentana();var varr=GetLeft(objetousado)+400+422;var valorizq=GetLeft(objetousado)-330;var valorder=GetLeft(objetousado)+230;var valorfinal;}
function OcultarDiv(elemento)
{try{document.getElementById(elemento).style.display="none";document.getElementById(elemento).style.zIndex=0;OcultarDivGeneral(elemento);}
catch(e){}}
function MostrarDivGeneralConValor(elemento,objetousado,tmpY)
{var nomDivGeneral="divgeneral";var varr=GetLeft(objetousado)+400+422;var valorizq=GetLeft(objetousado)-330;var valorder=GetLeft(objetousado)+230;var valorfinal;if(valorizq<0)valorfinal=valorder;else valorfinal=valorizq;document.getElementById(nomDivGeneral).style.left=valorfinal+'px';;document.getElementById(nomDivGeneral).style.top=tmpY+'px';document.getElementById(nomDivGeneral).style.zIndex=document.getElementById(elemento).style.zIndex;document.getElementById(nomDivGeneral).innerHTML=document.getElementById(elemento).innerHTML;document.getElementById(nomDivGeneral).style.display="block";}
function OcultarDivGeneral(elemento)
{var nomDivGeneral="divgeneral";document.getElementById(nomDivGeneral).style.zIndex=0;document.getElementById(nomDivGeneral).style.display="none";}
function MostrarDivNormal(elemento)
{document.getElementById(elemento).style.display="block";document.getElementById(elemento).style.zIndex="990";}
function OcultarDivNormal(elemento)
{document.getElementById(elemento).style.display="none";document.getElementById(elemento).style.zIndex="0";}
function MostraroOcultarDivNormal(elemento)
{if(document.getElementById(elemento).style.display=="block")OcultarDivNormal(elemento);if(document.getElementById(elemento).style.display=="none")MostrarDivNormal(elemento);}
function PonerDivEnOtroDiv(elemento1,elemento2)
{document.getElementById(elemento1).innerHTML=document.getElementById(elemento2).innerHTML;}
function PonerDivEnOtroDivMensajes(elemento1,elemento2,mensaje)
{document.getElementById(elemento1).innerHTML=document.getElementById(elemento2).innerHTML;if(mensaje!="")MostrarDiv(elemento1,mensaje);}
function PonerEnDivUnHtml(elemento1,mensaje)
{document.getElementById(elemento1).innerHTML=mensaje;}
function manejadorEventos(elEvento){var evento=elEvento||window.event;}
function muestraInformacion(elEvento){var evento=elEvento||window.event;var coordenadaX=evento.clientX;var coordenadaY=evento.clientY;}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
function CojerValorCookieG(indice){var galleta=document.cookie
var finDeCadena=galleta.indexOf(";",indice)
if(finDeCadena==-1)
finDeCadena=galleta.length
return unescape(galleta.substring(indice,finDeCadena))}
function CojerCookieG(nombre){var galleta=document.cookie
var arg=nombre+"="
var alen=arg.length
var glen=galleta.length
var i=0
while(i<glen){var j=i+alen
if(galleta.substring(i,j)==arg)
return CojerValorCookieG(j)
i=galleta.indexOf(" ",i)+1
if(i==0)
break}
return null}
function GuardarCookieG(nombre,valor,caducidad){if(!caducidad)
caducidad=CaducaG(0)
document.cookie=nombre+"="+escape(valor)+"; expires="+caducidad+"; path=/";}
function CaducaG(dias){var hoy=new Date()
var msEnXDias=eval(dias)*24*60*60*1000
hoy.setTime(hoy.getTime()+msEnXDias)
return(hoy.toGMTString())}
function BorrarCookieG(nombre){document.cookie=nombre+"=; expires="+Caduca(-1)+"; path=/"}
function IntroducirCookieG(nomCokie,datosCok,duraCokie){var _31dias=CaducaG(31)
if(datosCok!="")
GuardarCookieG(nomCokie,datosCok,_31dias)}
var winName="titulo";var objVentVisorImagenes;function Abrir_Ventana(a,w,h)
{if(!objVentVisorImagenes)
{theURL=a.getAttribute("href");var windowprops="top=0,left=0,toolbar=no,location=no,status=no, menubar=no,scrollbars=yes, resizable=no,width="+w+",height="+h;objVentVisorImagenes=window.open(theURL,winName,windowprops);}
else
{objVentVisorImagenes.focus();}}
function Cerrar_Ventana()
{window.close();if(objVentVisorImagenes)
{objVentVisorImagenes.close();}}
function Volver_Ventana_Anterior()
{history.back();}
function Abrir_Pagina(urlPagina)
{window.location=urlPagina;}
function Abrir_VentanaGeneral(a,w,h)
{theURL=a;var windowprops="top=0,left=0,toolbar=yes,location=no,status=yes, menubar=yes,scrollbars=yes, resizable=yes,width="+w+",height="+h;objVentVisorImagenes=window.open(theURL,winName,windowprops);objVentVisorImagenes.focus();}
function ponervalorcajatexto(cajatextoid,valorponer,objcheckbox)
{var valortmp;var espaciador=",";valortmp=document.getElementById(cajatextoid).value;if(objcheckbox.checked)
{valortmp=valortmp+valorponer+espaciador;}
else
{valortmp=valortmp.replace(valorponer+espaciador,"");}
document.getElementById(cajatextoid).value=valortmp;}
var tiendatimerID=0;var tiendacargado=false;function ponertextoendivcambiante(numdatosborrados,iddivcambiar,cadenaarray,cadenaarraytele,cadenaarraydire,inicial,tiemporotacion,urlhrefreci)
{var nombre="nombre";var otro="otro";var otro1="otro";var urlhref="urlhref";var urlonclick="urlonclick";var espaciador=",";var array,arraytele,arraydire;var i=inicial;array=cadenaarray.split(espaciador);arraytele=cadenaarraytele.split(espaciador);arraydire=cadenaarraydire.split(espaciador);if(numdatosborrados!=0)
{ponertextoendiv(iddivcambiar+nombre,array[i]);ponertextoendiv(iddivcambiar+otro,arraytele[i]);ponertextoendiv(iddivcambiar+otro1,arraydire[i]);cambiarhref(iddivcambiar+urlhref,urlhrefreci);if(i<array.length-1)i++;else i=0;if(!tiendacargado)
{tiendatimerID=setTimeout("ponertextoendivcambiante('"+numdatosborrados+"','"+iddivcambiar+"','"+cadenaarray+"','"+cadenaarraytele+"','"+cadenaarraydire+"',"+i+","+tiemporotacion+",'"+urlhrefreci+"')",7000);}}}
function ponertextoendiv(iddivcambiar,mensajeponer)
{document.getElementById(iddivcambiar).innerHTML=mensajeponer;}
function cambiarhref(iddivcambiar,mensajeponer)
{document.getElementById(iddivcambiar).href=mensajeponer;}
function cambiarhrefonclick(iddivcambiar,mensajeponer)
{document.getElementById(iddivcambiar).onClick=""+mensajeponer+"";}
function ejecutarcambiotxtdiv(numdatosborrados,iddivcambiar,cadenaarray,cadenaarraytele,cadenaarraydire,inicial,tiemporotacion,urlhrefreci)
{var nombre="nombre";var tele="tele";var dire="dire";var urlhref="urlhref";var urlonclick="urlonclick";var espaciador=",";var array,arraytele,arraydire;var i=inicial;try
{array=cadenaarray.split(espaciador);arraytele=cadenaarraytele.split(espaciador);arraydire=cadenaarraydire.split(espaciador);if(numdatosborrados!=0)
{ponertextoendiv(iddivcambiar+nombre,array[i]);ponertextoendiv(iddivcambiar+tele,arraytele[i]);ponertextoendiv(iddivcambiar+dire,arraydire[i]);cambiarhref(iddivcambiar+urlhref,urlhrefreci);cambiarhrefonclick(iddivcambiar+urlonclick,"Abrir_Pagina('"+urlhrefreci+"');");if(i<array.length-1)i++;else i=0;return i;}}
catch(e)
{}}
function ciclocambiotxtdivzzz(cont1,cont2)
{cont1=ejecutarcambiotxtdiv(2,12,'','','',cont1,200,'di.aspx/jj');cont2=ejecutarcambiotxtdiv(2,12,'','','',cont2,200,'di.aspx/jj');if(!tiendacargado)
{tiendatimerID=setTimeout("ciclocambiotxtdiv("+cont1+","+cont2+")",7000);}}
function ponerValorEnCajaTexto(nommbreObj,mensaje)
{var valortmp;var espaciador=",";document.getElementById(nommbreObj).value=mensaje;}
function MostrarOcultarDiv(nomobj)
{var objtmp;objtmp=document.getElementById(nomobj);var tamven=TamVentana();MostrarDivTimeX(nomobj,"solomostrar",tamven[0]/5,tamven[1]/5,0);}
function MostrarDivMitadPantalla(nomobj)
{var objtmp;objtmp=document.getElementById(nomobj);var tamven=TamVentana();var ancho=objtmp.style.width;MostrarDivTimeX('divbasura'," hahahahah si funciona",tamven[0]/2,tamven[1]/2,2500);}
function MostrarDivTimeX(elemento,mensaje,coorX,coorY,tiempo)
{try
{if(coorX!=0)
{document.getElementById(elemento).style.left=coorX.toString()+"px";document.getElementById(elemento).style.top=coorY.toString()+"px";}
if(mensaje!="solomostrar")
{document.getElementById(elemento).innerHTML=mensaje;}
MostraroOcultarDivNormal(elemento);if(tiempo!=0)
{setTimeout("OcultarDivTimeX('"+elemento+"');",tiempo);}}catch(e){}}
function OcultarDivTimeX(elemento)
{try{document.getElementById(elemento).style.display="none";document.getElementById(elemento).style.zIndex="0";}
catch(e){}}
function pulsar(e){tecla=(document.all)?e.keyCode:e.which;var valorObj;var objTmp;var objDdlTmp;var tamven=TamVentana();var izqui=tamven[0]/4;var arrib=tamven[1]/4;var demora=5000;if(tecla==13)
{objTmp=document.getElementById("cajaBusqueda");objDdlTmp=document.getElementById("datoCiudad");valorObj=trim1(objTmp.value);if(valorObj=="")
{MostrarDivTimeX('divalertacajatextobusque',"solomostrar",0,arrib,demora);return false;}
else if(valorObj.length<2)
{MostrarDivTimeX('divalertacajatextobusque',"solomostrar",0,arrib,demora);return false;}
else if(objDdlTmp.value==1)
{MostrarDivTimeX('divalertadroplistbusque',"solomostrar",0,arrib+50,demora);return false;}
else
{MostrarDivTimeX('divcargando',"solomostrar",izqui,arrib,0);try{document.forms[0].submit();}catch(e){}
return true;}}
else
{}}
function pulsarclick(e){var valorObj;var objTmp;var objDdlTmp;var tamven=TamVentana();var izqui=tamven[0]/4;var arrib=tamven[1]/4;var demora=5000;objTmp=document.getElementById("cajaBusqueda");objDdlTmp=document.getElementById("datoCiudad");valorObj=trim1(objTmp.value);if(valorObj=="")
{MostrarDivTimeX('divalertacajatextobusque',"solomostrar",0,tamven[1]/2,demora);return false;}
else if(valorObj.length<2)
{MostrarDivTimeX('divalertacajatextobusque',"solomostrar",0,tamven[1]/2,demora);return false;}
else if(objDdlTmp.value==1)
{MostrarDivTimeX('divalertadroplistbusque',"solomostrar",0,tamven[1]/2,demora);return false;}
else
{MostrarDivTimeX('divcargando',"solomostrar",100,100,0);try{document.forms[0].submit();}catch(e){}
return true;}}
function funcionesiniciales()
{var objTmp;window.addEventListener('keypress',pulsar(event),false);objTmp=document.getElementById("cajaBusqueda");objTmp.onkeypress="return pulsar(event)";}
function getatributoobjetoid(nomobj,nomatri)
{var result;if(nomatri=="")nomatri="value";try
{objTmp=document.getElementById(nomobj);eval("result = objTmp."+nomatri);}
catch(e){result="";}
return result;}
function validarEmail(valor){var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(reg.test(valor))
{return true;}
else
{return false;}}
function trim1(string){string=string.replace(/^\s+/,'');for(var i=string.length;i>0;i--){if(/\S/.test(string.charAt(i))){string=string.substring(0,i);break;}}
return string;}
function abrirRegistroEmp(IdReci,CostoReci)
{var pieza=null;var nombreCokie="GuiaComercial";var vTmp=null;var separador="$";var indicador=null;if(CojerCookieG(nombreCokie)!=null)
{vTmp=CojerCookieG(nombreCokie);indicador="pri";vTmp=cambiarDatoRegistroEmp(2,IdReci,vTmp);vTmp=cambiarDatoRegistroEmp(3,CostoReci,vTmp);GuardarCookieG(nombreCokie,vTmp,CaducaG(31));}
else
{indicador="sec";vTmp="$$"+IdReci+"$"+CostoReci+"$$$$$$$admin$$$0$$$$$$$";GuardarCookieG(nombreCokie,vTmp,CaducaG(31));}
Abrir_Pagina("registroempresas.aspx");}
function cambiarDatoRegistroEmp(numDatoReci,DatoReci,cokieReci)
{var pieza=null;var resultTmp="";var i=0;var separador="$";pieza=cokieReci.split(separador);for(i=0;i<pieza.length;i++){if(numDatoReci==i.toString())resultTmp+=DatoReci+separador;else resultTmp+=pieza[i]+separador;}
return resultTmp;}
var colorerrorG="#ffad07";var colorbienG="#ffffff";var arrayElementosRevG=["nombreMC","asuntoMC","mensajeMC"];var arrayElementosSelectRevG=["ciudadsucu"];var arrayElementosEmailRevG=["emailMC"];var arrayElementosCheckBoxRevG=[""];var datosFaltantes="";function revisarDatosFormuG(arrayElementosRevGReci,arrayElementosSelectRevGReci,arrayElementosEmailRevGReci,arrayElementosCheckBoxRevGReci){var nomObj;var nomObj1;var nomObj2;var objtmp;var saleError;var vTmp="";var separador=",";var nexoFinal="etip";var nomTmp="";if(arrayElementosRevGReci!="")arrayElementosRevG=arrayElementosRevGReci.split(separador);if(arrayElementosSelectRevGReci!="")arrayElementosSelectRevG=arrayElementosSelectRevGReci.split(separador);if(arrayElementosEmailRevGReci!="")arrayElementosEmailRevG=arrayElementosEmailRevGReci.split(separador);if(arrayElementosCheckBoxRevGReci!="")arrayElementosCheckBoxRevG=arrayElementosCheckBoxRevGReci.split(separador);datosFaltantes="";for(contador=0;contador<arrayElementosRevG.length;contador++)
{try
{nomTmp=arrayElementosRevG[contador];try{objtmp=document.getElementById(nomTmp);}catch(e){}
try{objtmp1=document.getElementById(nomTmp+nexoFinal);}catch(e){}
try{objtmp2=document.getElementById(nomTmp+nexoFinal+"1");}catch(e){}
if(trim1(objtmp.value)=="")
{try{objtmp.style.backgroundColor=colorerrorG;}catch(e){}
try{objtmp1.style.display="block";}catch(e){}
try{objtmp2.style.display="none";}catch(e){}
datosFaltantes+=nomTmp+" - ";saleError=true;}
else
{try{objtmp2.style.display="block";}catch(e){}
try{objtmp.style.backgroundColor=colorbienG;}catch(e){}
try{objtmp1.style.display="none";}catch(e){}}}
catch(e){}}
for(contador=0;contador<arrayElementosSelectRevG.length;contador++)
{try
{nomTmp=arrayElementosSelectRevG[contador]+"";try{objtmp=document.getElementById(nomTmp);}catch(e){}
try{objtmp1=document.getElementById(nomTmp+nexoFinal);}catch(e){}
try{objtmp2=document.getElementById(nomTmp+nexoFinal+"1");}catch(e){}
if(trim1(objtmp.value)=="1")
{try{objtmp.style.backgroundColor=colorerrorG;}catch(e){}
try{objtmp1.style.display="block";}catch(e){}
try{objtmp2.style.display="none";}catch(e){}
datosFaltantes+=nomTmp+" - ";saleError=true;}
else
{try{objtmp2.style.display="block";}catch(e){}
try{objtmp.style.backgroundColor=colorbienG;}catch(e){}
try{objtmp1.style.display="none";}catch(e){}}}
catch(e){}}
for(contador=0;contador<arrayElementosEmailRevG.length;contador++)
{try
{nomTmp=arrayElementosEmailRevG[contador];try{objtmp=document.getElementById(nomTmp);}catch(e){}
try{objtmp1=document.getElementById(nomTmp+nexoFinal);}catch(e){}
try{objtmp2=document.getElementById(nomTmp+nexoFinal+"1");}catch(e){}
if(!validarEmail(objtmp.value)||trim1(objtmp.value)=="")
{try{objtmp.style.backgroundColor=colorerrorG;}catch(e){}
try{objtmp1.style.display="block";}catch(e){}
try{objtmp2.style.display="none";}catch(e){}
datosFaltantes+=nomTmp+" - ";saleError=true;}
else
{try{objtmp2.style.display="block";}catch(e){}
try{objtmp.style.backgroundColor=colorbienG;}catch(e){}
try{objtmp1.style.display="none";}catch(e){}}}
catch(e){}}
for(contador=0;contador<arrayElementosCheckBoxRevG.length;contador++)
{try
{nomTmp=arrayElementosCheckBoxRevG[contador];try{objtmp=document.getElementById(nomTmp);}catch(e){}
try{objtmp1=document.getElementById(nomTmp+nexoFinal);}catch(e){}
try{objtmp2=document.getElementById(nomTmp+nexoFinal+"1");}catch(e){}
if(!objtmp.checked)
{try{objtmp.style.backgroundColor=colorerrorG;}catch(e){}
try{objtmp1.style.display="block";}catch(e){}
try{objtmp2.style.display="none";}catch(e){}
datosFaltantes+=nomTmp+" - ";saleError=true;}
else
{try{objtmp2.style.display="block";}catch(e){}
try{objtmp.style.backgroundColor=colorbienG;}catch(e){}
try{objtmp1.style.display="none";}catch(e){}}}
catch(e){}}
if(saleError)return false;else return true;return true;}
