function comprova_form_contacte() { error = ""; frm = document.frm_contacte; if(frm.nom.value.length < 3 || frm.nom.value == "Nom") error += 'Ompli el camp: Nom\n'; if(frm.xmal.value.length < 3 || frm.xmal.value == "E-mail") error += 'Ompli el camp: E-mail\n'; else if(!(/\S+@\S+\.\S+/.test(frm.xmal.value))) error += 'E-mail incorrecte\n'; if(!frm.check_condicions.checked) error += 'Cal acceptar les condicions\n'; if(frm.captcha_client.value.length < 4) error += 'Escriu el codi\n'; if(error) alert(error); else frm.submit(); } function filtra_caracs() { var frm = document.frm_caracs; var num_caracs = 0; $(".filtre_carac").each(function(){ if($(this).val() != "") num_caracs = num_caracs+1; }); if(num_caracs > 0) frm.submit(); else document.location = apps_url+"?id="+frm.id.value; } function inicia_mapa_contacte(lat,lng) { var myLatlng = new google.maps.LatLng(lat,lng); var mapOptions = { zoom: 18, center: myLatlng, mapTypeId: 'satellite' } var map = new google.maps.Map(document.getElementById('mapa_contacte'), mapOptions); map.setTilt(45); var marker = new google.maps.Marker({ position: myLatlng, map: map, icon: http_url+'templates/PUBLIC/img/icon_maps.png' }); } var mapa_prin = null; function carrega_mapa(lat,lng) { var myLatlng = new google.maps.LatLng(lat,lng); var mapOptions = { zoom: 13, center: myLatlng, mapTypeId: google.maps.MapTypeId.HYBRID, panControl: false, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.RIGHT_BOTTOM }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.RIGHT_BOTTOM }, scaleControl: false, streetViewControl: false, overviewMapControl: false } mapa_prin = new google.maps.Map(document.getElementById('mapa'), mapOptions); } var st_enabled= new Array() var st_gest = new Array() var serveis_turistics_enabled =0; function st(id_ruta,id_parent,icon) { //map2.setCenter(map_center) var st_gest_tmp = new Array(); var contenidor_mapa = $("#contenidor_mapa"); $("#boto_mapa_"+id_parent).toggleClass("active"); if($(document).scrollTop() > contenidor_mapa.offset().top+150) $("html,body").animate({scrollTop:0},300); if(!st_enabled[id_parent]) { $.ajax({ type: "GET", url: apps_url+'?action=p&p=PUBLIC/ESPECIFIC/items.php&id_ruta='+id_ruta+'&id_parent='+id_parent, dataType: "xml", success: function(xml) { $(xml).find('item').each(function(){ lat=($(this).attr("lat")) lng=($(this).attr("long")) id_item=($(this).attr("id")) $(this).find('titol').each(function(){ titol = ($(this).text()) }) $(this).find('descripcio').each(function(){ descripcio = ($(this).text()) }) $(this).find('imatge').each(function(){ imatge = ($(this).text()) }) if(imatge) { content_overlay = "
| "+titol+" "+descripcio+" |