






var vhm_jenc = function(o) {
  // regex from YUI
  var i,b,spc=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
  switch (typeof o) {
    case 'string':
      return '"' + o.replace(spc, function(c) {
        return '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);
      }) + '"';
    case 'number':
    case 'boolean':
      return o;
    case 'array':
      b = [];
      for (i=0;i<o.length;i++)
        b.push(vhm_jenc(o[i]));
      return '[' + b.join(',') + ']';
    case 'object':
      b = [];
      for (i in o)
        b.push(i + ':' + vhm_jenc(o[i]));
      return '{' + b.join(',') + '}';
    default:
      return 'null';
  }
};

(function(t) {

  var ws = vhm_widget_settings,
      args = document.location.search.substring(1).replace(/\+/g, ' ').split('&'),
      dec = decodeURIComponent,
      i,p,n,v;

  ws.domain = 'vhmengine.com';
  ws.baseUrl = 'http://vhmengine.com/';
  ws.secureUrl = 'https://vhmengine.com/';
  ws.mediaUrl = 'http://media.vhmengine.com/';
  ws.gigyaAPIKey = '2_KKaHN0mFm5QNmv2jIFH7Rnw7xtQJbTC1sLrJ6uJAxSuLbx0hm0zN5e1i3uYpbEeB';
  ws.referrer = 'null';

  ws.admin = false;
  if (ws.height < 250)
    ws.height = 250;

  // Pass vhm_ parameters to widgetSettings
  for (i = 0; i < args.length; i++) {
    p = args[i].split('=');
    n = dec(p[0]);
    if (n.indexOf('vhm_') == 0) {
      n = n.substring(4);
      v = (p.length==2) ? dec(p[1]) : n;
      ws[n] = v;
    }
  }

  ws.pollMode = ws.pollMode || (ws.width < 350);

  document.write(
      '<ifr'+'ame id="vhm_qaframe0" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" ' +
      'width="' + ws.width + '"  scrolling="no"  height="' + ws.height +
      '" src="http://cdn.vhmengine.com/widgets/v1.10.7.2.3/widgets/qa_skel.html?s=' + encodeURIComponent(vhm_jenc(ws)) + '" ></ifr'+'ame>');
})(this);
