/* Copyright (c) Pluck Corporation 2008. This software code and related intellectual property are the 
property of Pluck Corporation and are licensed for use solely on designated websites. Any distribution, 
copying, or other use of this intellectual property other than pursuant to a written agreement 
with Pluck Corporation is strictly prohibited. All Rights Reserved.
*/
(function(){
  if (typeof dmpod === 'undefined') {
    dmpod = {};
    dmpod.extendObject = function(obj, source) {
      for (var _var in source) {
        obj[_var] = source[_var];
      }
    }
    dmpod.extend = function(source) { dmpod.extendObject(dmpod, source); };
  };
  
  if (typeof dmpod.serviceFramework === 'undefined') {
    dmpod.serviceFramework = 1;
    dmpod.createPODRequestService = function(apiKey) {
      return new PluckItService(apiKey);
    }
    dmpod.createRequestService = function(apiKey) {
      return dmpod.createPODRequestService(apiKey); // default
    }
    dmpod.RequestServiceInstances = {};
    // This is the PluckItService. Instantiate this to talk to the PluckItService.
    // the apiKey is your customer key
    var PluckItService = function(){
      // query param PLUCK_DEBUG or page level _DEBUG
      //  0 = none, 1 = console level, 2 = alerts for IE
      var debugging = 0;
      var match = location.search.match(new RegExp('[\?&]PLUCK_DEBUG=([^&]+)'));
      if (match) {
        debugging = match[1];
      } else if (typeof(_DEBUG) !== 'undefined') {
        debugging = _DEBUG;
      }
      if (debugging != false && debugging != 'false') {
        if (debugging == true || debugging == 'true') {
          debugging = 1;
        }
      } else {
        debugging = 0;
      }
      this.debugging = {
        level: debugging,
        on: debugging > 0,
        alerts: debugging > 1,
        firebug: false
      };
      if (this.debugging.on) {
        if (typeof(window.console) !== 'undefined' && typeof(window.console.firebug) !== 'undefined') {
          try {
            if (parseFloat(window.console.firebug) >= 1.05 && document.location.toString().toLowerCase().indexOf('firebug=false') < 0) {
              this.debugging.firebug = true;
            }
          } catch (e) {
          }
        }
      }
      this.isDOMComplete = false;
      this.init.apply(this, arguments);
    }
    PluckItService.prototype = (function(){
      // utility functions and classes
      function $(id){
        if (document.getElementById) {
          return document.getElementById(id);
        }
        if (document.all) {
          return document.all[id];
        }
      }
      var isIE = (navigator.userAgent.indexOf('MSIE')!= -1 && navigator.userAgent.indexOf('Opera') == -1);
      var flashVersion = (function() {
          var versionNumber = 0;
          try {
            // do ie compatible check
            if (isIE) {
              try {
                activeXObject = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
                versionVariable = activeXObject.GetVariable('$version');
                versionNumber = versionVariable.match(/win[^\d]+?(\d+)[^\d].*/i)[1];
              } catch(e) {
              }
            }
            // Check browsers that use navigator. They will look something like this: "Shockwave Flash 10.0 r12"
            // Look for flash plugins that have at least a version of 9 or greater
            for (var i=0; i<navigator.plugins.length; i++) {
              var match = navigator.plugins[i].description.match(/shockwave flash.*?(\d+)[^\d].*/i);
              if (match != null && match.length == 2) {
                var version = parseInt(match[1]);
                if (version > versionNumber) {
                  versionNumber = version;
                }
              }
            }
          } catch(e) {
          }
          return versionNumber;
        })();
      var transport = "flash";
      if (typeof(PLUCKIT_TRANSPORT) !== 'undefined') {
        transport = PLUCKIT_TRANSPORT.toLowerCase();
      }
      var lowerurl = document.location.toString().toLowerCase();
      var m = lowerurl.match(/pluckit_transport=([a-z]+)/);
      if (m && m.length > 0) {
        transport = m[1];
      }
      var jsonpmax = 4000;
      if (typeof(PLUCKIT_JSONPMAX) !== 'undefined') {
        jsonpmax = PLUCKIT_JSONPMAX;
      }
      m = lowerurl.match(/pluckit_jsonpmax=([0-9]+)/);
      if (m && m.length > 0) {
        jsonpmax = m[1];
      }
      var flashNeeded = false;
      if (transport == "flashonly") {
        flashNeeded = flashVersion < 9;
      }
      return {
        constructor: PluckItService,
        FLASHONLY: "flashonly",
        JSONPONLY: "jsonponly",
        FLASH: "flash",
        JSONP: "jsonp",
        flashReady: false,
        jsonpReady: false,
        transport: transport,
        jsonpmax: jsonpmax,
        isIE: isIE,
        flashVersion: flashVersion, 
        flashNeeded: flashNeeded,
        getHost: function() { 
          var where = document.location.toString();
          if (where.match(/https/i)) {
            return 'https://pluckit.demandmedia.com/';
          } else {
            return 'http://pluckit.demandmedia.com/';
          }
        },
        getAssetsHost: function() { 
           var where = document.location.toString();
           if (where.match(/https/i)) {
             return 'https://pluckit.demandmedia.com/';
           } else {
             return 'http://cdn-docs.pluckit.pluck.com/';
           }
        },
        getServerUrl: function(apiKey, authToken) { var url = this.getHost()+'requests?apiKey=' + apiKey; if (typeof(authToken) !== 'undefined' && authToken != null) { url += '&at=' + escape(authToken); } return url; },
        getFlashTunnelUrl: function(apiKey) { return this.getHost()+'assets/v1/PluckFlashDAPIService.swf?apiKey=' + apiKey; },
        getFlashExpressInstallUrl: function(apiKey) { return this.getHost()+'assets/v1/expressinstall.swf?apiKey=' + apiKey; },
        getFlashFileUploaderUrl: function(apiKey) { return this.getHost()+'assets/v1/PluckItUploader.swf?apiKey=' + apiKey; },
        getFlashClipboardCopierUrl: function(apiKey) { return this.getHost()+'assets/v1/PluckItClipboard.swf?apiKey=' + apiKey; },
        // from sitelife version
        JSON: (function(isIE) {
          var json = function(){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},s={'boolean':function(x){return String(x);},number:function(x){return isFinite(x)?String(x):'null';},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}c=b.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);});}return'"'+x+'"';},object:function(x){if(x){var a=[],b,f,i,l,v;if(x instanceof Array){a[0]='[';l=x.length;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}a[a.length]=v;b=true;}}}a[a.length]=']';}else if(x instanceof Object){a[0]='{';for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}a.push(s.string(i));a.push(':');a.push(v);b=true;}}}a[a.length]='}';}else{return;}return a.join('');}return'null';}};return{copyright:'(c)2005 JSON.org',license:'http://www.crockford.com/JSON/license.html',stringify:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){return v;}}return null;},eval:function(text){try{return!(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g,'')))&&eval('('+text+')');}catch(e){return false;}},parse:function(text){var at=0;var ch=' ';function error(m){throw{name:'JSONError',message:m,at:at-1,text:text};}function next(){ch=text.charAt(at);at+=1;return ch;}function white(){while(ch){if(ch<=' '){next();}else if(ch=='/'){switch(next()){case'/':while(next()&&ch!='\n'&&ch!='\r'){}break;case'*':next();for(;;){if(ch){if(ch=='*'){if(next()=='/'){next();break;}}else{next();}}else{error("Unterminated comment");}}break;default:error("Syntax error");}}else{break;}}}function string(){var i,s='',t,u;if(ch=='"'){outer:while(next()){if(ch=='"'){next();return s;}else if(ch=='\\'){switch(next()){case'b':s+='\b';break;case'f':s+='\f';break;case'n':s+='\n';break;case'r':s+='\r';break;case't':s+='\t';break;case'u':u=0;for(i=0;i<4;i+=1){t=parseInt(next(),16);if(!isFinite(t)){break outer;}u=u*16+t;}s+=String.fromCharCode(u);break;default:s+=ch;}}else{s+=ch;}}}error("Bad string");}function array(){var a=[];if(ch=='['){next();white();if(ch==']'){next();return a;}while(ch){a.push(value());white();if(ch==']'){next();return a;}else if(ch!=','){break;}next();white();}}error("Bad array");}function object(){var k,o={};if(ch=='{'){next();white();if(ch=='}'){next();return o;}while(ch){k=string();white();if(ch!=':'){break;}next();o[k]=value();white();if(ch=='}'){next();return o;}else if(ch!=','){break;}next();white();}}error("Bad object");}function number(){var n='',v;if(ch=='-'){n='-';next();}while(ch>='0'&&ch<='9'){n+=ch;next();}if(ch=='.'){n+='.';while(next()&&ch>='0'&&ch<='9'){n+=ch;}}if(ch=='e'||ch=='E'){n+='e';next();if(ch=='-'||ch=='+'){n+=ch;next();}while(ch>='0'&&ch<='9'){n+=ch;next();}}v=+n;if(!isFinite(v)){}else{return v;}}function word(){switch(ch){case't':if(next()=='r'&&next()=='u'&&next()=='e'){next();return true;}break;case'f':if(next()=='a'&&next()=='l'&&next()=='s'&&next()=='e'){next();return false;}break;case'n':if(next()=='u'&&next()=='l'&&next()=='l'){next();return null;}break;}error("Syntax error");}function value(){white();switch(ch){case'{':return object();case'[':return array();case'"':return string();case'-':return number();default:return ch>='0'&&ch<='9'?number():word();}}return value();}};}();
          if (isIE) {
            json.parse = function(jsonstring) { return eval('('+jsonstring+')'); };
          }
          return json;
        })(isIE),
        init: function(apiKey){
          this.apiKey = apiKey;
          this.requestQueue = [];
          this.instanceID = 'pluckit_' + this.uniqueID()
          this.jsonpCounter = Math.floor(Math.random()*0x7fffffff);
          this.callbackContexts = {};
          var my = this;
          this.initProxy = (function(my){
            return function(){
              my.isDOMComplete = true;
              // create a placeholder for the flash tunnel on the page
              var flashObject = document.body.appendChild(document.createElement('div'));
              flashObject.id = 'flashProxy_' + my.instanceID + '_DIV';
              // I know this seems odd, but we needed the div even if jsonp only so that the widget
              // spacing is the same whether the trasport is flash or jsonp
              if (my.transport == my.JSONPONLY) {
                flashObject.innerHTML = "&nbsp;";
                return;
              }
              // load the flash tunnel
              var swfUrl = my.getFlashTunnelUrl(my.apiKey);
              var swfId = 'flashProxy_' + my.instanceID;
              var swfWidth = '0';
              var swfHeight = '0';
              var swfVersion = '9.0.0';
              var params = {
                autostart: 'true',
                width: swfWidth,
                height: swfHeight,
                allowfullscreen: 'false',
                allowscriptaccess: 'always'
              };
              var attributes = {};
              // register us as an instance so we are ready when flash tries to call us back
              window[my.instanceID+'flashready'] = function() { my.flashReadyCallback(); };
              window[my.instanceID+'flashstatus'] = function(status) { my.flashReadyCallback(status); };
              var podRevisionNumber = "7310";
              var fvars = 'onLoadCallbackName='+my.instanceID+'flashready&onStatusCallbackName='+my.instanceID+'flashstatus&podRevisionNumber='+podRevisionNumber;
              my.loadFlashCount = 0;
              my.loadFlash = function() {
                if (my.loadFlashCount <= 1) { // allow one addition load
                  my.loadFlashCount++;
                  my.flashReady = false;
                  my.safeEmbedSWF(flashObject, swfId, swfUrl, swfWidth, swfHeight, fvars, swfVersion, my.getFlashExpressInstallUrl(my.apiKey));
                }
              }
              my.loadFlash();
            };
          })(my);
          this.serverUrl = my.getServerUrl(my.apiKey,my.getUserAuthToken());
          dmpod.RequestServiceInstances[this.instanceID] = this;
          if (this.transport != my.FLASHONLY) {
              this.jsonpReady = true;
              this.processQueue();
          }
          if (document.body && ((typeof document.readyState == 'undefined') || /loaded|complete/.test(document.readyState))) { // setup the proxy
            this.initProxy();
          } else {
            this.addLoadEvent(this.initProxy);
          }
        },
        debug: function(data) {
          if (this.debugging.on) {
            if (window.opera) {
              opera.postError(data);
            } else if (window.console) {
              console.log(data);
            } else if (this.debugging.alerts) {
              alert(data);
            }
          }
        },
        getSafeEmbedSWFHTML: function(swfId, swfUrl, width, height, flashvars, version, expressInstallUrl) {
          var ie=(navigator.userAgent.indexOf('MSIE')!= -1 && navigator.userAgent.indexOf('Opera') == -1);
          if (ie) {
            return '<OBJECT id='+swfId+' height='+height+' width='+width+' classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000> \
              <PARAM NAME="FlashVars" VALUE="'+flashvars+'">\
              <PARAM NAME="Movie" VALUE="'+swfUrl+'&'+flashvars+'">\
              <PARAM NAME="Src" VALUE="'+swfUrl+'&'+flashvars+'">\
              <PARAM NAME="AllowScriptAccess" VALUE="always">\
              <PARAM NAME="AllowNetworking" VALUE="all">\
              <PARAM NAME="AllowFullScreen" VALUE="false">\
              <PARAM NAME="wmode" VALUE="window">\
              <PARAM NAME="Width" VALUE="'+width+'">\
              <PARAM NAME="Height" VALUE="'+height+'">\
              </OBJECT>';
          } else {
            return '<object id="'+swfId+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" data="'+swfUrl+'" style="visibility: visible;">\
              <param name="autostart" value="true"/>\
              <param name="width" value="'+width+'"/>\
              <param name="height" value="'+height+'"/>\
              <param name="allowfullscreen" value="false"/>\
              <param name="allowscriptaccess" value="always"/>\
              <param name="wmode" value="window"/>\
              <param name="flashvars" value="'+flashvars+'"/>\
              </object>';              
          }
        },
        // this function is here because using swfobject caused a crash in IE on successive refreshes and ctrl-refreshes during page unload - this doesn't
        safeEmbedSWF: function(hostObj, swfId, swfUrl, width, height, flashvars, version, expressInstallUrl) {
          hostObj.innerHTML = this.getSafeEmbedSWFHTML(swfId, swfUrl, width, height, flashvars, version, expressInstallUrl);
        },
        processQueue: function(){
          if (this.requestQueue.length > 0) {
            var func = this.requestQueue.pop();
            if (!func()) {
              this.requestQueue.push(func);
              var self = this;
              setTimeout(function() { self.processQueue(); }, 1000);
            }
          }
        },
        registerCallbackContext: function(context){
          // store the callback in the dictionary, the flash layer can only pass names
          var asyncToken = 'request_' + this.uniqueID();
          this.callbackContexts[asyncToken] = context;
          return asyncToken;
        },
        uniqueID: function() {
          var seed = (new Date()).getTime();
          return Math.floor(Math.random() * seed);// + '_' + Math.floor(Math.random() * seed);
        },
        DownloadUrl: function(serverUrl, queryString, callback){
          var me = this;
          // this is a queue that holds requests for the brief period of time required for flash to initialize
          this.requestQueue.push(function(){
            return me.doDownload(serverUrl, queryString, callback);
          });
          this.debug('[DownloadUrl/id:' + this.instanceID + '] queuing request -- total: ' + this.requestQueue.length);
          this.processQueue();
        },
        doDownload: function(serverUrl, queryString, callback){
          if (this.flashReady) {
            // register callback
            var asyncToken = this.registerCallbackContext({ callback: callback });
            if (queryString) {
              queryString = escape(queryString);
            }
            this.flashProxy.DownloadUrl(serverUrl, queryString, 'dmpod.RequestServiceInstances[\'' + this.instanceID + '\'].flashRequestCallback', asyncToken);
            return true;
          }
          return false;
        },
        PostForm: function(serverUrl, queryString, callback){
          var me = this;
          // this is a queue that holds requests for the brief period of time required for flash to initialize
          this.requestQueue.push(function(){
            return me.doPost(serverUrl, queryString, callback);
          });
          this.debug('[PostForm/id:' + this.instanceID + '] queuing request -- total: ' + this.requestQueue.length);
          this.processQueue();
        },
        doPost: function(serverUrl, queryString, callback){
          if (this.flashReady) {
            // register callback
            var asyncToken = this.registerCallbackContext({ callback: callback });
            if (queryString) {
              queryString = escape(queryString);
            }
            this.flashProxy.PostForm(serverUrl, queryString, 'dmpod.RequestServiceInstances[\'' + this.instanceID + '\'].flashRequestCallback', asyncToken,document.location.toString());
            return true;
          }
          return false;
        },
        SendRequests: function(requests, callback){
          if (requests) {
            if (requests.constructor != Array) { // handle single requests gracefully
              requests = [requests];
            }
            if (requests.length > 0) {
              var me = this;
              var context = {
                isBatchResponse: 1,
                callback: callback,
                requests: []
              };
              var map = [];
              var envelopes = [];
              for (var i = 0, request; request = requests[i]; i++) {
                var requestedBy = request.requestedBy;
                // don't send to server - remove from request so more will be non-unique and dedupable
                delete request.requestedBy;
                var payloadType = request.objectType;
                var payload = this.JSON.stringify(request);
                for (var j=0; j<envelopes.length; j++) {
                  if (envelopes[j].payloadType == payloadType && envelopes[j].payload == payload) {
                    break;
                  }
                }
                if (j<envelopes.length) {
                  // a dupe
                  map.push({pos: j, requestedBy: requestedBy});
                } else {
                  // not a dupe
                  map.push({pos: envelopes.length, requestedBy: requestedBy});
                  var envelope = new dmpod.RequestEnvelope();
                  envelope.payloadType = payloadType;
                  envelope.payload = payload;
                  envelopes.push(envelope);
                  context.requests.push(request);
                }
                // replace requested by
                request.requestedBy = requestedBy;
              }
              context.batchRequest = {
                  Envelopes: envelopes,
                  // If we have debugging, and if this is firebug, get diagnostics.
                  returnDiagnostics: (this.debugging.firebug),
                  executeMethod: requests.hasOwnProperty("executeMethod") ? requests.executeMethod : 'ExecuteAll',
                  callerSDK: "js:7310"
              }
              context.responseMap = map;
              context.asyncToken = this.registerCallbackContext(context);
              // this is a queue that holds requests for the brief period of time required for flash to initialize
              this.requestQueue.push(function() { return me.transmitRequests(context.asyncToken); });
              this.processQueue();
              return;
            }
          }
          this.debug("asked to send 0 requests");
        },
        transmitRequests: function(asyncToken){
          var context = this.callbackContexts[asyncToken];
          var method = null;
          var flash = this.flashReady ? (typeof(this.flashProxy.CallDAPI) !== 'undefined') : false;
          var jsonp = this.jsonpReady;
          if (this.transport == this.JSONPONLY) {
            method = jsonp ? this.JSONP : null;
          } else if (this.transport == this.FLASHONLY) {
            method = flash ? this.FLASH : null;
          } else if (this.transport == this.FLASH) {
            if (flash) {
              method = this.FLASH;
            } else if (jsonp) {
              method = this.JSONP;
            }
          } else if (jsonp) {
            method = this.JSONP;
          } else if (flash) {
            method = flash;
          }
          if (method == null) {
            return false;
          }
          context.method = method;
          if (this.debugging.firebug) {
            console.group('CLIENT Request [%s] %s ==>',context.asyncToken.replace(/request_/,''), method);
            for (var i=0;i<context.requests.length;i++) { 
              console.group(context.requests[i].objectType); 
              console.dir(context.requests[i]);
              console.group('from widgets:');
              for (var j=0; j<context.responseMap.length; j++) {
                if (context.responseMap[j].pos == i) {
                  console.log(context.responseMap[j].requestedBy);
                }
              }
              console.groupEnd(); 
              console.groupEnd(); 
            }
            console.groupEnd();
            console.time(context.asyncToken);
          }
          if (method == this.FLASH) {
            var jsonRequest = this.JSON.stringify(context.batchRequest);
            // Post the requests to the server via the flash proxy. We pass in the asyncToken
            // because flash can't handle the actual callback functions. The proxy returns they asyncToken
            // back to us on the callback, which we can use to locate and execute the callback function
            // do a last minute check in case flash has become disabled for some reason
            // return true if called, false if not
            this.flashProxy.CallDAPI(this.serverUrl, jsonRequest, 'dmpod.RequestServiceInstances[\'' + this.instanceID + '\'].flashRequestCallback', context.asyncToken,document.location.toString());
          } else {
            this.sendJsonpRequest(context);
          }
          return true;
        },
        sendJsonpRequest: function(context) {
          var envelopes = context.batchRequest.Envelopes;
          var split = 1;
          var pos = envelopes.length / split;
          var set = envelopes;
          // the maximum request url length: 1500 for IE versions, jsonpmax for all else
          var maxurl = this.isIE ? 1500 : this.jsonpmax;
          do {
            context.batchRequest.Envelopes = set;
            context.jsonRequest = this.JSON.stringify(context.batchRequest);
            if (set.length > 1) {
              if (escape(context.jsonRequest).length > maxurl && pos > 0) {
                split++;
                pos = envelopes.length / split;
                set = envelopes.slice(0, pos);
                context.moreEnvelopes = envelopes.slice(pos);
              } else {
                break;
              }
            } else {
              break;
            }
          } while (true);
          var elem = document.getElementsByTagName('head')[0];
          var scriptNode = document.createElement('script');
          scriptNode.type = "text/javascript";
          scriptNode.src = this.serverUrl+'&jsonpCallback=dmpod.RequestServiceInstances[\'' + this.instanceID + '\'].jsonpCallback&jsonpContext='+context.asyncToken+'&jsonRequest='+escape(context.jsonRequest);
          elem.appendChild(scriptNode);
        },
        flashReadyCallback: function(){
          var proxy = $('flashProxy_' + this.instanceID);
          if (proxy != null && typeof(proxy.CallDAPI) !== 'undefined') {
            this.debug('flash is ready');
            this.flashProxy = proxy;
            this.flashReady = true;
            this.processQueue();
          } else {
            this.debug('Flash ready failed!');
          }
        },
        flashStatusCallback: function(status){
          this.debug('flash proxy status: '+status);
        },
        flashRequestCallback: function(successful, response, asyncToken){
          this.processRequestResponse(this.FLASH, successful, response, asyncToken);
        },
        extractBatchResponse: function(transport, context, response){
          if (typeof(response) == 'string') {
            if (response.indexOf("Envelopes") >= 0 || response.indexOf("envelopes") >= 0) {
              response = this.JSON.parse(response);
            } else {
              return response;
            }
          } else if (!response.hasOwnProperty("Envelopes")) {
            return response;
          }
          var responses = [];
          for (var i=0; i<response.Envelopes.length; i++) {
            var envelope = this.JSON.parse(response.Envelopes[i].payload);
            if (envelope.hasOwnProperty('debugServerInfo') && envelope.debugServerInfo != null) {
              try {
                envelope.debugServerInfo = this.JSON.parse(envelope.debugServerInfo);
              }
              catch(e){}
            }
            response.Envelopes[i] = envelope;
          }
          // handle the dedupe map
          if (this.debugging.firebug) {
            console.group('SERVER Response [%s] ==>', context.asyncToken.replace(/request_/,''));
            if (response.hasOwnProperty('diagnostics') && response.diagnostics != null) {
              console.group('Diagnostics');
              console.dir(response.diagnostics);
              console.groupEnd();
            }
            for (var i=0;i<response.Envelopes.length;i++) { 
              console.group(response.Envelopes[i].objectType);
              console.dir(response.Envelopes[i]);
              console.group('to widgets:');
              for (var j=0; j<context.responseMap.length; j++) {
                if (context.responseMap[j].pos == i) {
                  console.log(context.responseMap[j].requestedBy);
                }
              }
              console.groupEnd();
              console.groupEnd();
            }
          }
          var map = context.responseMap;
          for (var i=0; i<map.length; i++) {
		    if (map[i].pos >= response.Envelopes.length) {
			  break;
			} else {
			  var r = response.Envelopes[map[i].pos];
			  r.requestedBy = map[i].requestedBy;
			  responses.push(r);
			}
          }
          if (this.debugging.firebug) {
            console.groupEnd();
          }
          return { 
            Responses: responses,
            ContentTrackingJavaScript: response.ContentTrackingJavaScript,
            ContentTrackingSrc: response.ContentTrackingSrc
          }
        },
        jsonpCallback: function(response, asyncToken){
          var context = this.callbackContexts[asyncToken];
          // clean dom storage
          delete context.elem;
          delete context.scriptNode;
          if (context.hasOwnProperty("response")) {
            context.response.isError = context.response.isError || response.isError;
            context.response.Envelopes = context.response.Envelopes.concat(response.Envelopes);
          } else {
            context.response = response;
          }
          if (context.hasOwnProperty("moreEnvelopes")) {
            context.batchRequest.Envelopes = context.moreEnvelopes;
            delete context.moreEnvelopes;
            this.sendJsonpRequest(context);
          } else {
            this.processRequestResponse(this.JSONP, true, context.response, asyncToken);
          }
        },
        processRequestResponse: function(transport, successful, response, asyncToken){
          if (this.debugging.firebug) { console.timeEnd(asyncToken); }
          try {
            if (!successful) {
              this.onError('Communication error: '+response);
              // if responses is an array return the array
              // otherwise we thrown an exception? not async cool?
              // should we pass a map of "success" and "error" handlers?
              return;
            }
            var context = this.callbackContexts[asyncToken];
            if (typeof(response) == 'string') {
              response = unescape(response);
            }
            if (context.hasOwnProperty("isBatchResponse")) {
              response = this.extractBatchResponse(transport, context, response);
            } else {
              this.debug(transport+': RECEIVED DATA FROM SERVER - ', asyncToken);
            }
            context.callback(response);
            delete this.callbackContexts[asyncToken];
          } catch (e) {
            this.onError(e);
            this.debug('exception: ',e.toString());
          }
        },
        addLoadEvent: function(func){
          if (window.addEventListener) 
            window.addEventListener('load', func, false);
          else 
            if (window.attachEvent) 
              window.attachEvent('onload', func);
            else { /* epic fail */
            }
        },
        getClipboardCopierHTML: function(flashId, getClipboardTextCallback, width, height, buttonUrl) {
          var swfUrl = this.getFlashClipboardCopierUrl(this.apiKey);
          // return the flash embed html
          var flashvars = "getClipboardTextCallback="+getClipboardTextCallback+"&buttonUrl="+encodeURIComponent(buttonUrl);
          return this.getSafeEmbedSWFHTML(flashId, swfUrl, width, height, flashvars, '9.0.0', this.getFlashExpressInstallUrl(this.apiKey));
        },
        getFileUploaderHTML: function(flashId, onLoadCallbackName, width, height, buttonUrl) {
          var swfUrl = this.getFlashFileUploaderUrl(this.apiKey);
          // return the flash embed html
          var flashvars = "onLoadCallbackName="+onLoadCallbackName+"&buttonUrl="+encodeURIComponent(buttonUrl);
          return this.getSafeEmbedSWFHTML(flashId, swfUrl, width, height, flashvars, '9.0.0', this.getFlashExpressInstallUrl(this.apiKey));
        },
        uploadFile: function(flashId, serverUrl, mediaTypesPrompt, mediaTypesFilter, callerThis, responseCallback, progressCallback) {
          var response = 'callback'+this.uniqueID();
          var progress = 'callback'+this.uniqueID();
          window[response] = function(success, data) {
            responseCallback.apply(callerThis,arguments);
          };
          window[progress] = function(percent) {
            progressCallback.apply(callerThis,arguments);
          };
          document.getElementById(flashId).PerformUpload(serverUrl,mediaTypesPrompt,mediaTypesFilter,response,progress);
        },
        // others need access to JSON - so these helpers are included
        JsonStringify: function(what){
          return this.JSON.stringify(what);
        },
        JsonParse: function(what){
          return this.JSON.parse(what);
        },
        getClientCookieName: function(){
          // set the client side cookie name for authentication/holding of the pluck at auth token
          if (typeof PLUCKIT_CLIENTCOOKIENAME != 'undefined') {
            return PLUCKIT_CLIENTCOOKIENAME;
          } else {
            return 'piat';
          }
        },
        isUserLoggedIn: function(){
          return typeof(this.getUserAuthToken()) !== 'undefined';
        },
        getUserAuthToken: function(){
          var cookies = document.cookie;
          if (cookies) {
            cookies = ";" + cookies + ";";
            var matches = cookies.match(new RegExp(';\\s*' + this.getClientCookieName() + '=(.+?);'));
            if (matches && matches.length > 1) {
              return matches[1];
            }
          }
        },
        setUserAuthToken: function(token){
          if (token) {
            document.cookie = this.getClientCookieName() + '=' + escape(token) + '; path=/;';
          } else {
            var d = new Date();
            d.setTime(d.getTime() - 86400000 /* 1 earth day */);
            document.cookie = this.getClientCookieName() + '=; expires=' + d.toGMTString() + '; path=/;';
          }
          this.serverUrl = this.getServerUrl(this.apiKey,escape(token));
        },
        getCookieValue: function(cookieName){
          var cookies = document.cookie;
          if (cookies) {
            cookies = ";" + cookies + ";";
            var matches = cookies.match(new RegExp(';\\s*' + cookieName + '=(.+?);'));
            if (matches && matches.length > 1) {
              return matches[1];
            }
          }
        },
        setCookieValue: function(cookieName, cookieValue, expiresDay){
            var d = new Date();
            d.setTime(d.getTime() + (expiresDay * 86400000));        
            document.cookie = cookieName + '=' + cookieValue + '; expires=' + d.toGMTString();
        },        
        changeApiKey: function(apiKey){
          this.apiKey = apiKey;
          this.serverUrl = this.getServerUrl(this.apiKey,this.getUserAuthToken());
        },
        // override me
        onError: function(e){
          this.debug('Error: ' + e);
          if (this.debugging.firebug) {
            console.trace();
          }
        }
      };
    })();
  }
})();

// THIS FILE IS AUTO GENERATED, See the website for the documentation
(function() {
  /* Demand Media Javascript Library Request Objects */
  dmpod.extend({
    UpdateContentSourceRequest: function(contentSource) {
      this.contentSource = contentSource;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateContentSourceRequest';
    },
    UpdateCustomerUserContentModeRequest: function(userContentMode) {
      this.userContentMode = userContentMode;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateCustomerUserContentModeRequest';
    },
    UpdateCustomerSDKAccessRequest: function(sdkAccessAllowed) {
      this.sdkAccessAllowed = sdkAccessAllowed;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateCustomerSDKAccessRequest';
    },
    UpdateCustomerSocialMediaAccessRequest: function(socialMediaEnabled) {
      this.socialMediaEnabled = socialMediaEnabled;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateCustomerSocialMediaAccessRequest';
    },
    UpdateCustomerSupportInfoRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateCustomerSupportInfoRequest';
    },
    UpdateCustomerNetworkRequest: function(publisherNetwork) {
      this.publisherNetwork = publisherNetwork;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateCustomerNetworkRequest';
    },
    GetAllContentSourcesRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GetAllContentSourcesRequest';
    },
    MakeUserPluckAdminRequest: function(password, userKey) {
      this.password = password;
      this.userKey = userKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.MakeUserPluckAdminRequest';
    },
    GetCaptchaInfoRequest: function(width, height) {
      this.width = width;
      this.height = height;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GetCaptchaInfoRequest';
    },
    UpdateAllowedContentSourcesForWriteRequest: function(userKey, contentSourceKeys) {
      this.userKey = userKey;
      this.contentSourceKeys = contentSourceKeys;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateAllowedContentSourcesForWriteRequest';
    },
    UpdateAllowedContentSourcesForReadRequest: function(contentSourceKeys) {
      this.contentSourceKeys = contentSourceKeys;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UpdateAllowedContentSourcesForReadRequest';
    },
    GenerateNewCustomerKeyRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GenerateNewCustomerKeyRequest';
    },
    GetKeyForUserRequest: function(userEmail) {
      this.userEmail = userEmail;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GetKeyForUserRequest';
    },
    GetLoginTokenRequest: function(userEmail, password) {
      this.userEmail = userEmail;
      this.password = password;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GetLoginTokenRequest';
    },
    VerifyUsersPublisherNetworkRequest: function(network) {
      this.network = network;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.VerifyUsersPublisherNetworkRequest';
    },
    UnlockUserRequest: function(userEmail, newPassword) {
      this.userEmail = userEmail;
      this.newPassword = newPassword;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.UnlockUserRequest';
    },
    GetApiKeysRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GetApiKeysRequest';
    },
    GetAssociatedCustomersRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GetAssociatedCustomersRequest';
    },
    RegisterUserRequest: function(displayName, userEmail, password) {
      this.displayName = displayName;
      this.userEmail = userEmail;
      this.password = password;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.RegisterUserRequest';
    },
    MakeUserCustomerAdminRequest: function(userKey, apiKey) {
      this.userKey = userKey;
      this.apiKey = apiKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.MakeUserCustomerAdminRequest';
    },
    ResetPasswordRequest: function(userEmail) {
      this.userEmail = userEmail;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.ResetPasswordRequest';
    },
    ChangePasswordRequest: function(userKey, oldPassword, newPassword) {
      this.userKey = userKey;
      this.oldPassword = oldPassword;
      this.newPassword = newPassword;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.ChangePasswordRequest';
    },
    GetEnabledDomainsForCustomerRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.GetEnabledDomainsForCustomerRequest';
    },
    EnableDomainForCustomerRequest: function(domain) {
      this.domain = domain;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.EnableDomainForCustomerRequest';
    },
    DisableDomainForCustomerRequest: function(domain) {
      this.domain = domain;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.DisableDomainForCustomerRequest';
    },
    AddDomainToExceptionListRequest: function(exceptionList, domain, reason) {
      this.exceptionList = exceptionList;
      this.domain = domain;
      this.reason = reason;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.AddDomainToExceptionListRequest';
    },
    RemoveDomainFromExceptionListRequest: function(exceptionList, domain) {
      this.exceptionList = exceptionList;
      this.domain = domain;
      this.callerSDK = 'js:7310';
      this.objectType = 'Admin.RemoveDomainFromExceptionListRequest';
    },
    CreateBundleTemplateListRequest: function(name) {
      this.name = name;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.CreateBundleTemplateListRequest';
    },
    GetBundleTemplateListRequest: function(bundleTemplateListKey) {
      this.bundleTemplateListKey = bundleTemplateListKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.GetBundleTemplateListRequest';
    },
    MoveBundleTemplateListRequest: function(bundleTemplateListKey, parentKey) {
      this.bundleTemplateListKey = bundleTemplateListKey;
      this.parentKey = parentKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.MoveBundleTemplateListRequest';
    },
    UpdateBundleTemplateAliasRequest: function(aliasKey, bundleTemplateKey) {
      this.aliasKey = aliasKey;
      this.bundleTemplateKey = bundleTemplateKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.UpdateBundleTemplateAliasRequest';
    },
    DeleteBundleTemplateAliasRequest: function(aliasKey) {
      this.aliasKey = aliasKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.DeleteBundleTemplateAliasRequest';
    },
    GetBundleTemplateAliasesRequest: function(bundleTemplateKey) {
      this.bundleTemplateKey = bundleTemplateKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.GetBundleTemplateAliasesRequest';
    },
    UpdateBundleTemplateListRequest: function(bundleTemplateListKey, name) {
      this.bundleTemplateListKey = bundleTemplateListKey;
      this.name = name;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.UpdateBundleTemplateListRequest';
    },
    DeleteBundleTemplateListRequest: function(bundleTemplateListKey) {
      this.bundleTemplateListKey = bundleTemplateListKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.DeleteBundleTemplateListRequest';
    },
    MoveBundleTemplateRequest: function(bundleTemplateKey, parentKey) {
      this.bundleTemplateKey = bundleTemplateKey;
      this.parentKey = parentKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.MoveBundleTemplateRequest';
    },
    CreateBundleTemplateRequest: function(parentKey, name, criteria) {
      this.parentKey = parentKey;
      this.name = name;
      this.criteria = criteria;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.CreateBundleTemplateRequest';
    },
    UpdateBundleTemplateRequest: function(bundleTemplateKey, name, criteria) {
      this.bundleTemplateKey = bundleTemplateKey;
      this.name = name;
      this.criteria = criteria;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.UpdateBundleTemplateRequest';
    },
    UpdateCustomDataRequest: function(key, customData) {
      if (key.constructor != dmpod.BaseKey) {
        var typeName = (typeof key.objectType == 'string') && key.objectType.split('.')[1],
            key = new dmpod.BaseKey(key.key, typeName || null);
      }
      this.key = key;
      this.customData = customData;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.UpdateCustomDataRequest';
    },
    DeleteBundleTemplateRequest: function(bundleTemplateKey) {
      this.bundleTemplateKey = bundleTemplateKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.DeleteBundleTemplateRequest';
    },
    GetBundleTemplateRequest: function(bundleTemplateKey) {
      this.bundleTemplateKey = bundleTemplateKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.GetBundleTemplateRequest';
    },
    GetBundleTemplateByAliasRequest: function(aliasKey) {
      this.aliasKey = aliasKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.GetBundleTemplateByAliasRequest';
    },
    GetBundleRequest: function(bundleId) {
      this.bundleId = bundleId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.GetBundleRequest';
    },
    DeleteContentActionRequest: function(deleteThisContentKey) {
      if (deleteThisContentKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof deleteThisContentKey.objectType == 'string') && deleteThisContentKey.objectType.split('.')[1],
            deleteThisContentKey = new dmpod.BaseKey(deleteThisContentKey.key, typeName || null);
      }
      this.deleteThisContentKey = deleteThisContentKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Common.DeleteContentActionRequest';
    },
    HardDeleteContentActionRequest: function(deleteThisContentKey) {
      if (deleteThisContentKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof deleteThisContentKey.objectType == 'string') && deleteThisContentKey.objectType.split('.')[1],
            deleteThisContentKey = new dmpod.BaseKey(deleteThisContentKey.key, typeName || null);
      }
      this.deleteThisContentKey = deleteThisContentKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Common.HardDeleteContentActionRequest';
    },
    GetArticlesRelatedToUrlRequest: function(url) {
      this.url = url;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetArticlesRelatedToUrlRequest';
    },
    GetArticlesRelatedToArticleRequest: function(articleId) {
      this.articleId = articleId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetArticlesRelatedToArticleRequest';
    },
    GetArticlesRelatedToTagRequest: function(tag) {
      this.tag = tag;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetArticlesRelatedToTagRequest';
    },
    GetArticlesRelatedToTextRequest: function(text) {
      this.text = text;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetArticlesRelatedToTextRequest';
    },
    GetTagsForUrlRequest: function(url) {
      this.url = url;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetTagsForUrlRequest';
    },
    GetTagsForArticleRequest: function(articleId) {
      this.articleId = articleId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetTagsForArticleRequest';
    },
    GetTagsForTagRequest: function(tag) {
      this.tag = tag;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetTagsForTagRequest';
    },
    GetTagsForTextRequest: function(text) {
      this.text = text;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetTagsForTextRequest';
    },
    GetPublisherLinksRelatedToUrlRequest: function(linkSource, url) {
      this.linkSource = linkSource;
      this.url = url;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetPublisherLinksRelatedToUrlRequest';
    },
    GetPublisherLinksRelatedToArticleRequest: function(linkSource, articleId) {
      this.linkSource = linkSource;
      this.articleId = articleId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetPublisherLinksRelatedToArticleRequest';
    },
    GetPublisherLinksRelatedToTagRequest: function(linkSource, tag) {
      this.linkSource = linkSource;
      this.tag = tag;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetPublisherLinksRelatedToTagRequest';
    },
    GetPublisherLinksRelatedToTextRequest: function(linkSource, text) {
      this.linkSource = linkSource;
      this.text = text;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetPublisherLinksRelatedToTextRequest';
    },
    GetAdsForArticleRequest: function(articleId, adFormats) {
      this.articleId = articleId;
      this.adFormats = adFormats;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetAdsForArticleRequest';
    },
    GetAdsRequest: function(adFormats) {
      this.adFormats = adFormats;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetAdsRequest';
    },
    GetSponsoredLinksRequest: function(numberOfLinks) {
      this.numberOfLinks = numberOfLinks;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetSponsoredLinksRequest';
    },
    GetRelatedAdLinksRequest: function(pageUrl) {
      this.pageUrl = pageUrl;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetRelatedAdLinksRequest';
    },
    GetArticleRequest: function(articleId) {
      this.articleId = articleId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetArticleRequest';
    },
    GetArticleSummaryRequest: function(articleId) {
      this.articleId = articleId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetArticleSummaryRequest';
    },
    GetExternalUrlContentRequest: function(contentLabel, relativePath) {
      this.contentLabel = contentLabel;
      this.relativePath = relativePath;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetExternalUrlContentRequest';
    },
    GetContentCategoriesRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.GetContentCategoriesRequest';
    },
    SearchArticlesRequest: function(query) {
      this.query = query;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.SearchArticlesRequest';
    },
    SearchArticlesFilteredRequest: function(query) {
      this.query = query;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.SearchArticlesFilteredRequest';
    },
    BlockArticleRequest: function(articleKey) {
      this.articleKey = articleKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.BlockArticleRequest';
    },
    BlockPublisherLinkRequest: function(publisherLinkKey) {
      this.publisherLinkKey = publisherLinkKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.BlockPublisherLinkRequest';
    },
    FindArticlesByKeywordsRequest: function(keywords, criteria) {
      this.keywords = keywords;
      this.criteria = criteria;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.FindArticlesByKeywordsRequest';
    },
    FindArticlesSimilarToTextRequest: function(text, criteria) {
      this.text = text;
      this.criteria = criteria;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.FindArticlesSimilarToTextRequest';
    },
    FindArticlesSimilarToArticleRequest: function(articleKey, criteria) {
      this.articleKey = articleKey;
      this.criteria = criteria;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.FindArticlesSimilarToArticleRequest';
    },
    UpdateArticleRequest: function(publisherId, contentSourceKey, title, content, url, thumbnailUrl) {
      this.publisherId = publisherId;
      this.contentSourceKey = contentSourceKey;
      this.title = title;
      this.content = content;
      this.url = url;
      this.thumbnailUrl = thumbnailUrl;
      this.callerSDK = 'js:7310';
      this.objectType = 'ContentRegistry.UpdateArticleRequest';
    },
    GetArticleByPublisherIdRequest: function(sourceKey, publisherId) {
      this.sourceKey = sourceKey;
      this.publisherId = publisherId;
      this.callerSDK = 'js:7310';
      this.objectType = 'ContentRegistry.GetArticleByPublisherIdRequest';
    },
    RegisterUsersCustomerAccountRequest: function(apiKey, domain, customerType, publisherNetwork, inlineTextAdsAllowed, userContentMode, mpaaRating, captchaId, captchaText) {
      this.apiKey = apiKey;
      this.domain = domain;
      this.customerType = customerType;
      this.publisherNetwork = publisherNetwork;
      this.inlineTextAdsAllowed = inlineTextAdsAllowed;
      this.userContentMode = userContentMode;
      this.mpaaRating = mpaaRating;
      this.captchaId = captchaId;
      this.captchaText = captchaText;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.RegisterUsersCustomerAccountRequest';
    },
    GetCustomerRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.GetCustomerRequest';
    },
    GetCustomerByResellerIdRequest: function(publisherNetwork, publisherSubNetwork, resellerCustomerId) {
      this.publisherNetwork = publisherNetwork;
      this.publisherSubNetwork = publisherSubNetwork;
      this.resellerCustomerId = resellerCustomerId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.GetCustomerByResellerIdRequest';
    },
    UpdateCustomerRequest: function(domain) {
      this.domain = domain;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UpdateCustomerRequest';
    },
    UpdateCustomerAdDetailsRequest: function(inlineTextAdsAllowed, sponsoredLinksAllowed) {
      this.inlineTextAdsAllowed = inlineTextAdsAllowed;
      this.sponsoredLinksAllowed = sponsoredLinksAllowed;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UpdateCustomerAdDetailsRequest';
    },
    UpdateCustomerDeploymentDetailsRequest: function() { /* This function has been deprecated. */
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UpdateCustomerDeploymentDetailsRequest';
    },
    UpdateCustomerPlatformRequest: function(platform) {
      this.platform = platform;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UpdateCustomerPlatformRequest';
    },
    UpdateCustomerLandingPageUrlRequest: function(widgetLandingPageUrl, forDomain) {
      this.widgetLandingPageUrl = widgetLandingPageUrl;
      this.forDomain = forDomain;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UpdateCustomerLandingPageUrlRequest';
    },
    ClearCustomerLandingPageUrlRequest: function(forDomain) {
      this.forDomain = forDomain;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.ClearCustomerLandingPageUrlRequest';
    },
    UseGlobalDefaultLandingPageUrlRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UseGlobalDefaultLandingPageUrlRequest';
    },
    UseOverlayByDefaultRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UseOverlayByDefaultRequest';
    },
    GetCustomerLandingPageUrlsRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.GetCustomerLandingPageUrlsRequest';
    },
    UpdateAdNetworksRequest: function(activeAdNetworks, adNetworkDetails) {
      this.activeAdNetworks = activeAdNetworks;
      this.adNetworkDetails = adNetworkDetails;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UpdateAdNetworksRequest';
    },
    GetAdNetworksRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.GetAdNetworksRequest';
    },
    UpdatePaymentSystemsRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.UpdatePaymentSystemsRequest';
    },
    GetPaymentSystemsRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.GetPaymentSystemsRequest';
    },
    GetCustomerSearchRecordsRequest: function(numberPerPage, onPage, sort) {
      this.numberPerPage = numberPerPage;
      this.onPage = onPage;
      this.sort = sort;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.GetCustomerSearchRecordsRequest';
    },
    GetUserRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Users.GetUserRequest';
    },
    HasAuthorizedExternalSiteRequest: function(externalSite) {
      this.externalSite = externalSite;
      this.callerSDK = 'js:7310';
      this.objectType = 'Users.HasAuthorizedExternalSiteRequest';
    },
    UpdateUserRequest: function(displayName) {
      this.displayName = displayName;
      this.callerSDK = 'js:7310';
      this.objectType = 'Users.UpdateUserRequest';
    },
    BlockUserRequest: function(userKey) {
      this.userKey = userKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Users.BlockUserRequest';
    },
    CheckDomainAgainstExceptionListRequest: function(exceptionList, domain) {
      this.exceptionList = exceptionList;
      this.domain = domain;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.CheckDomainAgainstExceptionListRequest';
    },
    BlockRelatedAdLinksRequest: function(pageUrl) {
      this.pageUrl = pageUrl;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.BlockRelatedAdLinksRequest';
    },
    GetMediaItemRequest: function(mediaItemKey) {
      this.mediaItemKey = mediaItemKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.GetMediaItemRequest';
    },
    GetMediaGalleryRequest: function(mediaGalleryKey) {
      this.mediaGalleryKey = mediaGalleryKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.GetMediaGalleryRequest';
    },
    GetMediaItemPageRequest: function(mediaGalleryKey, submissionState, numberPerPage, onPage, sort) {
      this.mediaGalleryKey = mediaGalleryKey;
      this.submissionState = submissionState;
      this.numberPerPage = numberPerPage;
      this.onPage = onPage;
      this.sort = sort;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.GetMediaItemPageRequest';
    },
    UpdateMediaItemActionRequest: function(mediaItemKey, title, description, tags, attribution, attributionDate, attributionEmail) {
      this.mediaItemKey = mediaItemKey;
      this.title = title;
      this.description = description;
      this.tags = tags;
      this.attribution = attribution;
      this.attributionDate = attributionDate;
      this.attributionEmail = attributionEmail;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.UpdateMediaItemActionRequest';
    },
    UpdateMediaGalleryActionRequest: function(mediaGalleryKey, title, description, tags) {
      this.mediaGalleryKey = mediaGalleryKey;
      this.title = title;
      this.description = description;
      this.tags = tags;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.UpdateMediaGalleryActionRequest';
    },
    UpdateMediaGalleryPromotionActionRequest: function(mediaGalleryKey, mediaItemKey) {
      this.mediaGalleryKey = mediaGalleryKey;
      this.mediaItemKey = mediaItemKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.UpdateMediaGalleryPromotionActionRequest';
    },
    UpdateMediaStateActionRequest: function(mediaGalleryKey, mediaItemKey, submissionState) {
      this.mediaGalleryKey = mediaGalleryKey;
      this.mediaItemKey = mediaItemKey;
      this.submissionState = submissionState;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.UpdateMediaStateActionRequest';
    },
    UpdateMediaPositionActionRequest: function(moveThisMediaItemKey, moveBeforeMediaItemKey) {
      this.moveThisMediaItemKey = moveThisMediaItemKey;
      this.moveBeforeMediaItemKey = moveBeforeMediaItemKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.UpdateMediaPositionActionRequest';
    },
    TweetArticleRequest: function(articleId) {
      this.articleId = articleId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.TweetArticleRequest';
    },
    CommentOnRequest: function(reactionTargetKey, body) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.body = body;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.CommentOnRequest';
    },
    GetCommentPageRequest: function(reactionTargetKey, numberPerPage, onPage, sort) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.numberPerPage = numberPerPage;
      this.onPage = onPage;
      this.sort = sort;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.GetCommentPageRequest';
    },
    GetReactionSummaryRequest: function(reactionTargetKey) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.GetReactionSummaryRequest';
    },
    RecommendRequest: function(reactionTargetKey, recommendationCategory) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.recommendationCategory = (typeof recommendationCategory != 'undefined' ? recommendationCategory : '');
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.RecommendRequest';
    },
    ReportAbuseOnRequest: function(reactionTargetKey, abuseReason) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.abuseReason = abuseReason;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.ReportAbuseOnRequest';
    },
    ClearAbuseReportRequest: function(reactionTargetKey) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.ClearAbuseReportRequest';
    },
    GetAbuseReportPageRequest: function(numberPerPage, onPage, maxReportersPerReport) {
      this.numberPerPage = numberPerPage;
      this.onPage = onPage;
      this.maxReportersPerReport = maxReportersPerReport;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.GetAbuseReportPageRequest';
    },
    GetAbuseReportRequest: function(reactionTargetKey, maxReporters) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.maxReporters = maxReporters;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.GetAbuseReportRequest';
    },
    DiscoverArticlesRequest: function(activity, age) {
      this.activity = activity;
      this.age = age;
      this.callerSDK = 'js:7310';
      this.objectType = 'Discovery.DiscoverArticlesRequest';
    },
    DiscoverUsersRequest: function(activity, age) {
      this.activity = activity;
      this.age = age;
      this.callerSDK = 'js:7310';
      this.objectType = 'Discovery.DiscoverUsersRequest';
    },
    UserRecentActivityRequest: function(userKey) {
      this.userKey = userKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.UserRecentActivityRequest';
    },
    GetPublisherMonthlyReportRequest: function(month, year, apiKey) {
      this.month = month;
      this.year = year;
      this.apiKey = apiKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reporting.GetPublisherMonthlyReportRequest';
    },
    EchoRequest: function(message) {
      this.message = message;
      this.callerSDK = 'js:7310';
      this.objectType = 'Util.EchoRequest';
    },
    ErrorRequest: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Util.ErrorRequest';
    },
	nocomma: function(){
	}
  });
})();

// THIS FILE IS AUTO GENERATED, See the website for the documentation
(function() {
  /* Demand Media Javascript Library Model Objects */
  dmpod.extend({
    AdNetworkDetails: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'AdNetworks.AdNetworkDetails';
    },
    AdDescription: function(width, height) {
      this.width = width;
      this.height = height;
      this.callerSDK = 'js:7310';
      this.objectType = 'AdNetworks.AdDescription';
    },
    Advertisement: function(adDescription, source) {
      this.adDescription = adDescription;
      this.source = source;
      this.callerSDK = 'js:7310';
      this.objectType = 'AdNetworks.Advertisement';
    },
    SponsoredLink: function(title, description, url, clickUrl) {
      this.title = title;
      this.description = description;
      this.url = url;
      this.clickUrl = clickUrl;
      this.callerSDK = 'js:7310';
      this.objectType = 'AdNetworks.SponsoredLink';
    },
    RelatedAdLink: function(searchTerm, returnQueryParams) {
      this.searchTerm = searchTerm;
      this.returnQueryParams = returnQueryParams;
      this.callerSDK = 'js:7310';
      this.objectType = 'AdNetworks.RelatedAdLink';
    },
    RelatedAdResultLink: function(title, description, displayUrl, clickUrl, directToAdvertiser) {
      this.title = title;
      this.description = description;
      this.displayUrl = displayUrl;
      this.clickUrl = clickUrl;
      this.directToAdvertiser = directToAdvertiser;
      this.callerSDK = 'js:7310';
      this.objectType = 'AdNetworks.RelatedAdResultLink';
    },
    BundleTemplateListKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.BundleTemplateListKey';
    },
    BundleTemplateList: function(parentKey, key, name) {
      this.parentKey = parentKey;
      this.key = key;
      this.name = name;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.BundleTemplateList';
    },
    BundleTemplateKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.BundleTemplateKey';
    },
    BundleTemplate: function(parentListKey, key, name, criteria) {
      this.parentListKey = parentListKey;
      this.key = key;
      this.name = name;
      this.criteria = criteria;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.BundleTemplate';
    },
    BundleTemplateAliasKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.BundleTemplateAliasKey';
    },
    BundleTemplateAlias: function(bundleTemplateKey) {
      this.bundleTemplateKey = bundleTemplateKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.BundleTemplateAlias';
    },
    Bundle: function(templateKey) {
      this.templateKey = templateKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Bundles.Bundle';
    },
    Article: function(key, id) {
      this.key = key;
      this.id = id;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.Article';
    },
    Tag: function(name) {
      this.name = name;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.Tag';
    },
    ArticleKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.ArticleKey';
    },
    PublisherContentKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.PublisherContentKey';
    },
    ContentCategory: function(id, name) {
      this.id = id;
      this.name = name;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.ContentCategory';
    },
    RelatedLink: function(title, url, key) {
      this.title = title;
      this.url = url;
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.RelatedLink';
    },
    QueryCriteria: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.QueryCriteria';
    },
    RequestEnvelope: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Core.RequestEnvelope';
    },
    ResponseEnvelope: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Core.ResponseEnvelope';
    },
    ItemEnvelope: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Core.ItemEnvelope';
    },
    BaseKey: function(key, keyType) {
      this.key = key;
      this.keyType = keyType;
      this.callerSDK = 'js:7310';
      this.objectType = 'Core.BaseKey';
    },
    KeyValuePair: function(key, data) {
      this.key = key;
      this.data = data;
      this.callerSDK = 'js:7310';
      this.objectType = 'Core.KeyValuePair';
    },
    Customer: function(domain, contactEmail, isInternalProperty, widgetLandingPageUrl, platform, enabledState, userContentMode, apiKey, publisherNetwork, publisherSubNetwork, resellerCustomerId, publisherNetworkCustomerId, publisherNetworkAccountId, inlineTextAdsAllowed, inlineImageAdsAllowed, sponsoredLinksAllowed, relatedAdLinksAllowed, sdkAccessAllowed, socialMediaEnabled, internalLinkTarget) {
      this.domain = domain;
      this.contactEmail = contactEmail;
      this.isInternalProperty = isInternalProperty;
      this.widgetLandingPageUrl = widgetLandingPageUrl;
      this.platform = platform;
      this.enabledState = enabledState;
      this.userContentMode = userContentMode;
      this.apiKey = apiKey;
      this.publisherNetwork = publisherNetwork;
      this.publisherSubNetwork = publisherSubNetwork;
      this.resellerCustomerId = resellerCustomerId;
      this.publisherNetworkCustomerId = publisherNetworkCustomerId;
      this.publisherNetworkAccountId = publisherNetworkAccountId;
      this.inlineTextAdsAllowed = inlineTextAdsAllowed;
      this.inlineImageAdsAllowed = inlineImageAdsAllowed;
      this.sponsoredLinksAllowed = sponsoredLinksAllowed;
      this.relatedAdLinksAllowed = relatedAdLinksAllowed;
      this.sdkAccessAllowed = sdkAccessAllowed;
      this.socialMediaEnabled = socialMediaEnabled;
      this.internalLinkTarget = internalLinkTarget;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.Customer';
    },
    ContentSourceKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.ContentSourceKey';
    },
    ContentSource: function(key, displayName, url, contentCrawlingAllowed, inlineTextAdsAllowed, hasOwnAds) {
      this.key = key;
      this.displayName = displayName;
      this.url = url;
      this.contentCrawlingAllowed = contentCrawlingAllowed;
      this.inlineTextAdsAllowed = inlineTextAdsAllowed;
      this.hasOwnAds = hasOwnAds;
      this.callerSDK = 'js:7310';
      this.objectType = 'Content.ContentSource';
    },
    UserKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Users.UserKey';
    },
    User: function(userKey) {
      this.userKey = userKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Users.User';
    },
    CustomerSearchRecord: function(apiKey, widgetLandingPageUrl, platform, publisherSubNetwork, resellerCustomerId) {
      this.apiKey = apiKey;
      this.widgetLandingPageUrl = widgetLandingPageUrl;
      this.platform = platform;
      this.publisherSubNetwork = publisherSubNetwork;
      this.resellerCustomerId = resellerCustomerId;
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.CustomerSearchRecord';
    },
    CustomerSearchRecordPage: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Customers.CustomerSearchRecordPage';
    },
    MediaGalleryKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.MediaGalleryKey';
    },
    MediaItemKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.MediaItemKey';
    },
    MediaGallery: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.MediaGallery';
    },
    MediaItem: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.MediaItem';
    },
    MediaItemPage: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Media.MediaItemPage';
    },
    PaymentSystemDetails: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'PaymentSystems.PaymentSystemDetails';
    },
    CommentKey: function(key) {
      this.key = key;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.CommentKey';
    },
    ReactionSummary: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.ReactionSummary';
    },
    Comment: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.Comment';
    },
    CommentPage: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.CommentPage';
    },
    AbuseReport: function(reactionTargetKey, reactionTargetType, url, title, abuseReportTotalCount, abuseReportDetail, abuseReporters) {
      if (reactionTargetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof reactionTargetKey.objectType == 'string') && reactionTargetKey.objectType.split('.')[1],
            reactionTargetKey = new dmpod.BaseKey(reactionTargetKey.key, typeName || null);
      }
      this.reactionTargetKey = reactionTargetKey;
      this.reactionTargetType = reactionTargetType;
      this.url = url;
      this.title = title;
      this.abuseReportTotalCount = abuseReportTotalCount;
      this.abuseReportDetail = abuseReportDetail;
      this.abuseReporters = abuseReporters;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.AbuseReport';
    },
    AbuseReportPage: function() {
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.AbuseReportPage';
    },
    AbuseReportDetail: function(abuseReason, abuseReportCount) {
      this.abuseReason = abuseReason;
      this.abuseReportCount = abuseReportCount;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.AbuseReportDetail';
    },
    RecommendationDetail: function(category, count) {
      this.category = category;
      this.count = count;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.RecommendationDetail';
    },
    UserActivity: function(action, targetKey) {
      this.action = action;
      if (targetKey.constructor != dmpod.BaseKey) {
        var typeName = (typeof targetKey.objectType == 'string') && targetKey.objectType.split('.')[1],
            targetKey = new dmpod.BaseKey(targetKey.key, typeName || null);
      }
      this.targetKey = targetKey;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reactions.UserActivity';
    },
    PublisherMonthlyReport: function(month, year, dailyReports) {
      this.month = month;
      this.year = year;
      this.dailyReports = dailyReports;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reporting.PublisherMonthlyReport';
    },
    PublisherDailyReport: function(day, pageViews, totalAdRevenue) {
      this.day = day;
      this.pageViews = pageViews;
      this.totalAdRevenue = totalAdRevenue;
      this.callerSDK = 'js:7310';
      this.objectType = 'Reporting.PublisherDailyReport';
    },
	nocomma: function(){
	}
  });
})();
