function chngImg (imgName, li)
{
var image = document.getElementById('imageMap');
widtheight = 'width="308" height="338"';
image.innerHTML = '
';
if (document.getElementById(li).className=='active') document.getElementById(li).className='noactive';
else if (document.getElementById(li).className=='noactive') document.getElementById(li).className='active';
}
function chngImgSrc (imgId, imgSrc)
{
var image = document.getElementById(imgId);
image.src = imgSrc;
}
function showMapTiend(urlMap) {
document.getElementById('navTiendaMap').style.display="none";
document.getElementById('navTiendaFot').style.display="block";
mapa = document.getElementById('mapa');
mapa.style.height = "338px";
mapa.style.width = "562px";
mapa.innerHTML = "";
}
function showPicTiend(urlMap) {
document.getElementById('navTiendaFot').style.display="none";
document.getElementById('navTiendaMap').style.display="block";
mapa = document.getElementById('mapa');
mapa.style.height = "217px";
mapa.style.width = "5495px";
mapa.innerHTML = "
";
}
function cambiaPestCat(numId) {
for (i=1; i<6;i++) {
if (document.getElementById('pest_'+i)) {
document.getElementById('pest_'+i).className = 'noactive';
document.getElementById('show_pest_'+i).style.display = 'none';
}
}
document.getElementById('pest_'+numId).className = 'active';
document.getElementById('show_pest_'+numId).style.display = 'block';
}
function cambiaDisplay(idString) {
var objs = idString.split("|");
for (i=0; i$1");
x++;
}
}
function limpiaPalabra(palabra)
{
// Funcion encargada de sacarle el codigo HTML de la negrita a las palabras
palabra=palabra.replace(//i, "");
palabra=palabra.replace(/<\/b>/i, "");
return palabra;
}
function coincideBusqueda(palabraEntera, primerasLetras)
{
/* Funcion para verificar que las primeras letras de busquedaActual sean iguales al
contenido de busquedaAnterior. Se devuelve 1 si la verificacion es afirmativa */
if(primerasLetras==null) return 0;
var verificaExpresion=new RegExp("^("+primerasLetras+")", "i");
if(verificaExpresion.test(palabraEntera)) return 1;
else return 0;
}
function nuevaCadenaNula(valor)
{
/* Seteo cual fue la ultima busqueda que no arrojo resultados siempre y cuando la cadena
nueva no comience con las letras de la ultima cadena que no arrojo resultados */
if(coincideBusqueda(valor, ultimaBusquedaNula)==0) ultimaBusquedaNula=valor;
}
function busquedaEnBD(tipo)
{
var inputLista = document.getElementById('qs_'+tipo+'-1');
var valor=inputLista.value;
if((coincideBusqueda(valor, busqueda)==1 && nuevaBusqueda==0) || coincideBusqueda(valor, ultimaBusquedaNula)==1) return 0;
else return 1;
}
function filtraLista(valor)
{
// Funcion encargada de modificar la lista de nombres en base a la nueva busqueda
var x=0;
while(divLista.childNodes[x]!=null)
{
// Saco la negrita a los elementos del listado
divLista.childNodes[x].innerHTML=limpiaPalabra(divLista.childNodes[x].innerHTML);
if(coincideBusqueda(limpiaPalabra(divLista.childNodes[x].innerHTML), valor)==0)
{
/* Si remuevo el elemento x, el elemento posterior pasa a ocupar la posicion de
x, entonces quedaria sin revisar. Por eso disminuyo 1 valor a x */
divLista.removeChild(divLista.childNodes[x]);
x--;
}
x++;
}
}
function reiniciaSeleccion()
{
mouseFuera();
elementoSeleccionado=0;
}
function navegaTeclado(tipo, evento)
{
var teclaPresionada=(document.all) ? evento.keyCode : evento.which;
switch(teclaPresionada)
{
case 40:
if(elementoSeleccionado1)
{
mouseDentro(document.getElementById(parseInt(elementoSeleccionado)-1));
}
return 0;
case 13:
if(divLista.style.display=="block" && elementoSeleccionado!=0)
{
clickLista(tipo, document.getElementById(elementoSeleccionado))
}
return 0;
default: return 1;
}
}
function clickLista(tipo, elemento)
{
var inputLista = document.getElementById('qs_'+tipo+'-1');
/* Se ejecuta cuando se hace clic en algun elemento de la lista. Se coloca en el input el
valor del elemento clickeado */
v=1;
valor=limpiaPalabra(elemento.innerHTML);
busqueda=valor; inputLista.value=valor;
divLista.style.display="none"; elemento.className="normal";
}
function mouseFuera()
{
// Des-selecciono el elemento actualmente seleccionado, si es que hay alguno
if(elementoSeleccionado!=0 && document.getElementById(elementoSeleccionado)) document.getElementById(elementoSeleccionado).className="normal";
}
function mouseDentro(elemento)
{
mouseFuera();
elemento.className="resaltado";
// Establezco el nuevo elemento seleccionado
elementoSeleccionado=elemento.id;
}
function checkContact() {
var thisForm = document.getElementById('formcontacto');
var camposRek = new Array('nombre', 'apellidos', 'email', 'email2', 'telefono', 'consulta');
var selectsRek = new Array( 'provincia');
var formOk = 1;
for(i=0; i