
/* 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-000085596-8'>KenoCoMultiples - Club Activities</a>");


var events = [
{
    'id': 'E0-001-006884174-3@2010021619',
    'date_readable': '16 Feb 10',
    'date_iso8601': '20100216',
    'time_readable': '7 PM',
    'time_iso8601': 'T190000',
    'link': 'http://eventful.com/events/E0-001-006884174-3@2010021619',
    'name': 'Kenosha County Parents of Multiples Club Meeting - Homemade Gourmet',
    'description': 'The Kenosha County Parents of Multiples Club is a service organization. We provide outlets for parents of multiples through monthly meetings with opportunities to socialize and gain information. We serve new parents of multiples with support and encouragement. We serve expectant parents of multiples and interested public with information about multiple births.  Meets the 3rd Tuesday of each month @ 7PM. (exceptions in Aug. & Dec. when we focus on summer & holiday gatherings in lieu of...',
    'venue_link': 'http://eventful.com/venues/V0-001-000180763-0',
    'venue_name': 'Kenosha, Wisconsin, United States',
  'venue_locality': 'Kenosha, WI'
},
{
    'id': 'E0-001-021635684-2@2010022019',
    'date_readable': '20 Feb 10',
    'date_iso8601': '20100220',
    'time_readable': '7 PM',
    'time_iso8601': 'T190000',
    'link': 'http://eventful.com/events/E0-001-021635684-2@2010022019',
    'name': 'Kenosha County Parents of Multiples Club Meeting',
    'description': 'The Kenosha County Parents of Multiples Club is a service organization. We provide outlets for parents of multiples through monthly meetings with opportunities to socialize and gain information. We serve new parents of multiples with support and encouragement. We serve expectant parents of multiples and interested public with information about multiple births. Meets the 3rd Tuesday of each month @ 7PM. (exceptions in Aug. & Dec. when we focus on summer & holiday gatherings in lieu of...',
    'venue_link': 'http://eventful.com/venues/V0-001-002341351-2',
    'venue_name': 'Postal code 53142, United States',
  'venue_locality': 'Kenosha, WI'
}];

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-000085596-8'>Subscribe</a>\
 <a href='http://eventful.com/rss/calendars/C0-001-000085596-8'><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-000085596-8'>Subscribe</a>\
 <a href='webcal://eventful.com/ical/calendars/C0-001-000085596-8'><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-000085596-8/C0-001-000085596-8.ics'>Download</a>\
 <a href='http://eventful.com/ical/calendars/C0-001-000085596-8/C0-001-000085596-8.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>");