
var map,lat,lon,zoom;function show_map(lat,lon,zoom,controls)
{if(controls=="big"){var point=new google.maps.LatLng(lat,lon);var mapOptions={zoom:zoom,zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE},panControl:true,panControlOptions:{style:google.maps.panControlStyle.LARGE},center:point,mapTypeId:google.maps.MapTypeId.ROADMAP}}
else if(controls=="small"){var point=new google.maps.LatLng(lat,lon);var mapOptions={zoom:zoom,zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL},panControl:true,panControlOptions:{style:google.maps.PanControlStyle.SMALL},center:point,mapTypeId:google.maps.MapTypeId.ROADMAP}}else{var point=new google.maps.LatLng(lat,lon);var mapOptions={zoom:zoom,center:point,mapTypeId:google.maps.MapTypeId.ROADMAP}}
map=new google.maps.Map(document.getElementById("map"),mapOptions);}
function loadMap()
{if(lat!=undefined&&lon!=undefined)
load_map(lat,lon,zoom);}
if(window.addEventListener)
window.addEventListener("load",loadMap,false);else
if(window.attachEvent)
window.attachEvent("onload",loadMap);else
window.onload=loadMap;function toggle_map_view(mode)
{map.setMapType(mode);}
function add_MapKeyboardHandler()
{var options={keyboardShortcuts:true};map.setOptions(options);}
function add_SimpleMarker(latitude,longitude)
{var myLatLng=new google.maps.LatLng(latitude,longitude);var marker=new google.maps.Marker({position:myLatLng});marker.setMap(map);}
function add_CustomMarker(latitude,longitude,image_url,image_width,image_height)
{var icon=new google.maps.MarkerImage({url:image_url,size:new google.maps.Size(image_width,image_height),anchor:new google.maps.Point(image_width.image_height)});var point=new google.maps.LatLng(latitude,longitude);var marker=new google.maps.Marker(point,icon);marker.setMap(map);}
function add_NearbyMarker(point,shortcode,id,photo,photo_width,photo_height,street,area,county,agreed,summary,price,collection,curr)
{var text="";var link="<a href=\"javascript:openpage("+id+")\">www.daft.ie/"+shortcode+"<\/a>";var image="";if(photo)
{var image="<img border=\"0\" src=\""+photo+"\" width=\""+photo_width+"\" height=\""+photo_height+"\" />";}
text="<div><table cellspacing=\"5\" style=\"font-family:arial;font-size:9pt;\"><tr><td>";if(street!="")
{text+=street+",<br> ";}
text+=area+",<br> "+county;var color="blue";if(agreed!=null&&agreed!="")
{text+="<br><font style=\"background:#ff0000; color:#ffffff\"><strong>&nbsp;"+agreed+"&nbsp;<\/b><\/font><br>";color="red";}
else
{text+="<br><br>";}
text+=summary;if(price!="0")
{text+=", <strong>&#8364;"+price+"<\/b>";}
if(collection!=null)
{text+=" "+collection;}
text+="<br><br>"+link+"<\/td><td><a href=\"javascript:openpage("+id+")\">"+image+"<\/a><\/td><\/tr><\/table><\/div>";;if(curr==true)
{var icon=new google.maps.MarkerImage({url:"http://www.daft.ie/i/maps/big_pointer.png",size:new google.maps.Size(20,34),anchor:new google.maps.Point(10.34)});}
else
{var icon=new google.maps.MarkerImage({url:"http://www.daft.ie/i/maps/"+color+".png",size:new google.maps.Size(12,20),anchor:new google.maps.Point(10.34)});}
var marker=new google.maps.Marker({icon:icon,position:point});google.maps.event.addListener(marker,'click',function()
{infowindow.setContent('<div style=\"white-space: nowrap;\">'+text+'<\/div>');infowindow.open(map);});marker.setMap(map);}
function jumpTo(c_id)
{setZoomLevel(12);if(c_id==1)
{map.setCenter(new google.maps.LatLng(53.33395522745,-6.272611661));}
else if(c_id==2)
{map.setCenter(new google.maps.LatLng(53.65002736,-6.68038649267));}
else if(c_id==3)
{map.setCenter(new google.maps.LatLng(53.1584612880,-6.90632871966));}
else if(c_id==4)
{map.setCenter(new google.maps.LatLng(52.9762654725,-6.0451768411187));}
else if(c_id==5)
{map.setCenter(new google.maps.LatLng(53.7273798444,-7.79358941406));}
else if(c_id==6)
{map.setCenter(new google.maps.LatLng(53.096040595,-7.908538857467));}
else if(c_id==7)
{map.setCenter(new google.maps.LatLng(53.524338231,-7.342952742));}
else if(c_id==8)
{map.setCenter(new google.maps.LatLng(53.0390439834,-7.29400750362));}
else if(c_id==9)
{map.setCenter(new google.maps.LatLng(53.717047,-6.349113585));}
else if(c_id==10)
{map.setCenter(new google.maps.LatLng(52.8344881467682864,-6.9186402001592));}
else if(c_id==11)
{map.setCenter(new google.maps.LatLng(52.6534668367059717,-7.2480053748417));}
else if(c_id==12)
{map.setCenter(new google.maps.LatLng(52.2506772464,-7.1118272939));}
else if(c_id==13)
{map.setCenter(new google.maps.LatLng(52.33380127767,-6.47231964887));}
else if(c_id==14)
{map.setCenter(new google.maps.LatLng(52.27266432377,-9.70207581));}
else if(c_id==15)
{map.setCenter(new google.maps.LatLng(51.8928466,-8.4662617539984));}
else if(c_id==16)
{map.setCenter(new google.maps.LatLng(52.845066787529,-8.984881619132));}
else if(c_id==17)
{map.setCenter(new google.maps.LatLng(52.6584631285742,-8.624995459));}
else if(c_id==18)
{map.setCenter(new google.maps.LatLng(52.35862389252,-7.70717318));}
else if(c_id==19)
{map.setCenter(new google.maps.LatLng(53.277184502,-9.05647148783695));}
else if(c_id==20)
{map.setCenter(new google.maps.LatLng(53.85722137523,-9.29829184392));}
else if(c_id==21)
{map.setCenter(new google.maps.LatLng(53.76599258834,-8.4902629975));}
else if(c_id==22)
{map.setCenter(new google.maps.LatLng(54.269413793188,-8.474957035));}
else if(c_id==23)
{map.setCenter(new google.maps.LatLng(53.9503715558,-8.0878817580));}
else if(c_id==24)
{map.setCenter(new google.maps.LatLng(54.65479716457,-8.1098959344472));}
else if(c_id==25)
{map.setCenter(new google.maps.LatLng(53.992247327311,-7.3593206748));}
else if(c_id==26)
{map.setCenter(new google.maps.LatLng(54.2449336845,-6.970013354848));}
else if(c_id==27)
{map.setCenter(new google.maps.LatLng(54.926353,-6.149597));}
else if(c_id==28)
{map.setCenter(new google.maps.LatLng(54.380554,-6.607715));}
else if(c_id==29)
{map.setCenter(new google.maps.LatLng(54.63212,-7.338867));}
else if(c_id==30)
{map.setCenter(new google.maps.LatLng(54.347952,-7.648544));}
else if(c_id==31)
{map.setCenter(new google.maps.LatLng(54.957314,-7.062836));}
else if(c_id==32)
{map.setCenter(new google.maps.LatLng(54.366958,-5.979309));}}
function pan(dx,dy)
{map.panDirection(dx,dy);}
function add_nearby_property(point,shortcode,id,photo,photo_width,photo_height,street,area,county,c_id,agreed,summary,price,collection,curr)
{var text="";var link="<a href=\"http://www.daft.ie/"+shortcode+"\">www.daft.ie/"+shortcode+"<\/a>";var image="";var currency="";if(photo)
{var image="<img border=\"0\" src=\""+photo+"\" width=\""+photo_width+"\" height=\""+photo_height+"\" />";}
text="<div><table cellspacing=\"5\" style=\"font-family:arial;font-size:9pt;\"><tr><td style=\"vertical-align: top;\">";if(street!="")
{text+=street+",<br> ";}
text+=area+",<br> "+county;var color="blue";if(agreed!=null&&agreed!="")
{text+="<br><font style=\"background:#ff0000; color:#ffffff\"><strong>&nbsp;"+agreed+"&nbsp;<\/b><\/font><br>";color="red";}
else
{text+="<br><br>";}
text+=summary;if(c_id>27)
{currency="&pound;";}
else
{currency="&euro;";}
if(price!="0")
{if(price.substr(0,4)!='From')
{text+=", <strong>"+currency+price+"<\/b>";}
else
{text+=",<br /><strong>"+currency+price+"<\/b>";}}
if(collection!=null)
{text+=" "+collection;}
text+="<br><br>"+link+"<\/td><td><a href=\"http://www.daft.ie/"+shortcode+"\">"+image+"<\/a><\/td><\/tr><\/table><\/div>";;if(curr==true)
{var icon=new google.maps.MarkerImage({url:"/i/m/nearby_property.png",size:new google.maps.Size(30,34),anchor:new google.maps.Point(9.23)});}
else
{var icon=new google.maps.MarkerImage({url:"/i/m/nearby_property.png",size:new google.maps.Size(30,34),anchor:new google.maps.Point(9.23)});}
var marker=new google.maps.Marker({icon:icon,position:point});google.maps.event.addListener(marker,'click',function()
{infowindow.setContent('<div style=\"white-space:nowrap; padding-right: 10px;\">'+text+'<\/div>');infowindow.open(map);});marker.setMap(map);GEvent.addListener(marker,'click',function()
{marker.openInfoWindowHtml('<div style=\"white-space:nowrap; padding-right: 10px;\">'+text+'<\/div>');});return marker;}
