Object.prototype.update = function(other) {
  for (var property in other) this[property] = other[property];
  return this;
}

function QuizWidget(options) {
  this.update({
    channel_id:"",
    user_list_id:"",
    size:300,
    domain:"http://www.likebetter.com",
    background_color:"ffffff",
    text_color:"000000"
  }.update(options));

  var hsize = this.size*2+10;
  var vsize = this.size+65;
  document.write(
    '<iframe name="likebetter-widget" src="'+this.domain+
    '/quiz/embed?size='+this.size+'&channel_id='+this.channel_id+
    '&user_list_id='+this.user_list_id+'&bgcolor='+this.background_color+
    '&text_color='+this.text_color+
    '" id="likebetter-gadget" marginwidth="0" marginheight="0" frameborder="0" height="'+
    vsize+'" width="'+hsize+'" scrolling="no"></iframe>');
}
