// http://miso.blog.matfyz.sk/p731-cross-domain-ajax

// make err_str, result, track_id optional.

// create a global object. SS. put eventlog in that. Ex:
// SS.eventlog. And then, put function to log, in that.
// do something similar for uploads.
function ss_event_log(tag, uniq_id, result, err_str)
{
  var now = new Date();
  var month = now.getUTCMonth() + 1;
  var happened_at = now.getUTCFullYear() + "-" + month + "-" + now.getUTCDate()
    + " " + now.getUTCHours() + ":" + now.getUTCMinutes() + ":" + now.getUTCSeconds();
  
  var request_script = document.createElement("script");

  request_script.src = "http://eventlog.slideshare.com/" + tag + "/?"
    + "happened_at=" + happened_at + "&"
    + "track_id=" + uniq_id + "&"
    + "result=" + result + "&"
    + "err_str=" + err_str;

  document.getElementsByTagName("head")[0].appendChild(request_script);
}


