
/* sticker_add_style - add a stylesheet to the current document.
 * Argument 'css' should be a URL to a stylesheet.
 */
function sticker_add_style(css) {
  var head        = document.getElementsByTagName("head")[0];
  var csslink     = document.createElement("link");
  var csslinkrel  = document.createAttribute("rel");
  csslinkrel.nodeValue = "stylesheet";
  csslink.setAttributeNode(csslinkrel);
  var csslinktype = document.createAttribute("type");
  csslinktype.nodeValue = "text/css";
  csslink.setAttributeNode(csslinktype);
  var csslinkhref = document.createAttribute("href");
  csslinkhref.nodeValue = css;
  csslink.setAttributeNode(csslinkhref);

  head.appendChild(csslink);
}


var eventful_css;
if (eventful_css) {
  sticker_add_style(eventful_css);
}


document.write("<a class='calendar-name' href='http://eventful.com/calendars/C0-001-000099600-7'>Rochester, MN - Local Events</a>");


var events = [
{
    'id': 'E0-001-005887293-9',
    'date_readable': 'Jul 30, 2010',
    'date_iso8601': '20100730',
    'time_readable': '12 AM',
    'time_iso8601': 'T000000',
    'link': 'http://eventful.com/events/E0-001-005887293-9',
    'name': 'Riverboat Days Festival',
    'description': 'Arts, Crafts and Antique Fair, River Run and Walk, Pancakes in the Park, Fishing Tournament, Family Entertainment, Firemen\'s Waterfight, Grand Parade, Food, Live music in the Beer Garden. All located along the Beautiful Mississippi River at Heritage Square Park, Downtown Wabasha Directions to Event Wabasha is located 80 miles south of the St. Paul/Mpls. area on Highway 61, the Great River Road. Gate admission for the Troubleshooter band on Saturday night. Dates 7/30/2010 to...',
    'venue_link': 'http://eventful.com/venues/V0-001-001494331-2',
    'venue_name': 'Riverboat Days , Jul.&nbsp;25-26 2008 Description Riverboat days includes parade, 5K run/walk, band, beer tent.Time: Various timesPrice: Varies Address and Contact Details 137 W Main St Wabasha, MN&nbsp;55981&nbsp;(view map and get directions) For more information, call 507-289-5289. Visit us online at www.wabashamn.org',
  'venue_locality': 'Wabasha, MN'
},
{
    'id': 'E0-001-031623851-6',
    'date_readable': 'Jul 30, 2010',
    'date_iso8601': '20100730',
    'time_readable': '7 PM',
    'time_iso8601': 'T190000',
    'link': 'http://eventful.com/events/E0-001-031623851-6',
    'name': 'Charlie and the Chocolate Factory',
    'description': 'Based on the book by Roald Dahl, Dramatized by Richard R GeorgeTime: Fri @ 7:00pm, Sat @ 2:00pm & 7:00pm, Sun @ 2:00pmPrice: Adult $18.50, Senior $15.50, Student $13.50',
    'venue_link': 'http://eventful.com/venues/V0-001-000184182-9',
    'venue_name': 'Rochester Civic Theatre',
  'venue_locality': 'Rochester, MN'
},
{
    'id': 'E0-001-005887044-5',
    'date_readable': 'Jun 25, 2010',
    'date_iso8601': '20100625',
    'time_readable': '12 AM',
    'time_iso8601': 'T000000',
    'link': 'http://eventful.com/events/E0-001-005887044-5',
    'name': 'Great River Shakespeare Festival',
    'description': 'ANNOUNCING... Season 7 of the Great River Shakespeare Festival opens June 25, 2010 and runs for six weeks through August 1, 2010. Anchoring the Festival are two Shakespeare plays, \"OTHELLO\" and \"THE COMEDY OF ERRORS,\" plus a musical WWII memoir, \"THE DALY NEWS.\" The Apprentice Project will feature \"TITUS ANDRONICUS.\" ...Enjoy ALL the Festival events! Watch www.grsf.org for updates. Directions to Event Performances are at Winona State University\'s PERFORMING ARTS CENTER in Winona, MN, located...',
    'venue_link': 'http://eventful.com/venues/V0-001-003011370-8',
    'venue_name': 'WSU Performing Arts Center',
  'venue_locality': 'Winona, MN'
},
{
    'id': 'E0-001-030534229-3',
    'date_readable': 'Apr 24, 2010',
    'date_iso8601': '20100424',
    'time_readable': '12 AM',
    'time_iso8601': 'T000000',
    'link': 'http://eventful.com/events/E0-001-030534229-3',
    'name': 'Five Centuries of Medicine in Art',
    'description': 'Exhibition - from the Collection of Bruce & Lois Fye Dates 4/24/2010 to 9/5/2010',
    'venue_link': 'http://eventful.com/venues/V0-001-000388626-0',
    'venue_name': 'Postal code 55904, United States',
  'venue_locality': 'Rochester, MN'
},
{
    'id': 'E0-001-003878606-9',
    'date_readable': 'Aug 2, 2010',
    'date_iso8601': '20100802',
    'time_readable': '12 AM',
    'time_iso8601': 'T000000',
    'link': 'http://eventful.com/events/E0-001-003878606-9',
    'name': 'Olmsted County Fair',
    'description': 'Carnival rides, food vendors, animals, exhibits and more! Directions to Event Just south of downtown Rochester on Hwy 63, Broadway Ave.Dates 8/2/2010 to 8/8/2010Additional Information Event is Accessible to Disabled',
    'venue_link': 'http://eventful.com/venues/V0-001-000462684-1',
    'venue_name': 'Olmsted County Fairgrounds &amp; Graham Arenas',
  'venue_locality': 'Rochester, MN'
}];

var eventful_date;
var eventful_time;
var eventful_venue;
var eventful_venue_display;
var eventful_description;


document.write("<div class='vcalendar'>");

if (events.length < 1) {
  document.write("<div class='sticker-error'>No future events.</div>");
} else {
  for (e = 0; e < events.length; e++) {
    var event = events[e];
    document.write("<div class='vevent'>");
    if (eventful_date && eventful_time) {
      document.write("<abbr class='dtstart' title='" + event['date_iso8601']
          + "T" + event['time_iso8601'] + "'>"
          + event['date_readable'] + " " + event['time_readable'] + "</abbr>");
    } else if (eventful_date) {
      document.write("<abbr class='dtstart' title='" + event['date_iso8601'] + "'>"
          + event['date_readable'] + "</abbr>");
    } else if (eventful_time) {
      document.write("<abbr class='dtstart' title='" + event['time_iso8601'] + "'>"
          + event['time_readable'] + "</abbr>");
    }
    document.write(" <a class='url uid summary' href='" + event['link'] + "' title='" + event['name'] + "'>" + event['name'] + "</a>");
    if (eventful_venue) {
      if (eventful_venue_display == "city-state") {
        document.write(" in ");
        if (event['venue_link']) {
          document.write(" <a class='location' href='" + event['venue_link'] + "' title='" + event['venue_locality'] + "'>" + event['venue_locality'] + "</a>");
        } else {
          document.write(" <span class='location'>" + event['venue_locality'] + "</span>");
        }
      } else if (event['venue_name'] && (event['venue_name'] != ' ')) {
        document.write(" at ");
        if (event['venue_link']) {
          document.write(" <a class='location' href='" + event['venue_link'] + "' title='" + event['venue_name'] + "'>" + event['venue_name'] + "</a>");
        } else {
          document.write(" <span class='location'>" + event['venue_name'] + "</span>");
        }
      }
    }
    if (eventful_description) {
      document.write("<div class='summary'>" + event['description'] + "</div>");
    }
    document.write("</div>");
  }
}

document.write("</div>");

document.write("<div class='calendar-subs'>");
document.write("<div>\
<a href='http://eventful.com/rss/calendars/C0-001-000099600-7'>Subscribe</a>\
 <a href='http://eventful.com/rss/calendars/C0-001-000099600-7'><img src='http://eventful.com/images/skin/rss.gif' alt='Subscribe with RSS' title='Subscribe with RSS' width='36' height='14' /></a>\
</div>");
document.write("<div>\
<a href='webcal://eventful.com/ical/calendars/C0-001-000099600-7'>Subscribe</a>\
 <a href='webcal://eventful.com/ical/calendars/C0-001-000099600-7'><img src='http://eventful.com/images/skin/ical.gif' alt='Subscribe with iCalendar' title='Subscribe with iCalendar' width='36' height='14' /></a>\
</div>");
document.write("<div>\
<a href='http://eventful.com/ical/calendars/C0-001-000099600-7/C0-001-000099600-7.ics'>Download</a>\
 <a href='http://eventful.com/ical/calendars/C0-001-000099600-7/C0-001-000099600-7.ics'><img src='http://eventful.com/images/skin/ical.gif' alt='Subscribe with iCalendar' title='Download as iCalendar' width='36' height='14' /></a>\
</div>");
document.write("</div>");

document.write("<div class='calendar-footer'>");
document.write("powered by <a href='http://eventful.com/'>Eventful</a>");
document.write("</div>");