﻿var IdRatonIE = document.all ? true : false; var IE = document.all ? true : false; var varbusTime = '0'; var RequestURL = document.URL; var RequestURLQuery = ''; var TempMenuWin = ''; var enProcesoXML = false; var http = getHTTPObject(); var XMLsyncro = false; var jxdonde = ''; var JXTextCargando = 'Cargando'; var http = getHTTPObject(); var ActiveCallback = false; var TempInput = null; var urlweb = ""; var basepro = ""; var galeriaload = false; var subDir = false; function tab(val1, tab1) { if (val1 == 1) { $Ob(tab1).className = 'menutabon'; if (tab1 != 'tt1') ocultar('fam1'); if (tab1 != 'tt2') ocultar('fam2'); if (tab1 != 'tt3') ocultar('fam3');if (tab1 != 'tt9') ocultar('fam9'); if (tab1 != 'tt4') ocultar('fam4'); if (tab1 != 'tt5') ocultar('fam5'); if (tab1 != 'tt6') ocultar('fam6'); if (tab1 != 'tt7') ocultar('fam7'); } else { $Ob(tab1).className = 'menutaboff'; } } function ocultar(sid) { $Ob(sid).style.visibility = 'hidden'; } function visible(sid) { $Ob(sid).style.visibility = 'visible'; } function vionoff(sid) { if ($Ob(sid).style.visibility == 'visible') { $Ob(sid).style.visibility = 'hidden'; } else { $Ob(sid).style.visibility = 'visible'; } } function sutab(val1, tab1) { if (val1 == 1) { $Ob(tab1).className = 'menutabon2'; } else { $Ob(tab1).className = 'menutaboff2'; } } function clicktab() { } function ErFoto(str) { $Ob(str).src = urlweb + 'nofoto.jpg'; } function $Ob(id) { return document.getElementById(id); } function Ira(valor) { ActivarRaton(); top.location.href = (urlweb + valor); return false; } function ClickBusca() { IrBusca(); return false; } function PressBusca(e) { var tecla = (document.all) ? e.keyCode : e.which; if (tecla == 13) { IrBusca(); return false; } } function IrBusca() { if ($Ob('busca').value.length > 1) { top.location.href = urlweb + 'familia.aspx?busca=' + $Ob('busca').value + RequestURLQuery; } else { $Ob('busca').focus(); } return false; } function ClickBusAV() { if ($Ob('buscaraki').disabled == false) { if ($Ob('buscaraki').checked == false) { RequestURLQuery = ''; } else { RequestURLQuery = '&' + RequestURL.split('?')[1].replace('busca', 'b'); $Ob('busca').focus(); } } } function getHTTPObject() { var xmlhttp = null; try { xmlhttp = new ActiveXObject('MSXML2.XMLHTTP'); } catch (e) { try { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) { xmlhttp = null; } } if ((xmlhttp == null) && (typeof XMLHttpRequest != 'undefined')) { try { xmlhttp = new XMLHttpRequest(); XMLsyncro = true; } catch (e) { xmlhttp = null; } } return xmlhttp; } function xGet(pagina, cadena, jxd) { if (!enProcesoXML && http) { jxdonde = jxd; if (JXTextCargando != '') { ActivarRaton(); } var url = urlweb + pagina + '.aspx?' + cadena; http.open('GET', url, true); http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=ISO-8859-1'); http.onreadystatechange = handleHttpResponseXML2; enProcesoXML = true; http.send(null); } } function ActivarRaton() { if (!IdRatonIE) document.captureEvents(Event.MOUSEMOVE); document.onmousemove = ctrRatonRatonXY; if ($Ob('IdRat') != null) { $Ob('IdRat').style.position = 'absolute'; $Ob('IdRat').style.zIndex = '9000'; $Ob('IdRat').innerHTML = '<center><img src=\'' + urlweb + 'classic-loader.gif\' border=0 >'; } } function ctrRatonRatonXY(e) { if (IdRatonIE) { ctrRatonX = event.clientX + document.body.scrollLeft; ctrRatonY = event.clientY + document.body.scrollTop; } else { ctrRatonX = e.pageX; ctrRatonY = e.pageY; } if (ctrRatonX < 0) { ctrRatonX = 0; } if (ctrRatonY < 0) { ctrRatonY = 0; } if ($Ob('IdRat') != null) { $Ob('IdRat').style.top = ctrRatonY + 25; $Ob('IdRat').style.left = ctrRatonX - 1; $Ob('IdRat').style.position = 'absolute'; $Ob('IdRat').style.zIndex = '9000'; } } function DesactivarRaton() { if ($Ob('IdRat') != null) { $Ob('IdRat').innerHTML = ''; } } function handleHttpResponseXML2() { if (http.readyState == 4) { if (http.status == 200) { results = http.responseText; XMLresultado = results; DesactivarRaton(); if (XMLresultado != '') { document.getElementById(jxdonde).innerHTML = XMLresultado; } enProcesoXML = false; if (typeof callback == 'function') { callback(jxdonde); } if (typeof returncallback == 'function') { returncallback(XMLresultado, jxdonde); } } } } function Consultar(sId) { Ira('contactar.aspx?idx=' + sId); return false; } function showTop() { boxWidth = 748; boxHeight = 686; screenWidth = document.all ? document.body.clientWidth : window.innerWidth; screenHeight = document.all ? document.body.clientHeight : window.innerHeight; xPos = (screenWidth - boxWidth) * 0.5; yPos = (screenHeight - boxHeight) * 0.5; $Ob('screenoverlay').style.height = '100%'; if ($Ob('mapa') != null) { $Ob('mapa').style.left = xPos + 'px'; $Ob('mapa').style.top = yPos + 'px'; $Ob('mapa').style.visibility = 'visible'; } $Ob('screenoverlay').style.visibility = 'visible'; $Ob('screenoverlay').style.height = document.body.scrollHeight + 'px'; } function delayedShowTop(seconds) { setTimeout('closeTop()', seconds * 1000); } function closeTop() { $Ob('screenoverlay').style.visibility = 'hidden'; if ($Ob('mapa') != null) { $Ob('mapa').style.visibility = 'hidden'; } MapPrimer = true; } function CheckConta() { var TodoOk = true; if ($Ob('mapa') != null) { $Ob('mapa').style.visibility = 'hidden'; } if (vEmail($Ob('ctrlconta1_txtmail').value) == false) { TodoOk = false; window.scrollTo(0, 0); showTop(); $Ob('msg000').style.visibility = 'visible'; TempInput = $Ob('ctrlconta1_txtmail'); xGet('tiendas', 'msg=er0', 'msg000'); } if ($Ob('ctrlconta1_txtasunto').value == '' && TodoOk == true) { TodoOk = false; window.scrollTo(0, 0); showTop(); $Ob('msg000').style.visibility = 'visible'; TempInput = $Ob('ctrlconta1_txtasunto'); xGet('tiendas', 'msg=er1', 'msg000'); } if ($Ob('ctrlconta1_txtcuerpo').value == '' && TodoOk == true) { TodoOk = false; window.scrollTo(0, 0); showTop(); $Ob('msg000').style.visibility = 'visible'; TempInput = $Ob('ctrlconta1_txtcuerpo'); xGet('tiendas', 'msg=er2', 'msg000'); } if (TodoOk == true) { return true; } else { return false; } } function closeMsg() { $Ob('screenoverlay').style.visibility = 'hidden'; $Ob('msg000').innerHTML = ''; $Ob('msg000').style.visibility = 'hidden'; if ($Ob('mapa') != null) { $Ob('mapa').style.visibility = 'hidden'; } if (TempInput != null) { TempInput.focus(); } } function vEmail(valor) { re = /^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/; if (!re.exec(valor)) { return false; } else { return true; } } function Hidden(sId, nom) { if ($Ob(sId).className == 'oculto') { $Ob(sId).className = nom; } else { $Ob(sId).className = 'oculto'; } } function MenOu(sId) { var imafon = ''; if (sId.startsWith('divf')) { imafon = '2'; } $Ob(sId).style.backgroundImage = 'url(\'' + urlweb + 'fondofam' + imafon + '.jpg\')'; } function MenOv(sId) { var imafon = '3'; if (sId.startsWith('divf')) { imafon = '4'; } $Ob(sId).style.backgroundImage = 'url(\'' + urlweb + 'fondofam' + imafon + '.jpg\')'; } function BusRes(bscpala, bscres, bscpag, bsctime) { } function memoriabase() { if (basepro == "") { basepro = $Ob("basepro").innerHTML; } return true; } function clickRest() { if (basepro != "") { $Ob("clickrest").style.color = "black"; $Ob("clickes").style.color = ""; $Ob("clickgal").style.color = ""; $Ob("clickprob").style.color = ""; $Ob("basepro").innerHTML = basepro; } } function clickEs(sid) { $Ob("clickes").style.color = "black"; $Ob("clickrest").style.color = ""; $Ob("clickgal").style.color = ""; $Ob("clickprob").style.color = ""; if (memoriabase() == true) { xGet('probase', 'id=' + sid, 'basepro'); } } function clickgal(sid) { $Ob("clickgal").style.color = "black"; $Ob("clickrest").style.color = ""; $Ob("clickes").style.color = ""; $Ob("clickprob").style.color = ""; if (memoriabase() == true) { $Ob("basepro").innerHTML = ""; xGet('galeria', 'id=' + sid, 'basepro'); } }
function clickprob(sid) { $Ob("clickprob").style.color = "black"; $Ob("clickgal").style.color = ""; $Ob("clickrest").style.color = ""; $Ob("clickes").style.color = ""; if (memoriabase() == true) { $Ob("basepro").innerHTML = ""; xGet('proble', 'id=' + sid, 'basepro'); } } function returncallback(XMLresultado, jxdonde) { if (galeriaload == false) { Galleria.loadTheme('galleria.classic.min.js'); galeriaload = true; } ActivarRaton(); $('#galleria').galleria(); } function jColor(scolor, fotpos) {
    if (subDir == false) { $Ob(fotpos).src = "imagenes/" + scolor + ".png"; } else { $Ob(fotpos).src = "../imagenes/" + scolor + ".png"; } 
} 
