﻿
var cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils = new Object();
cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils.CreateSafeFunction = function(instance, func)
{
    return function() {
        return func.apply(instance, arguments);
    }
}
var loader_a3717d1ba8a84272bc31fb04ed5fa16f = new cs_a3717d1ba8a84272bc31fb04ed5fa16f_Loader();
loader_a3717d1ba8a84272bc31fb04ed5fa16f.ReplaceScriptTag('http://www.epals.com/media/p/208898/embed.aspx','<div id=\"video_a457e79f-6831-46a7-a72e-abfaced74fe3\"><span style=\"display: block; width: 400px; height: 300px; position: relative; overflow: hidden; background-color: #000;\"><a style=\"position: absolute; left: 0px; display: block; width: 400px; height: 300px; text-decoration: none;\" href=\"http://www.epals.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.20.88.98/go-green-4_5F00_0001.wmv\" onclick=\"cs_setInnerHtml(\'video_a457e79f-6831-46a7-a72e-abfaced74fe3\',\'&lt;object type=\\&quot;video/x-ms-wmv\\&quot; data=\\&quot;http://www.epals.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.20.88.98/go-green-4_5F00_0001.wmv\\&quot; width=\\&quot;400\\&quot; height=\\&quot;300\\&quot; &gt;&lt;param name=\\&quot;src\\&quot; value=\\&quot;http://www.epals.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.20.88.98/go-green-4_5F00_0001.wmv\\&quot; /&gt;&lt;param name=\\&quot;autostart\\&quot; value=\\&quot;true\\&quot; /&gt;&lt;param name=\\&quot;controller\\&quot; value=\\&quot;true\\&quot; /&gt;&lt;param name=\\&quot;uimode\\&quot; value=\\&quot;full\\&quot; /&gt;&lt;param name=\\&quot;autosize\\&quot; value=\\&quot;true\\&quot; /&gt;&lt;param name=\\&quot;scale\\&quot; value=\\&quot;tofit\\&quot; /&gt;&lt;/object&gt;\');return false;\"><span style=\"cursor: pointer; position: absolute; left: 0px; display: block; width: 400px; top: 108px; text-align: center; color: #fff; font-family: Arial, Helvetica; font-size: 12px; font-weight: bold;\"><img src=\"http://www.epals.com/utility/images/video-preview.gif\" alt=\"Click here to play this video\" style=\"border-width: 0;\" /></span></a></span></div>');
loader_a3717d1ba8a84272bc31fb04ed5fa16f.AddScriptToLoad(new cs_a3717d1ba8a84272bc31fb04ed5fa16f_ScriptToLoad(true, 'http://www.epals.com/WebResource.axd?d=VDZCBvNZAlOLmxaGqus0lz4LUM6V8OWaMLuF3EchiopGZc87aFbdPPk4g9cZK_Dg66gTgE-1Wn1xgUoLtQh52Yug1ZuzDeu2xZD-jlerTw1yH_I6Pv_YQaJW4Qtq0Gqi0&t=633537949099531250'));
loader_a3717d1ba8a84272bc31fb04ed5fa16f.AddScriptToLoad(new cs_a3717d1ba8a84272bc31fb04ed5fa16f_ScriptToLoad(true, 'http://www.epals.com/WebResource.axd?d=VDZCBvNZAlOLmxaGqus0lz4LUM6V8OWaMLuF3EchiopGZc87aFbdPPk4g9cZK_Dg66gTgE-1Wn1xgUoLtQh52UzhVkfoC_xO-M_kKMJmEykfKM1Onr5W3bigPWemyix00&t=633537949099531250'));
loader_a3717d1ba8a84272bc31fb04ed5fa16f.AddScriptToLoad(new cs_a3717d1ba8a84272bc31fb04ed5fa16f_ScriptToLoad(true, 'http://www.epals.com/WebResource.axd?d=VDZCBvNZAlOLmxaGqus0lz4LUM6V8OWaMLuF3EchiopGZc87aFbdPPk4g9cZK_Dg66gTgE-1Wn1xgUoLtQh52d_aEi7Da7qErnYo7qPgaAnWvWHUxwJVIpeJ_XsnZqeS0&t=633537949099531250'));
loader_a3717d1ba8a84272bc31fb04ed5fa16f.AddScriptToLoad(new cs_a3717d1ba8a84272bc31fb04ed5fa16f_ScriptToLoad(false, 'try\n{\nvar video_a457e79f683146a7a72eabfaced74fe3 = new jeroenwijering.Player(document.getElementById(\'video_a457e79f-6831-46a7-a72e-abfaced74fe3\'),\'http://www.epals.com/WebResource.axd?d=VDZCBvNZAlOLmxaGqus0lz4LUM6V8OWaMLuF3EchiopGZc87aFbdPPk4g9cZK_Dg66gTgE-1Wn1xgUoLtQh52U-oHoGOu4IePnK5JCBuSomyJlqjBW6PB0Lt691315AC0&t=633537949099531250\',{height:\'300\',width:\'400\',file:\'http://www.epals.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.20.88.98/go-green-4_5F00_0001.wmv\'});\n} catch(e) { }'));
loader_a3717d1ba8a84272bc31fb04ed5fa16f.LoadAll();

function cs_a3717d1ba8a84272bc31fb04ed5fa16f_Loader()
{
    this._scriptsToLoad = new Array();
    this._currentScript = 0;

    this.AddScriptToLoad = function(scriptToLoad)
    {
        this._scriptsToLoad[this._scriptsToLoad.length] = scriptToLoad;
    }

    this.ReplaceScriptTag = function(scriptUrl, html)
    {
        scriptUrl = scriptUrl.toLowerCase();

        var scripts = document.getElementsByTagName('script');
        var script = null;
        for (var i = 0; i < scripts.length; i++)
        {
            if (scripts[i].src && scripts[i].src.toLowerCase() == scriptUrl)
	        {
		        script = scripts[i];
		        break;
	        }
        }

        if (script)
        {
	        var d = document.createElement('div');
	        d.innerHTML = html;
	        script.parentNode.insertBefore(d, script);
            script.parentNode.removeChild(script);
        }
    }

    this.AddCssText = function(cssText, media)
    {
        var s = document.createElement('style');
        s.type = 'text/css';

        if (media)
            s.media = media;

        if (s.styleSheet)
            s.styleSheet.cssText = cssText;
        else
            s.appendChild(document.createTextNode(cssText));

        document.getElementsByTagName('HEAD')[0].appendChild(s);            
    }

    this.LoadAll = function()
    {
        if (this._scriptsToLoad.length > 0 && this._currentScript < this._scriptsToLoad.length)
            this._scriptsToLoad[this._currentScript].Load(cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils.CreateSafeFunction(this, this._loadSuccessful), cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils.CreateSafeFunction(this, this._loadFailed));
    }

    this._loadSuccessful = function()
    {
        this._currentScript++;
        this.LoadAll();
    }

    this._loadFailed = function(e)
    {
        if (e)
            alert(e.message);
        else if (window.error)
            alert(window.error.message);
        else
            alert('An unknown error occured while loading scripts associated to the latest callback');
    }
}

function cs_a3717d1ba8a84272bc31fb04ed5fa16f_ScriptToLoad(isInclude, content)
{
    this._isInclude = isInclude;
    this._content = content;
    this._element = null;
    this._completeCallback = null;
    this._errorCallback = null;
    this._errorTimeout = null;

    this._isSafari = function()
    {
        return navigator.userAgent.indexOf('Safari') != -1;
    }

    this._isIE = function()
    {
        return navigator && navigator.userAgent && navigator.userAgent.indexOf('MSIE') != -1
    }

    this.Load = function (completeCallback, errorCallback)
    {
        if (this._isInclude)
        {
            if (this._isScriptIncludeRegistered(this._content))
            {
                if (completeCallback)
                    completeCallback();
            }
            
            this._element = document.createElement('script');
            this._element.src = this._content;

            this._completeCallback = completeCallback;
            this._errorCallback = errorCallback;
            
            if (this._isSafari())
            {
                try
                {
                    document.getElementsByTagName('HEAD')[0].appendChild(this._element);
                }
                catch (e)
                {
                   if (errorCallback)
                       errorCallback(e);
                }

                setTimeout(cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils.CreateSafeFunction(this, this._completeCallback), 999);
            }
            else
            {
                if (this._isIE())
                {
                    this._element.onreadystatechange = cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils.CreateSafeFunction(this, this._readyStateChanged);
                }
                else
                {
                    this._element.readyState = 'loaded';
                    this._element.onload = cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils.CreateSafeFunction(this, this._readyStateChanged);
                }
                
                document.getElementsByTagName('HEAD')[0].appendChild(this._element);
                
                this._errorTimeout = setTimeout(cs_a3717d1ba8a84272bc31fb04ed5fa16f_Utils.CreateSafeFunction(this, this._errorOccured), 29999);
            }
        }
        else
        {
            var element = document.createElement('script');
            element.type = 'text/javascript';
            
            if (this._isSafari())
                element.innerHTML = this._content.replace(/(?:^\W*\/\/[^$]*?$|\/\*.*?\*\/)/gm, '');
            else
                element.text = this._content;
             
            try
            {
                document.getElementsByTagName('HEAD')[0].appendChild(element);
                
                if (!this._isSafari())
                    document.getElementsByTagName('HEAD')[0].removeChild(element);
            }
            catch (e)
            {
               if (errorCallback)
                   errorCallback(e);
            }

            if (completeCallback)
                completeCallback();
        }
    }

    this._isScriptIncludeRegistered = function(scriptUrl)
    {
        var scripts = document.getElementsByTagName('SCRIPT');
        
        for (var i = 0; i < scripts.length; i++)
        {

            if (scripts[i].src == scriptUrl)
                return true;
        }
        
        return false;
    }
    
    this._readyStateChanged = function()
    {
        if (this._element && (this._element.readyState == 'loaded' || this._element.readyState == 'complete'))
        {
            clearTimeout(this._errorTimeout);
            
            this._element.onreadystatechange = null;
            this._element.onload = null;
            this._element.onerror = null;
             
            if (this._completeCallback)
                this._completeCallback(); 
        }
    }
    
    this._errorOccured = function()
    {
        if (this._element)
        {
            this._element.onreadystatechange = null;
            this._element.onload = null;
            this._element.onerror = null;
        }
        
        if (this._errorCallback)
            this._errorCallback({'message': 'A script was not able to be loaded within the allowed time.  The callback has failed'});
    }
};
