
var clickHandler;var map;var lat;var lng;var locations;var bounds;$(document).ready(function(){$("#map").css("z-index","1");$(".navoHak").css("z-index","2");$(".navoEstetik").css("z-index","2");$(".navoCocuk").css("z-index","2");$(".navoDistedavi").css("z-index","2");$("#randevum").validate({messages:{email:{required:"Eposta adresinizi giriniz!",email:"Lutfen gecerli bir eposta adresi giriniz"},name:{required:"Lutfen adinizi soyadinizi giriniz"},message:{required:"Lutfen mesajinizi giriniz"}}});$("#doktorum").validate({messages:{email:{required:"Eposta adresinizi giriniz!",email:"Lutfen gecerli bir eposta adresi giriniz"},name:{required:"Lutfen adinizi soyadinizi giriniz"},message:{required:"Lutfen mesajinizi giriniz"}}});if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.setCenter(new GLatLng(41.052608769306964,28.995248879299927),17);var icon=new GIcon();icon.image="http://www.toruko.org/plusdent_marker.png";icon.iconSize=new GSize(47,72);icon.iconAnchor=new GPoint(37,59);icon.infoWindowAnchor=new GPoint(31,8);var marker=new GMarker(new GLatLng(41.052608769306964,28.995248079299927),icon);map.addOverlay(marker);GEvent.addListener(marker,'mouseover',function(){marker.openInfoWindowHtml('<b>PlusDent</b><br />Poyracik Sok.<br />Astorya Apt. <br />45/2<br />Nisantasi Istanbul');});}});function setNewMarker(point){$('div#formular').show('slow');$('a#new_location').show();$('div#info').hide();lat=point.lat();lng=point.lng();$('div#formular').find('p:nth-of-type(0) ').html('Latitude=<b>'+lat+'</b>, Longitude=<b>'+lng+'</b>');$('div#formular').show();GEvent.removeListener(clickHandler);}
function processLocations(content){eval("locations = "+content);$('p#location_list').html('');locations.forEach(function(element,index,array){var marker=new GMarker(new GLatLng(element.latitude,element.longitude),{title:element.name});map.addOverlay(marker);GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml('Name: <b>'+element.name+'</b><br />Latitude: <b>'+element.latitude+'</b><br />Longitude: <b>'+element.longitude+'</b>');});link='<a href="#" onclick="moveMapTo('+index+')">'+element.name+'</a><br />';$('p#location_list').append(link);});zoomShowAll();}
function moveMapTo(index){map.panTo(new GLatLng(locations[index].latitude,locations[index].longitude));}
function zoomShowAll(){bounds=new GLatLngBounds();map.setCenter(new GLatLng(0,0),0);locations.forEach(function(elemet,id,array){bounds.extend(new GLatLng(locations[id].latitude,locations[id].longitude));});map.setZoom(map.getBoundsZoomLevel(bounds));var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;map.setCenter(new GLatLng(clat,clng));}