function detailsLog(id){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("/WhenYouGoScripts/detailsLog.asp?id=" + id + "&time=" + timestamp, {
    method: 'get',
    onSuccess: function(transport) {
    }});
    return true;
}
function websiteLog(id){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("/WhenYouGoScripts/websiteLog.asp?id=" + id + "&time=" + timestamp, {
    method: 'get',
    onSuccess: function(transport) {
    }});
    return true;
}
    var map = null;
    var geocoder = null;
    
    function addAddressToMap(response) {
        if (!response || response.Status.code != 200) {
            
        } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(place.address + '<br>' +
          '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
        }
    }
    function showLocation(address) {
          geocoder.getLocations(address, addAddressToMap);
    }
    function showAddress(lat, lng, message,theIcon){

        var latnew = plotCoordinates[0][0] / 10000;
        var lngnew = plotCoordinates[0][1] / 10000;  

        map.setCenter(new GLatLng(latnew, lngnew), 10);

	latnew = lat / 10000;
	lngnew = lng / 10000;
	    
	markerOptions = { icon:theIcon };
        var marker = new GMarker(new GLatLng(latnew, lngnew), markerOptions);
        GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(message);
        });

        map.addOverlay(marker);
    }
       
    var plotCoordinates = [];
    
    function loadab() {
      if(GBrowserIsCompatible()){
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        geocoder = new GClientGeocoder();
        var icon = new GIcon();
        icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
        icon.iconSize = new GSize(12, 20);
        icon.shadowSize = new GSize(22, 20);
        icon.iconAnchor = new GPoint(6, 20);
        icon.infoWindowAnchor = new GPoint(5, 1);
        for(var i = 0; i < plotCoordinates.length; i++){
        	var theicon = new GIcon();

        	if(plotCoordinates[i][3] == "Restaurants"){
	            theicon.shadow = "/Media/MediaManager/OhioMagRedesign/dining2s.png";
	            theicon.image = "/Media/MediaManager/OhioMagRedesign/dining2.png";
	            theicon.iconSize = new GSize(30, 30);
	            theicon.shadowSize = new GSize(30, 30);
	            theicon.iconAnchor = new GPoint(12, 27);
	            theicon.infoWindowAnchor = new GPoint(9, 2);
	            theicon.infoShadowAnchor = new GPoint(18, 25);
	        }else if(plotCoordinates[i][3] == "Lodging"){
	            theicon.shadow = "/Media/MediaManager/OhioMagRedesign/hotel2s.png";
	            theicon.image = "/Media/MediaManager/OhioMagRedesign/hotel2.png";
	            theicon.iconSize = new GSize(30, 30);
	            theicon.shadowSize = new GSize(30, 30);
	            theicon.iconAnchor = new GPoint(12, 27);
	            theicon.infoWindowAnchor = new GPoint(9, 2);
	            theicon.infoShadowAnchor = new GPoint(18, 25);
	        }else if(plotCoordinates[i][3] == "Events"){
	            theicon.shadow = "/Media/MediaManager/OhioMagRedesign/event2s.png";
	            theicon.image = "/Media/MediaManager/OhioMagRedesign/event2.png";
	            theicon.iconSize = new GSize(30, 30);
	            theicon.shadowSize = new GSize(30, 30);
	            theicon.iconAnchor = new GPoint(12, 27);
	            theicon.infoWindowAnchor = new GPoint(9, 2);
	            theicon.infoShadowAnchor = new GPoint(18, 25);
	        }else{
	            theicon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
	            theicon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	            theicon.iconSize = new GSize(12, 20);
	            theicon.shadowSize = new GSize(22, 20);
	            theicon.iconAnchor = new GPoint(6, 20);
	            theicon.infoWindowAnchor = new GPoint(5, 1);
	        }
            showAddress(plotCoordinates[i][0],plotCoordinates[i][1],plotCoordinates[i][2],theicon);
        }
      }
   }
    function addAddressToMap(response) {
      if (!response || response.Status.code != 200) {
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(place.address + '<br>' +
          '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
      }
    }
    function showLocation(address) {
      geocoder.getLocations(address, addAddressToMap);
    }


var counter = 0;
function runOnLoad(f){
    if(runOnLoad.loaded) f();
    else runOnLoad.funcs.push(f);
}

runOnLoad.funcs = [];
runOnLoad.loaded = false;

runOnLoad.run = function(){
    if(runOnLoad.loaded) return;
    for(var i = 0; i < runOnLoad.funcs.length; i++){
        try { runOnLoad.funcs[i](); }
        catch (e) { /* Don't stop onload if a function fails */ }
    }
};

if(window.addEventListener) window.addEventListener("load", runOnLoad.run, false);
else if(window.attachEvent) window.attachEvent("onload", runOnLoad.run);
else window.onload = runOnLoad.run;

function unique(theArr) {
	var temp = [];
	var tempb;
	for(i=0;i<theArr.length;i++){
		tempb = theArr[i][1];
		if(!contains(tempb, temp)){
			temp.push(theArr[i]);
		}
	}
	return temp;
}
function contains(tempb, temp) {
	for(j=0;j<temp.length;j++)if(temp[j][1]==tempb)return true;
	return false;
}


function showNearBy(transport,type,tempLat,tempLng){
    if(transport.responseText.length != 0){
        var ajaxResponse = [];
        var response = "";
        var eventsArray = [];
        var toShowArray = [];
        if (type=="Story"){var descriptionArray = [];}
        if (type=="Story"){var issueArray = [];}
        var top = 0;
        var strResponseText = transport.responseText.substring(0,(transport.responseText.length - 2));
        ajaxResponse = strResponseText.split("||");
        for(var i=0; i< ajaxResponse.length; i++){
            eventsArray.push(ajaxResponse[i].split("|"));
        }
        //Do this for each event we get...
        for(var i=0; i < eventsArray.length; i++){
            //Determine all events within a 20 mile radius of the event from the 40x40 mile square.
            var lat1=tempLat/10000,lon1=tempLng/10000,lat2=eventsArray[i][3]/10000;lon2=eventsArray[i][2]/10000; //Convert Latitude to decimal format from integer format
            var R = 6371; // circumference of the world in km
            
            //Start distance formula
            var dLat = (lat2-lat1) * Math.PI/214;
            var dLon = (lon2-lon1) * Math.PI/214; 
            var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
                    Math.cos(lat1 * Math.PI/214) * Math.cos((lat2 * Math.PI/214)) * 
                    Math.sin(dLon/2) * Math.sin(dLon/2); 
            var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); 
            var d = R * c;
            
            //Convert distance from km to miles
            d = d * 0.621369949495;
            //Add event to toShowArray if distance is less than 20 miles.
            if(d < 20){
                toShowArray[top] = new Array();
                toShowArray[top][0] = d;
                toShowArray[top][1] = eventsArray[i][1];
                toShowArray[top][2] = eventsArray[i][0];
                toShowArray[top][3] = eventsArray[i][4];
                if (type=="Story"){toShowArray[top][4] = eventsArray[i][5];}
                toShowArray[top][5] = eventsArray[i][3];
                toShowArray[top][6] = eventsArray[i][2];
                if(type != "Story" && eventsArray[i][5]){toShowArray[top][7] = eventsArray[i][5];}
                else{toShowArray[top][7] = "NOIMAGE";}
                top++;
            }
        }
        //toShowArray.sort(function(a,b){if(typeof(a[7]) == "string" && typeof(b[7]) == "string") return a[0] - b[0];else if(typeof(a[7]) == "string" && !(typeof(b[7]) == "string")) return -1; else return a[0]-b[0];});
        //toShowArray.sort(function(a,b){if(a[7] != "NOIMAGE" && b[7] != "NOIMAGE") return a[0] - b[0];else if(a[7] != "NOIMAGE" && b[7] == "NOIMAGE") return -1;else return a[0]-b[0];});
//	toShowArray.sort(function(a,b){if(a[7] != "NOIMAGE" && b[7] != "NOIMAGE"){ return a[0] - b[0];}else if(a[7] != "NOIMAGE" && b[7] == "NOIMAGE"){ return -1;}else if(a[7] != "NOIMAGE" && b[7] == "NOIMAGE"){ return 1;} else return a[0]-b[0];});
	toShowArray.sort(function(a,b){if(a[7] != "NOIMAGE" && b[7] != "NOIMAGE"){ return a[0] - b[0];}else if(a[7] != "NOIMAGE" && b[7] == "NOIMAGE"){ return -1;}else if(a[7] == "NOIMAGE" && b[7] != "NOIMAGE"){ return 1;} else return a[0]-b[0];});

	var uniqueToShowArray;
	if(type == "Story"){
		uniqueToShowArray = unique(toShowArray);
		toShowArray = [];
		for(i=0; i < uniqueToShowArray.length; i++){
			toShowArray.push(uniqueToShowArray[i]);
		}
		top = toShowArray.length;
	}


        if(top > 5 ){ top = 5; }
        if(top == 0 && type == "Events") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td class="NoListingFound" >No Events within 20 miles...</td></tr></table>';
        if(top == 0 && type == "Restaurants") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td class="NoListingFound" >No restaurants within 20 miles...</td></tr></table>';
        if(top == 0 && type == "Lodging") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td class="NoListingFound" >No Lodging within 20 miles...</td></tr></table>';
        if(top == 0 && type == "Story") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td class="NoListingFound" >No Stories within 20 miles...</td></tr></table>';
        for(var i=0; i < top; i++){
            if(type != "Story" && toShowArray[i][7] != "NOIMAGE"){
                if(type == "Events") response = response + '<table cellpadding="0" cellspacing="0"><tr><td colspan="2"><img width="150px" src="' + toShowArray[i][7] + '" /></td></tr><tr valign="top"><td class="listingNumber" >' +  (i + 1) + '. </td><td><a class="listingLink" href="/Main/Events.aspx?sid=30BF81B411F74328A39BF1BA0337CD19&nm=Ohio+Events&type=MyModule&mod=Directories%3A%3AEventsCalendar&mid=972281777D9545958362A298D6D74713&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a></td></tr><tr><td>&nbsp;</td><td class="listingDescription">' + toShowArray[i][3] + '</td></tr><tr><td>&nbsp;</td><td class="listingMiles">' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table><br />';
		if(type == "Events") plotCoordinates.push(new Array(toShowArray[i][5],toShowArray[i][6], '<table width="300px"><tr><td><img align="center" width="150px" src="' + toShowArray[i][7] + '" /><br /><a class="listingLink" href="/Main/Events.aspx?sid=30BF81B411F74328A39BF1BA0337CD19&nm=Ohio+Events&type=MyModule&mod=Directories%3A%3AEventsCalendar&mid=972281777D9545958362A298D6D74713&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a><br />&nbsp;' + toShowArray[i][3] + '&nbsp;<br /><br />' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table>',type));
                if(type == "Restaurants") response = response + '<table cellpadding="0" cellspacing="0"><tr><td colspan="2"><img align="center" width="150px" src="' + toShowArray[i][7] + '" /></td></tr><tr valign="top"><td class="listingNumber" >' +  (i + 1) + '. </td><td><a class="listingLink" href="/Main/Restaurants.aspx?sid=03627C837E0249F8AD5A918A883CFBE2&nm=Ohio+Restaurants&type=MyModule&mod=Directories%3A%3AOMDiningSearch&mid=34C13CB3B0D445468B6C76558DD1EB1E&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a></td></tr><tr><td>&nbsp;</td><td class="listingDescription">' + toShowArray[i][3] + '</td></tr><tr><td>&nbsp;</td><td class="listingMiles">' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table><br />';
		if(type == "Restaurants") plotCoordinates.push(new Array(toShowArray[i][5],toShowArray[i][6],'<table width="300px"><tr><td><img align="center" width="150px" src="' + toShowArray[i][7] + '" /><br /><a class="listingLink" href="/Main/Restaurants.aspx?sid=03627C837E0249F8AD5A918A883CFBE2&nm=Ohio+Restaurants&type=MyModule&mod=Directories%3A%3AOMDiningSearch&mid=34C13CB3B0D445468B6C76558DD1EB1E&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a>&nbsp;<br />' + toShowArray[i][3] + '<br /><br />' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table>',type));
                if(type == "Lodging") response = response + '<table cellpadding="0" cellspacing="0"><tr><td colspan="2"><img align="center" width="150px" src="' + toShowArray[i][7] + '" /></td></tr><tr valign="top"><td class="listingNumber" >' +  (i + 1) + '. </td><td><a class="listingLink" href="/Main/Hotels.aspx?sid=207592A3FF054D8FACF3C5EBC3B8F262&nm=Ohio+Hotels&type=MyModule&mod=Directories%3A%3AOMHotelSearchTwo&mid=2C6872AE8B414873B38528BD9CA6817D&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a></td></tr><tr><td>&nbsp;</td><td class="listingDescription">' + toShowArray[i][3] + '</td></tr><tr><td>&nbsp;</td><td class="listingMiles">' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table><br />';
		if(type == "Lodging") plotCoordinates.push(new Array(toShowArray[i][5],toShowArray[i][6], '<table width="300px"><tr><td><img align="center" width="150px" src="' + toShowArray[i][7] + '" /><br /><a class="listingLink" href="/Main/Hotels.aspx?sid=207592A3FF054D8FACF3C5EBC3B8F262&nm=Ohio+Hotels&type=MyModule&mod=Directories%3A%3AOMHotelSearchTwo&mid=2C6872AE8B414873B38528BD9CA6817D&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a><br />&nbsp;' + toShowArray[i][3] + '&nbsp;<br /><br />' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table>',type));
		if(whenyougoLog(toShowArray[i][2]));
            }else{
                if(type == "Events") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;">' +  (i + 1) + '. </td><td><a class="listingLink" href="/Main/Events.aspx?sid=30BF81B411F74328A39BF1BA0337CD19&nm=Ohio+Events&type=MyModule&mod=Directories%3A%3AEventsCalendar&mid=972281777D9545958362A298D6D74713&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a></td></tr><tr><td>&nbsp;</td><td class="listingDescription">' + toShowArray[i][3] + '</td></tr><tr><td>&nbsp;</td><td class="listingMiles">' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table><br />';
		if(type == "Events") plotCoordinates.push(new Array(toShowArray[i][5],toShowArray[i][6],'<table width="300px"><tr><td><a class="listingLink" href="/Main/Events.aspx?sid=30BF81B411F74328A39BF1BA0337CD19&nm=Ohio+Events&type=MyModule&mod=Directories%3A%3AEventsCalendar&mid=972281777D9545958362A298D6D74713&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a><br />' + toShowArray[i][3] + '&nbsp;<br /><br />' + toShowArray[i][0].toFixed(2) + ' mi. from hotel<br /></td></tr></table>',type) );
                if(type == "Restaurants") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;">' +  (i + 1) + '. </td><td><a class="listingLink" href="/Main/Restaurants.aspx?sid=03627C837E0249F8AD5A918A883CFBE2&nm=Ohio+Restaurants&type=MyModule&mod=Directories%3A%3AOMDiningSearch&mid=34C13CB3B0D445468B6C76558DD1EB1E&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a></td></tr><tr><td>&nbsp;</td><td class="listingDescription">' + toShowArray[i][3] + '</td></tr><tr><td>&nbsp;</td><td class="listingMiles">' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table><br />';
 		if(type == "Restaurants") plotCoordinates.push(new Array(toShowArray[i][5],toShowArray[i][6],'<table width="300px"><tr><td><a class="listingLink" href="/Main/Restaurants.aspx?sid=03627C837E0249F8AD5A918A883CFBE2&nm=Ohio+Restaurants&type=MyModule&mod=Directories%3A%3AOMDiningSearch&mid=34C13CB3B0D445468B6C76558DD1EB1E&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a><br />' + toShowArray[i][3] + '&nbsp;<br /><br />' + toShowArray[i][0].toFixed(2) + ' mi. from hotel<br /></td></tr></table>',type) );
                if(type == "Lodging") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;">' +  (i + 1) + '. </td><td><a class="listingLink" href="/Main/Hotels.aspx?sid=207592A3FF054D8FACF3C5EBC3B8F262&nm=Ohio+Hotels&type=MyModule&mod=Directories%3A%3AOMHotelSearchTwo&mid=2C6872AE8B414873B38528BD9CA6817D&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a></td></tr><tr><td>&nbsp;</td><td class="listingDescription">' + toShowArray[i][3] + '</td></tr><tr><td>&nbsp;</td><td class="listingMiles">' + toShowArray[i][0].toFixed(2) + ' mi. from hotel</td></tr></table><br />';
		if(type == "Lodging") plotCoordinates.push(new Array(toShowArray[i][5],toShowArray[i][6],'<table width="300px"><tr><td><a class="listingLink" href="/Main/Hotels.aspx?sid=207592A3FF054D8FACF3C5EBC3B8F262&nm=Ohio+Hotels&type=MyModule&mod=Directories%3A%3AOMHotelSearchTwo&mid=2C6872AE8B414873B38528BD9CA6817D&tier=3&ModuleSID=' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a><br />' + toShowArray[i][3] + '&nbsp;<br /><br />' + toShowArray[i][0].toFixed(2) + ' mi. from hotel<br /></td></tr></table>',type) );
                if(type == "Story") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;" >' +  (i + 1) + '. </td><td><a class="listingLink" href="' + toShowArray[i][2] + '" >' + toShowArray[i][1] + '</a></td></tr><tr><td>&nbsp;</td><td style="color:#656564;font-family:Verdana;font-size:8pt;width:180px;">' + toShowArray[i][3] + '</td></tr><tr><td>&nbsp;</td><td style="color:#000;font-family:Verdana;font-size:8pt;">' + toShowArray[i][4] + "</td></tr></table><br />";

            }
//            if(type == "Restaurants" || type == "Lodging") plotCoordinates.push(new Array(toShowArray[i][5],toShowArray[i][6],toShowArray[i][1],type) );
        }
    } else {
        if(type == "Events") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td style="font-size: 8pt; font-family: Verdana" >No Events within 20 miles...</td></tr></table>';
        if(type == "Restaurants") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td style="font-size: 8pt; font-family: Verdana" >No Restaurants within 20 miles...</td></tr></table>';
        if(type == "Lodging") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td style="font-size: 8pt; font-family: Verdana" >No Lodging within 20 miles...</td></tr></table>';
        if(type == "Story") response = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td style="font-size: 8pt; font-family: Verdana" >No Stories within 20 miles...</td></tr></table>';
    }
    
    if(type == "Events") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;font-size: 10pt; font-family: Verdana" >&nbsp;</td><td><br /><a class="listingLink" href="http://www.ohiomag.com/events">Find More&#62;&#62;</td></tr></table>';
    if(type == "Restaurants") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;font-size: 10pt; font-family: Verdana" >&nbsp;</td><td><br /><a class="listingLink" href="http://www.ohiomag.com/restaurants">Find More&#62;&#62;</td></tr></table>';
    if(type == "Lodging") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;font-size: 10pt; font-family: Verdana" >&nbsp;</td><td><br /><a class="listingLink" href="http://www.ohiomag.com/hotels">Find More&#62;&#62;</td></tr></table>';
    if(type == "Story") response = response + '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;font-size: 10pt; font-family: Verdana" >&nbsp;</td><td><br /><a class="listingLink" href="http://www.ohiomag.com/magazine">Find More&#62;&#62;</td></tr></table>';
    return response;
}

function getEvents(lat,lng){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("/my_modules/OMHotels/whenyougo.asp?type=Events&Lat="+lat+"&Long="+lng+"&time="+timestamp, {
    method: 'get',
    onSuccess: function(transport) {
    var response = showNearBy(transport,"Events",lat,lng);
    $("Events").innerHTML = response;
},  onFailure: function(transport) {
    $("Events").innerHTML = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td class="NoListingFound" >No Dining within 20 miles...</td></tr></table><table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;font-size: 10pt; font-family: Verdana" >&nbsp;</td><td><br /><a style="text-decoration:none; color:#007bbb;font-family: Verdana;font-size:10pt;" href="http://www.ohiomag.com/events">Find More&#62;&#62;</td></tr></table>'
}});
}

function getRestaurants(lat,lng){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("/my_modules/OMHotels/whenyougo.asp?type=Restaurants&Lat="+lat+"&Long="+lng+"&time="+timestamp, {
    method: 'get',
    onSuccess: function(transport) {    
    var response = showNearBy(transport,"Restaurants",lat,lng);
    $("Restaurants").innerHTML = response;
},  onFailure: function(transport) {
    $("Restaurants").innerHTML = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td class="NoListingFound" >No Dining within 20 miles...</td></tr></table><table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;font-size: 10pt; font-family: Verdana" >&nbsp;</td><td><br /><a style="text-decoration:none; color:#007bbb;font-family: Verdana;font-size:10pt;" href="http://www.ohiomag.com/restaurants">Find More&#62;&#62;</td></tr></table>'
}});
}

function getStories(lat,lng){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("/my_modules/OMHotels/whenyougo.asp?type=Stories&Lat="+lat+"&Long="+lng+"&time="+timestamp, {
    method: 'get',
    onSuccess: function(transport) {
    var response = showNearBy(transport,"Story",lat,lng);
    $("Story").innerHTML = response;
},  onFailure: function(transport) {
    $("Story").innerHTML = '<table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px">&nbsp;</td><td class="NoListingFound" >No Stories within 20 miles...</td></tr></table><table cellpadding="0" cellspacing="0"><tr valign="top"><td style="width:20px;font-size: 10pt; font-family: Verdana" >&nbsp;</td><td><br /><a style="text-decoration:none; color:#007bbb;font-family: Verdana;font-size:10pt;" href="http://www.ohiomag.com/magazine">Find More&#62;&#62;</td></tr></table>'
}});
}

function whenyougoLog(id){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("/WhenYouGoScripts/whenyougoLog.asp?id=" + id + "&time=" + timestamp, {
    method: 'get',
    onSuccess: function(transport) {
    }});
    return true;
}