if (brightcove == undefined) {
    var brightcove = {};
    brightcove.getExperience = function() {
        //alert("Please import APIModules_all.js in order to use the API.");
    };
}

if (brightcove.experiences == undefined) {

    brightcove.servicesURL = 'http://c.brightcove.com/services';
    brightcove.cdnURL = 'http://admin.brightcove.com';
    brightcove.secureServicesURL = 'https://secure.brightcove.com/services';
    brightcove.experiences = {};
    brightcove.experienceNum = 0;
    brightcove.majorVersion = 9;
    brightcove.minorVersion = 0;
    brightcove.minorRevision = 28;

    // remove post Naga
    var brightcoveJS = brightcove;

    brightcove.createExperiences = function(pEvent, pElementID) {
        brightcove.removeListeners();

        var pDefaultParam = {};
        pDefaultParam.width  = '100%';
        pDefaultParam.height = '100%';

        var pDefaultFParam = {};
        pDefaultFParam.allowScriptAccess = 'always';
        pDefaultFParam.allowFullScreen = 'true';
        pDefaultFParam.seamlessTabbing   = false;
        pDefaultFParam.swliveconnect     = true;
        pDefaultFParam.wmode   = 'window';
        pDefaultFParam.quality = 'high';
        pDefaultFParam.bgcolor = '#999999';

        var isIE = (window.ActiveXObject != undefined);
        var pMajorVersion = 0;
        var pMinorRevision = 0;
        var pVersions;
        var pNoFlash = false;
        if (typeof navigator.plugins != 'undefined' && navigator.plugins.length > 0) {
            if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
                var pSWFVersion = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
                var pDescription = navigator.plugins["Shockwave Flash" + pSWFVersion].description;
                pVersions = pDescription.split(" ");
                pMajorVersion = pVersions[2].split(".")[0];
                pMinorRevision = pVersions[3];
                if (pMinorRevision == "") {
                    pMinorRevision = pVersions[4];
                }
                if (pMinorRevision[0] == "d") {
                    pMinorRevision = pMinorRevision.substring(1);
                } else if (pMinorRevision[0] == "r") {
                    pMinorRevision = pMinorRevision.substring(1);
                    if (pMinorRevision.indexOf("d") > 0) {
                        pMinorRevision = pMinorRevision.substring(0, pMinorRevision.indexOf("d"));
                    }
                }
            }
        } else if (isIE) {
            try {
                var pFlash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
                pVersions = / ([0-9]+),[0-9],([0-9]+),/.exec(pFlash.GetVariable('$version'));
                pMajorVersion = pVersions[1];
                pMinorRevision = pVersions[2];
            } catch(e) {
                pNoFlash = true;
            }
        } else {
            pNoFlash = true;
        }

        var pExperiences = [];
        if (pElementID != null) {
            pExperiences.push(document.getElementById(pElementID));
        } else {
            var pAllObjects = document.getElementsByTagName('object');
            var pNumObjects = pAllObjects.length;
            for (var i = 0; i < pNumObjects; i++) {
                if(/\bBrightcoveExperience\b/.test(pAllObjects[i].className)) {
                    pExperiences.push(pAllObjects[i]);
                }
            }
        }
        if (isIE) {
            var pParams = document.getElementsByTagName('param');
        }
        var pExperience;
        var pPlayerID = brightcove.getParameter("bcpid");
        var pTitleID = brightcove.getParameter("bctid");
        var pLineupID = brightcove.getParameter("bclid");
        var pNumExperiences = pExperiences.length;
        var pRequestedMinorRevision;
        var pRequestedMajorVersion;
        for (var i = 0; i < pNumExperiences; i++) {

            pExperience = pExperiences[i];
            if (!pExperience.params) pExperience.params = {};
            if (!pExperience.fParams) pExperience.fParams = {};
            for (var j in pDefaultParam) {
                pExperience.params[j] = pDefaultParam[j];
            }
            for (var j in pDefaultFParam) {
                pExperience.fParams[j] = pDefaultFParam[j];
            }
            if (pExperience.id.length > 0) {
                pExperience.params.flashID = pExperience.id;
            } else {
                pExperience.id = pExperience.params.flashID = 'bcExperienceObj' + (brightcove.experienceNum++);
            }
            if (!isIE) {
                var pParams = pExperience.getElementsByTagName('param');
            }
            var pNumParams = pParams.length;
            var pParam;
            for (var j = 0; j < pNumParams; j++) {
                pParam = pParams[j];
                if (isIE && pParam.parentNode.id != pExperience.id) {
                    continue;
                }
                pExperience.params[pParam.name] = pParam.value;
            }
            if (pExperience.params.majorVersion != undefined) {
                pRequestedMajorVersion = parseInt(pExperience.params.majorVersion);
            } else {
                pRequestedMajorVersion = brightcove.majorVersion;
            }
            if (pExperience.params.minorRevision != undefined) {
                pRequestedMinorRevision = parseInt(pExperience.params.minorRevision);
            } else {
                pRequestedMinorRevision = brightcove.minorRevision;
            }
            var pUseInstaller = false;
            if (pMajorVersion < pRequestedMajorVersion || 
                (pMajorVersion == pRequestedMajorVersion && pMinorRevision < pRequestedMinorRevision)
            ) {
                pUseInstaller = true;
            }
            if (pExperience.params.bgcolor != undefined) pExperience.fParams.bgcolor = pExperience.params.bgcolor;
            if (pExperience.params.wmode != undefined) pExperience.fParams.wmode = pExperience.params.wmode;
            if (pPlayerID.length < 1  || (pPlayerID == pExperience.params.playerID)) {
                if (pPlayerID != pExperience.params.playerID && pPlayerID.length > 0) {
                    pExperience.params.playerID = pPlayerID;
                }
                if (pTitleID.length > 0) {
                    pExperience.params.videoID = pTitleID;
                    pExperience.params.autoStart = true;
                    pExperience.params.fromLink = true;
                }
                if (pLineupID.length > 0) {
                    pExperience.params.lineupID = pLineupID;
                }
            }

            var pFile;
            if (pUseInstaller) {
                pFile = brightcove.cdnURL + "/viewer/playerProductInstall.swf";
                var MMPlayerType = isIE ? "ActiveX" : "PlugIn";
                document.title = document.title.slice(0, 47) + " - Flash Player Installation";
                var MMdoctitle = document.title;
                pFile += "?&MMredirectURL="+window.location+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle;
            } else {
                if (pExperience.params.secureConnections == "true") {
                    pFile = brightcove.secureServicesURL;
                } else {
                    pFile = brightcove.servicesURL;
                }
                pFile += ('/viewer/federated_f9?' + brightcove.getOverrides());

                for (var pConfig in pExperience.params) {
                    pFile += '&' + encodeURIComponent(pConfig) + '=' + encodeURIComponent(pExperience.params[pConfig]);
                }

            }

            var pExperienceElement;
            if (pNoFlash) {
                var pContainer = document.createElement('span');
                if (pExperience.params.height.charAt(pExperience.params.height.length-1) == "%") {
                    pContainer.style.display = 'block';
                } else {
                    pContainer.style.display = 'inline-block';
                }
                pContainer.id = '_container' + i;
                var pLinkHTML = "<a href='http://www.adobe.com/go/getflash/' target='_blank'><img src='"+brightcove.cdnURL+"/viewer/upgrade_flash_player2.gif' alt='Get Flash Player' width='314' height='200' border='0'></a>";
                pExperience.parentNode.replaceChild(pContainer, pExperience);
                document.getElementById('_container' + i).innerHTML = pLinkHTML;
            } else {
                if (isIE) {
                    var pContainer = document.createElement('span');
                    if (pExperience.params.height.charAt(pExperience.params.height.length-1) == "%") {
                        pContainer.style.display = 'block';
                    } else {
                        pContainer.style.display = 'inline-block';
                    }
                    pContainer.id = '_container' + i;
                    pExperience.fParams.movie = pFile;
                    var pOptions = '';
                    for (var pOption in pExperience.fParams) {
                        pOptions += '<param name="' + pOption + '" value="' + pExperience.fParams[pOption] + '" />';
                    }
                    var pProtocol = (pExperience.params.secureConnections == "true") ? "https" : "http";
                    var pExperienceHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
                    + ' codebase="' + pProtocol + '://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + brightcove.majorVersion + ',' + brightcove.majorRevision + ',' + brightcove.minorRevision + ',0"'
                    + ' id="' + pExperience.id + '"'
                    + ' width="' + pExperience.params.width + '"'
                    + ' height="' + pExperience.params.height + '"'
                    + ' class="BrightcoveExperience">'
                    + pOptions
                    + '</object>';
                    pExperience.parentNode.replaceChild(pContainer, pExperience);
                    document.getElementById('_container' + i).innerHTML = pExperienceHTML;
                    pExperience.experience = document.getElementById(pExperience.id);
                    brightcove.experiences[pExperience.id] = pContainer;
                } else {
                    var pExperienceElement = document.createElementNS('http://www.w3.org/1999/xhtml', 'object');
                    pExperienceElement.type = 'application/x-shockwave-flash';
                    pExperienceElement.data = pFile;
                    pExperienceElement.id = pExperience.params.flashID;
                    pExperienceElement.width = pExperience.params.width;
                    pExperienceElement.height = pExperience.params.height;
                    pExperienceElement.className = pExperience.className;
                    var pTempParam;
                    for (var pConfig in pExperience.fParams) {
                        pTempParam = document.createElementNS('http://www.w3.org/1999/xhtml', 'param');
                        pTempParam.name = pConfig;
                        pTempParam.value = pExperience.fParams[pConfig];
                        pExperienceElement.appendChild(pTempParam);
                    }
                    pExperience.parentNode.replaceChild(pExperienceElement, pExperience);
                    brightcove.experiences[pExperience.id] = pExperienceElement;
                }
            }
        }
    };

    brightcove.createExperience = function(pElement, pParentOrSibling, pAppend) {
        if (!pElement.id || pElement.id.length < 1) {
            pElement.id = 'bcExperienceObj' + (brightcove.experienceNum++);
        }
        if (pAppend) {
            pParentOrSibling.appendChild(pElement);
        } else {
            pParentOrSibling.parentNode.insertBefore(pElement, pParentOrSibling);
        }
        brightcove.createExperiences(null, pElement.id);
    };

    brightcove.removeExperience = function(pID) {
        if (brightcove.experiences[pID] != null) {
            brightcove.experiences[pID].parentNode.removeChild(brightcove.experiences[pID]);
        }
    };

    brightcove.getURL = function() {
        var pURL;
        if (typeof window.location.search != 'undefined') {
            pURL = window.location.search;
        } else {
            pURL = /(\?.*)$/.exec(document.location.href);
        }
        return pURL;
    };

    brightcove.getOverrides = function() {
        var pURL = brightcove.getURL();
        var pQuery = new RegExp('@[\\w\\.]+=\\w+', 'g');
        var pValue = pQuery.exec(pURL);
        var pOverrides = "";
        while (pValue != null) {
            pOverrides += "&" + pValue;
            pValue = pQuery.exec(pURL);
        }
        
        return pOverrides;
    };

    brightcove.getParameter = function(pName, pDefaultValue) {
        if (pDefaultValue == null) pDefaultValue = "";
        var pURL = brightcove.getURL();
        var pQuery = new RegExp(pName + '=([^&]*)');
        var pValue = pQuery.exec(pURL);
        if (pValue != null) {
            return pValue[1];
        } else {
            return pDefaultValue;
        }
    };

    brightcove.createElement = function(el) {
        if (document.createElementNS) {
            return document.createElementNS('http://www.w3.org/1999/xhtml', el);
        } else {
            return document.createElement(el);
        }
    };

    brightcove.i18n = {
        'BROWSER_TOO_OLD'      : 'The browser you are using is too old. Please upgrade to the latest version of your browser.'
    };

    brightcove.removeListeners = function() {
        if (/KHTML/i.test(navigator.userAgent)) {
            clearInterval(checkLoad);
            document.removeEventListener('load', brightcove.createExperiences, false);
        }
        if (typeof document.addEventListener != 'undefined') {
            document.removeEventListener('DOMContentLoaded', brightcove.createExperiences, false);
            document.removeEventListener('load', brightcove.createExperiences, false);
        } else if (typeof window.attachEvent != 'undefined') {
            window.detachEvent('onload', brightcove.createExperiences);
        }
    };

    if (/KHTML/i.test(navigator.userAgent)) {
        var checkLoad = setInterval(function() { if(/loaded|complete/.test(document.readyState)) { clearInterval(checkLoad); brightcove.createExperiences(); }}, 70);
        document.addEventListener('load', brightcove.createExperiences, false);
    }
    if (typeof document.addEventListener != 'undefined') {
        document.addEventListener('DOMContentLoaded', brightcove.createExperiences, false);
        document.addEventListener('load', brightcove.createExperiences, false);
    } else if (typeof window.attachEvent != 'undefined') {
        window.attachEvent('onload', brightcove.createExperiences);
    } else {
        alert(brightcove.i18n.BROWSER_TOO_OLD);
    }

}


var APIModules = {};
APIModules.EXPERIENCE = "experience";
APIModules.CONTENT = "content";
APIModules.VIDEO_PLAYER = "videoPlayer";
APIModules.SOCIAL = "social";
APIModules.SEARCH = "search";
APIModules.CUE_POINTS = "cuePoints";
APIModules.ADVERTISING = "advertising";
APIModules.MENU = "menu";

if (brightcove == undefined) var brightcove = {};

brightcove.instances = {};
brightcove.modules = {};
brightcove.ID_DELIM = "|||";
// remove post Naga
var bcPlayer = brightcove;

brightcove.getExperience = function(pExperience) {
    if (this.instances[pExperience] == null) {
        //alert("Experience '" + pExperience + "' not found. Please ensure the name is correct and the API for the player is enabled.");
    }
    return this.instances[pExperience];
};
// remove post Naga
brightcove.getPlayer = brightcove.getExperience;

function setAPICallback(pID, pCallback) {
    brightcove.instances[pID] = new BrightcoveExperience(pCallback);
}

function BrightcoveExperience(pCallback) {
    this.callback = pCallback;
    this.modules = {};
}

BrightcoveExperience.prototype.getModule = function(pModule) {
    if (this.modules[pModule] == null) {
        this.modules[pModule] = new brightcove.modules[pModule](this);
    }
    return this.modules[pModule];
};

function APIModule() {
    this.handlers = [];
}

APIModule.handlerCount = 0;

APIModule.getHandler = function() {
    return "bc_handler" + (APIModule.handlerCount++);
};

APIModule.callFlash = function(pCallback, pParams) {
    var pCallbackArray = pCallback.split(brightcove.ID_DELIM);
    if (pCallbackArray.length < 2) return;
    if (pCallbackArray[0].length < 1) return;
    var pFlashId = pCallbackArray[0];
    var pCallback = pCallbackArray[1];
    var pExperience = document.getElementById(pFlashId);
    if (pExperience[pCallback] != null) {
        return pExperience[pCallback](BCXML.convertToXML(pParams, "js2flash"));
    }
};

APIModule.prototype.name = "APIModule";

APIModule.prototype.addEventListener = function(pEvent, pHandler) {
    var pNewHandler = APIModule.getHandler();
    this.handlers.push({handler:pHandler, bcHandler:pNewHandler, event:pEvent});
    window[pNewHandler] = pHandler;
    return this.callMethod("addEventListener", [pEvent, pNewHandler]);
};

APIModule.prototype.removeEventListener = function(pEvent, pHandler) {
    var pNum = this.handlers.length;
    for (var i = 0; i < pNum; i++) {
        if (this.handlers[i].event == pEvent && this.handlers[i].handler == pHandler) {
            var pBCHandler = this.handlers[i].bcHandler;
            this.handlers.splice(i, 1);
            break;
        }
    }
    if (pBCHandler == undefined) return;
    return this.callMethod("removeEventListener", [pEvent, pBCHandler]);
};

APIModule.prototype.callMethod = function(pMethod, pArguments) {
    var pArgs = [];
    for (var i = 0; i < pArguments.length; i++) pArgs.push(pArguments[i]);
    return APIModule.callFlash(this.callback, {module:this.name, method:pMethod, params:pArgs});
};

var BCXML = {};
BCXML.convertToXML = function(pObj, pNodeName) {
    if (pObj instanceof Function) return "";
      var pType = BCXML.getType(pObj);
      var pXML = "<" + pType.name + pNodeName + ">";
    if (pType.sub) {
          for (var i in pObj) {
             pXML += BCXML.convertToXML(pObj[i], i);
            }
    } else if (pType.name == "str") {
        pObj = BCXML.replaceEntities(pObj);
        pXML += pObj;
    } else {
        pXML += pObj;
    }
    pXML += "</" + pType.name + pNodeName + ">";
    return pXML;
};

BCXML.replaceEntities = function(pObj) {
    pObj = pObj.replace(new RegExp("&", "g"), "&amp;");
    pObj = pObj.replace(new RegExp("<", "g"), "&lt;");
    pObj = pObj.replace(new RegExp(">", "g"), "&gt;");
    return pObj;
};

BCXML.getType = function(pObj) {
    switch (typeof(pObj)) {
        case "boolean":
            return {name:"boo", type:Boolean, sub:false};
        case "string":
            return {name:"str", type:String, sub:false};
        case "number":
            return {name:"num", type:Number, sub:false};
        default:
            if (pObj instanceof Array) {
                return {name:"arr", type:Array, sub:true};
            } else {
                return {name:"obj", type:Object, sub:true};
            }
    }
};
BCAdvertisingEvent = {}

BCAdvertisingEvent.AD_COMPLETE = "adComplete";
BCAdvertisingEvent.AD_PAUSE = "adPause";
BCAdvertisingEvent.AD_PROGRESS = "adProgress";
BCAdvertisingEvent.AD_RESUME = "adResume";
BCAdvertisingEvent.AD_START = "adStart";
BCAdvertisingEvent.EXTERNAL_AD = "externalAd";

brightcove.modules[APIModules.ADVERTISING] = AdvertisingAPI;

function AdvertisingAPI(pExperience) {
	this.experience = pExperience;
	this.callback = pExperience.callback;
	this.name = APIModules.ADVERTISING;
}
var pttp = AdvertisingAPI.prototype = new APIModule();

pttp.showAd = function() {
	return this.callMethod("showAd", arguments);
};

pttp.resumeAfterExternalAd = function() {
	return this.callMethod("resumeAfterExternalAd", arguments);
};

pttp.getEnabledAdFormats = function() {
	return this.callMethod("getEnabledAdFormats", arguments);
};

pttp.enableAdFormats = function() {
	return this.callMethod("enableAdFormats", arguments);
};

pttp.enableExternalAds = function() {
	return this.callMethod("enableExternalAds", arguments);
};

pttp.enableOverrideAds = function() {
	return this.callMethod("enableOverrideAds", arguments);
};

pttp.getExternalAdsEnabled = function() {
	return this.callMethod("getExternalAdsEnabled", arguments);
};

pttp.getOverrideAdsEnabled = function() {
	return this.callMethod("getOverrideAdsEnabled", arguments);
};

pttp.disableForExternalAd = function() {
	return this.callMethod("disableForExternalAd", arguments);
};
pttp.getCurrentAdProperties = function() {
	return this.callMethod("getCurrentAdProperties", arguments);
};

pttp.showSponsorMessage = function() {
	return this.callMethod("showSponsorMessage", arguments);
};

pttp.getShowSponsorMessage = function() {
	return this.callMethod("getShowSponsorMessage", arguments);
};

pttp.allowThirdPartyControl = function() {
	return this.callMethod("allowThirdPartyControl", arguments);
};

pttp.setThirdPartyTime = function() {
	return this.callMethod("setThirdPartyTime", arguments);
};

pttp.getThirdPartyTime = function() {
	return this.callMethod("getThirdPartyTime", arguments);
};
BCContentEvent = {}

BCContentEvent.VIDEO_LOAD = "videoLoad";
BCContentEvent.PLAYLIST_LOAD = "playlistLoad";
BCContentEvent.PLAYLISTS_LOAD = "playlistsLoad";
BCContentEvent.CATALOG_LOAD = "catalogLoad";

brightcove.modules[APIModules.CONTENT] = ContentAPI;

function ContentAPI(pExperience) {
	this.experience = pExperience;
	this.callback = pExperience.callback;
	this.name = APIModules.CONTENT;
}
var pttp = ContentAPI.prototype = new APIModule();

pttp.getAllPlaylists = function() {
	return this.callMethod("getAllPlaylists", arguments);
};

pttp.getAllPlaylistIDs = function() {
	return this.callMethod("getAllPlaylistIDs", arguments);
};

pttp.getCatalog = function() {
	return this.callMethod("getCatalog", arguments);
};

pttp.getCatalogAsynch = function() {
	return this.callMethod("getCatalogAsynch", arguments);
};

pttp.getCatalogIDs = function() {
	return this.callMethod("getCatalogIDs", arguments);
};

pttp.getPlaylist = function() {
	return this.callMethod("getPlaylist", arguments);
};

pttp.getPlaylistAsynch = function() {
	return this.callMethod("getPlaylistAsynch", arguments);
};

pttp.getPlaylistsForCategory = function() {
	return this.callMethod("getPlaylistsForCategory", arguments);
};

pttp.getPlaylistsForCategoryAsynch = function() {
	return this.callMethod("getPlaylistsForCategoryAsynch", arguments);
};

pttp.getVideo = function() {
	return this.callMethod("getVideo", arguments);
};

pttp.getVideoAsynch = function() {
	return this.callMethod("getVideoAsynch", arguments);
};

pttp.purgeAllCatalogs = function() {
	return this.callMethod("purgeAllCatalogs", arguments);
};
	
pttp.purgeAllCategoryPlaylists = function() {
	return this.callMethod("purgeAllCategoryPlaylists", arguments);
};

pttp.purgeAllContent = function() {
	return this.callMethod("purgeAllContent", arguments);
};

pttp.purgeCatalog = function() {
	return this.callMethod("purgeCatalog", arguments);
};
	
pttp.purgePlaylist = function() {
	return this.callMethod("purgePlaylist", arguments);
};

pttp.purgePlaylists = function() {
	return this.callMethod("purgePlaylists", arguments);
};

pttp.purgePlaylistsForCategory = function() {
	return this.callMethod("purgePlaylistsForCategory", arguments);
};
	
pttp.purgeVideo = function() {
	return this.callMethod("purgeVideo", arguments);
};

pttp.purgeVideos = function() {
	return this.callMethod("purgeVideos", arguments);
};
BCCuePointEvent = {}

BCCuePointEvent.CUE = "cuePoint";

brightcove.modules[APIModules.CUE_POINTS] = CuePointsAPI;

function CuePointsAPI(pExperience) {
	this.experience = pExperience;
	this.callback = pExperience.callback;
	this.name = APIModules.CUE_POINTS;
}

var pttp = CuePointsAPI.prototype = new APIModule();

pttp.addCuePoints = function() {
	return this.callMethod("addCuePoints", arguments);
};

pttp.clearCodeCuePoints = function() {
	return this.callMethod("clearCodeCuePoints", arguments);
};

pttp.removeCodeCuePointsAtTime = function() {
	return this.callMethod("removeCodeCuePointsAtTime", arguments);
};

pttp.getCuePoints = function() {
	return this.callMethod("getCuePoints", arguments);
};
BCExperienceEvent = {}

BCExperienceEvent.CONTENT_LOAD = "contentLoad";
BCExperienceEvent.USER_MESSAGE = "userMessage";
BCExperienceEvent.TEMPLATE_READY = "templateReady";
BCExperienceEvent.ENTER_FULLSCREEN = "enterFullScreen";
BCExperienceEvent.EXIT_FULLSCREEN = "exitFullScreen";

brightcove.modules[APIModules.EXPERIENCE] = ExperienceAPI;

BCComponentModules = {};

function ExperienceAPI(pExperience) {
    this.experience = pExperience;
    this.callback = pExperience.callback;
    this.name = APIModules.EXPERIENCE;
}
var pttp = ExperienceAPI.prototype = new APIModule();

pttp.setSize = function() {
    return this.callMethod("setSize", arguments);
};

pttp.getReady = function() {
    return this.callMethod("getReady", arguments);
};

pttp.getWidth = function() {
    return this.callMethod("getWidth", arguments);
};

pttp.getHeight = function() {
    return this.callMethod("getHeight", arguments);
};

pttp.getEnabled = function() {
    return this.callMethod("getEnabled", arguments);
};

pttp.setEnabled = function() {
    return this.callMethod("setEnabled", arguments);
};

pttp.loadExperience = function() {
    return this.callMethod("loadExperience", arguments);
};

pttp.getLayout = function() {
    return this.callMethod("getLayout", arguments);
};

pttp.getAffiliateID = function() {
    return this.callMethod("getAffiliateID", arguments);
};

pttp.getExperienceID = function() {
    return this.callMethod("getExperienceID", arguments);
};

pttp.getPublisherID = function() {
    return this.callMethod("getPublisherID", arguments);
};

pttp.getExperienceURL = function() {
    return this.callMethod("getExperienceURL", arguments);
};

pttp.getReferrerURL = function() {
    return this.callMethod("getReferrerURL", arguments);
};

pttp.getConfiguredPropertiesForID = function() {
    return this.callMethod("getConfiguredPropertiesForID", arguments);
};

pttp.getLayoutRoot = function() {
    var pObj = this.callMethod("getLayoutRootJS", arguments);
    if (pObj != null) {
        if (BCComponentModules[pObj.elementName] != null) {
            return new BCComponentModules[pObj.elementName](this.experience, this.callback, pObj.elementID);
        }
    }
    return null;
};

pttp.getElementByID = function() {
    var pNodeName = this.callMethod("getJSElementByID", arguments);
    if (pNodeName != null) {
        if (pNodeName == "VideoPlayer" || pNodeName == "VideoDisplay") {
            var pPlayerAPI = this.experience.getModule(APIModules.VIDEO_PLAYER);
            pPlayerAPI.initializeComponentAPI();
            return pPlayerAPI;
        } else if (BCComponentModules[pNodeName] != null) {
            return new BCComponentModules[pNodeName](this.experience, this.callback, arguments[0]);
        }
    }
    return null;
};
BCMenuEvent = {}
BCMenuPage = {}

BCMenuEvent.MENU_PAGE_OPEN = "menuPageOpen";
BCMenuEvent.MENU_PAGE_CLOSE = "menuPageClose";
BCMenuEvent.OVERLAY_MENU_OPEN = "overlayMenuOpen";
BCMenuEvent.OVERLAY_MENU_CLOSE = "overlayMenuClose";
BCMenuEvent.ICON_MENU_OPEN = "iconMenuOpen";
BCMenuEvent.ICON_MENU_CLOSE = "iconMenuClose";
BCMenuEvent.SEND_EMAIL_CLICK = "sendEmailClick";
BCMenuEvent.BLOG_POST_CLICK = "blogPostClick";
BCMenuEvent.COPY_LINK = "copyLink";
BCMenuEvent.COPY_CODE = "copyCode";
BCMenuEvent.VIDEO_REQUEST = "videoRequest";

BCMenuPage.EMAIL = "Email";
BCMenuPage.LINK = "Link";
BCMenuPage.CODE = "Embed";
BCMenuPage.INFO = "Info";

brightcove.modules[APIModules.MENU] = MenuAPI;

function MenuAPI(pExperience) {
    this.experience = pExperience;
    this.callback = pExperience.callback;
    this.name = APIModules.MENU;
}
var pttp = MenuAPI.prototype = new APIModule();

pttp.showIconMenu = function() {
    return this.callMethod("showIconMenu", arguments);
};

pttp.isIconMenuShowing = function() {
    return this.callMethod("isIconMenuShowing", arguments);
};

pttp.showMenuPage = function() {
    return this.callMethod("showMenuPage", arguments);
};

pttp.closeMenuPage = function() {
    return this.callMethod("closeMenuPage", arguments);
};

pttp.isMenuPageShowing = function() {
    return this.callMethod("isMenuPageShowing", arguments);
};

pttp.isOverlayMenuShowing = function() {
    return this.callMethod("isOverlayMenuShowing", arguments);
};

pttp.removeOverlayMenu = function() {
    return this.callMethod("removeOverlayMenu", arguments);
};

pttp.getCurrentMenuPage = function() {
    return this.callMethod("getCurrentMenuPage", arguments);
};

pttp.setOverlayMenuVisible = function() {
    return this.callMethod("setOverlayMenuVisible", arguments);
};

pttp.getOverlayMenuVisible = function() {
    return this.callMethod("getOverlayMenuVisible", arguments);
};
BCSearchEvent = {};

BCSearchEvent.RESULT = "searchResult";
BCSearchEvent.ERROR = "searchError";

brightcove.modules[APIModules.SEARCH] = SearchAPI;

SortOrderType = {
    ASC: "ASC",
    DESC: "DESC"
};

SortByType = {
    PUBLISH_DATE: "PUBLISH_DATE",
    CREATION_DATE: "CREATION_DATE",
    MODIFIED_DATE: "MODIFIED_DATE",
    PLAYS_TOTAL: "PLAYS_TOTAL",
    PLAYS_TRAILING_WEEK: "PLAYS_TRAILING_WEEK"
};

function SearchAPI(pExperience) {
    this.experience = pExperience;
    this.callback = pExperience.callback;
    this.name = APIModules.SEARCH;
}

SearchAPI.searches = {};

var pttp = SearchAPI.prototype = new APIModule();

pttp.findRelatedVideos = function() {
    var pID = this.callMethod("findRelatedVideosJS", arguments);
    return this.getVideoSearch(pID);
};

pttp.findVideosByText = function() {
    var pID = this.callMethod("findVideosByTextJS", arguments);
    return this.getVideoSearch(pID);
};

pttp.findVideosByTags = function() {
    var pID = this.callMethod("findVideosByTagsJS", arguments);
    return this.getVideoSearch(pID);
};

pttp.findAllVideos = function() {
    var pID = this.callMethod("findAllVideosJS", arguments);
    return this.getVideoSearch(pID);
};

pttp.getVideoSearch = function(pID) {
    var pSearch = SearchAPI.searches[pID];
    if (pSearch == undefined) {
        pSearch = new VideoSearch(pID, this.callback);
        SearchAPI.searches[pID] = pSearch;
    }
    return pSearch;
};

pttp.getMaxItemsInMemory = function() {
    return this.callMethod("getMaxItemsInMemory", arguments);
};

pttp.setMaxItemsInMemory = function() {
    return this.callMethod("setMaxItemsInMemory", arguments);
};

function VideoSearch(pID, pCallback) {
    this.id = pID;
    this.name = APIModules.SEARCH;
    this.callback = pCallback;
}

pttp = VideoSearch.prototype = new APIModule();

pttp.id = -1;

pttp.callMethod = function(pMethod, pArguments) {
    if (pArguments == undefined) pArguments = [];
    var pArgs = [this.id];
    for (var i = 0; i < pArguments.length; i++) pArgs.push(pArguments[i]);
    return APIModule.callFlash(this.callback, {module:this.name, method:pMethod, params:pArgs});
};

pttp.getItems = function() {
    return this.callMethod("getItems", arguments);
};

pttp.getPage = function() {
    return this.callMethod("getPage", arguments);
};

pttp.getPageAsynch = function() {
    this.pageNumber = this.callMethod("getPageNumber");
    return this.callMethod("getPageAsynch", arguments);
};

pttp.getNextPage = function() {
    return this.callMethod("getNextPage", arguments);
};

pttp.getNextPageAsynch = function() {
    return this.callMethod("getNextPageAsynch", arguments);
};

pttp.getPreviousPage = function() {
    return this.callMethod("getPreviousPage", arguments);
};

pttp.getPreviousPageAsynch = function() {
    return this.callMethod("getPreviousPageAsynch", arguments);
};

pttp.getRow = function() {
    return this.callMethod("getRow", arguments);
};

pttp.getRowOnPage = function() {
    return this.callMethod("getRowOnPage", arguments);
};

pttp.purgeAll = function() {
    return this.callMethod("purgeAll", arguments);
};

pttp.purgePage = function() {
    return this.callMethod("purgePage", arguments);
};

pttp.getTotalRows = function() {
    return this.callMethod("getTotalRows", arguments);
};

pttp.getTotalPages = function() {
    return this.callMethod("getTotalPages", arguments);
};

pttp.getPageNumber = function() {
    return this.callMethod("getPageNumber", arguments);
};

pttp.getPageSize = function() {
    return this.callMethod("getPageSize", arguments);
};

pttp.getMaxPagesInMemory = function() {
    return this.callMethod("getMaxPagesInMemory", arguments);
};

pttp.setMaxPagesInMemory = function() {
    return this.callMethod("setMaxPagesInMemory", arguments);
};
BCSocialEvent = {}

BCSocialEvent.EMBED_CODE_RETRIEVED = "embedCodeRetrieved";

brightcove.modules[APIModules.SOCIAL] = SocialAPI;

function SocialAPI(pExperience) {
	this.experience = pExperience;
	this.callback = pExperience.callback;
	this.name = APIModules.SOCIAL;
}
var pttp = SocialAPI.prototype = new APIModule();

pttp.shareVideoViaEmail = function() {
	return this.callMethod("shareVideoViaEmail", arguments);
};

pttp.getEmbedCode = function() {
	return this.callMethod("getEmbedCode", arguments);
};

pttp.setLink = function() {
	return this.callMethod("setLink", arguments);
};

pttp.getLink = function() {
	return this.callMethod("getLink", arguments);
};

pttp.getRSS = function() {
	return this.callMethod("getRSS", arguments);
};
BCVideoEvent = {}

BCVideoEvent.END_BUFFER = "endBuffering";
BCVideoEvent.RENDITION_CHANGE = "renditionChange";
BCVideoEvent.VIDEO_CHANGE = "videoChange";
BCVideoEvent.VIDEO_COMPLETE = "videoComplete";
BCVideoEvent.VIDEO_CONNECT = "videoConnect";
BCVideoEvent.VIDEO_LOAD = "videoLoad";
BCVideoEvent.VIDEO_PROGRESS = "videoProgress";
BCVideoEvent.VIDEO_START = "videoStart";
BCVideoEvent.VIDEO_STOP = "videoStop";
BCVideoEvent.VIDEO_MUTE = "ui_mute"; // check this -- I don't think it corresponds to actual mute event
BCVideoEvent.VIDEO_SEEK = "seek";
BCVideoEvent.START_BUFFER = "startBuffering";
BCVideoEvent.STREAM_START = "streamStart";
BCVideoEvent.VOLUME_CHANGE = "volumeChange";

brightcove.modules[APIModules.VIDEO_PLAYER] = VideoPlayerAPI;

function VideoPlayerAPI(pExperience) {
    this.experience = pExperience;
    this.callback = pExperience.callback;
    this.name = APIModules.VIDEO_PLAYER;
}
var pttp = VideoPlayerAPI.prototype = new APIModule();

pttp.initializeComponentAPI = function() {
    return this.callMethod("initializeComponentAPI", arguments);
};

pttp.getComponentAPI = function(pElementName, pElementID) {
    if (pElementName != null) {
        if (pElementName == "VideoPlayer" || pElementName == "VideoDisplay") {
            var pPlayerAPI = this.experience.getModule(APIModules.VIDEO_PLAYER);
            pPlayerAPI.initializeComponentAPI();
            return pPlayerAPI;
        } else if (BCComponentModules[pElementName] != null) {
            return new BCComponentModules[pElementName](this.experience, this.callback, pElementID);
        }
    }
    return null;
};

pttp.setVideoFilter = function() {
    return this.callMethod("setVideoFilter", arguments);
};

pttp.getCurrentVideo = function() {
    return this.callMethod("getCurrentVideo", arguments);
};

pttp.getCurrentRendition = function() {
    return this.callMethod("getCurrentRendition", arguments);
};

pttp.loadVideo = function() {
    return this.callMethod("loadVideo", arguments);
};
        
pttp.cueVideo = function() {
    return this.callMethod("cueVideo", arguments);
};

pttp.play = function() {
    return this.callMethod("play", arguments);
};
        
pttp.stop = function() {
    return this.callMethod("stop", arguments);
};
    
pttp.pause = function() {
    return this.callMethod("pause", arguments);
};
     
pttp.seek = function() {
    return this.callMethod("seek", arguments);
};
        
pttp.mute = function() {
    return this.callMethod("mute", arguments);
};

pttp.setVolume = function() {
    return this.callMethod("setVolume", arguments);
};
    
pttp.getVolume = function() {
    return this.callMethod("getVolume", arguments);
};
    
pttp.showVolumeControls = function() {
    return this.callMethod("showVolumeControls", arguments);
};
    
pttp.getVideoPosition = function() {
    return this.callMethod("getVideoPosition", arguments);
};
    
pttp.getVideoDuration = function() {
    return this.callMethod("getVideoDuration", arguments);
};

pttp.getVideoBytesLoaded = function() {
    return this.callMethod("getVideoBytesLoaded", arguments);
};
        
pttp.getVideoBytesTotal = function() {
    return this.callMethod("getVideoBytesTotal", arguments);
};
    
pttp.isPlaying = function() {
    return this.callMethod("isPlaying", arguments);
};
    
pttp.isMuted = function() {
    return this.callMethod("isMuted", arguments);
};

pttp.getContentTypeDisplayed = function() {
    return this.callMethod("getContentTypeDisplayed", arguments);
};

pttp.setSize = function() {
    return this.callMethod("setSize", arguments);
};

pttp.move = function() {
    return this.callMethod("move", arguments);
};

pttp.getX = function() {
    return this.callMethod("getX", arguments);
};

pttp.getY = function() {
    return this.callMethod("getY", arguments);
};

pttp.getDefinition = function() {
    return this.callMethod("getDefinition", arguments);
};

pttp.getID = function() {
    return this.callMethod("getID", arguments);
};

pttp.getWidth = function() {
    return this.callMethod("getWidth", arguments);
};

pttp.getHeight = function() {
    return this.callMethod("getHeight", arguments);
};

pttp.getEnabled = function() {
    return this.callMethod("getEnabled", arguments);
};

pttp.setStyles = function() {
    return this.callMethod("setStyles", arguments);
};

pttp.setEnabled = function() {
    return this.callMethod("setEnabled", arguments);
};

pttp.getVisible = function() {
    return this.callMethod("getVisible", arguments);
};

pttp.setVisible = function() {
    return this.callMethod("setVisible", arguments);
};

pttp.getAlpha = function() {
    return this.callMethod("getAlpha", arguments);
};

pttp.setAlpha = function() {
    return this.callMethod("setAlpha", arguments);
};

pttp.getBlendMode = function() {
    return this.callMethod("getBlendMode", arguments);
};

pttp.setBlendMode = function() {
    return this.callMethod("setBlendMode", arguments);
};

pttp.getRotation = function() {
    return this.callMethod("getRotation", arguments);
};

pttp.setRotation = function() {
    return this.callMethod("setRotation", arguments);
};

pttp.getIndex = function() {
    return this.callMethod("getIndex", arguments);
};

pttp.getContainer = function() {
    var pObj = this.callMethod("getContainerJS", arguments);
    if (pObj) {
        return this.getComponentAPI(pObj.elementName, pObj.elementID);
    }
    return null;
};

pttp.getNextSibling = function() {
    var pObj = this.callMethod("getNextSiblingJS", arguments);
    if (pObj) {
        return this.getComponentAPI(pObj.elementName, pObj.elementID);
    }
    return null;
};

pttp.getPreviousSibling = function() {
    var pObj = this.callMethod("getPreviousSiblingJS", arguments);
    if (pObj) {
        return this.getComponentAPI(pObj.elementName, pObj.elementID);
    }
    return null;
};

var bcRenditionSelectionCallback;
pttp.setRenditionSelectionCallback = function(pSelector) {
    bcRenditionSelectionCallback = pSelector;
    return this.callMethod("setRenditionSelectionCallbackJS", ["bcCallRenditionSelectionCallback"]);
};
function bcCallRenditionSelectionCallback(pContext) {
    return bcRenditionSelectionCallback(pContext);
};

function ComponentAPI() {
    this.name = APIModules.EXPERIENCE;
}
var pttp = ComponentAPI.prototype = new APIModule();

pttp.callMethod = function(pMethod, pArguments) {
    var pArgs = [];
    for (var i = 0; i < pArguments.length; i++) pArgs.push(pArguments[i]);
    return APIModule.callFlash(this.callback, {module:this.name, element:this.elementID, method:"getComponentAPI", componentMethod:pMethod, params:pArgs});
};

pttp.getComponentAPI = function(pElementName, pElementID) {
    if (pElementName != null) {
        if (pElementName == "VideoPlayer") {
            var pPlayerAPI = this.experience.getModule(APIModules.VIDEO_PLAYER);
            pPlayerAPI.initializeComponentAPI();
            return pPlayerAPI;
        } else if (BCComponentModules[pElementName] != null) {
            return new BCComponentModules[pElementName](this.experience, this.callback, pElementID);
        }
    }
    return null;
};

pttp.setSize = function() {
    return this.callMethod("setSize", arguments);
};

pttp.move = function() {
    return this.callMethod("move", arguments);
};

pttp.getX = function() {
    return this.callMethod("getX", arguments);
};

pttp.getY = function() {
    return this.callMethod("getY", arguments);
};

pttp.getDefinition = function() {
    return this.callMethod("getDefinition", arguments);
};

pttp.getID = function() {
    return this.callMethod("getID", arguments);
};

pttp.getWidth = function() {
    return this.callMethod("getWidth", arguments);
};

pttp.getHeight = function() {
    return this.callMethod("getHeight", arguments);
};

pttp.getIndex = function() {
    return this.callMethod("getIndex", arguments);
};

pttp.getContainer = function() {
    var pObj = this.callMethod("getContainerJS", arguments);
    if (pObj) {
        return this.getComponentAPI(pObj.elementName, pObj.elementID);
    }
    return null;
};

pttp.getNextSibling = function() {
    var pObj = this.callMethod("getNextSiblingJS", arguments);
    if (pObj) {
        return this.getComponentAPI(pObj.elementName, pObj.elementID);
    }
    return null;
};

pttp.getPreviousSibling = function() {
    var pObj = this.callMethod("getPreviousSiblingJS", arguments);
    if (pObj) {
        return this.getComponentAPI(pObj.elementName, pObj.elementID);
    }
    return null;
};
function UIObjectAPI(pCallback, pElementID) {
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = UIObjectAPI.prototype = new ComponentAPI();

pttp.getEnabled = function() {
    return this.callMethod("getEnabled", arguments);
};

pttp.setEnabled = function() {
    return this.callMethod("setEnabled", arguments);
};

pttp.getVisible = function() {
    return this.callMethod("getVisible", arguments);
};

pttp.setVisible = function() {
    return this.callMethod("setVisible", arguments);
};

pttp.getAlpha = function() {
    return this.callMethod("getAlpha", arguments);
};

pttp.setAlpha = function() {
    return this.callMethod("setAlpha", arguments);
};

pttp.getBlendMode = function() {
    return this.callMethod("getBlendMode", arguments);
};

pttp.setBlendMode = function() {
    return this.callMethod("setBlendMode", arguments);
};

pttp.getRotation = function() {
    return this.callMethod("getRotation", arguments);
};

pttp.setRotation = function() {
    return this.callMethod("setRotation", arguments);
};

pttp.setStyles = function() {
    return this.callMethod("setStyles", arguments);
};

pttp.getCSS = function() {
    return this.callMethod("getCSS", arguments);
};
BCComponentModules["Banner"] = BannerAPI;

function BannerAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = BannerAPI.prototype = new UIObjectAPI();
BCComponentModules["Button"] = ButtonAPI;

function ButtonAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = ButtonAPI.prototype = new UIObjectAPI();

pttp.getLabel = function() {
    return this.callMethod("getLabel", arguments);
};

pttp.setLabel = function() {
    return this.callMethod("setLabel", arguments);
};

pttp.setFont = function() {
    return this.callMethod("setFont", arguments);
};

pttp.getFont = function() {
    return this.callMethod("getFont", arguments);
};

pttp.setLabelSize = function() {
    return this.callMethod("setLabelSize", arguments);
};

pttp.getLabelSize = function() {
    return this.callMethod("getLabelSize", arguments);
};

pttp.getAutoSize = function() {
    return this.callMethod("getAutoSize", arguments);
};

pttp.setAutoSize = function() {
    return this.callMethod("setAutoSize", arguments);
};

pttp.getTruncateLabel = function() {
    return this.callMethod("getTruncateLabel", arguments);
};

pttp.setTruncateLabel = function() {
    return this.callMethod("setTruncateLabel", arguments);
};

pttp.getMultiline = function() {
    return this.callMethod("getMultiline", arguments);
};

pttp.setMultiline = function() {
    return this.callMethod("setMultiline", arguments);
};

pttp.getIsTruncated = function() {
    return this.callMethod("getIsTruncated", arguments);
};

pttp.getLabelWidth = function() {
    return this.callMethod("getLabelWidth", arguments);
};

pttp.getShowBack = function() {
    return this.callMethod("getShowBack", arguments);
};

pttp.setShowBack = function() {
    return this.callMethod("setShowBack", arguments);
};

pttp.getTooltip = function() {
    return this.callMethod("getTooltip", arguments);
};

pttp.setTooltip = function() {
    return this.callMethod("setTooltip", arguments);
};

pttp.getIconOffsetX = function() {
    return this.callMethod("getIconOffsetX", arguments);
};

pttp.setIconOffsetX = function() {
    return this.callMethod("setIconOffsetX", arguments);
};

pttp.getIconOffsetY = function() {
    return this.callMethod("getIconOffsetY", arguments);
};

pttp.setIconOffsetY = function() {
    return this.callMethod("setIconOffsetY", arguments);
};

pttp.getLabelOffsetX = function() {
    return this.callMethod("getLabelOffsetX", arguments);
};

pttp.setLabelOffsetX = function() {
    return this.callMethod("setLabelOffsetX", arguments);
};

pttp.getLabelOffsetY = function() {
    return this.callMethod("getLabelOffsetY", arguments);
};

pttp.setLabelOffsetY = function() {
    return this.callMethod("setLabelOffsetY", arguments);
};

pttp.getLabelBuffer = function() {
    return this.callMethod("getLabelBuffer", arguments);
};

pttp.setLabelBuffer = function() {
    return this.callMethod("setLabelBuffer", arguments);
};

pttp.getIconAlignmentH = function() {
    return this.callMethod("getIconAlignmentH", arguments);
};

pttp.setIconAlignmentH = function() {
    return this.callMethod("setIconAlignmentH", arguments);
};

pttp.getIconAlignmentV = function() {
    return this.callMethod("getIconAlignmentV", arguments);
};

pttp.setIconAlignmentV = function() {
    return this.callMethod("setIconAlignmentV", arguments);
};

pttp.getLabelAlignmentH = function() {
    return this.callMethod("getLabelAlignmentH", arguments);
};

pttp.setLabelAlignmentH = function() {
    return this.callMethod("setLabelAlignmentH", arguments);
};

pttp.getLabelAlignmentV = function() {
    return this.callMethod("getLabelAlignmentV", arguments);
};

pttp.setLabelAlignmentV = function() {
    return this.callMethod("setLabelAlignmentV", arguments);
};

pttp.getIconName = function() {
    return this.callMethod("getIconName", arguments);
};

pttp.setIconName = function() {
    return this.callMethod("setIconName", arguments);
};
BCComponentModules["ComboBox"] = ComboBoxAPI;

function ComboBoxAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = ComboBoxAPI.prototype = new UIObjectAPI();

pttp.setSelectedIndex = function() {
    return this.callMethod("setSelectedIndex", arguments);
};

pttp.getSelectedIndex = function() {
    return this.callMethod("getSelectedIndex", arguments);
};

pttp.getSelectedData = function() {
    return this.callMethod("getSelectedData", arguments);
};

pttp.getDataAtIndex = function() {
    return this.callMethod("getDataAtIndex", arguments);
};

pttp.getData = function() {
    return this.callMethod("getData", arguments);
};

pttp.setData = function() {
    return this.callMethod("setData", arguments);
};

pttp.getNumItems = function() {
    return this.callMethod("getNumItems", arguments);
};

pttp.getScrollerWidth = function() {
    return this.callMethod("getScrollerWidth", arguments);
};

pttp.setScrollerWidth = function() {
    return this.callMethod("setScrollerWidth", arguments);
};

pttp.getScrollerInset = function() {
    return this.callMethod("getScrollerInset", arguments);
};

pttp.setScrollerInset = function() {
    return this.callMethod("setScrollerInset", arguments);
};

pttp.getItemLeading = function() {
    return this.callMethod("getItemLeading", arguments);
};

pttp.setItemLeading = function() {
    return this.callMethod("setItemLeading", arguments);
};

pttp.getItemInsetH = function() {
    return this.callMethod("getItemInsetH", arguments);
};

pttp.setItemInsetH = function() {
    return this.callMethod("setItemInsetH", arguments);
};

pttp.getItemInsetV = function() {
    return this.callMethod("getItemInsetV", arguments);
};

pttp.setItemInsetV = function() {
    return this.callMethod("setItemInsetV", arguments);
};

pttp.getRowHeight = function() {
    return this.callMethod("getRowHeight", arguments);
};

pttp.setRowHeight = function() {
    return this.callMethod("setRowHeight", arguments);
};

pttp.getLabelBufferLeft = function() {
    return this.callMethod("getLabelBufferLeft", arguments);
};

pttp.setLabelBufferLeft = function() {
    return this.callMethod("setLabelBufferLeft", arguments);
};

pttp.getLabelBufferRight = function() {
    return this.callMethod("getLabelBufferRight", arguments);
};

pttp.setLabelBufferRight = function() {
    return this.callMethod("setLabelBufferRight", arguments);
};

pttp.getLabelBufferTop = function() {
    return this.callMethod("getLabelBufferTop", arguments);
};

pttp.setLabelBufferTop = function() {
    return this.callMethod("setLabelBufferTop", arguments);
};

pttp.getAnimated = function() {
    return this.callMethod("getAnimated", arguments);
};

pttp.setAnimated = function() {
    return this.callMethod("setAnimated", arguments);
};

pttp.getLabelField = function() {
    return this.callMethod("getLabelField", arguments);
};

pttp.setLabelField = function() {
    return this.callMethod("setLabelField", arguments);
};

pttp.getLabel = function() {
    return this.callMethod("getLabel", arguments);
};

pttp.setLabel = function() {
    return this.callMethod("setLabel", arguments);
};
BCComponentModules["ExpandingBanner"] = ExpandingBannerAPI;

function ExpandingBannerAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = ExpandingBannerAPI.prototype = new UIObjectAPI();

pttp.expand = function() {
    return this.callMethod("expand", arguments);
};

pttp.contract = function() {
    return this.callMethod("contract", arguments);
};

pttp.getExpanded = function() {
    return this.callMethod("getExpanded", arguments);
};

pttp.synchBannerWithExternal = function() {
    return this.callMethod("synchBannerWithExternal", arguments);
};
BCComponentModules["Image"] = ImageAPI;

function ImageAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = ImageAPI.prototype = new UIObjectAPI();

pttp.setSource = function() {
    return this.callMethod("setSource", arguments);
};

pttp.getSource = function() {
    return this.callMethod("getSource", arguments);
};

pttp.getScaleMode = function() {
    return this.callMethod("getScaleMode", arguments);
};

pttp.setScaleMode = function() {
    return this.callMethod("setScaleMode", arguments);
};

pttp.getHAlign = function() {
    return this.callMethod("getHAlign", arguments);
};

pttp.setHAlign = function() {
    return this.callMethod("setHAlign", arguments);
};

pttp.getVAlign = function() {
    return this.callMethod("getVAlign", arguments);
};

pttp.setVAlign = function() {
    return this.callMethod("setVAlign", arguments);
};

pttp.getURL = function() {
    return this.callMethod("getURL", arguments);
};

pttp.setURL = function() {
    return this.callMethod("setURL", arguments);
};

pttp.getTooltip = function() {
    return this.callMethod("getTooltip", arguments);
};

pttp.setTooltip = function() {
    return this.callMethod("setTooltip", arguments);
};

pttp.getInset = function() {
    return this.callMethod("getInset", arguments);
};

pttp.setInset = function() {
    return this.callMethod("setInset", arguments);
};

pttp.getContentWidth = function() {
    return this.callMethod("getContentWidth", arguments);
};

pttp.getContentHeight = function() {
    return this.callMethod("getContentHeight", arguments);
};
BCComponentModules["Label"] = LabelAPI;

function LabelAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = LabelAPI.prototype = new UIObjectAPI();

pttp.setText = function() {
    return this.callMethod("setText", arguments);
};

pttp.getText = function() {
    return this.callMethod("getText", arguments);
};

pttp.setType = function() {
    return this.callMethod("setType", arguments);
};

pttp.getType = function() {
    return this.callMethod("getType", arguments);
};

pttp.setFont = function() {
    return this.callMethod("setFont", arguments);
};

pttp.getFont = function() {
    return this.callMethod("getFont", arguments);
};

pttp.setColor = function() {
    return this.callMethod("setColor", arguments);
};

pttp.getColor = function() {
    return this.callMethod("getColor", arguments);
};

pttp.setTextSize = function() {
    return this.callMethod("setTextSize", arguments);
};

pttp.getTextSize = function() {
    return this.callMethod("getTextSize", arguments);
};

pttp.getHAlign = function() {
    return this.callMethod("getHAlign", arguments);
};

pttp.setHAlign = function() {
    return this.callMethod("setHAlign", arguments);
};

pttp.getVAlign = function() {
    return this.callMethod("getVAlign", arguments);
};

pttp.setVAlign = function() {
    return this.callMethod("setVAlign", arguments);
};

pttp.setUnderline = function() {
    return this.callMethod("setUnderline", arguments);
};

pttp.getUnderline = function() {
    return this.callMethod("getUnderline", arguments);
};

pttp.setHTMLEnabled = function() {
    return this.callMethod("setHTMLEnabled", arguments);
};

pttp.getHTMLEnabled = function() {
    return this.callMethod("getHTMLEnabled", arguments);
};

pttp.setAutoSize = function() {
    return this.callMethod("setAutoSize", arguments);
};

pttp.getAutoSize = function() {
    return this.callMethod("getAutoSize", arguments);
};

pttp.setTruncate = function() {
    return this.callMethod("setTruncate", arguments);
};

pttp.getTruncate = function() {
    return this.callMethod("getTruncate", arguments);
};

pttp.setMultiline = function() {
    return this.callMethod("setMultiline", arguments);
};

pttp.getMultiline = function() {
    return this.callMethod("getMultiline", arguments);
};

pttp.getIsTruncated = function() {
    return this.callMethod("getIsTruncated", arguments);
};

pttp.getTextWidth = function() {
    return this.callMethod("getTextWidth", arguments);
};

pttp.getTextHeight = function() {
    return this.callMethod("getTextHeight", arguments);
};
BCComponentModules["LayoutBox"] = LayoutBoxAPI;

function LayoutBoxAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = LayoutBoxAPI.prototype = new ComponentAPI();

pttp.getHAlign = function() {
    return this.callMethod("getHAlign", arguments);
};

pttp.setHAlign = function() {
    return this.callMethod("setHAlign", arguments);
};

pttp.getVAlign = function() {
    return this.callMethod("getVAlign", arguments);
};

pttp.setVAlign = function() {
    return this.callMethod("setVAlign", arguments);
};

pttp.getBackgroundColor = function() {
    return this.callMethod("getBackgroundColor", arguments);
};

pttp.setBackgroundColor = function() {
    return this.callMethod("setBackgroundColor", arguments);
};

pttp.getBackgroundImage = function() {
    return this.callMethod("getBackgroundImage", arguments);
};

pttp.setBackgroundImage = function() {
    return this.callMethod("setBackgroundImage", arguments);
};

pttp.getGutter = function() {
    return this.callMethod("getGutter", arguments);
};

pttp.setGutter = function() {
    return this.callMethod("setGutter", arguments);
};

pttp.getPadding = function() {
    return this.callMethod("getPadding", arguments);
};

pttp.setPadding = function() {
    return this.callMethod("setPadding", arguments);
};

pttp.appendChild = function() {
    return this.callMethod("appendChild", arguments);
};

pttp.insertChildAt = function() {
    return this.callMethod("insertChildAt", arguments);
};

pttp.removeChildByID = function() {
    return this.callMethod("removeChildByID", arguments);
};

pttp.getNumChildren = function() {
    return this.callMethod("getNumChildren", arguments);
};

pttp.removeChildAt = function() {
    return this.callMethod("removeChildAt", arguments);
};

pttp.getChildAt = function() {
    var pObj = this.callMethod("getChildAtJS", arguments);
    if (pObj) {
        return this.getComponentAPI(pObj.elementName, pObj.elementID);
    }
    return null;
};
BCComponentModules["Link"] = LinkAPI;

function LinkAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = LinkAPI.prototype = new UIObjectAPI();

pttp.setText = function() {
    return this.callMethod("setText", arguments);
};

pttp.getText = function() {
    return this.callMethod("getText", arguments);
};

pttp.setAutoSize = function() {
    return this.callMethod("setAutoSize", arguments);
};

pttp.getAutoSize = function() {
    return this.callMethod("getAutoSize", arguments);
};

pttp.setFont = function() {
    return this.callMethod("setFont", arguments);
};

pttp.getFont = function() {
    return this.callMethod("getFont", arguments);
};

pttp.setTextSize = function() {
    return this.callMethod("setTextSize", arguments);
};

pttp.getTextSize = function() {
    return this.callMethod("getTextSize", arguments);
};

pttp.getHAlign = function() {
    return this.callMethod("getHAlign", arguments);
};

pttp.setHAlign = function() {
    return this.callMethod("setHAlign", arguments);
};

pttp.getVAlign = function() {
    return this.callMethod("getVAlign", arguments);
};

pttp.setVAlign = function() {
    return this.callMethod("setVAlign", arguments);
};

pttp.setMultiline = function() {
    return this.callMethod("setMultiline", arguments);
};

pttp.getMultiline = function() {
    return this.callMethod("getMultiline", arguments);
};

pttp.getURL = function() {
    return this.callMethod("getURL", arguments);
};

pttp.setURL = function() {
    return this.callMethod("setURL", arguments);
};

pttp.getTooltip = function() {
    return this.callMethod("getTooltip", arguments);
};

pttp.setTooltip = function() {
    return this.callMethod("setTooltip", arguments);
};
BCComponentModules["List"] = ListAPI;

function ListAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = ListAPI.prototype = new UIObjectAPI();

pttp.setSelectedIndex = function() {
    return this.callMethod("setSelectedIndex", arguments);
};

pttp.getSelectedIndex = function() {
    return this.callMethod("getSelectedIndex", arguments);
};

pttp.scrollTo = function() {
    return this.callMethod("scrollTo", arguments);
};

pttp.getSelectedData = function() {
    return this.callMethod("getSelectedData", arguments);
};

pttp.getDataAtIndex = function() {
    return this.callMethod("getDataAtIndex", arguments);
};

pttp.getData = function() {
    return this.callMethod("getData", arguments);
};

pttp.setData = function() {
    return this.callMethod("setData", arguments);
};

pttp.showPlaylist = function() {
    return this.callMethod("showPlaylist", arguments);
};

pttp.getNumItems = function() {
    return this.callMethod("getNumItems", arguments);
};

pttp.getAutomaticAdvance = function() {
    return this.callMethod("getAutomaticAdvance", arguments);
};

pttp.setAutomaticAdvance = function() {
    return this.callMethod("setAutomaticAdvance", arguments);
};

pttp.getScrollerWidth = function() {
    return this.callMethod("getScrollerWidth", arguments);
};

pttp.setScrollerWidth = function() {
    return this.callMethod("setScrollerWidth", arguments);
};

pttp.getScrollerInset = function() {
    return this.callMethod("getScrollerInset", arguments);
};

pttp.setScrollerInset = function() {
    return this.callMethod("setScrollerInset", arguments);
};

pttp.getItemLeading = function() {
    return this.callMethod("getItemLeading", arguments);
};

pttp.setItemLeading = function() {
    return this.callMethod("setItemLeading", arguments);
};

pttp.getItemInsetH = function() {
    return this.callMethod("getItemInsetH", arguments);
};

pttp.setItemInsetH = function() {
    return this.callMethod("setItemInsetH", arguments);
};

pttp.getItemInsetV = function() {
    return this.callMethod("getItemInsetV", arguments);
};

pttp.setItemInsetV = function() {
    return this.callMethod("setItemInsetV", arguments);
};

pttp.getRowHeight = function() {
    return this.callMethod("getRowHeight", arguments);
};

pttp.setRowHeight = function() {
    return this.callMethod("setRowHeight", arguments);
};
BCComponentModules["MediaControls"] = MediaControlsAPI;

function MediaControlsAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = MediaControlsAPI.prototype = new LayoutBoxAPI();
BCComponentModules["Playhead"] = PlayheadAPI;

function PlayheadAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = PlayheadAPI.prototype = new UIObjectAPI();

pttp.getSliderWidth = function() {
    return this.callMethod("getSliderWidth", arguments);
};

pttp.setSliderWidth = function() {
    return this.callMethod("setSliderWidth", arguments);
};
BCComponentModules["SWFLoader"] = SWFLoaderAPI;

function SWFLoaderAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp =SWFLoaderAPI.prototype = new UIObjectAPI();

pttp.setSource = function() {
    return this.callMethod("setSource", arguments);
};

pttp.getSource = function() {
    return this.callMethod("getSource", arguments);
};

pttp.callSWFMethod = function() {
    return this.callMethod("callSWFMethod", arguments);
};
BCComponentModules["TabBar"] = TabBarAPI;

function TabBarAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = TabBarAPI.prototype = new UIObjectAPI();

pttp.setSelectedIndex = function() {
    return this.callMethod("setSelectedIndex", arguments);
};

pttp.getSelectedIndex = function() {
    return this.callMethod("getSelectedIndex", arguments);
};

pttp.getSelectedData = function() {
    return this.callMethod("getSelectedData", arguments);
};

pttp.getDataAtIndex = function() {
    return this.callMethod("getDataAtIndex", arguments);
};

pttp.getData = function() {
    return this.callMethod("getData", arguments);
};

pttp.setData = function() {
    return this.callMethod("setData", arguments);
};

pttp.getNumItems = function() {
    return this.callMethod("getNumItems", arguments);
};

pttp.getAutoSizeTabs = function() {
    return this.callMethod("getAutoSizeTabs", arguments);
};

pttp.setAutoSizeTabs = function() {
    return this.callMethod("setAutoSizeTabs", arguments);
};

pttp.getTabWidth = function() {
    return this.callMethod("getTabWidth", arguments);
};

pttp.setTabWidth = function() {
    return this.callMethod("setTabWidth", arguments);
};

pttp.getLabelBuffer = function() {
    return this.callMethod("getLabelBuffer", arguments);
};

pttp.setLabelBuffer = function() {
    return this.callMethod("setLabelBuffer", arguments);
};

pttp.getLabelField = function() {
    return this.callMethod("getLabelField", arguments);
};

pttp.setLabelField = function() {
    return this.callMethod("setLabelField", arguments);
};

pttp.getTabPadding = function() {
    return this.callMethod("getTabPadding", arguments);
};

pttp.setTabPadding = function() {
    return this.callMethod("setTabPadding", arguments);
};

pttp.getTabAlign = function() {
    return this.callMethod("getTabAlign", arguments);
};

pttp.setTabAlign = function() {
    return this.callMethod("setTabAlign", arguments);
};

pttp.getIncludeMenu = function() {
    return this.callMethod("getIncludeMenu", arguments);
};

pttp.setIncludeMenu = function() {
    return this.callMethod("setIncludeMenu", arguments);
};

pttp.getMenuWidth = function() {
    return this.callMethod("getMenuWidth", arguments);
};

pttp.setMenuWidth = function() {
    return this.callMethod("setMenuWidth", arguments);
};

pttp.getMenuRowHeight = function() {
    return this.callMethod("getMenuRowHeight", arguments);
};

pttp.setMenuRowHeight = function() {
    return this.callMethod("setMenuRowHeight", arguments);
};

pttp.getMenuItemInset = function() {
    return this.callMethod("getMenuItemInset", arguments);
};

pttp.setMenuItemInset = function() {
    return this.callMethod("setMenuItemInset", arguments);
};

pttp.getMaxMenuRows = function() {
    return this.callMethod("getMaxMenuRows", arguments);
};

pttp.setMaxMenuRows = function() {
    return this.callMethod("setMaxMenuRows", arguments);
};

pttp.getHideSingleTab = function() {
    return this.callMethod("getHideSingleTab", arguments);
};

pttp.setHideSingleTab = function() {
    return this.callMethod("setHideSingleTab", arguments);
};

pttp.appendTab = function() {
    return this.callMethod("appendTab", arguments);
};

pttp.insertTabAt = function() {
    return this.callMethod("insertTabAt", arguments);
};

pttp.replaceTabAt = function() {
    return this.callMethod("replaceTabAt", arguments);
};

pttp.removeTabAt = function() {
    return this.callMethod("removeTabAt", arguments);
};
BCComponentModules["TileList"] = TileListAPI;

function TileListAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = TileListAPI.prototype = new UIObjectAPI();

pttp.setSelectedIndex = function() {
    return this.callMethod("setSelectedIndex", arguments);
};

pttp.getSelectedIndex = function() {
    return this.callMethod("getSelectedIndex", arguments);
};

pttp.getSelectedData = function() {
    return this.callMethod("getSelectedData", arguments);
};

pttp.getDataAtIndex = function() {
    return this.callMethod("getDataAtIndex", arguments);
};

pttp.getData = function() {
    return this.callMethod("getData", arguments);
};

pttp.setData = function() {
    return this.callMethod("setData", arguments);
};

pttp.showPlaylist = function() {
    return this.callMethod("showPlaylist", arguments);
};

pttp.getNumItems = function() {
    return this.callMethod("getNumItems", arguments);
};

pttp.getAutomaticAdvance = function() {
    return this.callMethod("getAutomaticAdvance", arguments);
};

pttp.setAutomaticAdvance = function() {
    return this.callMethod("setAutomaticAdvance", arguments);
};

pttp.getButtonOffsetX = function() {
    return this.callMethod("getButtonOffsetX", arguments);
};

pttp.setButtonOffsetX = function() {
    return this.callMethod("setButtonOffsetX", arguments);
};

pttp.getButtonOffsetY = function() {
    return this.callMethod("getButtonOffsetY", arguments);
};

pttp.setButtonOffsetY = function() {
    return this.callMethod("setButtonOffsetY", arguments);
};

pttp.getButtonSize = function() {
    return this.callMethod("getButtonSize", arguments);
};

pttp.setButtonSize = function() {
    return this.callMethod("setButtonSize", arguments);
};

pttp.getNumRows = function() {
    return this.callMethod("getNumRows", arguments);
};

pttp.setNumRows = function() {
    return this.callMethod("setNumRows", arguments);
};

pttp.getNumColumns = function() {
    return this.callMethod("getNumColumns", arguments);
};

pttp.setNumColumns = function() {
    return this.callMethod("setNumColumns", arguments);
};

pttp.getRowHeight = function() {
    return this.callMethod("getRowHeight", arguments);
};

pttp.setRowHeight = function() {
    return this.callMethod("setRowHeight", arguments);
};

pttp.getColumnWidth = function() {
    return this.callMethod("getColumnWidth", arguments);
};

pttp.setColumnWidth = function() {
    return this.callMethod("setColumnWidth", arguments);
};

pttp.getColumnGutter = function() {
    return this.callMethod("getColumnGutter", arguments);
};

pttp.setColumnGutter = function() {
    return this.callMethod("setColumnGutter", arguments);
};

pttp.getRowGutter = function() {
    return this.callMethod("getRowGutter", arguments);
};

pttp.setRowGutter = function() {
    return this.callMethod("setRowGutter", arguments);
};

pttp.getContentInsetV = function() {
    return this.callMethod("getContentInsetV", arguments);
};

pttp.setContentInsetV = function() {
    return this.callMethod("setContentInsetV", arguments);
};

pttp.getContentInsetH = function() {
    return this.callMethod("getContentInsetH", arguments);
};

pttp.setContentInsetH = function() {
    return this.callMethod("setContentInsetH", arguments);
};

pttp.setScrollDirection = function() {
    return this.callMethod("setScrollDirection", arguments);
};

pttp.getScrollDirection = function() {
    return this.callMethod("getScrollDirection", arguments);
};

pttp.getAnimationType = function() {
    return this.callMethod("getAnimationType", arguments);
};

pttp.setAnimationType = function() {
    return this.callMethod("setAnimationType", arguments);
};

pttp.getUseBlur = function() {
    return this.callMethod("getUseBlur", arguments);
};

pttp.setUseBlur = function() {
    return this.callMethod("setUseBlur", arguments);
};

pttp.showPage = function() {
    return this.callMethod("showPage", arguments);
};

pttp.showNextPage = function() {
    return this.callMethod("showNextPage", arguments);
};

pttp.showPreviousPage = function() {
    return this.callMethod("showPreviousPage", arguments);
};

pttp.getPageIndex = function() {
    return this.callMethod("getPageIndex", arguments);
};

pttp.getNumPages = function() {
    return this.callMethod("getNumPages", arguments);
};

pttp.getCenterContent = function() {
    return this.callMethod("getCenterContent", arguments);
};

pttp.setCenterContent = function() {
    return this.callMethod("setCenterContent", arguments);
};

pttp.getColumnCount = function() {
    return this.callMethod("getColumnCount", arguments);
};

pttp.getRowCount = function() {
    return this.callMethod("getRowCount", arguments);
};
BCComponentModules["ToggleButton"] = ToggleButtonAPI;

function ToggleButtonAPI(pExperience, pCallback, pElementID) {
    this.experience = pExperience;
    this.callback = pCallback;
    this.elementID = pElementID;
}
var pttp = ToggleButtonAPI.prototype = new ButtonAPI();

pttp.getToggledLabel = function() {
    return this.callMethod("getToggledLabel", arguments);
};

pttp.setToggledLabel = function() {
    return this.callMethod("setToggledLabel", arguments);
};

pttp.getToggledTooltip = function() {
    return this.callMethod("getToggledTooltip", arguments);
};

pttp.setToggledTooltip = function() {
    return this.callMethod("setToggledTooltip", arguments);
};

pttp.getToggledIconName = function() {
    return this.callMethod("getToggledIconName", arguments);
};

pttp.setToggledIconName = function() {
    return this.callMethod("setToggledIconName", arguments);
};

pttp.getIsToggled = function() {
    return this.callMethod("getIsToggled", arguments);
};

pttp.setIsToggled = function() {
    return this.callMethod("setIsToggled", arguments);
};
