(function(){

function initialize() {

  mixin ={
    server: 'http://www.mixin.com/', // dont forget the trailing
    event_id: 1813442,

    widgetStyle: {
      marginRight: '15px'
    },

    colors: {
      bg_body: '#009575',
      text: '#fff',

      bg_button: '#7ed40c',
      bg_button_selected: '#129d02',

      border_button: '#00FF00',
      border_button_selected: '#4C8400'
    },
    
    language: 'fr'
  };

  var custom_colors_tail = [] ;

  if (mixin.colors) {
    for (var s in mixin.colors) {
      if (mixin.colors.hasOwnProperty(s)){
        custom_colors_tail.push('&' + s + '=' + encodeURIComponent(mixin.colors[s]));
      }
    }
  }


  var iframe = document.createElement('iframe');
  iframe.className = 'mixin-widget';
  iframe.setAttribute('src', mixin.server + 'integration/events/' + mixin.event_id
    + '/?c=' + (+new Date) + document.location.hash
    + custom_colors_tail.join('')
    + (mixin.language ? '&lang=' + mixin.language: ''));

  if (mixin.widgetStyle) {
    for (var s in mixin.widgetStyle) {
      iframe.style[s] = mixin.widgetStyle[s];
    }
  }
  document.getElementById('mixin-attendee-widget').appendChild(iframe);
}

/* DOMContentLoaded: http://www.kryogenix.org/days/2007/09/26/shortloaded */
(function(i) {u = navigator.userAgent; e = /*@cc_on!@*/false; st = setTimeout;
if(/webkit/i.test(u)){st(function(){dr = document.readyState;if(dr=="loaded"||
dr=="complete"){i();}else{st(arguments.callee,10);}},10);}else if((/mozilla/i.
test(u)&&!/(compati)/.test(u))||(/opera/i.test(u))){document.addEventListener(
"DOMContentLoaded",i,false);} else if(e){(function(){t=document.createElement(
'doc:ready');try{t.doScroll('left');i();t= null;}catch(e){st(arguments.callee,
0);}})();}else{window.onload = i;}}
(initialize));


})();