function map_window(theURL,winName,features) {
  //window.open(theURL,winName,features);
  window.location = theURL;
}

function map_link()
{
	var map_string = "<div id='map_link' class='map_link'><form id='map_includes' name='map_includes' method='post' action=''>";

	if(map_id && map_id != "" && map_id != " ") { // check for map_id, the only req param
		map_string += "<input type='hidden' name='map_id' id='map_id' value='"+map_id+"' />";

		if(referer_id && referer_id != "" && referer_id != " ") { // referring site
		map_string += "<input type='hidden' name='referer_id' id='referer_id' value='"+referer_id+"' />";
			map_string += "<a href='http://dev.mapdots.com/map/signup.php?map_id="+map_id+"&referring_site_id="+referer_id+"' target='_blank'>Click here for more information on getting your business listed on this map.</a><br /><br />";
		}

		if(location_id && location_id != "" && location_id != " ") { // linking to a specific location on map
		map_string += "<input type='hidden' name='location_id' id='location_id' value='"+location_id+"' />";
		}
		
		if(type) {
			map_string += "<input type='hidden' name='type' id='type' value='"+type+"' />";
		}
		
		map_path = ('http://dev.mapdots.com/map/map_window.php?map_id='+map_id+'&referer_id='+referer_id+'&location_id='+location_id+'&type='+type);
		map_string += "<a href=\"#\" onClick=\"javascript: map_window('"+map_path+"','InteractiveVisitorsGuide','scrollbars=yes,resizable=yes,width=850,height=638')\"><img src=\"http://dev.mapdots.com/map/map_includes.gif\" alt=\"Click to open the interactive visitors guide! Powered by: mapdots.com\" title=\"Click to open the interactive visitors guide! Powered by: mapdots.com\" border=\"0\"></a><br />";
		
	}else{
		map_string += "There seems to be a problem with the link to the map, please contact the web site administrator.<br />";
	}
	
	map_string += "</form></div>";

document.write(map_string);
//map_window(map_path,'InteractiveVisitorsGuide','scrollbars=yes,resizable=yes,width=850,height=638');
}

