Solved

Loading XML file for Google Map Markers

Posted on 2014-02-25
17
1,186 Views
Last Modified: 2014-02-25
Hello,

I have a page which is loading an XML file to drive a Google map, but the map doesn't seem to work...

The page is here:


And the XML file is here (content is held in an ASP file):


My code to open the file and transfer the contents to my variable is:
sInstFile = "C:\HostingSpaces\villas\villasdirect.com\wwwroot\destination_lists\" & replace(country, " ", "_") & "_xmls.asp"
	Set oFSO = CreateObject("Scripting.FileSystemObject")
	If oFSO.FileExists(sInstFile) Then
		Set f = oFSO.OpenTextFile(sInstFile)
		xmlss = f.ReadAll
		f.Close
	End If
	Set f = Nothing
	Set oFSO = Nothing

Open in new window


The output seems to be fine as this is from the source of the page:
	var xmlsource = '<markers><marker region="Cork and Kerry" country="Ireland" lat="52.1544607" lng="-9.5668632" URL="http://www.villasdirect.com" title = "Ireland, Cork And Kerry" typery = "country" type="green"/><marker region="Dublin" country="Ireland" lat="53.3498053" lng="-6.2603097" URL="http://www.villasdirect.com" title = "Ireland, Dublin" typery = "country" type="green"/><marker region="North West Ireland" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, North West Ireland" typery = "country" type="green"/><marker region="South East" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, South East" typery = "country" type="green"/><marker region="The Shannon Region" country="Ireland" lat="52.6660928" lng="-8.6214908" URL="http://www.villasdirect.com" title = "Ireland, The Shannon Region" typery = "country" type="green"/><marker region="West Ireland" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, West Ireland" typery = "country" type="green"/></markers>'     

Open in new window


And finally, the Google Maps code is:
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> 
    <div id="map" style="width: <%=mapwidth%>px; height: <%=mapheight%>px;"></div>
  
    <form onsubmit="showAddress(); return false" id="form2" name="form2" action="">
    <%if region <> "" then%>
      <input id="search" type="hidden" value="<%=UCase(ssregion) & ", " & UCase(Country)%>" />
    <%else%>
      <input id="search" type="hidden" value="<%=UCase(ssregion)%>" />
    <%end if%>
    </form>
        
    <div id="message"></div>

    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b> 
      However, it seems JavaScript is either disabled or not supported by your browser. 
      To view Google Maps, enable JavaScript by changing your browser options, and then 
      try again.
    </noscript>

    <script type="text/javascript">
    
	var gMarkers = [];

	var myOptions = {
		zoom: 8,
		scrollwheel: false,
	  	mapTypeId: google.maps.MapTypeId.ROADMAP
	  };
      var map = new google.maps.Map(document.getElementById("map"), myOptions);

      // ====== Create a Client Geocoder ======
      var geo = new google.maps.Geocoder(); 
	  geo.geocode({'address': document.getElementById("search").value}, function (results, status) {
         var ne = results[0].geometry.viewport.getNorthEast();
         var sw = results[0].geometry.viewport.getSouthWest();
		 ParseLocation(results[0].geometry.location);
		 
		 map.fitBounds(results[0].geometry.viewport); 
		 placeMarkers();   
	
		var listener = google.maps.event.addListener(map, "idle", function() { 
		var mapautozoom = map.getZoom() <%=zzoom%>;
		  map.setZoom(mapautozoom); 
		  google.maps.event.removeListener(listener);	

	      }); 
	  });     
	  
	 function ParseLocation(location) {
      var autolat = location.lat().toString().substr(0, 12);
      var autolng = location.lng().toString().substr(0, 12);
	  //document.getElementById("autolng").value = autolng;
	  //document.getElementById("autolat").value = autolat;
	 } 
	 
	var xmlsource = '<%=XMLSS%>'     

	  var infoWindow = new google.maps.InfoWindow;
	  $( $.parseXML( xmlsource ) ).find("marker").each(function() {
	  	var lng = $(this).attr('lng');
	  	var lat = $(this).attr('lat');
	  	marker = new google.maps.Marker({
      		map:map,
      		draggable:true,
      		animation: google.maps.Animation.DROP,
      		//position: new google.maps.LatLng(59.32522, 18.07002)
      	});
	  });
      google.maps.event.addListener(marker, 'click');
	 	  
	  function placeMarkers(){
	  	var xmlList = $.parseXML(xmlsource);
		var markers = $(xmlList).find('marker');
		for (var i = 0; i < markers.length; i++) {
			var latlng = new google.maps.LatLng(parseFloat($(markers[i]).attr("lat")),
										parseFloat($(markers[i]).attr("lng")));
			var type = $(markers[i]).attr("type");
			var url = $(markers[i]).attr("url");
			var title = $(markers[i]).attr("title");
			var region = $(markers[i]).attr("region");
			var country = $(markers[i]).attr("country");
			var typery = $(markers[i]).attr("typery");
			var imgnam = "";
			if(type == "green")	{
				imgnam = "http://www.villasdirect.com/images/region_marker_blue.gif";
			}else{
				imgnam = "http://www.villasdirect.com/images/mapmarker_green.gif";
			}		
			var img = new google.maps.MarkerImage(
				imgnam,
				new google.maps.Size(30,35),
				new google.maps.Point(0,0),
				new google.maps.Point(15,35)
			);
			//add a link to your xml that can be inserted here where I have http://www.google.com
			var html = "<div class = 'MarkerPopUp' style='width: 150px; height: 25px;'><a href='" + $(markers[i]).attr('url') + "' Title=' + $(markers[i]).attr('Title') + '>" + $(markers[i]).attr('region') + "</a></div>";									
			var marker = new google.maps.Marker({position: latlng, map:map, icon:img, html:html, url:url, title:title, region:region, country:country, typery:typery});
	//		marker.set("id", region.replace(' ','_') + '_Marker');
	//		var infowindow1 = new google.maps.InfoWindow();
	//		google.maps.event.addListener(marker, 'mouseover', function() {
	//			infowindow1.setContent(this.html);
	//	        infowindow1.open(map, this);

	//	    });
			
			google.maps.event.addListener(marker, 'click', function() {
	//            document.getElementById("region").value = this.region;
	//            document.getElementById("country").value = this.country;
	//            document.getElementById("location").value = this.title;
	//            document.getElementById("fb").value = this.title;
	//			document.getElementById("typery").value = this.typery;
	//			document.getElementById("form1").submit();
			window.location.href = marker.url;
			
			});

			var regionmarker = "Marker_"+(i+1);//region.replace(/ /g,"").replace(/\-/g,"").replace(/'/g,"").replace(/\&/g,"").replace(/\//g,"");
			var element1= document.getElementById(regionmarker);
			gMarkers[i] = marker;
						
			element1.setAttribute("onmouseover","gMarkers["+i+"].setIcon(\'/images/region_marker_red.gif\')");
			element1.setAttribute("onmouseout","gMarkers["+i+"].setIcon('"+imgnam+"')");
		}
	  }

    </script>

Open in new window


Thanks in advance!
0
Comment
Question by:Nico2011
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 4
  • 3
17 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39885486
It is best to start at the end!   let's forget about your serverside asp code for now and see what the output is.  Can you please post a link to your sample page?  If you can do that, run your page, view source and copy and past the rendered html, css and js here.
0
 

Author Comment

by:Nico2011
ID: 39885495
Thanks Scott.  Here's the page (I won't touch anything until I hear back from you):



And here's the source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/ico" href="/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>VillasDirect.com | Holiday Rentals in Ireland in Ireland</title>
<meta name="Keywords" content="holiday rentals, villas, apartments, cottages, holiday lettings, accommodation, home away, holidays, cheap holidays, family holiday accommodation, holiday homes, book direct, owner" />
<meta name="Description" content="Best Prices &amp; No Booking Fee. 49,516 verified holiday properties for Rent Worldwide. Rent your home away with the owner direct." />
<meta name="revisit-after" content="2 days" />
<meta name="Distribution" content="Global" />
<meta name="Rating" content="General" />
<meta name="copyright" content="(c)Copyright 2014 VillasDirect Limited. All rights reserved." />
<meta name="rights" content="Copyright by VillasDirect Limited. Some content and links are trademarks and/or copyrights by others and property of respective owners" />
<meta name="category" content="Top: Recreation: Travel: Rental: Real Estate: Rental" /> 
<meta http-equiv="expires" content="never" />
<meta name="content-language" content="EN" />
<meta name="ROBOTS" content="NOYDIR" />
<meta name="ROBOTS" content="NOODP" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="google" content="notranslate" />
<meta http-equiv="Content-Language" content="en" />
<meta name="msvalidate.01" content="93A2BBBC7A9A9B5F3849AE706E870F6C" />
<meta name="google-translate-customization" content="1bb199f66d09b701-f8d02e4a8a893b7b-g2c974e446001e019-14"></meta>
<script type="text/javascript" src="//use.typekit.net/svp8evc.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>

<link href="villasdirect.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	background-color: #FFFFFF;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	text-decoration:none;
	#map_canvas { height: 100% }
}
</style>
<style>
#containerhead
{
    height:30px;
    width:650px;
    position:relative;
}
#transhead
{
    height:30px;
    width:650px;
    position:relative;
    left:53px;
    top:40px;
	width:650px;
	background-color:#FFFFFF;
	filter:alpha(opacity=60); 
	opacity:.6;
}
#texthead
{
    z-index:100;
    position:absolute;    
    color:white;
    font-size:27px;
	font-weight:bold;
    font-family:futura-pt;
	text-align:right;
    left:53px;
    top:-20px;
	width:650px;
	font-shadow: #FFF, 0px, 0.3px, 0.3px;
	-webkit-text-stroke: 0.3px;
}
</style>

<script>
	function ChangePic(a, b)
    {
        document.getElementById(b).src = a;
    }
</script>
<script src="js/googleanalytics.js"></script>
<script language="javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="JSCal2/src/js/jscal2.js"></script>
<script src="JSCal2/src/js/lang/en.js"></script>
<link rel="stylesheet" type="text/css" href="JSCal2/src/css/jscal2.css" />
<link rel="stylesheet" type="text/css" href="JSCal2/src/css/border-radius.css" />
    
<!-- Start Alexa Certify Javascript -->
<script type="text/javascript">
_atrk_opts = { atrk_acct:"5+v5i1acVE008Z", domain:"villasdirect.com",dynamic: true};
(function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = "https://d31qbv1cthcecs.cloudfront.net/atrk.js"; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();
</script>

<script type="text/javascript">
jQuery(document).ready(function(){
    jQuery("input[name='hideshow']").click(function() {        
         jQuery('#content').toggle('show');
    });
});
</script>

<noscript><img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=5+v5i1acVE008Z" style="display:none" height="1" width="1" alt="" /></noscript>
<!-- End Alexa Certify Javascript -->
   
<!--include file="deps/pageloading.asp"-->
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0" background="images/headbkg_ns_ntxt_142px.jpg" class="tableshadowallsides" style="background-repeat:no-repeat;">
  <tr>
  <td width="265" align="left" valign="top">
  		<!--table to position logo-->
  		<table height="142">
        <tr>
        <td height="40" colspan="2">&nbsp;</td>
        </tr>
        <tr>
        <td width="30">&nbsp;</td><td><a href="index.asp" title="Return to Home Page"><img src="images/villas-direct-logo.gif" alt="Villas Direct Logo" border="0"/></a></td>
        </tr>
        </table>
  </td>      
  <td width="715" height="142" valign="top" align="right">
    <table width="715" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="715" height="51" align="right" valign="bottom" class="menu">
	

<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

<table width="715" border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="24" colspan="2" valign="top"><script>
// (C) 2001 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header

//var theURL = '../logoff.asp';
//var width  = 300;
//var height = 100;
function popWindow(theURL, width, height) {
newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height);
}
</script>

<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	text-decoration:none;
}
</style>
<table height="22" align="right" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="right" valign="middle" nowrap="nowrap">

<span class="loggedin">lg@nicoco.eu&nbsp;|&nbsp;<a href="dashboard.asp?view=messages" class="loggedin"><font color="RED">45&nbsp;Unread Messages</font></a>&nbsp;|&nbsp;<a href="dashboard.asp" class="loggedin">My Dashboard</a>&nbsp;|&nbsp;<a href="_admin/admin.asp" class="loggedin">Admin</a>&nbsp;|&nbsp;<a href="http://www.villasdirect.com?testmode=yes" class="loggedin">Test Mode</a>&nbsp;|&nbsp;<a href="javascript:popWindow('../logoff.asp','300','100')" class="loggedin">Log Out</a></span>

</td>
</tr>
</table>
</td>
                  <td width="16">&nbsp;</td>
                </tr>

<tr>
  <td height="26" align="right" valign="bottom" colspan="2">	
<ul class="drop" id="nav" name="nav">
  <li><a href="index.asp">HOME</a></li>
  <li><a href="index.asp">SEARCH</a></li>
  <li><a href="about_villas_direct.asp">ABOUT US</a></li>
  <li><a href="rentals_renters.asp">HOW TO RENT</a>
    <ul>
      <li class="dir"><a href="rentals_owners.asp">HOME OWNER</a></li>
      <li class="dir"><a href="rentals_renters.asp">HOLIDAY MAKER</a></li>
    </ul>
  </li>
  <!--<li><a href="sell_your_property.asp">HOW TO SELL</a></li>-->
  <li><a href="sales_rental_agents.asp">AGENTS</a></li>
  <li><a href="support.asp">HELP</a></li>
</ul>
</td>
</tr>
</table>
    </td>
    </tr>
    <tr>
    <td>
    <div id="transhead">
    </div>
    <div id="containerhead">
	<p id="texthead"><span style="color:#68a72c; filter:alpha(opacity=100); opacity:1;">VILLAS FOR RENT </span> <span style="color:#68a72c; filter:alpha(opacity=100); opacity:1;"><!--CAR HIRE--></span> <span style="color:#2b6488; filter:alpha(opacity=100); opacity:1;"><!--SEARCH--> AROUND <!--COMPARE--> THE <!--BOOK--> WORLD&nbsp;</span></p>
</div>
    </td>
    </tr>
    </table>
  </td>
  </tr>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="sticky/jquery.sticky.js"></script>

<script>
jQuery(function($) {
      $("#searchbar").sticky({topSpacing:0});
});
</script>

<style>
#container
{
    height:356px;
    width:980px;
    position:relative;
}

#image
{    
    position:absolute;
    left:0;
    top:0;
}
#text
{
    z-index:100;
    position:absolute;    
    color:#FFFFFF;
    font-size:50px;
	font-weight:bold;
    font-family:futura-pt;
	text-align:right;
    left:-600px;
    top:235px;
	width:800px;
}
</style>
<tr>
<td colspan="2">
<div id="container">
<img id="image" src="images/Ireland-Kerry.jpg" title="Kerry, Ireland" alt="Photo of Kerry, Ireland"/>
<p id="text">
IRELAND
</p>
</div>    
</td>
</tr>
<tr>
<td style="width:980px; height:43px; text-align:left; vertical-align:top; background:url(images/index_search_bkg_ns.jpg" colspan="2">    
<div id="searchbar" style="z-index:1100; height:43px; background:url(images/index_search_bkg_ns.jpg); vertical-align:top">

<form id="form1" class="refno" name="form1" method="post" action="">
<table width="980" border="0" align="left" cellpadding="1" cellspacing="0" background="images/index_search_bkg_ns.jpg">

          <tr>
            <td style="height:14px; width:23px">&nbsp;</td>
            <td class="para14whitesh" style="height:14px; width:363px; vertical-align:bottom;">Where  would you like to go?</td>
            <td class="para14whitesh" style="height:14px; wdith:128px; vertical-align:bottom;">Arriving<span class="para11white">&nbsp;(optional)</span></td>
            <td nowrap="nowrap" class="para14whitesh" style="height:14px; width:107px; vertical-align:bottom;">Flexible By</td>
            <td style="height:14px; width:89px; vertical-align:bottom;" class="para14whitesh">Duration</td>
            <td class="para14whitesh" style="height:14px; width:72px; vertical-align:bottom;">Sleeps</td>
           <td style="width:182px;" align="left" valign="top" rowspan="2"><br />
            <input name="searchlocationsrentals" id="searchlocationsrentals" type="submit" class="bindexbuyrent-long" value="SEARCH NOW" align="top" onmouseover="this.style.cursor='pointer'"/><!--<img src="images/index_rent_button.jpg" width="90" height="37" />--></td>
        <!--<td width="92" align="left" valign="top" rowspan="2"><br />
          <input name="searchlocationssales" id="searchlocationssales" type="submit" class="bindexbuyrent" value="BUY" align="top" onmouseover="this.style.cursor='pointer'"/></td>-->
          </tr>
             
          <tr>
            <td height="29" width="23">&nbsp;</td>
            <td style="vertical-align:top;" class="srsearchfields80"><link rel="stylesheet" href="deps/jquery-ui.css" />  
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script>  
$(function() {
	function split( val ) {      
		return val.split( /,\s*/ );    
	}    
	function extractLast( term ) {      
		return split( term ).pop();    
	}     
	$( "#location" )      
		// don't navigate away from the field on tab when selecting an item      
		.bind( "keydown", function( event ) 
		{        
			if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "ui-autocomplete" ).menu.active ) 
			{          
					event.preventDefault();        
			}
		})      
		.autocomplete({        
			source: function( request, response ) {
				$("#fb").val(request.term);
				$.ajax({
					url: "DDData.php",
					dataType: "json",
					data: { 
						term : request.term,
						country : $("#country").val(),
						region : $("#region").val(),
						beach : $("#beach").val(),
						ski : $("#ski").val(),
						golf : $("#golf").val(),
						luxury : $("#luxury").val(),
						exclusive : $("#exclusive").val(),
						rental : $("#rental").val(),
						sale : $("#sale").val()						
						},						
					type: "GET",
					success: function(data){
						response($.map(data, function(item){
							var itemText = "";
							if(item.country != "" && item.country != null) {
								itemText = item.country;
							}
							if(item.region != "" && item.region != null ) {
								if(itemText != "") itemText = itemText + ", " 
								itemText = itemText + item.region
							}
							if(	item.location != "" && item.location != null) {
								if(itemText != "") itemText = itemText + ", " 
								itemText = itemText + item.location
							}					
							return {
								value: item.ID,
								label: itemText
							}
						}))
					}           
        	});        
		},        
		search: function() {          
		  // custom minLength          
		  var term = extractLast( this.value );          
		  if ( term.length < 1 ) {            
		  	return false;          
			}        
		},        
		focus: function() {          
		  	// prevent value inserted on focus          
		  	return false;        },        
		select: function( event, ui ) {          
		  	var terms = split( this.value );         
		  	// remove the current input          
		  	terms.pop();          
		  	// add the selected item          
		  	terms.push( ui.item.label );          
		  	// add placeholder to get the comma-and-space at the end          
		  	//terms.push( "" );          
		  	this.value = ui.item.label;    
		  	
		  	$("#fb").val(ui.item.value);
		  	      
			return false;        
		}      
	});  
});  
</script>
	<input name="searchtermtext" class="indextextbox" id="location" onfocus="if (this.value=='Start By Typing a Location Name or Property No.') this.value = ''"
	onblur="if (this.value=='') this.value = 'Start By Typing a Location Name or Property No.'"  value="Start By Typing a Location Name or Property No." style="width: 350px;">
	<input id="fb" name="fb" value="-1" style="left:" type="hidden" />
    <input id="country" name="country" value="Ireland" type="hidden" />
    <input id="region" name="region" value="" type="hidden" />
    <input id="beach" name="beach" value="" type="hidden" />
    <input id="ski" name="ski" value="" type="hidden" />
    <input id="golf" name="golf" value="" type="hidden" />
    <input id="luxury" name="luxury" value="" type="hidden" />
    <input id="exclusive" name="exclusive" value="" type="hidden" />
    <input id="rental" name="rental" value="" type="hidden" />
	<input id="sale" name="sale" value="" type="hidden" />    
    </td>
            <td style="vertical-align:top;" nowrap="nowrap">
              <input name="f_date1" class="indextextbox" id="f_date1" value="" size="10" maxlength="11"  style="width: 89px;"/>
              <button id="f_btn1" class="calendarindex">&nbsp;</button>
            <script type="text/javascript">//<![CDATA[
			      Calendar.setup({
				  inputField : "f_date1",
		          trigger    : "f_btn1",
//		          onSelect   : function() { this.hide(); document.forms['form1'].submit() },
		          onSelect   : function() { this.hide()},				  		          //showTime   : 12,
				  min: 20140225,
				  max: 20150707,
				  fdow: 6,
		          dateFormat : "%d-%b-%Y"
			      });
				  //]]></script></td>
            <td style="vertical-align:top; width:107px;"><select name="plusminus" size="1" id="plusminus" class="indextextbox" style="width:98px;">
                    <option value="0">0 Days</option>
                    <option value="7" selected="selected">+/-7 Days</option>
                    <option value="14">+/-14 Days</option>
                    <option value="21">+/-21 Days</option>
                    <option value="28">+/-28 Days</option>
            </select></td>
            <td style="vertical-align:top; width:89px;"><select name="staydays" size="1" id="staydays"  class="indextextbox" style="width:80px;">
<!--<option  value="1" >1 day</option>-->
<option  value="2" >2 nights</option>
<option  value="3" >3 nights</option>
<option  value="4" >4 nights</option>
<option  value="5" >5 nights</option>
<option  value="6" >6 nights</option>
<option  value="7" selected="selected">7 nights</option>
<option  value="8" >8 nights</option>
<option value="9" >9 nights</option>
<option  value="10" >10 nights</option>
<option  value="11" >11 nights</option>
<option  value="12" >12 nights</option>
<option  value="13" >13 nights</option>
<option  value="14" >14 nights</option>
<option  value="15" >15 nights</option>
<option  value="16" >16 nights</option>
<option  value="17" >17 nights</option>
<option  value="18" >18 nights</option>
<option  value="19" >19 nights</option>
<option  value="20" >20 nights</option>
<option value="21" >21 nights</option>
<option value="22" >22 nights</option>
<option value="23" >23 nights</option>
<option value="24" >24 nights</option>
<option value="25" >25 nights</option>
<option value="26" >26 nights</option>
<option value="27" >27 nights</option>
<option value="28" >28 nights</option>
<option value="29" >29 nights</option>
<option value="30" >30 nights</option>
<option value="31" >31 nights</option>
<option value="32" >32 nights</option>
<option value="33" >33 nights</option>
<option value="34" >34 nights</option>
<option value="35" >35 nights</option>
<option value="36" >36 nights</option>
<option value="37" >37 nights</option>
<option value="38" >38 nights</option>
<option value="39" >39 nights</option>
<option value="40" >40 nights</option>
<option value="41" >41 nights</option>
<option value="42" >42 nights</option>
<option value="43" >43 nights</option>
<option value="44" >44 nights</option>
<option value="45" >45 nights</option>
<option value="46" >46 nights</option>
<option value="47" >47 nights</option>
<option value="48" >48 nights</option>
<option value="49" >49 nights</option>
<option value="50" >50 nights</option>
<option value="51" >51 nights</option>
<option value="52" >52 nights</option>
<option value="53" >53 nights</option>
<option value="54" >54 nights</option>
<option value="55" >55 nights</option>
<option value="56" >56 nights</option>

<!--<option value="mid" >Mid-Term Rentals</option>
<option value="long" >Long Term Rentals</option>-->

</select></td>
            <td style="vertical-align:top; width:72px;"><select name="people" id="people"  class="indextextbox" style="width:60px;">
        <option value="Any" selected>Any</option>
        <option value="2">2-4</option>
        <option value="4">4-6</option>
        <option value="6">6-8</option>
        <option value="8">8-10</option>
        <option value="10+">10+</option>
        </select>
</td>
          </tr>
        </table>
</form>

</div></td>
</tr>

<tr>
<td colspan="10">
		<table style="width:980px;" border="0">
		<tr>
        <td style="width:10px;"></td>
		<td style="width:470px; text-align:left" valign="top">
		<table style="width:490px;" border="0"><tr><td align="left" colspan="3" class="indexspecialtitles">&nbsp;<a href="javascript:popWindow('deps/top-destinations-data.asp?country=Ireland','550','775')"><img src="images/pencil.gif"></a></td></tr><tr><td align="left" style="width:33%;"><a id='Marker_1' href="http://www.villasdirect.com/top_destinations.asp?country=Ireland&amp;region=Cork and Kerry&amp;proptype=rentals" class="parablueh">Cork and Kerry (49)</a>&nbsp;<a href="javascript:popWindow('deps/normalize_names.asp?country=Ireland&amp;newname=Cork+and+Kerry&amp;typer=2','550','300')"><img src="images/pencil.gif" border="0"></a></td><td align="left" style="width:33%;"><a id='Marker_2' href="http://www.villasdirect.com/top_destinations.asp?country=Ireland&amp;region=Dublin&amp;proptype=rentals" class="parablueh">Dublin (14)</a>&nbsp;<a href="javascript:popWindow('deps/normalize_names.asp?country=Ireland&amp;newname=Dublin&amp;typer=2','550','300')"><img src="images/pencil.gif" border="0"></a></td><td align="left" style="width:33%;" class="parablue"><a id='Marker_3' href="http://www.villasdirect.com/top_destinations.asp?country=Ireland&amp;region=North West Ireland&amp;proptype=rentals" class="parablueh">North West Ireland (4)</a>&nbsp;<a href="javascript:popWindow('deps/normalize_names.asp?country=Ireland&amp;newname=North+West+Ireland&amp;typer=2','550','300')"><img src="images/pencil.gif" border="0"></a></td></tr><tr><td align="left" style="width:33%;"><a id='Marker_4' href="http://www.villasdirect.com/top_destinations.asp?country=Ireland&amp;region=South East&amp;proptype=rentals" class="parablueh">South East (10)</a>&nbsp;<a href="javascript:popWindow('deps/normalize_names.asp?country=Ireland&amp;newname=South+East&amp;typer=2','550','300')"><img src="images/pencil.gif" border="0"></a></td><td align="left" style="width:33%;"><a id='Marker_5' href="http://www.villasdirect.com/top_destinations.asp?country=Ireland&amp;region=The Shannon Region&amp;proptype=rentals" class="parablueh">The Shannon Region (22)</a>&nbsp;<a href="javascript:popWindow('deps/normalize_names.asp?country=Ireland&amp;newname=The+Shannon+Region&amp;typer=2','550','300')"><img src="images/pencil.gif" border="0"></a></td><td align="left" style="width:33%;" class="parablue"><a id='Marker_6' href="http://www.villasdirect.com/top_destinations.asp?country=Ireland&amp;region=West Ireland&amp;proptype=rentals" class="parablueh">West Ireland (10)</a>&nbsp;<a href="javascript:popWindow('deps/normalize_names.asp?country=Ireland&amp;newname=West+Ireland&amp;typer=2','550','300')"><img src="images/pencil.gif" border="0"></a></td></tr><tr></td></tr></table>
        </td>
		<td style="vertical-align:top;">
	        <table style="width:470px;vertical-align:top;">
    	    <tr>
        	<td style="height:5px;" colspan="2"></td><td></td></tr>
	        <tr><td style="vertical-align:top;"><script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> 
    <div id="map" style="width: 450px; height: 450px;"></div>
  
    <form onsubmit="showAddress(); return false" id="form2" name="form2" action="">
    
      <input id="search" type="hidden" value="" />
    
    </form>
        
    <div id="message"></div>

    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b> 
      However, it seems JavaScript is either disabled or not supported by your browser. 
      To view Google Maps, enable JavaScript by changing your browser options, and then 
      try again.
    </noscript>

    <script type="text/javascript">
    
	var gMarkers = [];

	var myOptions = {
		zoom: 8,
		scrollwheel: false,
	  	mapTypeId: google.maps.MapTypeId.ROADMAP
	  };
      var map = new google.maps.Map(document.getElementById("map"), myOptions);

      // ====== Create a Client Geocoder ======
      var geo = new google.maps.Geocoder(); 
	  geo.geocode({'address': document.getElementById("search").value}, function (results, status) {
         var ne = results[0].geometry.viewport.getNorthEast();
         var sw = results[0].geometry.viewport.getSouthWest();
		 ParseLocation(results[0].geometry.location);
		 
		 map.fitBounds(results[0].geometry.viewport); 
		 placeMarkers();   
	
		var listener = google.maps.event.addListener(map, "idle", function() { 
		var mapautozoom = map.getZoom() + 1;
		  map.setZoom(mapautozoom); 
		  google.maps.event.removeListener(listener);	

	      }); 
	  });     
	  
	 function ParseLocation(location) {
      var autolat = location.lat().toString().substr(0, 12);
      var autolng = location.lng().toString().substr(0, 12);
	  //document.getElementById("autolng").value = autolng;
	  //document.getElementById("autolat").value = autolat;
	 } 
	 
	var xmlsource = '<markers><marker region="Cork and Kerry" country="Ireland" lat="52.1544607" lng="-9.5668632" URL="http://www.villasdirect.com" title = "Ireland, Cork And Kerry" typery = "country" type="green"/><marker region="Dublin" country="Ireland" lat="53.3498053" lng="-6.2603097" URL="http://www.villasdirect.com" title = "Ireland, Dublin" typery = "country" type="green"/><marker region="North West Ireland" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, North West Ireland" typery = "country" type="green"/><marker region="South East" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, South East" typery = "country" type="green"/><marker region="The Shannon Region" country="Ireland" lat="52.6660928" lng="-8.6214908" URL="http://www.villasdirect.com" title = "Ireland, The Shannon Region" typery = "country" type="green"/><marker region="West Ireland" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, West Ireland" typery = "country" type="green"/></markers>'     

	  var infoWindow = new google.maps.InfoWindow;
	  $( $.parseXML( xmlsource ) ).find("marker").each(function() {
	  	var lng = $(this).attr('lng');
	  	var lat = $(this).attr('lat');
	  	marker = new google.maps.Marker({
      		map:map,
      		draggable:true,
      		animation: google.maps.Animation.DROP,
      		//position: new google.maps.LatLng(59.32522, 18.07002)
      	});
	  });
      google.maps.event.addListener(marker, 'click');
	 	  
	  function placeMarkers(){
	  	var xmlList = $.parseXML(xmlsource);
		var markers = $(xmlList).find('marker');
		for (var i = 0; i < markers.length; i++) {
			var latlng = new google.maps.LatLng(parseFloat($(markers[i]).attr("lat")),
										parseFloat($(markers[i]).attr("lng")));
			var type = $(markers[i]).attr("type");
			var url = $(markers[i]).attr("url");
			var title = $(markers[i]).attr("title");
			var region = $(markers[i]).attr("region");
			var country = $(markers[i]).attr("country");
			var typery = $(markers[i]).attr("typery");
			var imgnam = "";
			if(type == "green")	{
				imgnam = "http://www.villasdirect.com/images/region_marker_blue.gif";
			}else{
				imgnam = "http://www.villasdirect.com/images/mapmarker_green.gif";
			}		
			var img = new google.maps.MarkerImage(
				imgnam,
				new google.maps.Size(30,35),
				new google.maps.Point(0,0),
				new google.maps.Point(15,35)
			);
			//add a link to your xml that can be inserted here where I have http://www.google.com
			var html = "<div class = 'MarkerPopUp' style='width: 150px; height: 25px;'><a href='" + $(markers[i]).attr('url') + "' Title=' + $(markers[i]).attr('Title') + '>" + $(markers[i]).attr('region') + "</a></div>";									
			var marker = new google.maps.Marker({position: latlng, map:map, icon:img, html:html, url:url, title:title, region:region, country:country, typery:typery});
	//		marker.set("id", region.replace(' ','_') + '_Marker');
	//		var infowindow1 = new google.maps.InfoWindow();
	//		google.maps.event.addListener(marker, 'mouseover', function() {
	//			infowindow1.setContent(this.html);
	//	        infowindow1.open(map, this);

	//	    });
			
			google.maps.event.addListener(marker, 'click', function() {
	//            document.getElementById("region").value = this.region;
	//            document.getElementById("country").value = this.country;
	//            document.getElementById("location").value = this.title;
	//            document.getElementById("fb").value = this.title;
	//			document.getElementById("typery").value = this.typery;
	//			document.getElementById("form1").submit();
			window.location.href = marker.url;
			
			});

			var regionmarker = "Marker_"+(i+1);//region.replace(/ /g,"").replace(/\-/g,"").replace(/'/g,"").replace(/\&/g,"").replace(/\//g,"");
			var element1= document.getElementById(regionmarker);
			gMarkers[i] = marker;
						
			element1.setAttribute("onmouseover","gMarkers["+i+"].setIcon(\'/images/region_marker_red.gif\')");
			element1.setAttribute("onmouseout","gMarkers["+i+"].setIcon('"+imgnam+"')");
		}
	  }

    </script></td><td style="width:10px;"></td></tr>
    	    <tr><td style="height:5px;"></td></tr>
        	</table>
        </td>
		</tr>
		</table>
</td>
</tr>
</table><br />

<table width="980" border="0" align="center" cellpadding="0" cellspacing="0" class="tableshadowallsides">
  <tr>
    <td height="323" align="center" valign="top"><table width="963" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
      <td width="10">&nbsp;</td>
        <td style="height:33px; text-align:left; valign:middle;" class="indexspecialtitleslightblue">FEATURED <span class="indexspecialtitles">HOLIDAY RENTAL</span> PROPERTIES</td>
      </tr>
    </table>
      <table width="940" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="width:8px;">&nbsp;</td>
          <td width="220" height="268" align="left" valign="bottom">
		  	
<table width="200" align="left" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr><td width="200" height="132" align="left" valign="top">
	<a href="http://www.villasdirect.com/70455"><img src="../villa/70455/SMie2250.100a_s.jpg" name="The Waterfront" width="200" height="129" align="absmiddle" id="Villa70455" border="0" alt="Property The Waterfront for Rent in Dromod, East Coast/Midlands, Ireland"/></a></td></tr>
<tr><td height="42" valign="top">
<table width="200" border="0" cellspacing="0" cellpadding="0">
		<tbody><tr>

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70455/SMie2250.100a_s.jpg','Villa70455');"><img src="../villa/70455/TMie2250.100a_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="First Photo of Property The Waterfront for Rent in Dromod, East Coast/Midlands, Ireland"/></a></td>

<td width="66" height="40" valign="bottom">

<a href="#" onmouseover="ChangePic('../villa/70455/SMie2250.100b_s.jpg','Villa70455');"><img src="../villa/70455/TMie2250.100b_s.jpg" width="66" height="40" align="absmiddle" border="0" alt="Second Photo of Property The Waterfront for Rent in Dromod, East Coast/Midlands, Ireland"/></a></td>

<td width="67" height="40" valign="bottom">

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70455/SMie2250.100h_s.jpg','Villa70455');"><img src="../villa/70455/TMie2250.100h_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="Third Photo of Property The Waterfront for Rent in Dromod, East Coast/Midlands, Ireland"/></a></td>

</tr></tbody></table></td></tr>
<tr><td height="86" align="center" valign="top" class="indexfeatpropbkg">
<table width="200" border="0" cellspacing="0" cellpadding="0" class="indexfeatpropbkg">
<tr><td height="27" align="center" valign="bottom"><strong class="parablue14">Dromod</strong><br /><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 3 Star Accomodation" title="Property Is Rated As 3 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 3 Star Accomodation" title="Property Is Rated As 3 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 3 Star Accomodation" title="Property Is Rated As 3 Star Accomodation" border="0"></td></tr>
<tr><td height="39" valign="bottom"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr><td width="35" align="right"><img src="images/people_wh.png" width="26" height="25" alt="Sleeps 6 People" title="Sleeps 6 People"/></td>
<td width="42" class="para18white" align="left">&nbsp;6</td>
<td width="45"><img src="images/beds.png" width="41" height="25" alt="3 bedrooms" title="3 bedrooms"/></td>
<td width="23" class="para18white">3</td>
<td width="35"><img src="images/showers.png" width="31" height="30" alt="3 baths/showers" title="3 baths/showers"/></td>
<td width="20"><span class="para18white">3</span></td></tr>
</table></td></tr>
<tr><td height="33" align="center" valign="top" class="para12white">price per week from<br />&#128;309&nbsp; &pound;255&nbsp;&nbsp;&#36;425</td>
</tr></table></td></tr><tr><td height="5"></td></tr>
<tr><td><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr><td height="36" align="center" valign="bottom"><a href="http://www.villasdirect.com/70455" class="buttongrsresults">&nbsp;&nbsp;VIEW PROPERTY&nbsp;&nbsp;</a></td></tr>
</table></td></tr></tbody></table>
</td>
		  <td width="18">&nbsp;</td>
          <td width="220" align="center" valign="bottom">
		  	
<table width="200" align="left" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr><td width="200" height="132" align="left" valign="top">
	<a href="http://www.villasdirect.com/70526"><img src="../villa/70526/SMie4550.200a_s.jpg" name="Radharc Na Mara" width="200" height="129" align="absmiddle" id="Villa70526" border="0" alt="Property Radharc Na Mara for Rent in Dingle, Cork and Kerry, Ireland"/></a></td></tr>
<tr><td height="42" valign="top">
<table width="200" border="0" cellspacing="0" cellpadding="0">
		<tbody><tr>

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70526/SMie4550.200a_s.jpg','Villa70526');"><img src="../villa/70526/TMie4550.200a_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="First Photo of Property Radharc Na Mara for Rent in Dingle, Cork and Kerry, Ireland"/></a></td>

<td width="66" height="40" valign="bottom">

<a href="#" onmouseover="ChangePic('../villa/70526/SMie4550.200b_s.jpg','Villa70526');"><img src="../villa/70526/TMie4550.200b_s.jpg" width="66" height="40" align="absmiddle" border="0" alt="Second Photo of Property Radharc Na Mara for Rent in Dingle, Cork and Kerry, Ireland"/></a></td>

<td width="67" height="40" valign="bottom">

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70526/SMie4550.200l_s.jpg','Villa70526');"><img src="../villa/70526/TMie4550.200l_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="Third Photo of Property Radharc Na Mara for Rent in Dingle, Cork and Kerry, Ireland"/></a></td>

</tr></tbody></table></td></tr>
<tr><td height="86" align="center" valign="top" class="indexfeatpropbkg">
<table width="200" border="0" cellspacing="0" cellpadding="0" class="indexfeatpropbkg">
<tr><td height="27" align="center" valign="bottom"><strong class="parablue14">Dingle</strong><br /><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"></td></tr>
<tr><td height="39" valign="bottom"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr><td width="35" align="right"><img src="images/people_wh.png" width="26" height="25" alt="Sleeps 6 People" title="Sleeps 6 People"/></td>
<td width="42" class="para18white" align="left">&nbsp;6</td>
<td width="45"><img src="images/beds.png" width="41" height="25" alt="3 bedrooms" title="3 bedrooms"/></td>
<td width="23" class="para18white">3</td>
<td width="35"><img src="images/showers.png" width="31" height="30" alt="3 baths/showers" title="3 baths/showers"/></td>
<td width="20"><span class="para18white">3</span></td></tr>
</table></td></tr>
<tr><td height="33" align="center" valign="top" class="para12white">price per week from<br />&#128;400&nbsp; &pound;330&nbsp;&nbsp;&#36;550</td>
</tr></table></td></tr><tr><td height="5"></td></tr>
<tr><td><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr><td height="36" align="center" valign="bottom"><a href="http://www.villasdirect.com/70526" class="buttongrsresults">&nbsp;&nbsp;VIEW PROPERTY&nbsp;&nbsp;</a></td></tr>
</table></td></tr></tbody></table>
</td>
          <td width="15">&nbsp;</td>
          <td width="220" align="center" valign="bottom">
		  	
<table width="200" align="left" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr><td width="200" height="132" align="left" valign="top">
	<a href="http://www.villasdirect.com/70448"><img src="../villa/70448/SMie1004.500a_s.jpg" name="Lansdowne Village" width="200" height="129" align="absmiddle" id="Villa70448" border="0" alt="Property Lansdowne Village for Rent in Dublin, Dublin, Ireland"/></a></td></tr>
<tr><td height="42" valign="top">
<table width="200" border="0" cellspacing="0" cellpadding="0">
		<tbody><tr>

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70448/SMie1004.500a_s.jpg','Villa70448');"><img src="../villa/70448/TMie1004.500a_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="First Photo of Property Lansdowne Village for Rent in Dublin, Dublin, Ireland"/></a></td>

<td width="66" height="40" valign="bottom">

<a href="#" onmouseover="ChangePic('../villa/70448/SMie1004.500b_s.jpg','Villa70448');"><img src="../villa/70448/TMie1004.500b_s.jpg" width="66" height="40" align="absmiddle" border="0" alt="Second Photo of Property Lansdowne Village for Rent in Dublin, Dublin, Ireland"/></a></td>

<td width="67" height="40" valign="bottom">

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70448/SMie1004.500d_s.jpg','Villa70448');"><img src="../villa/70448/TMie1004.500d_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="Third Photo of Property Lansdowne Village for Rent in Dublin, Dublin, Ireland"/></a></td>

</tr></tbody></table></td></tr>
<tr><td height="86" align="center" valign="top" class="indexfeatpropbkg">
<table width="200" border="0" cellspacing="0" cellpadding="0" class="indexfeatpropbkg">
<tr><td height="27" align="center" valign="bottom"><strong class="parablue14">Dublin</strong><br /><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 3 Star Accomodation" title="Property Is Rated As 3 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 3 Star Accomodation" title="Property Is Rated As 3 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 3 Star Accomodation" title="Property Is Rated As 3 Star Accomodation" border="0"></td></tr>
<tr><td height="39" valign="bottom"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr><td width="35" align="right"><img src="images/people_wh.png" width="26" height="25" alt="Sleeps 3 People" title="Sleeps 3 People"/></td>
<td width="42" class="para18white" align="left">&nbsp;3</td>
<td width="45"><img src="images/beds.png" width="41" height="25" alt="2 bedrooms" title="2 bedrooms"/></td>
<td width="23" class="para18white">2</td>
<td width="35"><img src="images/showers.png" width="31" height="30" alt="1 baths/showers" title="1 baths/showers"/></td>
<td width="20"><span class="para18white">1</span></td></tr>
</table></td></tr>
<tr><td height="33" align="center" valign="top" class="para12white">price per week from<br />&#128;1016&nbsp; &pound;838&nbsp;&nbsp;&#36;1396</td>
</tr></table></td></tr><tr><td height="5"></td></tr>
<tr><td><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr><td height="36" align="center" valign="bottom"><a href="http://www.villasdirect.com/70448" class="buttongrsresults">&nbsp;&nbsp;VIEW PROPERTY&nbsp;&nbsp;</a></td></tr>
</table></td></tr></tbody></table>
</td>
          <td width="15">&nbsp;</td>
          <td width="220" align="right" valign="bottom">
		  	
<table width="200" align="left" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr><td width="200" height="132" align="left" valign="top">
	<a href="http://www.villasdirect.com/70443"><img src="../villa/70443/SMie1004.200a_s.jpg" name="Baggot Rath" width="200" height="129" align="absmiddle" id="Villa70443" border="0" alt="Property Baggot Rath for Rent in Dublin, Dublin, Ireland"/></a></td></tr>
<tr><td height="42" valign="top">
<table width="200" border="0" cellspacing="0" cellpadding="0">
		<tbody><tr>

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70443/SMie1004.200a_s.jpg','Villa70443');"><img src="../villa/70443/TMie1004.200a_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="First Photo of Property Baggot Rath for Rent in Dublin, Dublin, Ireland"/></a></td>

<td width="66" height="40" valign="bottom">

<a href="#" onmouseover="ChangePic('../villa/70443/SMie1004.200b_s.jpg','Villa70443');"><img src="../villa/70443/TMie1004.200b_s.jpg" width="66" height="40" align="absmiddle" border="0" alt="Second Photo of Property Baggot Rath for Rent in Dublin, Dublin, Ireland"/></a></td>

<td width="67" height="40" valign="bottom">

<td width="67" height="40" valign="bottom">
<a href="#" onmouseover="ChangePic('../villa/70443/SMie1004.200f_s.jpg','Villa70443');"><img src="../villa/70443/TMie1004.200f_s.jpg" width="67" height="40" align="absmiddle" border="0" alt="Third Photo of Property Baggot Rath for Rent in Dublin, Dublin, Ireland"/></a></td>

</tr></tbody></table></td></tr>
<tr><td height="86" align="center" valign="top" class="indexfeatpropbkg">
<table width="200" border="0" cellspacing="0" cellpadding="0" class="indexfeatpropbkg">
<tr><td height="27" align="center" valign="bottom"><strong class="parablue14">Dublin</strong><br /><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"><img src="images/star-white-invisible-bg.gif" alt="Property Is Rated As 4 Star Accomodation" title="Property Is Rated As 4 Star Accomodation" border="0"></td></tr>
<tr><td height="39" valign="bottom"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr><td width="35" align="right"><img src="images/people_wh.png" width="26" height="25" alt="Sleeps 6 People" title="Sleeps 6 People"/></td>
<td width="42" class="para18white" align="left">&nbsp;6</td>
<td width="45"><img src="images/beds.png" width="41" height="25" alt="3 bedrooms" title="3 bedrooms"/></td>
<td width="23" class="para18white">3</td>
<td width="35"><img src="images/showers.png" width="31" height="30" alt="2 baths/showers" title="2 baths/showers"/></td>
<td width="20"><span class="para18white">2</span></td></tr>
</table></td></tr>
<tr><td height="33" align="center" valign="top" class="para12white">price per week from<br />&#128;2106&nbsp; &pound;1737&nbsp;&nbsp;&#36;2893</td>
</tr></table></td></tr><tr><td height="5"></td></tr>
<tr><td><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr><td height="36" align="center" valign="bottom"><a href="http://www.villasdirect.com/70443" class="buttongrsresults">&nbsp;&nbsp;VIEW PROPERTY&nbsp;&nbsp;</a></td></tr>
</table></td></tr></tbody></table>
</td>
        </tr>
      </table></td>
  </tr>
  <tr><td style="height:25px;"></td></tr>
</table>

<DIV id="content" style="position:fixed; font-family:arial; font-size:29; left:50%; top:50%;  height:510px; width:610px; margin-left:-305px; margin-top:-300px; z-index:1110; display:none"><br />
<table style="width:580px; height:480px; background-color:#FFF;" align="center" class="tableshadowallsides">
<tr style="height:25px;"><td align="left" valign="bottom" class="indexspecialtitleslightblue">INFORMATION <span class="indexspecialtitles">ABOUT</span> IRELAND</td>
</tr>
<tr>
<td class="parablue" style="text-align:justify"></td>
</tr>
<tr><td><input name="hideshow" class="hideshow" onMouseOver="this.style.cursor='pointer'" value="CLOSE" size="10" align="middle" style="text-align:center;"/>
</td></tr>
</table>
</DIV>

<br />&nbsp;<br />
<span class="copyright">&copy; Copyright VillasDirect Limited 1998 - 2014 All Rights Reserved&nbsp;-&nbsp;Registered in the UK: 07929131&nbsp;|&nbsp;<a href="privacy.asp">Your Privacy | Terms &amp; Conditions</a><!--&nbsp;|&nbsp;<img src="images/index_visa_icons.jpg" width="220" height="24" />--><div id="google_translate_element"></div><script type="text/javascript">function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, gaTrack: true, gaId: 'UA-34898521-1'}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</span>
</body>
</html>

<!--<span class="copyright"><br />
Use of this website constitutes acceptance of the TERMS OF USE, BOOKING TERMS and PRIVACY POLICY <br />
</span>-->

Open in new window

0
 
LVL 56

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 39885517
When you say the map does not work - can you elaborate?

I get a map loading the correct region country - but I don't know what I am looking for in terms of working / not working.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Nico2011
ID: 39885521
Please try this page - this one has the files already created:

0
 

Author Comment

by:Nico2011
ID: 39885526
I don't see the pages coming up in the questions, so here's the URL not using the 'URL' tool:

http://www.villasdirect.com/top-destinations2.asp?Country=Ireland&property-type=rentals
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39885559
Can we see  just the code that pertains the the map...   The javascript and html for map area only.

Also, I quickly caught a error in your css.  The #map_canvas { height: 100% } should be outside the body{...}

body {
	background-color: #FFFFFF;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	text-decoration:none;
	#map_canvas { height: 100% }
}

Open in new window

0
 
LVL 56

Expert Comment

by:Julian Hansen
ID: 39885565
The page is generating this error

ReferenceError: marker is not defined

google.maps.event.addListener(marker, 'click');

This goes back to this code at the end of the script in your first post

	var regionmarker = "Marker_"+(i+1);//region.replace(/ /g,"").replace(/\-/g,"").replace(/'/g,"").replace(/\&/g,"").replace(/\//g,"");
	var element1= document.getElementById(regionmarker);
	gMarkers[i] = marker;
						
	element1.setAttribute("onmouseover","gMarkers["+i+"].setIcon(\'/images/region_marker_red.gif\')");
	element1.setAttribute("onmouseout","gMarkers["+i+"].setIcon('"+imgnam+"')");

Open in new window

This line is the culprit
	var element1= document.getElementById(regionmarker);

Open in new window

Can't find any element with id Marker_1, Marker_2 etc.
0
 

Author Comment

by:Nico2011
ID: 39885586
Hmmm - they are specified - they are the names in the list of regions... each has id=Marfker_1 etc. and this works when the page is loaded dynamically as can be seen here: http://www.villasdirect.com/top-destinations.asp?Country=Ireland&property-type=rentals
0
 

Author Comment

by:Nico2011
ID: 39885588
Hi Scott,

Removed the css error - thank you!

I think this is the map code that you're after?:

<script type="text/javascript">
    
	var gMarkers = [];

	var myOptions = {
		zoom: 8,
		scrollwheel: false,
	  	mapTypeId: google.maps.MapTypeId.ROADMAP
	  };
      var map = new google.maps.Map(document.getElementById("map"), myOptions);

      // ====== Create a Client Geocoder ======
      var geo = new google.maps.Geocoder(); 
	  geo.geocode({'address': document.getElementById("search").value}, function (results, status) {
         var ne = results[0].geometry.viewport.getNorthEast();
         var sw = results[0].geometry.viewport.getSouthWest();
		 ParseLocation(results[0].geometry.location);
		 
		 map.fitBounds(results[0].geometry.viewport); 
		 placeMarkers();   
	
		var listener = google.maps.event.addListener(map, "idle", function() { 
		var mapautozoom = map.getZoom() + 1;
		  map.setZoom(mapautozoom); 
		  google.maps.event.removeListener(listener);	

	      }); 
	  });     
	  
	 function ParseLocation(location) {
      var autolat = location.lat().toString().substr(0, 12);
      var autolng = location.lng().toString().substr(0, 12);
	  //document.getElementById("autolng").value = autolng;
	  //document.getElementById("autolat").value = autolat;
	 } 
	 
	var xmlsource = '<markers><marker region="Cork and Kerry" country="Ireland" lat="52.1544607" lng="-9.5668632" URL="http://www.villasdirect.com" title = "Ireland, Cork And Kerry" typery = "country" type="green"/><marker region="Dublin" country="Ireland" lat="53.3498053" lng="-6.2603097" URL="http://www.villasdirect.com" title = "Ireland, Dublin" typery = "country" type="green"/><marker region="North West Ireland" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, North West Ireland" typery = "country" type="green"/><marker region="South East" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, South East" typery = "country" type="green"/><marker region="The Shannon Region" country="Ireland" lat="52.6660928" lng="-8.6214908" URL="http://www.villasdirect.com" title = "Ireland, The Shannon Region" typery = "country" type="green"/><marker region="West Ireland" country="Ireland" lat="53.41291" lng="-8.24389" URL="http://www.villasdirect.com" title = "Ireland, West Ireland" typery = "country" type="green"/></markers>'     

	  var infoWindow = new google.maps.InfoWindow;
	  $( $.parseXML( xmlsource ) ).find("marker").each(function() {
	  	var lng = $(this).attr('lng');
	  	var lat = $(this).attr('lat');
	  	marker = new google.maps.Marker({
      		map:map,
      		draggable:true,
      		animation: google.maps.Animation.DROP,
      		//position: new google.maps.LatLng(59.32522, 18.07002)
      	});
	  });
      google.maps.event.addListener(marker, 'click');
	 	  
	  function placeMarkers(){
	  	var xmlList = $.parseXML(xmlsource);
		var markers = $(xmlList).find('marker');
		for (var i = 0; i < markers.length; i++) {
			var latlng = new google.maps.LatLng(parseFloat($(markers[i]).attr("lat")),
										parseFloat($(markers[i]).attr("lng")));
			var type = $(markers[i]).attr("type");
			var url = $(markers[i]).attr("url");
			var title = $(markers[i]).attr("title");
			var region = $(markers[i]).attr("region");
			var country = $(markers[i]).attr("country");
			var typery = $(markers[i]).attr("typery");
			var imgnam = "";
			if(type == "green")	{
				imgnam = "http://www.villasdirect.com/images/region_marker_blue.gif";
			}else{
				imgnam = "http://www.villasdirect.com/images/mapmarker_green.gif";
			}		
			var img = new google.maps.MarkerImage(
				imgnam,
				new google.maps.Size(30,35),
				new google.maps.Point(0,0),
				new google.maps.Point(15,35)
			);
			//add a link to your xml that can be inserted here where I have http://www.google.com
			var html = "<div class = 'MarkerPopUp' style='width: 150px; height: 25px;'><a href='" + $(markers[i]).attr('url') + "' Title=' + $(markers[i]).attr('Title') + '>" + $(markers[i]).attr('region') + "</a></div>";									
			var marker = new google.maps.Marker({position: latlng, map:map, icon:img, html:html, url:url, title:title, region:region, country:country, typery:typery});
	//		marker.set("id", region.replace(' ','_') + '_Marker');
	//		var infowindow1 = new google.maps.InfoWindow();
	//		google.maps.event.addListener(marker, 'mouseover', function() {
	//			infowindow1.setContent(this.html);
	//	        infowindow1.open(map, this);

	//	    });
			
			google.maps.event.addListener(marker, 'click', function() {
	//            document.getElementById("region").value = this.region;
	//            document.getElementById("country").value = this.country;
	//            document.getElementById("location").value = this.title;
	//            document.getElementById("fb").value = this.title;
	//			document.getElementById("typery").value = this.typery;
	//			document.getElementById("form1").submit();
			window.location.href = marker.url;
			
			});

			var regionmarker = "Marker_"+(i+1);//region.replace(/ /g,"").replace(/\-/g,"").replace(/'/g,"").replace(/\&/g,"").replace(/\//g,"");
			var element1= document.getElementById(regionmarker);
			gMarkers[i] = marker;
						
			element1.setAttribute("onmouseover","gMarkers["+i+"].setIcon(\'/images/region_marker_red.gif\')");
			element1.setAttribute("onmouseout","gMarkers["+i+"].setIcon('"+imgnam+"')");
		}
	  }

    </script>

Open in new window

0
 
LVL 56

Expert Comment

by:Julian Hansen
ID: 39885641
Hmmm - they are specified - they are the names in the list of regions
Where in the code are you setting the markerid?

getElementById is going to look for an element with an id attribute of the one specified.

Somewhere you need to be setting that.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39885693
Can you take a look at the issue on this page http://www.villasdirect.com/deps/images/index.asp
0
 

Author Comment

by:Nico2011
ID: 39885805
Hi Scott,

I can't even see this file...!

Best wishes/Nico
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 250 total points
ID: 39885814
That page is causing a problem probably from an infinite loop
0
 

Author Comment

by:Nico2011
ID: 39885932
but the file doesn't exist - we have a specific error 404 page to redirect to the home page, but it's probably doing this within the folder
0
 

Author Comment

by:Nico2011
ID: 39885966
I have fixed that though - it was looping in the folder rather than redirecting to the homepage when it couldn't find a file...!  Thank you for that!

I think I may have found the issue - the country name wasn't being passed over, so the map couldn't load... I will close this and share the points between you both for the effort!

If I am wrong, then I will ask the question once again.
0
 

Author Closing Comment

by:Nico2011
ID: 39886040
Thank you both for your help
0
 

Author Comment

by:Nico2011
ID: 39886136
It was simply that the name of the location wasn't being loaded in the google map, so it couldn't centre or find the initial point - it works now!
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question