function fl2jv($x,$y,$z){ if($x=="connexion"){ if($y=="1"){ document.getElementById('stateconnect').innerHTML=" [ Se déconnecter ] | [Mon compte] |"; }else{ document.getElementById('stateconnect').innerHTML="[ Connectez-vous... ] |"; } } if($z=="1"){ ajaxLoader(1,'data','825759a4f371befcb203a1e61abc1880','',''); } } function getWindowHeight() { var windowHeight = 0; if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body && document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; } var windowHeight = 0; var windowWidth = 0; function getWindowHeight() { if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body && document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; } function getWindowWidth() { if (typeof(window.innerWidth) == 'number') { windowWidth = window.innerWidth; } else { if (document.documentElement && document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { if (document.body && document.body.clientWidth) { windowWidth = document.body.clientWidth; } } } return windowWidth; } function setSize() { if (document.getElementById) { windowHeight = getWindowHeight(); if (windowHeight > 0) { var mapHeight = document.getElementById('mapContainer').offsetHeight; var topHeight = document.getElementById('top').offsetHeight; var delta = windowHeight - (topHeight)-2-15; document.getElementById('mapContainer').style.height = delta+ 'px'; document.getElementById('sideContainer').style.height = delta+ 'px'; document.getElementById('data').style.height = delta+ 'px'; //document.getElementById('msg').innerHTML=windowHeight+" "+topHeight + " "+mapHeight+" "+delta; } windowWidth = getWindowWidth(); var wa=document.getElementById('sideContainer').offsetWidth; var wb=document.getElementById('mapContainer').offsetWidth; var wc=document.getElementById('data').offsetWidth; //document.getElementById('msg').innerHTML = windowWidth-(wa+wb)+" : "+wc+" : "+(windowWidth-(wa+wb+wc))+' '+Math.floor(wc/windowWidth*1000)/10; if(Math.floor(wc/windowWidth*1000)/10<41.2){ //document.getElementById('mapContainer').style.width = '44%'; } } } function libcty($x,$zg){ if($zg=="N"){ document.getElementById('libpaysN').innerHTML=$x.toUpperCase(); document.getElementById('libpaysS').innerHTML=""; }else{ document.getElementById('libpaysN').innerHTML=""; document.getElementById('libpaysS').innerHTML=$x.toUpperCase(); } } google.load('maps','3',{'other_params': 'sensor=false&language=FR'}); google.setOnLoadCallback(startmap); /*var map; */ var markers=[]; var visibleInfoWindow = null; var latlngbounds; var tabdata; var tabaoc; var onemarker; var infoWindow = null; var iwevent; var contentString = '
'; var directionsDisplay; var directionsService; var ln='2'; var regencours; var timeo=true; function toiwoff(){ setTimeout("toiw()",100); } function toiw(){ timeo=true; } function generateTriggerCallback(object, eventType) { return function() { google.maps.event.trigger(object, eventType); }; } function openInfoWindow(infoWindow, marker) { return function() { // Close the last selected marker before opening this one. if (visibleInfoWindow) { visibleInfoWindow.close(); } var latLng = marker.position; var offsetiw = new google.maps.Size(10, 3); //var iwsize = new google.maps.Size(430, 400); var posiw = latLng; infoWindow = new google.maps.InfoWindow(); infoWindow.setContent(contentString); //infoWindow.setOptions({pixelOffset:offsetiw,size:iwsize}); infoWindow.setOptions({pixelOffset:offsetiw}); infoWindow.setPosition(latLng); infoWindow.open(map, marker); iwevent=google.maps.event.addListener(infoWindow, 'closeclick', function() { closeiw(); }); iwevent=google.maps.event.addListener(infoWindow, 'domready', function() { iwLoader('iw','825759a4f371befcb203a1e61abc1880',marker.kelcode); }); map.panTo(marker.position); map.panBy(20,-80); visibleInfoWindow = infoWindow; } } function closeiw() { if (visibleInfoWindow) { visibleInfoWindow.close(); } visibleInfoWindow = null; } function clearMarkers(){ for (var i = 0, marker; marker = markers[i]; i++) { marker.setMap(null); marker.setVisible(false); } } function goBack($x){ countryLoader(0,$x,'825759a4f371befcb203a1e61abc1880','',''); } function loadfile($x){ alert($x); } function sh(kelcode,openit){ if(timeo){ var el = document.getElementById('contactFormArea'); closeiw(); if(openit == 1){ var n = tabdata.count; for (var i = 0; i < n; i++) { if(tabdata.prod[i].prod_kelcode == kelcode){ var latLng = new google.maps.LatLng(tabdata.prod[i].latitude,tabdata.prod[i].longitude); var offsetiw = new google.maps.Size(10, 3); var iwsize = new google.maps.Size(430, 400); var posiw = latLng; if(!visibleInfoWindow){ infoWindow = new google.maps.InfoWindow(); infoWindow.setContent(contentString); infoWindow.setOptions({pixelOffset:offsetiw,size:iwsize}); infoWindow.setPosition(latLng); infoWindow.open(map); iwevent=google.maps.event.addListener(infoWindow, 'closeclick', function() { closeiw(); }); iwevent=google.maps.event.addListener(infoWindow, 'domready', function() { iwLoader('iw','825759a4f371befcb203a1e61abc1880',kelcode); }); }else{ infoWindow.setContent(""); infoWindow.setPosition(latLng); iwLoader('iw','825759a4f371befcb203a1e61abc1880',kelcode); } map.panTo(latLng); map.panBy(20,-80); visibleInfoWindow = infoWindow; } } }else{ visibleInfoWindow.close(); } toiwoff(); } timeo=false; } function generateRandomMarkers(zoom) { closeiw(); // Populate side bar. var ul = document.getElementById('sideContainer'); ul.innerHTML = ''; clearMarkers(); if(zoom>7){ for (var i = 0; i < tabdata.count; i++) { var image = new google.maps.MarkerImage('http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,'+tabdata.prod[i].prod_col+',000000&ext=', new google.maps.Size(32, 32), new google.maps.Point(0,0), new google.maps.Point(0, 32)); /* var shadow = new google.maps.MarkerImage('images/beachflag_shadow.png', new google.maps.Size(37, 32), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var shape = { coord: [1, 1, 1, 20, 18, 20, 18 , 1], type: 'poly' };*/ var latLng = new google.maps.LatLng(tabdata.prod[i].latitude, tabdata.prod[i].longitude) var marker = new google.maps.Marker({ map: map, title: tabdata.prod[i].prod_title, position: latLng, icon: image, kelcode: tabdata.prod[i].prod_kelcode, draggable: true }); markers.push(marker); // Create marker info window. infoWindow = new google.maps.InfoWindow({ content: contentString, size: new google.maps.Size(430, 210) }); // Add marker click event listener. google.maps.event.addListener(marker, 'click', openInfoWindow(infoWindow, marker)); } }else{ for (var i = 0; i < regions.count; i++) { var image = new google.maps.MarkerImage('http://www.alastyn.com/v3/css/icone.php?r=16&fg='+regions.region[i].reg_color+'&bg=000000&tx='+regions.region[i].reg_nbre, new google.maps.Size(32, 32), new google.maps.Point(0,0), new google.maps.Point(10,10) ); var shadow = new google.maps.MarkerImage('http://www.alastyn.com/v3/css/icone.php?r=18&fg=FFFFFF&bg=FFFFFF&tx=', new google.maps.Size(36, 36), new google.maps.Point(3,3), new google.maps.Point(0, 0) ); var shape = { coord: [1, 1, 1, 30, 30, 30, 30 , 1], type: 'poly' }; var latLng = new google.maps.LatLng(regions.region[i].latitude, regions.region[i].longitude) var marker = new google.maps.Marker({ map: map, title: regions.region[i].reg_title, position: latLng, regid: regions.region[i].reg_id, icon: image, shape: shape }); markers.push(marker); // Add marker click event listener. google.maps.event.addListener(marker, 'click', zm(marker.position,marker.regid)); } } var li = document.createElement('li'); /*li.style.backgroundColor = '#C678C6';*/ li.style.background = 'url(../v3/images/ui/plebg.png) 0 0 repeat-x'; var aSel = document.createElement('a'); aSel.innerHTML = '

France

'; li.appendChild(aSel); ul.appendChild(li); for (var i = 0; i < regions.count; i++) { // Generate list elements for each marker. var li = document.createElement('li'); var aSel = document.createElement('a'); aSel.href = 'javascript:zoneLoader(1,\''+regions.region[i].reg_id+'\',\'825759a4f371befcb203a1e61abc1880\');';//'javascript:void(0);'; aSel.innerHTML = '
'+regions.region[i].reg_title; //aSel.onclick = generateTriggerCallback(marker,'click'); li.appendChild(aSel); ul.appendChild(li); } ajaxLoader(1,'data','825759a4f371befcb203a1e61abc1880','',''); } function showMarkers(zoom,url,tabdata,tabaoc,valentity,level) { clearMarkers(); closeiw(); latlngbounds = new google.maps.LatLngBounds(); google.maps.event.removeListener(myevent1); for (var i = 0; i < tabdata.count; i++) { var image = new google.maps.MarkerImage('http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,'+tabdata.prod[i].aoc_col+',000000&ext=', new google.maps.Size(32, 32), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var latLng = new google.maps.LatLng(tabdata.prod[i].latitude,tabdata.prod[i].longitude) latlngbounds.extend(latLng); var marker = new google.maps.Marker({ map: map, title: tabdata.prod[i].prod_title, position: latLng, icon: image, kelcode: tabdata.prod[i].prod_kelcode }); markers.push(marker); // Create marker info window. infoWindow = new google.maps.InfoWindow({ content: contentString /*size: new google.maps.Size(200, 80)*/ }); google.maps.event.addListener(marker, 'click', openInfoWindow(infoWindow, marker)); } if(tabdata.count>1){ map.fitBounds(latlngbounds); var $z=map.getZoom()-1; map.setZoom($z); }else{ map.setZoom(10); map.setCenter(latLng); } ajaxLoader(1,'data','825759a4f371befcb203a1e61abc1880',valentity,''); switchSideBar(2);//,tabdata,tabaoc); } function switchSideBar($whattoshow){ var ul = document.getElementById('sideContainer'); ul.innerHTML = ''; var li = document.createElement('li'); /*li.style.backgroundColor = '#C9F';*/ li.style.background = 'url(../v3/images/ui/plebg.png) 0 0 repeat-x'; var aSel = document.createElement('a'); aSel.href = 'javascript:goBack(1);'; aSel.innerHTML = '

'+tabaoc.region+'

'; li.appendChild(aSel); ul.appendChild(li); if($whattoshow==1){ for(var i = 0; i < tabdata.count; i++){ // Generate list elements for each marker. var li = document.createElement('li'); var aSel = document.createElement('a'); aSel.href = 'javascript:dar(\''+tabaoc.lib[i].aoc_id+'\',\'825759a4f371befcb203a1e61abc1880\')'; //aSel.innerHTML = tabdata.prod[i].prod_title; aSel.innerHTML = '
'+tabdata.prod[i].prod_title; aSel.onclick = generateTriggerCallback(markers[i], 'click'); li.appendChild(aSel); ul.appendChild(li); } var li = document.createElement('li'); var aSel = document.createElement('a'); aSel.href = 'javascript:switchSideBar(2);'; aSel.innerHTML = 'Liste des Appellations'; li.appendChild(aSel); ul.appendChild(li); }else{ for(var i = 0; i < tabaoc.count; i++){ // Generate list elements for each marker. var li = document.createElement('li'); var aSel = document.createElement('a'); aSel.href = 'javascript:dar(\''+tabaoc.lib[i].aoc_id+'\',\'825759a4f371befcb203a1e61abc1880\');'; //aSel.innerHTML = tabaoc.lib[i].aoc_title; aSel.innerHTML = '
'+tabaoc.lib[i].aoc_title; li.appendChild(aSel); ul.appendChild(li); } /*var li = document.createElement('li'); var aSel = document.createElement('a'); aSel.href = 'javascript:switchSideBar(1);'; aSel.innerHTML = 'Liste des Producteurs'; li.appendChild(aSel); ul.appendChild(li);*/ } } function zm(pos,id){ return function() { map.setZoom(8); map.setCenter(pos); zoneLoader(1,id,'825759a4f371befcb203a1e61abc1880') } } var myevent1; function startmap() { var firstLatLng = new google.maps.LatLng(46.50,2.96); directionsService = new google.maps.DirectionsService(); directionsDisplay = new google.maps.DirectionsRenderer(); directionsDisplay.setPanel(document.getElementById('directionsPanel')); map = new google.maps.Map(document.getElementById('mapContainer'), { zoom: 6, center: firstLatLng, mapTypeId: google.maps.MapTypeId.ROADMAP }); directionsDisplay.setMap(map); var startzoom=6; myevent1=google.maps.event.addListener(map, 'zoom_changed', function() { zoomLevel = map.getZoom(); generateRandomMarkers(zoomLevel); }); // Add onclick handler to generate link. generateRandomMarkers(6); setSize(); pubLoader(1,"pubright","alastyn","2"); closeiw(); } window.onresize = function() { setSize(); }