
/* 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-000003167-4'>fcctb</a>");


var events = [
];

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