window.addEvent('domready', function() { if ($("plaats_select")) { $("plaats_select").addEvent('change', function(event) { document.location.href ='/tiendas-shopping/'+this.value+'.html'; }); } if ($("zoek_plaats")) { $("zoek_plaats").addEvent('keyup', function(event) { filter_plaatsen.set(this.value); if (event.key == "enter") { $('plaats_select').selectedIndex=0; if ($('plaats_select').value != "") document.location.href ='/tiendas-shopping/'+$('plaats_select').value+'.html'; } }); } if ($("winkel_select")) { $("winkel_select").addEvent('change', function(event) { var url=""; if (instr(this.value, 'fs_', 0)) url = '/estaciones/'+this.value.replace("fs_","")+'.html'; if (instr(this.value, 'bk_', 0)) url = '/bancos/'+this.value.replace("bk_","")+'.html'; if (url == "") url = '/tiendas/'+this.value+'.html'; document.location.href = url; }); } if ($("zoek_winkel")) { $("zoek_winkel").addEvent('keyup', function(event) { filter_winkels.set(this.value); if (event.key == "enter") { $('winkel_select').selectedIndex=0; if ($('winkel_select').value != "") document.location.href ='/tiendas/'+$('winkel_select').value+'.html'; } }); } $$('.delete_winkel').each(function(item) { item.addEvent('click', function(event) { if (!confirm('Eliminar?')) return false; }); }); if ($("winkel_wijziging")) { $("reden").addEvent('change', function(event) { if (this.value == 3) { $('adressenlijst').setStyle('display', 'none'); } else if ((this.value == 1) || (this.value == 2)) { $('adressenlijst').setStyle('display', 'block'); } }); $("winkel_wijziging").addEvent('submit', function(event) { melding = ''; if ($('reden').selectedIndex < 0) { melding += "- No se han indicado el motivo!\n"; } if (($('reden').value == "1") || ($('reden').value == "2")) { if ($('winkelid').selectedIndex < 0) { melding += "- No se ha seleccionado una dirección!\n"; } } if (melding != "") { alert(melding); return false; } else { return true; } }); } var filter_winkels = new filterlist($('winkel_select')); var filter_plaatsen = new filterlist($('plaats_select')); }); var gmarkers = []; var i = 0; function createMarker(point,html,icon,i) { var marker = new GMarker(point,icon); GEvent.addListener(marker, "click", function() { //$('map').setZoom(3); marker.openInfoWindowHtml(html); clearSelectedAddresses(); $('adres_'+(i-1)).addClass('adres_div_active'); }); gmarkers[i] = marker; i++; return marker; } function getAdresClick(i) { GEvent.trigger(gmarkers[i], "click"); } function clearSelectedAddresses() { $$('.adres_div').each(function(item) { item.removeClass('adres_div_active'); }); } function bookmark(url, description) { if (document.all) { window.external.AddFavorite(url, description); } else if (window.sidebar) { window.sidebar.addPanel(description, url, ""); } } function filterlist(selectobj) { this.selectobj = selectobj; this.flags = 'i'; this.match_text = true; this.match_value = false; this.show_debug = false; this.init = function() { if (!this.selectobj) return this.debug('selectobj not defined'); if (!this.selectobj.options) return this.debug('selectobj.options not defined'); this.optionscopy = new Array(); if (this.selectobj && this.selectobj.options) { for (var i=0; i < this.selectobj.options.length; i++) { this.optionscopy[i] = new Option(); this.optionscopy[i].text = selectobj.options[i].text; if (selectobj.options[i].value) { this.optionscopy[i].value = selectobj.options[i].value; } else { this.optionscopy[i].value = selectobj.options[i].text; } } } } this.reset = function() { this.set(''); } this.set = function(pattern) { var loop=0, index=0, regexp, e; if (!this.selectobj) return this.debug('selectobj not defined'); if (!this.selectobj.options) return this.debug('selectobj.options not defined'); this.selectobj.options.length = 0; try { regexp = new RegExp(pattern, this.flags); } catch(e) { if (typeof this.hook == 'function') { this.hook(); } return; } for (loop=0; loop < this.optionscopy.length; loop++) { var option = this.optionscopy[loop]; if ((this.match_text && regexp.test(option.text)) || (this.match_value && regexp.test(option.value))) { this.selectobj.options[index++] = new Option(option.text, option.value, false); } } if (typeof this.hook == 'function') { this.hook(); } } this.set_ignore_case = function(value) { if (value) { this.flags = 'i'; } else { this.flags = ''; } } this.debug = function(msg) { if (this.show_debug) { alert('FilterList: ' + msg); } } this.init(); } function instr (haystack, needle, offset) { var i = (haystack+'').indexOf(needle, (offset ? offset : 0)); return i === -1 ? false : true; } function strpos (haystack, needle, offset) { var i = (haystack+'').indexOf(needle, (offset ? offset : 0)); return i === -1 ? false : i; }