if (typeof (LimelightPlayerUtil) === 'undefined') {
  if (typeof (JSON) === 'undefined') {
    this.JSON={};
    (function(){function l(b){return b<10?"0"+b:b}function o(b){p.lastIndex=0;return p.test(b)?'"'+b.replace(p,function(f){var c=r[f];return typeof c==="string"?c:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function m(b,f){var c,d,g,j,i=h,e,a=f[b];if(a&&typeof a==="object"&&typeof a.toJSON==="function")a=a.toJSON(b);if(typeof k==="function")a=k.call(f,b,a);switch(typeof a){case "string":return o(a);case "number":return isFinite(a)?String(a):"null";case "boolean":case "null":return String(a);
    case "object":if(!a)return"null";h+=n;e=[];if(Object.prototype.toString.apply(a)==="[object Array]"){j=a.length;for(c=0;c<j;c+=1)e[c]=m(c,a)||"null";g=e.length===0?"[]":h?"[\n"+h+e.join(",\n"+h)+"\n"+i+"]":"["+e.join(",")+"]";h=i;return g}if(k&&typeof k==="object"){j=k.length;for(c=0;c<j;c+=1){d=k[c];if(typeof d==="string")if(g=m(d,a))e.push(o(d)+(h?": ":":")+g)}}else for(d in a)if(Object.hasOwnProperty.call(a,d))if(g=m(d,a))e.push(o(d)+(h?": ":":")+g);g=e.length===0?"{}":h?"{\n"+h+e.join(",\n"+h)+
    "\n"+i+"}":"{"+e.join(",")+"}";h=i;return g}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+l(this.getUTCMonth()+1)+"-"+l(this.getUTCDate())+"T"+l(this.getUTCHours())+":"+l(this.getUTCMinutes())+":"+l(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,n,r={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;if(typeof JSON.stringify!=="function")JSON.stringify=function(b,f,c){var d;n=h="";if(typeof c==="number")for(d=0;d<c;d+=1)n+=" ";else if(typeof c==="string")n=c;if((k=f)&&typeof f!=="function"&&(typeof f!=="object"||typeof f.length!=="number"))throw new Error("JSON.stringify");return m("",
    {"":b})};if(typeof JSON.parse!=="function")JSON.parse=function(b,f){function c(g,j){var i,e,a=g[j];if(a&&typeof a==="object")for(i in a)if(Object.hasOwnProperty.call(a,i)){e=c(a,i);if(e!==undefined)a[i]=e;else delete a[i]}return f.call(g,j,a)}var d;b=String(b);q.lastIndex=0;if(q.test(b))b=b.replace(q,function(g){return"\\u"+("0000"+g.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
    "]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+b+")");return typeof f==="function"?c({"":d},""):d}throw new SyntaxError("JSON.parse");}})();
  }
  LimelightPlayerUtil =
    (function() {
       var EMBED_CODE_VERSION = '1.2.8';
       var DEFAULT_PLAYLIST_SERVICE = 'http://ps2.delvenetworks.com/r/PlaylistService';
       var DEFAULT_METRICS_COLLECTION_SERVICE = 'http://mcs.delvenetworks.com/r/MetricsCollectionService';
       var DEFAULT_HTML_PLAYER_LOCATION = 'http://assets.delvenetworks.com/player/html-player.js';
       var HEARTBEAT_INTERVAL_MS = 30 * 1000;

       var QUALITY_MOBILE_H264 = 'MobileH264';
       var QUALITY_MOBILE_3GP = 'Mobile3gp';
       var QUALITY_HLS = 'HttpLiveStreaming';

       var nav = navigator;
       var agent = nav.userAgent.toLowerCase();
       var platform = nav.platform.toLowerCase();
       var isIE = (navigator.appVersion.indexOf('MSIE') != -1);
       var isMobileApple = /iphone|ipad|ipod/.test(agent);
       var isLinux = /linux/.test(platform ? platform : agent);
       var isAndroid = /android \d+\x2E\d+/.test(agent);
       var isAndroid2plus = /android [2-9]+\x2E\d+/.test(agent);
       var isKindleFire = /silk/.test(agent);
       var isMobile = /mobile|blackberry/.test(agent) || isKindleFire || isAndroid;
       var supportsH264 = (function() {
         var v = document.createElement('VIDEO');
         if (!v.canPlayType) return '';
         return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
       }());
       var supportsHLS =  (function() {
         var v = document.createElement('VIDEO');
         if (!v.canPlayType) return '';
         return v.canPlayType('application/vnd.apple.mpegurl');
       }());
       var htmlCodec = (supportsHLS === 'probably' || isMobileApple) ? QUALITY_HLS : QUALITY_MOBILE_H264;

       function getCookie(name) {
	 var start = document.cookie.indexOf(name + "=");
	 var len = start + name.length + 1;
	 if (!start && (name != document.cookie.substring(0, name.length))) {
	   return null;
	 }
	 if (start == -1) return null;
	 var end = document.cookie.indexOf(';', len);
	 if (end == -1) end = document.cookie.length;
	 return unescape(document.cookie.substring(len, end));
       }

       function setCookie(name, value, expires, path, domain, secure) {
	 var today = new Date();
	 today.setTime(today.getTime());
	 if (expires) {
	   expires = expires * 1000 * 60 * 60 * 24;
	 }
	 var expires_date = new Date(today.getTime() + expires);
	 document.cookie = name + '=' + escape(value) +
	   (expires ? ';expires=' + expires_date.toGMTString() : '') +
	   (path ? ';path=' + path : '') +
	   (domain ? ';domain=' + domain : '') +
	   (secure ? ';secure' : '');
       }

       // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
       function generateGUID() {
         return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
             var r = Math.random()*16|0;
             var v = (c == 'x') ? r : (r&0x3|0x8);
             return v.toString(16);
         }).toUpperCase();
       }
       var metricsSourceInstanceId = generateGUID();
       var metricsSource = 'Limelight Embed Code';
       var metricsSourceVersion = 1;

       var metricsFlashCapabilities = '';
       var metricsHtmlCapabilities = { H264: supportsH264, HLS: supportsHLS };
       var metricsPlayerProviderId = "Delve Networks";
       var metricsVersion = EMBED_CODE_VERSION;
       var metricsUserAgent = navigator.userAgent;
       var metricsPlatform = navigator.platform;
       var getMetricsUserId = (function() {
           var USERID_COOKIE = 'Limelight_Embed_Code_UserId';
           var userid = getCookie(USERID_COOKIE);
           return function() {
             if (!userid) {
               userid = generateGUID();
               setCookie(USERID_COOKIE, userid, 365);
             }
             return userid;
           };
       }());
       var getMetricsElapsed = (function () {
         var start = +new Date();
         return function() {
           return new Date() - start;
         };
       }());

       var flashVersion =
         (function() {
            var desc = null, err;
            if (typeof(nav.plugins) !== 'undefined' && typeof(nav.plugins['Shockwave Flash']) == 'object') {
              desc = nav.plugins['Shockwave Flash'].description;
              if (desc && !(typeof(nav.mimeTypes) !== 'undefined' &&
                            nav.mimeTypes['application/x-shockwave-flash'] &&
                            !nav.mimeTypes['application/x-shockwave-flash'].enabledPlugin)) {
                desc = desc.replace(/^.*\s+(\S+\s+\S+$)/, '$1');
                return [parseInt(desc.replace(/^(.*)\..*$/, '$1'), 10),
                        parseInt(desc.replace(/^.*\.(.*)\s.*$/, '$1'), 10),
                        /[a-zA-Z]/.test(desc) ? parseInt(desc.replace(/^.*[a-zA-Z]+(.*)$/, '$1'), 10) : 0];
              }
            } else if (typeof(window.ActiveXObject) !== 'undefined') {
              try {
                var activex = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
                if (activex) {
                  desc = activex.GetVariable('$version');
                  if (desc) {
                    desc = desc.split(' ')[1].split(',');
                    return [parseInt(desc[0], 10), parseInt(desc[1], 10), parseInt(desc[2], 10)];
                  }
                }
              } catch(err) {}
            }
            return [0,0,0];
          }());

       // HTML5 codepath only-- ES5-safe
       var loadPlayer = (function() {
         var onload = [];

         return function(resourceLocations, callback) {
           if (LimelightPlayerUtil.Player !== undefined) {
             callback(LimelightPlayerUtil.Player);
           } else {
             onload.push(callback);
             if (LimelightPlayerUtil.playerLoadedCallback === undefined) {
               var head = document.getElementsByTagName('head')[0] || document.documentElement;
               var script = document.createElement('SCRIPT');
               script.type = 'text/javascript';
               script.src = resourceLocations.htmlPlayerLocation;
               script.charset = 'utf-8';
               LimelightPlayerUtil.playerLoadedCallback = function(Player) {
                 LimelightPlayerUtil.Player = Player;
                 delete LimelightPlayerUtil.playerLoadedCallback;
                 if (head) {
                   head.removeChild(script);
                 }
                 onload.forEach(function(currentCallback) {
                                  currentCallback(Player);
                                });
                 onload = [];
               };
               script.onerror = function() {
                 onload.forEach(function(currentCallback) {
                                  currentCallback(null);
                                });
                 onload = [];
               };
               head.insertBefore(script, head.firstChild);
             }
           }
         };
       }());

       var loadJsonp = (function() {
         var jsonpCounter = 0;
         return function(url, callback) {
           var jsonpFuncIdx = '_' + jsonpCounter++;
           url += '&jsonp=LimelightPlayerUtil.jsonpCallback.' + jsonpFuncIdx;
           var head = document.getElementsByTagName('head')[0] || document.documentElement;
           var script = document.createElement('SCRIPT');
           script.type = 'text/javascript';
           script.src = url;
           script.charset = 'utf-8';
           LimelightPlayerUtil.jsonpCallback[jsonpFuncIdx] = function(json) {
             delete LimelightPlayerUtil.jsonpCallback[jsonpFuncIdx];
             callback(json);
             if (head) {
               head.removeChild(script);
             }
           };
           script.onerror = function() { callback(null); };
           head.insertBefore(script, head.firstChild);
         };
       }());

       function once(fn, that) {
         if (fn === undefined) return undefined;
         var done = false;
         return function() {
           if (!done) {
             done = true;
             fn.apply(that || this, arguments);
           }
         };
       }

       var post = (function() {
         var counter = 0;
         function makeFrameName() {
           return '_limelight_embed_ajax_' + (counter++);
         }

         return function(url, data, callback) {
           var frameName = makeFrameName();
           var iframe = document.createElement('IFRAME');
           iframe.id = frameName;
           iframe.name = frameName;
           iframe.style.cssText = 'display:none;width:0px;height:0px;';
           var body = document.getElementsByTagName('body')[0] || document.documentElement;
           body.appendChild(iframe);

           var form = document.createElement('FORM');
           form.setAttribute('target', frameName);
           form.setAttribute('method', 'POST');
           form.setAttribute('action', url);
           for (field in data) {
             var input = document.createElement('INPUT');
             input.setAttribute('type', 'hidden');
             input.setAttribute('name', field);
             input.setAttribute('value', JSON.stringify(data[field]));
             form.appendChild(input);
           }
           iframe.appendChild(form);
           iframe.onload = function() {
             if (callback !== undefined) callback();
             setTimeout(function() { iframe.parentNode.removeChild(iframe); }, 0);
           };
           form.submit();
         };
       }());

       function makePostEvent(flashVars, metricsCollectionService) {
         var postEvent = function(type, inEvent, callback) {
           var event = {
             channelId: flashVars.channelId,
             mediaId: flashVars.mediaId,
             millisecondsElapsed: getMetricsElapsed()
           };
           var i;
           for (i in event) {
             if (event[i] === undefined) event[i] = '';
           }
           for (i in inEvent) {
             event[i] = (inEvent[i] === undefined) ? '' : inEvent[i];
           }
           post(metricsCollectionService + '/recordMetricsEvent',
                { sourceInstanceId: metricsSourceInstanceId,
                  source: metricsSource,
                  sourceVersion: metricsSourceVersion,
                  eventType: type,
                  data: event },
                callback);
         };
         postEvent.HEARTBEAT = 'Heartbeat';
         postEvent.MEDIA_COMPLETE = 'MediaComplete';
         postEvent.PLAY = 'Play';
         postEvent.PAUSE = 'Pause';
         postEvent.SEEK = 'Seek';
         postEvent.START_SESSION = 'StartSession';

         return postEvent;
       }

       var heartbeatTimer = null;
       function heartbeat(args) {
         if (args.isPlaying()) {
           args.postEvent(args.postEvent.HEARTBEAT,
                          { droppedFrames: 0,
                            droppedFramesRatio: '',
                            selectedMediaQuality: args.quality,
                            positionInMilliseconds: args.getPosition(),
                            maxBytesPerSecond: '',
                            currentBitrate: '' }
           );
         }
       }

       function startHeartbeat(args) {
         if (heartbeatTimer !== null) clearInterval(heartbeatTimer);
         heartbeatTimer = setInterval(function() { heartbeat(args); }, HEARTBEAT_INTERVAL_MS);
       }

       function stopHeartbeat() {
         if (heartbeatTimer !== null) clearInterval(heartbeatTimer);
         heartbeatTimer = null;
       }

       // If no target, just write to the document.  If given an element or
       // element id and that element is not an <object>, add the html to the
       // innerHTML of that element.  If it _is_ an <object>, replace that
       // element instead of appending in it.  The added content can be either
       // a string, or a DOM node.
       function makeWriter(target) {
         function isElement(object) {
           return (typeof(object) === 'object' || typeof(object) === 'function') && object.nodeType;
         }
         if (typeof(target) === 'undefined') {
           return function(newContent) {
             if (isElement(newContent)) {
               document.body.appendChild(newContent);
             } else {
               document.write(newContent);
             }
           };
         } else {
           if (typeof(target) === 'string') {
             target = document.getElementById(target);
           }
           if (isElement(target)) {
             if (target.nodeName === 'OBJECT') {
               var parent = target.parentNode;
               var next = target.nextSibling;
               var written = false;
               return function(newContent) {
                 var containerDiv = document.createElement('DIV');
                 if (isElement(newContent)) {
                   containerDiv.appendChild(newContent);
                 } else {
                   containerDiv.innerHTML = newContent;
                 }

                 if (!written) {
                   var first = containerDiv.firstChild;
                   parent.replaceChild(first, target);
                   written = true;
                 }
                 while (containerDiv.firstChild) {
                   parent.insertBefore(containerDiv.firstChild, next);
                 }
               };
             } else {
               return function(newContent) {
                 if (isElement(newContent)) {
                   target.appendChild(newContent);
                 } else {
                   target.innerHTML = target.innerHTML + newContent;
                 }
               };
             }
           }
         }
         return null;
       }

       function formatFlashVars(flashVarsObj) {
         var flashVars = '', key;
         if (typeof(flashVarsObj) === 'string') {
           flashVars = flashVarsObj;
         } else if (typeof(flashVarsObj) === 'object') {
           for (key in flashVarsObj) {
             flashVars += encodeURIComponent(key) + '=' + encodeURIComponent(flashVarsObj[key]) + '&';
           }
         }
         return flashVars;
       }

       function parseFlashVars(query_string) {
         var parsed_params = {};
         var split_vars = query_string.split('&');
         for (var i = 0; i < split_vars.length; i++) {
           var param = split_vars[i];
	   var split_point = param.indexOf('=');
	   if (split_point === -1) {
             parsed_params[decodeURIComponent(param)] = 'true';
	   } else {
             parsed_params[decodeURIComponent(param.substring(0, split_point))] =
	       decodeURIComponent(param.substring(split_point + 1));
	   }
         };
         return parsed_params;
       }

       function writeFlash(writer, url, flashVarsObj, width, height, id, wmode) {
         var flashVars = formatFlashVars(flashVarsObj);
         var player = '<object type="application/x-shockwave-flash" id="' + id +
                          '" name="' + id +
                          '" width="' + width +
                          '" height="' + height +
                          '" data="' + url +
                          '"><param name="movie" value="' + url +
                          '"/><param name="wmode" value="' + wmode +
                          '"/><param name="allowScriptAccess" value="always"/>' +
                          '<param name="allowFullScreen" value="true"/>' +
                          '<param name="flashVars" value="' + flashVars +
                          '"/></object>';
         writer(player);
         return document.getElementById(id);
       }

       function minFlashVersion(major, minor, build) {
         return flashVersion[0] > major ||
                (flashVersion[0] == major && (flashVersion[1] > minor ||
                                              (flashVersion[1] == minor && flashVersion[2] >= build)));
       }

       function defaultOptions(options) {
         options = options || {};
         options.wmode = options.wmode || 'window';
         options.id = options.id || 'limelight_player_' + Math.floor(Math.random() * 1000000000);
         options.playlistService = options.playlistService || DEFAULT_PLAYLIST_SERVICE;
         options.metricsCollectionService = options.metricsCollectionService || DEFAULT_METRICS_COLLECTION_SERVICE;
         options.htmlPlayerLocation = options.htmlPlayerLocation || DEFAULT_HTML_PLAYER_LOCATION;
         return options;
       }

       var fallback = (function() {
         return function (writer, resourceLocations, flashVars, width, height, id, wmode) {
           function showError(text, url) {
             writer('<table width="' + width +
                    '" height="' + height +
                    '" bgcolor="black" style="background-color:black">' +
                    '<tr><td align="center">' +
                    (url ? '<a href="' + url + '" style="text-decoration:underline; color:white">' : '') +
                    '<span style="font-size:12px; color:white">' + text + '</span>' +
                    (url ? '</a>' : '') +
                    '</td></tr></table>');
           }

           var postEvent = makePostEvent(flashVars, resourceLocations.metricsCollectionService);
           function postPlayStateEvent(eventType, position, callback) {
             var callbackOnce = once(callback);
             postEvent(eventType, { positionInMilliseconds: position }, callbackOnce);
             if (callback !== undefined) setTimeout(callbackOnce, 1000);
           }

           function request(platform, callback) {
             var url;
             if (flashVars.mediaId) {
               url = resourceLocations.playlistService +
                 '/getMobilePlaylistByMediaIds?media='+ flashVars.mediaId +
                 (flashVars.channelId ? '&channel=' + flashVars.channelId : '') +
                 '&platform=' + platform;
             } else if (flashVars.channelId) {
               url = resourceLocations.playlistService +
                 '/channel/' + flashVars.channelId +
                 '/getFirstAvailableMobilePlaylistByChannelId?platform=' + platform;
             } else if (flashVars.channelListId) {
               url = resourceLocations.playlistService +
                 '/channel_list/' + flashVars.channelListId +
                 '/getFirstAvailableMobilePlaylistByChannelListId?platform=' + platform;
             }
             loadJsonp(url, function(json) {
                          if (json && json.mediaList && json.mediaList[0]) {
                            postEvent(postEvent.START_SESSION,
                                      { adConfigurationChannelId: flashVars.adConfigurationChannelId,
                                        channelListId: flashVars.channelListId,
                                        htmlCapabilities: JSON.stringify(metricsHtmlCapabilities),
                                        pageURL: window.location.href,
                                        platform: metricsPlatform,
                                        playerProviderId: metricsPlayerProviderId,
                                        userAgent: metricsUserAgent,
                                        userId: getMetricsUserId(),
                                        version: metricsVersion });
                            if (json.mediaList[0].mobileUrls.length > 0) {
                              callback(platform, json);
                            } else {
                              showError('Video Not Available For This Device');
                            }
                          } else {
                            showError('Video Not Available');
                          }
                        });
           }

           if (isMobile) {
             if (supportsH264 === 'probably' || isAndroid2plus || isMobileApple || isKindleFire) {
               if (flashVars.mobileHtmlPlaylistPlayer) {
                 loadPlayer(resourceLocations, function(Player) {
                   DelvePlayer = Player.createPlayer(width, height, flashVars, id);
                 });
               } else {
                 metricsHtmlCapabilities.embedMode = 'video';
                 request(htmlCodec, function(platform, json) {
                           var media = json.mediaList[0];
                           var video = document.createElement('VIDEO');
                           video.src = encodeURI(media.mobileUrls[0].mobileUrl);
                           video.width = width;
                           video.height = height;
                           video.poster = encodeURI(media.previewImageUrl);
                           video.controls = true;
                           // android doesn't provide click-to-play even with controls
                           video.addEventListener('click', video.play);

                           video.addEventListener('play', function() {
                               postPlayStateEvent(postEvent.PLAY, Math.round(video.currentTime * 1000));
                               startHeartbeat({ postEvent: postEvent,
                                                quality: platform,
                                                getPosition: function() { return Math.round(video.currentTime * 1000); },
                                                isPlaying: function() { return !video.paused; } });
                           });
                           video.addEventListener('pause', function() {
                               if (!video.ended) {
                                 postPlayStateEvent(postEvent.PAUSE, Math.round(video.currentTime * 1000));
                               }
                               stopHeartbeat();
                           });
                           video.addEventListener('ended', function() {
                               postEvent(postEvent.MEDIA_COMPLETE);
                               stopHeartbeat();
                           });
                           var lastPosition = 0;
                           video.addEventListener('timeupdate', function() {
                               var position = video.currentTime;
                               if (video.seeking && position !== lastPosition) {
                                 var before = Math.round(lastPosition * 1000);
                                 var after = Math.round(position * 1000);
                                 if (before !== after) {
                                   postEvent(postEvent.SEEK,
                                             { offsetBefore: before,
                                               offsetAfter: after,
                                               heatmapDisplayed: false,
                                               spectrumType: '',
                                               spectrumColor: 0,
                                               relatedConcepts: '' });
                                 }
                               }
                               lastPosition = position;
                           });

                           writer(video);
                         });
               }
             } else {
               metricsHtmlCapabilities.embedMode = 'link';
               request(QUALITY_MOBILE_3GP, function(platform, json) {
                         var media = json.mediaList[0];
                         var table = document.createElement('TABLE');
                         table.style = 'border-style:none';
                         var tr1 = table.appendChild(document.createElement('TR'));
                         var td1 = tr1.appendChild(document.createElement('TD'));
                         var a1 = td1.appendChild(document.createElement('A'));
                         a1.href = '#';
                         var img = a1.appendChild(document.createElement('IMG'));
                         img.src = encodeURI(media.thumbnailImageUrl);
                         var tr2 = table.appendChild(document.createElement('TR'));
                         var td2 = tr2.appendChild(document.createElement('TD'));
                         td2.style = 'text-align:center';
                         var a2 = td2.appendChild(document.createElement('A'));
                         a2.href = '#';
                         a2.appendChild(document.createTextNode('Click to play'));

                         var click3gp = function() {
                           postPlayStateEvent(postEvent.PLAY,
                                              0,
                                              function() {
                                                window.location = media.mobileUrls[0].mobileUrl;
                                              });
                           return false;
                         };

                         a1.onclick = click3gp;
                         a2.onclick = click3gp;
                         writer(table);
                       });
             }
           } else {
             if (!isLinux && minFlashVersion(6, 0, 65)) {
               var MMPlayerType = (isIE == true) ? 'ActiveX' : 'PlugIn';
               document.title = document.title.slice(0, 47) + ' - Flash Player Installation';
               var installerUrl = 'http://assets.delvenetworks.com/player/playerProductInstall.swf';
               var installerVars = 'MMredirectURL=' + window.location +
                 '&MMplayerType=' + MMPlayerType +
                 '&MMdoctitle=' + document.title;
               writeFlash(writer, installerUrl, installerVars, width, height, id, wmode);
             } else {
               showError('You need to have the Adobe Flash Player 9' +
                         (minFlashVersion(9, 0, 0) ? '.0.115' : '') +
                         ' to view this content.<br>Please click here to continue.',
                         'http://www.adobe.com/go/getflash/');
             }
           }
           return null;
         };
       }());

       var exports = {
         jsonpCallback: [],
         initEmbed: function(id, playlistService, metricsCollectionService, htmlPlayerLocation) {
           var rawPlayer = document.getElementById(id);
           var width = rawPlayer.width;
           var height = rawPlayer.height;

           var param = rawPlayer.firstChild;
           var options = { id: id,
                           playlistService: playlistService,
                           metricsCollectionService: metricsCollectionService,
                           htmlPlayerLocation: htmlPlayerLocation
                         };
           var flashVars = {};
           while (param !== null) {
             if (param.nodeName === 'PARAM') {
               if (param.name === 'flashVars') flashVars = parseFlashVars(param.value);
               if (param.name === 'wmode') options.wmode = param.value;
             }
             param = param.nextSibling;
           }
           options = defaultOptions(options);

           // if no flash, replace with something better.
           // On android, don't use flash even if available.
           if (!minFlashVersion(9,0,115) || isAndroid) {
             var writer = makeWriter(rawPlayer);
             return fallback(writer,
                             options,
                             flashVars,
                             width,
                             height,
                             options.id,
                             options.wmode);
           }
           return rawPlayer;
         },
         embedPlayer: function(flashVars, width, height, options, target) {
           var writer = makeWriter(target);
           options = defaultOptions(options);

           if (minFlashVersion(9,0,115)) {
             var swfUrl = minFlashVersion(10, 0, 0) ?
                            'http://assets.delvenetworks.com/player/fp10loader.swf' :
                            'http://assets.delvenetworks.com/player/fp9loader.swf';
             return writeFlash(writer, swfUrl, flashVars, width, height, options.id, options.wmode);
           }

           return fallback(writer,
                           options,
                           flashVars,
                           width,
                           height,
                           options.id,
                           options.wmode);
         }
       };
       return exports;
     }());
}


