<iframe id="adIFrame" src="http://bling.king.com/modules/ad/iframe.jsp?kingAppId=8&amp;kingAppName=bling&amp;adId=3576399&amp;adServer=adtech&amp;coreUserId=-1&amp;placementId=1&amp;signInSourceId=0&amp;secure=false&amp;domain=king.com" frameborder="0" align="middle" scrolling="no" width="0" height="0" marginwidth="0" marginheight="0" style="width: 750px; height: 312px; opacity: 1; ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><script async="" src="http://rya.rockyou.com/ams/interstitial/server/ry_interstitial_tracking_service.php?callback=$RY161048949960339814425_1342731376737&amp;cmd=trackAdComplete&amp;adKey=8cea845d260df77c79d22f8a65afa93a781f38c11720c8dd5ec28731c9e71c1720b86142642e1756734544ea8d9569e846821dcf477a5acefeb28cbefe56595b33df983ae299266cfc6cd7beec286d91bebf8f11da8debd9ec1832115388b2c9deb277e71817d85085bdf9af1885675837339726b6cf572ec99501dd4ffd68c5&amp;_=1342731454189"></script><script async="" src="http://rya.rockyou.com/ams/interstitial/server/ry_interstitial_tracking_service.php?callback=$RY161048949960339814425_1342731376736&amp;cmd=trackVideoPercentCompleted&amp;adKey=8cea845d260df77c79d22f8a65afa93a781f38c11720c8dd5ec28731c9e71c1720b86142642e1756734544ea8d9569e846821dcf477a5acefeb28cbefe56595b33df983ae299266cfc6cd7beec286d91bebf8f11da8debd9ec1832115388b2c9deb277e71817d85085bdf9af1885675837339726b6cf572ec99501dd4ffd68c5&amp;percentCompleted=100&amp;_=1342731454188"></script><script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"></script>
    <title>Ad 1 iFrame</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <script src="http://bling1.midasplayer.com/js/jquery.min.js?_v=gi6ehw" type="text/javascript"></script>

    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(["_setAccount", "UA-25013161-1"]);
        _gaq.push(["_setDomainName", ".king.com"]);
        _gaq.push(["_trackPageview"]);
    </script>

    <script src="http://bling1.midasplayer.com/js/KingBlingTracking.min.js?_v=vxhitm" type="text/javascript"></script>

    <style type="text/css">
        body {
            position: relative;
            text-align: center;
        }
    </style>
</head>

<body marginwidth="0" marginheight="0">

    <div id="adContainer" style="">

        <script type="text/javascript">
            var BlingAd1IFrame = new function()
            {
                // members
                var mNumOfTimesResizeCalled = 0, mNumOfTimesCloseCalled = 0, mNumOfTimesClickCalled = 0, mNumOfTimesCancelCalled = 0;
                var mNumOfTimesGiveRewardCalled = 0;
                var mNumOfTimesLoadingTimeoutCalled = 0, mNumOfTimesMaxLoadingTimeoutCalled = 0;
                var mAdContainerContentPollCounter = 0;
                var mUseMaxContentDimensionsForResize = false;
                var mLoadingTimeoutTimer;
                var mMaxLoadingTimeoutTimer;
                var mAdContainer$ = $("#adContainer");

                var mKingAppId = "8";
                var mCoreUserId = "-1";
                var mPlacementId = "1";
                var mPlacementIdNumber = 1;
                var mSignInSourceId = "0";
                var mSecureProtocol = "http";
                var mIsSecureInteger = "0";

                var mTrackingActionLabel = "bling (" + mSecureProtocol + ')';

                var CONTINUOUS_TRACKING_INTERVAL = 5000;
                var mContinuousTrackingIntervalCounter = 0;
                var mContinuousTrackingTimer;


                var logConsole = function(message, obj)
                {
                    if (window.console) {
                        console.log("[BlingAd1IFrame] " + message, obj);
                    }
                };


                var setDomain = function()
                {
                    document.domain = "king.com";
                };


                var startContinuousTracking = function()
                {
                    clearContinuousTracking();

                    var callback = function()
                    {
                        var reachedSeconds = (CONTINUOUS_TRACKING_INTERVAL * mContinuousTrackingIntervalCounter) / 1000;

                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Continuous Tracking", reachedSeconds + " seconds reached");

                        logConsole("Continuous tracking", reachedSeconds + " seconds reached.");

                        mContinuousTrackingIntervalCounter++;
                    };

                    callback();

                    // every 5 seconds
                    mContinuousTrackingTimer = setInterval(callback, CONTINUOUS_TRACKING_INTERVAL);
                };


                var clearContinuousTracking = function()
                {
                    clearInterval(mContinuousTrackingTimer);

                    logConsole("Continuous tracking cleared.");
                };


                var loadAdScript = function()
                {
                    logConsole("loadAdScript()", "Game Placement->Ad Id, 1->3576399 adtech");

                    KingBlingTracking.trackEvent("Bling Ad 1 Module", "Load Ad", mTrackingActionLabel);
                    KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 1, mPlacementId, mSignInSourceId, mIsSecureInteger);

                    var adScript;
                    var adServer = "adtech";

                    // use Adtech
                    if (adServer === "adtech")
                    {
                        var adGroupId = Math.round(Math.random() * 1000);
                        var timeNow = new Date().getTime();
                        var adtechHostname = (mIsSecureInteger == 1) ? "https://secserv.adtech.de" : "http://adserver.adtech.de";

                        adScript = '<scr'+'ipt type="text/javascript"' +
                                       'src="' + adtechHostname + '/addyn|3.0|1002.1|' + '3576399' + '|0|0|ADTECH;' +
                                       'cookie=info;alias=;loc=100;target=_blank;key=key1+key2+key3+key4;' +
                                       'grp=' + adGroupId + ';misc=' + timeNow +
                                   '"></scri'+'pt>';
                    }

                    // use OpenX
                    else if (adServer === "openx")
                    {
                        if (!window.OX_ads) {
                            OX_ads = [];
                        }

                        OX_ads.push({"auid": "3576399"});

                        /* TODO: change this to real server */

                        var openxHostname = (mIsSecureInteger == 1) ? "https://ox-d.king.com" : "http://ox-d.king.com";

                        adScript = '<scr' + 'ipt src="' + openxHostname + '/w/1.0/jstag"><\/scr' + 'ipt>';
                    }

                    //console.log(adScript);

                    document.write(adScript);
                };


                // Version 1
                var performWhenReady = function(testConditionCallback, conditionAchievedCallback, callbackData)
                {
                    var pollingCallback = function()
                    {
                        // poll using a minimal timeout, check if the condition is met
                        if (!testConditionCallback()) {
                            setTimeout(pollingCallback, 50);
                            return;
                        }

                        conditionAchievedCallback(callbackData);
                    };

                    pollingCallback();
                };


                var loadingTimeoutCallback = function()
                {
                    logConsole("loadingTimeoutCallback()", mNumOfTimesLoadingTimeoutCalled);

                    // avoid calling more than 1 time
                    mNumOfTimesLoadingTimeoutCalled++;
                    if (mNumOfTimesLoadingTimeoutCalled > 1)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module (Error)", "Too many calls (loadingTimeoutCallback)", mTrackingActionLabel, mNumOfTimesLoadingTimeoutCalled);
                        return;
                    }

                    if (parent.BlingAd1Renderer.loadingFailed)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Loading timeout", mTrackingActionLabel);
                        KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 4, mPlacementId, mSignInSourceId, mIsSecureInteger);

                        parent.BlingAd1Renderer.loadingFailed();
                    }
                    else {
                        document.write("Error 1 in iframe.");
                    }
                };


                var maxLoadingTimeoutCallback = function()
                {
                    logConsole("maxLoadingTimeoutCallback()", mNumOfTimesMaxLoadingTimeoutCalled);

                    // avoid calling more than 1 time
                    mNumOfTimesMaxLoadingTimeoutCalled++;
                    if (mNumOfTimesMaxLoadingTimeoutCalled > 1)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module (Error)", "Too many calls (maxLoadingTimeoutCallback)", mTrackingActionLabel, mNumOfTimesMaxLoadingTimeoutCalled);
                        return;
                    }

                    if (parent.BlingAd1Renderer.close)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Max loading timeout", mTrackingActionLabel);
                        KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 5, mPlacementId, mSignInSourceId, mIsSecureInteger);

                        parent.BlingAd1Renderer.close({isMaxTimeout:true});
                    } else {
                        document.write("Error 2 in iframe.");
                    }
                };


                var testConditionCallback = function()
                {
                    mAdContainerContentPollCounter++;

                    //console.log("Current polled size of Ad container:", mAdContainer$.outerWidth(), mAdContainer$.outerHeight());
                    //console.log("Ad container html length:", mAdContainer$.html().length);
                    //console.log("mAdContainerContentPollCounter:", mAdContainerContentPollCounter);

                    // depend on content instead, after X num of polls
                    if ((jQuery.browser.msie) && (jQuery.browser.version <= 7) && (mAdContainerContentPollCounter >= 20))
                    {
                        mUseMaxContentDimensionsForResize = true;

                        return (mAdContainer$.html().length !== 0);    // return true if content is not empty
                    }

                    return (mAdContainer$.outerHeight() !== 0);    // return true if height is not 0
                };


                var conditionAchievedCallback = function(callbackData)
                {
                    startContinuousTracking();

                    resize(mAdContainer$.outerWidth(), mAdContainer$.outerHeight());
                };


                var installTimeoutTimers = function()
                {
                    mLoadingTimeoutTimer = setTimeout(loadingTimeoutCallback, 10 * 1000);
                    mMaxLoadingTimeoutTimer = setTimeout(maxLoadingTimeoutCallback, 30 * 1000);
                };


                /*
                    May be called from Ad/page.

                    i.e.
                    BlingAd1IFrame.resize(w, h);
                 */
                var resize = function(width, height)
                {
                    logConsole("resize()", [mNumOfTimesResizeCalled, width, height]);

                    // avoid calling more than 1 time
                    mNumOfTimesResizeCalled++;
                    if (mNumOfTimesResizeCalled > 1)
                    {
                        logConsole("resize()", "Can't do that any more!");
                        KingBlingTracking.trackEvent("Bling Ad 1 Module (Error)", "Too many calls (resize)", mTrackingActionLabel, mNumOfTimesResizeCalled);
                        return;
                    }

                    // avoid small size (missing content)
                    if ((width <= 50) || (height <= 50))
                    {
                        logConsole("Ad content to small or empty, closing!", [width, height]);
                        closeAd();
                    }

                    forceResize(width, height);
                };


                /*
                    Can be forced from Ad/page.

                    i.e.
                    BlingAd1IFrame.forceResize(w, h);
                 */
                var forceResize = function(width, height)
                {
                    logConsole("forceResize()", [mNumOfTimesResizeCalled, width, height]);

                    // since we are doing a forced resize
                    // avoid calling the default resize more than 1 time
                    mNumOfTimesResizeCalled++;

                    // remove timeout timers
                    clearInterval(mLoadingTimeoutTimer);
                    clearInterval(mMaxLoadingTimeoutTimer);

                    if (parent.BlingAd1Renderer.resize)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Ad loaded & resize", mTrackingActionLabel);
                        KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 2, mPlacementId, mSignInSourceId, mIsSecureInteger);

                        //console.log("mAdContainerContentPollCounter:", mAdContainerContentPollCounter);
                        //console.log("mUseMaxContentDimensionsForResize:", mUseMaxContentDimensionsForResize);

                        if (mUseMaxContentDimensionsForResize) {
                            parent.BlingAd1Renderer.resize();    // fail safe, resize to a fit container
                        } else {
                            parent.BlingAd1Renderer.resize(width, height);
                        }
                    }
                    else {
                        document.write("Error 3 in iframe.");
                    }
                };


                /*
                    Called from the Ad.

                    i.e.
                    BlingAd1IFrame.giveReward(options);
                 */
                var giveReward = function(options)
                {
                    logConsole("giveReward()", mNumOfTimesGiveRewardCalled);

                    // avoid calling more than 1 time
                    mNumOfTimesGiveRewardCalled++;
                    if (mNumOfTimesGiveRewardCalled > 1)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module (Error)", "Too many calls (giveReward)", mTrackingActionLabel, mNumOfTimesGiveRewardCalled);
                        return;
                    }

                    if (parent.BlingAd1Renderer.giveReward)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Ad give reward called", mTrackingActionLabel);
                        KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 8, mPlacementId, mSignInSourceId, mIsSecureInteger);

                        // create object, in case it does not exist
                        var newOptions = $.extend({}, options);

                        // we must send back the placement id
                        newOptions = $.extend({placementId: mPlacementIdNumber}, newOptions);

                        parent.BlingAd1Renderer.giveReward(newOptions);
                    } else {
                        document.write("Error 4 in iframe.");
                    }
                };


                /*
                    Called from the Ad/Flash.

                    i.e.
                    BlingAd1IFrame.clickAd(options);
                 */
                var clickAd = function(options)
                {
                    logConsole("clickAd()", mNumOfTimesClickCalled);

                    // avoid calling more than 1 time
                    mNumOfTimesClickCalled++;
                    if (mNumOfTimesClickCalled > 1)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module (Error)", "Too many calls (clickAd)", mTrackingActionLabel, mNumOfTimesClickCalled);
                        return;
                    }

                    if (parent.BlingAd1Renderer.click)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Ad click called", mTrackingActionLabel);
                        KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 6, mPlacementId, mSignInSourceId, mIsSecureInteger);

                        var newOptions = {};

                        // if a parameter (!object) comes from the Ad/Flash, convert it into an object
                        if (typeof options == "object")
                        {
                            // create object, in case it does not exist
                            newOptions = $.extend({}, options);
                        }
                        else
                        {
                            var strParam = '' + options;

                            newOptions = $.extend({}, options);
                            newOptions[strParam] = true;
                        }

                        // we must send back the placement id
                        newOptions = $.extend({placementId: mPlacementIdNumber}, newOptions);

                        parent.BlingAd1Renderer.click(newOptions);
                    } else {
                        document.write("Error 5 in iframe.");
                    }
                };


                /*
                    Called from the Ad.

                    i.e.
                    BlingAd1IFrame.closeAd(options);
                 */
                var closeAd = function(options)
                {
                    logConsole("closeAd()", options);

                    // avoid calling more than 1 time
                    mNumOfTimesCloseCalled++;
                    if (mNumOfTimesCloseCalled > 1)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module (Error)", "Too many calls (closeAd)", mTrackingActionLabel, mNumOfTimesCloseCalled);
                        return;
                    }

                    if (parent.BlingAd1Renderer.close)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Ad close called", mTrackingActionLabel);
                        KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 3, mPlacementId, mSignInSourceId, mIsSecureInteger);

                        // create object, in case it does not exist
                        var newOptions = $.extend({}, options);

                        // we must send back the placement id
                        newOptions = $.extend({placementId: mPlacementIdNumber}, newOptions);

                        newOptions = $.extend({}, newOptions, {isIFrameCloseAdCalledFromAd:true});

                        parent.BlingAd1Renderer.close(newOptions);
                    } else {
                        document.write("Error 6 in iframe.");
                    }
                };


                /*
                    Called from the Ad.

                    i.e.
                    BlingAd1IFrame.cancelAd(options);
                 */
                var cancelAd = function(options)
                {
                    logConsole("cancelAd()", options);

                    // avoid calling more than 1 time
                    mNumOfTimesCancelCalled++;
                    if (mNumOfTimesCancelCalled > 1)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module (Error)", "Too many calls (cancelAd)", mTrackingActionLabel, mNumOfTimesCancelCalled);
                        return;
                    }

                    if (parent.BlingAd1Renderer.cancel)
                    {
                        KingBlingTracking.trackEvent("Bling Ad 1 Module", "Ad cancel called", mTrackingActionLabel);
                        KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 7, mPlacementId, mSignInSourceId, mIsSecureInteger);

                        // create object, in case it does not exist
                        var newOptions = $.extend({}, options);

                        // we must send back the placement id
                        newOptions = $.extend({placementId: mPlacementIdNumber}, newOptions);

                        parent.BlingAd1Renderer.cancel(newOptions);
                    } else {
                        document.write("Error 7 in iframe.");
                    }
                };


                /*
                    Called from the Ad, as a fallback.

                    i.e.
                    BlingAd1IFrame.forceReload(newAdId, newAdServer);
                 */
                var forceReload = function(newAdId, newAdServer)
                {
                    logConsole("forceReload()", {newAdId:newAdId, newAdServer:newAdServer});

                    if (parent.BlingAd1Renderer.forceReload)
                    {
                        parent.BlingAd1Renderer.forceReload(newAdId, newAdServer);
                    } else {
                        document.write("Error 9 in iframe.");
                    }
                };


                /*
                    Called from the Ad.

                    i.e.
                    BlingAd1IFrame.getUserId();
                 */
                var getUserId = function()
                {
                    logConsole("getUserId()", (mCoreUserId ^ 0xFFFFFFF));

                    return mCoreUserId ^ 0xFFFFFFF;
                };


                /*
                    Called from the Ad.

                    i.e.
                    BlingAd1IFrame.setCloseButton(options);
                 */
                var setCloseButton = function(options)
                {
                    logConsole("setCloseButton()", options);

                    if (parent.BlingAd1Renderer.setCloseButton)
                    {
                        // create object, in case it does not exist
                        var newOptions = $.extend({}, options);

                        // we must send back the placement id
                        newOptions = $.extend({placementId: mPlacementIdNumber}, newOptions);

                        parent.BlingAd1Renderer.setCloseButton(newOptions);
                    } else {
                        document.write("Error 8 in iframe.");
                    }
                };


                /*
                    Called from the Ad.

                    i.e.
                    BlingAd1IFrame.setAdProviderName(adProviderName);
                 */
                var setAdProviderName = function(adProviderName)
                {
                    logConsole("setAdProviderName:", adProviderName);
                };


                // init
                setDomain();

                installTimeoutTimers();
                performWhenReady(testConditionCallback, conditionAchievedCallback, {});

                KingBlingTracking.trackEvent("Bling Ad 1 Module", "Ad 1 sandbox initiated: " + mTrackingActionLabel);
                KingBlingTracking.trackLogEvent(mKingAppId, mCoreUserId, 1, 1000, mPlacementId, mSignInSourceId, mIsSecureInteger);

                loadAdScript();


                return {
                    resize: resize,
                    forceResize: forceResize,

                    giveReward: giveReward,
                    clickAd: clickAd,
                    closeAd: closeAd,
                    cancelAd: cancelAd,

                    forceReload: forceReload,

                    getUserId: getUserId,
                    setCloseButton: setCloseButton,
                    setAdProviderName: setAdProviderName
                }
            };
        </script><script type="text/javascript" src="http://adserver.adtech.de/addyn|3.0|1002.1|3576399|0|0|ADTECH;cookie=info;alias=;loc=100;target=_blank;key=key1+key2+key3+key4;grp=265;misc=1342731368614"></script><script type="text/javascript" src="https://cdnrockyou-a.akamaihd.net/apps/ams/interstitial/ryinterstitial_lib.js">
</script>

<script type="text/javascript" src="http://aka-cdn-ns.adtech.de/apps/157/Ad7918237St3Sz170Sq102796031V7Id1/extFile1.js"></script>

    </div>

    <script type="text/javascript">
        (function() {
            var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;
            ga.src = (("https:" == document.location.protocol) ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
            var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>





<div id="ryInterstitialModalDiv" style="position: absolute; top: 0px; left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; z-index: 1000; width: 100%; background-color: rgb(0, 0, 0); opacity: 0.3; height: 0px; "></div><div id="ryInterstitialPopupDiv" style="position: absolute; z-index: 1001; overflow-x: hidden; overflow-y: hidden; left: -10px; top: 0px; "><div id="ryInterstitialContentDiv">


<div id="ryIauWrapper" class="ryIauWrapper">
    <div id="ryIauInnerBorderWrapper" class="ryIauInnerBorderWrapper">
        <div id="ryIauContentHeaderWrapper" class="ryIauContentHeaderWrapper">
            <div id="ryIauContentHeaderHolder" class="ryIauContentHeaderHolder">
                <span id="ryIauContentHeaderText">Please enjoy this message from our sponsor</span>
            </div>
            <div id="ryIauCloseBtnHolder" class="ryIauCloseBtnHolder">
                <span id="ryIauCloseBtnCountdown" class="ryIauCloseBtnCountdown" style="display: none; ">You can close in 0 second</span>
                <span id="ryIauCloseBtn" class="ryIauCloseBtn" title="Click to close" style="background-color: rgb(33, 151, 197); color: rgb(255, 255, 255); ">X</span>
            </div>
        </div>
        <div id="ryIauContainerWrapper" class="ryIauContainerWrapper">
            <div id="ryIauContainer">
                <div id="ryIauUnitHolder" style="display: none; ">
                   

       








<div id="ryIauContentWrapper" class="ryIauContentWrapper">
    <div id="ryIauHelperWrapper" class="ryIauHelperWrapper">
       






               




<div>
    <object width="445" height="250" id="VideoPlayer" name="VideoPlayer">
        <param name="movie" value="http://cdnrockyou-a.akamaihd.net/apps/rycampaign/swf/liveRailAdManager.swf">
        <param name="quality" value="high">
        <param name="shareDisable" value="true">
        <param name="allowScriptAccess" value="always">
        <param name="allowFullScreen" value="false">
        <param name="flashVars" value="&amp;protocolString=http://&amp;lRStartMute=&amp;lRVolume=0.7&amp;lRPublisherId=9351&amp;lRLayoutSkinId=2&amp;lRTags=female&amp;lRCompanions=300:250:ryIauCompanionAdWrapper:ryIauCompanionAdWrapperDefault&amp;initHandlerName=playerToJsInitHandler&amp;successHandlerName=playerToJsSuccessHandler&amp;errorHandlerName=playerToJsErrorHandler&amp;video0PHandlerName=playerToJsCallback&amp;video25PHandlerName=playerToJsCallback&amp;video50PHandlerName=playerToJsCallback&amp;video75PHandlerName=playerToJsCallback&amp;video100PHandlerName=playerToJsCallback">
        <param name="wmode" value="transparent">
        <embed id="VideoPlayer" name="VideoPlayer" src="http://cdnrockyou-a.akamaihd.net/apps/rycampaign/swf/liveRailAdManager.swf" flashvars="&amp;protocolString=http://&amp;lRStartMute=&amp;lRVolume=0.7&amp;lRPublisherId=9351&amp;lRLayoutSkinId=2&amp;lRTags=female&amp;lRCompanions=300:250:ryIauCompanionAdWrapper:ryIauCompanionAdWrapperDefault&amp;initHandlerName=playerToJsInitHandler&amp;successHandlerName=playerToJsSuccessHandler&amp;errorHandlerName=playerToJsErrorHandler&amp;video0PHandlerName=playerToJsCallback&amp;video25PHandlerName=playerToJsCallback&amp;video50PHandlerName=playerToJsCallback&amp;video75PHandlerName=playerToJsCallback&amp;video100PHandlerName=playerToJsCallback" wmode="transparent" quality="high" allowscriptaccess="always" allowfullscreen="true" type="application/x-shockwave-flash" width="445" height="250">
    </object>
</div>    </div>
            <div id="ryIauCompanionAdWrapper" class="ryIauCompanionAdWrapper"></div>
        <div id="ryIauCompanionAdWrapperDefault" class="ryIauCompanionAdWrapperDefault" style="width: 300px; height: 250px; "><a id="ryIauCompanionLink" href="http://apps.facebook.com/playzoo/zoo/landingZoo2.php" target="_blank"><img id="ryIauCompanionImg" src="http://cdnrockyou-a.akamaihd.net/apps/ams/interstitial/images/sponsor_300x250.jpg" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a></div>
    </div>




<style type="text/css">
    .ryIauContentWrapper {
        position: relative;
        padding: 0;
        overflow: hidden;
        width: 745px;
        height: 250px;
    }
    .ryIauHelperWrapper {
        position: absolute;
        width: 445px;
        top: px;
        left: px;
    }
    .ryIauCompanionAdWrapper {
        display: none;
        position: absolute;
        top: px;
        left: 445px;
    }
    .ryIauCompanionAdWrapperDefault {
        position: absolute;
        top: px;
        left: 445px;
    }
</style>
                </div>
                                    <div id="ryIauFallbackUnitHolder" class="ryIauFallbackUnitHolder" style="display: block; ">
                       

       
   






<div id="fallbackryIauContentWrapper" class="fallbackryIauContentWrapper">
    <div id="fallbackryIauHelperWrapper" class="fallbackryIauHelperWrapper">
       


       
               

<div>
    <object id="fallbackvideoPlayer" name="fallbackvideoPlayer" width="300" height="250">
        <param name="movie" value="http://cdnrockyou-a.akamaihd.net/apps/rycampaign/swf/rvnVideoPlayer.swf">
        <param name="quality" value="high">
        <param name="shareDisable" value="true">
        <param name="allowScriptAccess" value="always">
        <param name="flashVars" value="&amp;shareDisable=true&amp;startMute=1&amp;useCover=false&amp;startMode=auto&amp;showTopOverlay=&amp;topOverlayCTA=&amp;useOverlay=&amp;overlayStartupDelay=0&amp;overlayCloseTime=0&amp;overlayTxt=&amp;extOverlayClickUrl=&amp;controlBarCTA=&amp;showEndButton=1&amp;endBtnCTA=Thanks For Watching&amp;videoResourceType=1&amp;vidAdId=liveUnited_default300&amp;extAdClick=http%3A%2F%2Frockyou.com&amp;overlayClickThruCallback=fallbackbottomOverlayClickedCallback&amp;videoClickThruCallback=fallbackvideoClickedCallback&amp;replayCallback=fallbackplayerToJsReplayCallback&amp;trackingAt0Callback=fallbackplayerToJsCallback&amp;trackingAt25Callback=fallbackplayerToJsCallback&amp;trackingAt50Callback=fallbackplayerToJsCallback&amp;trackingAt75Callback=fallbackplayerToJsCallback&amp;trackingAt100Callback=fallbackplayerToJsCallback">
        <param name="wmode" value="transparent">
        <embed id="fallbackvideoPlayer" name="fallbackvideoPlayer" src="http://cdnrockyou-a.akamaihd.net/apps/rycampaign/swf/rvnVideoPlayer.swf" wmode="transparent" flashvars="&amp;shareDisable=true&amp;startMute=1&amp;useCover=false&amp;startMode=auto&amp;showTopOverlay=&amp;topOverlayCTA=&amp;useOverlay=&amp;overlayStartupDelay=0&amp;overlayCloseTime=0&amp;overlayTxt=&amp;extOverlayClickUrl=&amp;controlBarCTA=&amp;showEndButton=1&amp;endBtnCTA=Thanks For Watching&amp;videoResourceType=1&amp;vidAdId=liveUnited_default300&amp;extAdClick=http%3A%2F%2Frockyou.com&amp;overlayClickThruCallback=fallbackbottomOverlayClickedCallback&amp;videoClickThruCallback=fallbackvideoClickedCallback&amp;replayCallback=fallbackplayerToJsReplayCallback&amp;trackingAt0Callback=fallbackplayerToJsCallback&amp;trackingAt25Callback=fallbackplayerToJsCallback&amp;trackingAt50Callback=fallbackplayerToJsCallback&amp;trackingAt75Callback=fallbackplayerToJsCallback&amp;trackingAt100Callback=fallbackplayerToJsCallback" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" type="application/x-shockwave-flash" width="300" height="250">
    </object>
</div>    </div>
            <div id="fallbackryIauCompanionAdWrapper" class="fallbackryIauCompanionAdWrapper">
                            <a id="fallbackryIauCompanionAdLink" href="javascript:void(0);" title="Sponsored Ad" class="fallbackryIauCompanionAdLink">
                    <img id="fallbackryIauCompanionAdImg" src="http://cdn.rockyou.com/apps/ams/interstitial/images/sponsor_300x250.jpg" alt="Companion Ad" class="fallbackryIauCompanionAdImg">
                </a>
                    </div>
    </div>




<style type="text/css">
    .fallbackryIauContentWrapper {
        position: relative;
        overflow: hidden;
        clear:both;
        margin: 0px auto;
        text-align: center;
        width:600px;
    }
    .fallbackryIauHelperWrapper{
        display: inline;
        float: left;
        overflow: hidden;
        width:300px;
    }
    .fallbackryIauCompanionAdWrapper {
        float: left;
        position: relative;
        display: inline;
        width: 300px;
    }
    .fallbackryIauCompanionAdIframe {
        margin:0px;
        padding:0px;
        height: 250px;
        width: 300px;
    }
    .fallbackryIauCompanionAdImg {
        border: none;
    }
</style>
                    </div>
                            </div>
        </div>
    </div>
</div>




<style type="text/css">
    .ryIauWrapper {
        position: relative;
        margin: 0 auto;
        font-family: Verdana, sans-serif;
        text-align: center;
        display: block;
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        border-radius: 10px;
        border: 10px solid #333333;
        background-color:#000000;
    }
    .ryIauInnerBorderWrapper {
        position: relative;
        overflow: hidden;
        margin: 0;
        padding: 0;
        border: 1px solid #2E629E;
    }
    .ryIauContentHeaderWrapper {
        position: relative;
        height:35px;
        color:#ccc;
    }
    .ryIauContentHeaderHolder {
        position: relative;
        height:35px;
        line-height: 30px;
        text-align: left;
        padding: 0 0 0 10px;
        float: left;
        font-weight: normal;
        font-family: ;
        font-style: normal;
        font-size: 10px;
        color:#CCCCCC;
    }
    .ryIauFallbackUnitHolder {
        display: none;
    }
    .ryIauCloseBtnHolder {
        margin: 5px 4px 0 0px;
        text-align: right;
        position: relative;
        left: 0px;
        top: 0px;
    }
    .ryIauCloseBtnCountdown {
        margin: 0 5px 0 0;
        font-weight: normal;
        font-family: ;
        font-style: normal;
        font-size: 10px;
        color: #FFFFFF;
    }
    .ryIauCloseBtn {
        padding: 3px 7px;
        float:right;
        font-size: 12px;
        font-weight: bold;
        cursor: pointer;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px; 
        color: #FFFFFF;
        background-color: #CCCCCC;
    }
</style></div></div></body></html>


</iframe>


        /**
         * TODO: Test logging only, remove this for live code.
         */
        function log(message, params)
        {
            if (window.console)
            {
                if (params) {
                    console.log(message, params);
                } else {
                    console.log(message);
                }
            }
            else
            {
                if (params) {
                    alert(message + "\n\n" + params);
                } else {
                    alert(message);
                }
            }
        }


        function loadMyAd()
        {
            /**
             * Callbacks
             */
            var openAdCallback = function()
            {
                // TODO: remove this logging
                log("openAdCallback");

                // TODO: show div element
                $("#kingBlingDiv").css("display", "block");
            };

            var closeAdCallback = function(options)
            {
                // TODO: remove this logging
                log("closeAdCallback", options);

                if (options)
                {
                    // TODO: this was an incentivised video ad
                    if ((options.placementId === 1) && (options.giveReward === true))
                    {
                        // TODO: give reward to the user :-)
                    }
                    else if ((options.placementId === 2) && (options.isPostroll === true))
                    {
                        // TODO: this was a postroll video ad
                    }
                }

                // TODO: hide div element
                $("#kingBlingDiv").css("display", "none");
            };

            var openAdSuccessCallback = function()
            {
                // TODO: the Ad opened, King Bling has taken over...do something if you want to...

                // TODO: remove this logging
                log("openAdSuccessCallback");
            };

            var openAdErrorCallback = function()
            {
                // TODO: handle the error...

                // TODO: remove this logging
                log("openAdErrorCallback");

                closeAdCallback({});
            };

            var clickAdCallback = function(options)
            {
                // TODO: handle the click which is only available in special cases...

                // TODO: remove this logging
                log("clickAdCallback", options);

                if (options && options["iframeUrl"])
                {
                    alert("I will now simulate the iframe opening, if a new window does not open then remove pop-up blocking in your browser.\n\nUrl: " + options["iframeUrl"]);
                    window.open(options["iframeUrl"]);
                }

                closeAdCallback(options);
            };

            var cancelAdCallback = function(options) {
                // TODO: handle the user canceled the Ad...

                // TODO: remove this logging
                log("cancelAdCallback", options);

                closeAdCallback(options);
            };

            var giveRewardCallback = function(options)
            {
                // TODO: give reward to the user...

                // TODO: remove this logging
                log("giveRewardCallback", options);
            };


            /**
             * Init and open a King Bling ad module.
             */
            var myKingBling = new KingBling();

           
                        log("Fake user data in effect!");

                        myKingBling.init({
                            protocol: "http://",
                            kingBlingHostname: "bling.king.com",
                            kingAppId: 8,
                            kingAppShortName: "bling",
                            coreUserId: "-1",
                            language: "en",
                            countryCode: "US",
                            age: -18,
                            sex: "m",
                            signInSourceId: "0",
                            videoAdPlacements: null
                        });
                   

            myKingBling.open(KingBlingModuleTypeMap.VIDEO_AD_ADTECH_1, "kingBlingDiv",
            {
                placementId: 1,                      /* TODO: 1=Default ad tag (incentivised, Ads4Life), 2=Postroll ad tag */
                width: 760,                          /* TODO */
                height: 650,                         /* TODO */
                adMessageKey: "template_message",    /* TODO: remove or override */
                openCallback: openAdCallback,
                openSuccessCallback: openAdSuccessCallback,
                errorCallback: openAdErrorCallback,
                closeCallback: closeAdCallback,
                // optional
                clickCallback: clickAdCallback,
                cancelCallback: cancelAdCallback,
                giveRewardCallback: giveRewardCallback,

                debug: true,                            /* TODO: remove for live code */
                testAdId: "3576399",           /* TODO: remove for live code */
                testAdServer: ""    /* TODO: remove for live code */
            });
        }


        /**
         * Load the King Bling script.
         */
        $(document).ready(function()
        {
            $.ajax(
            {
                url: "http://bling.king.com/js/KingBling.js",    /* TODO: games use .getScriptUrl() */
                dataType: "script",
                cache: true,
                success: function(data, textStatus, jqXHR)
                {
                    // TODO: remove this logging
                    log("Data:", (data) ? data.length : "...");
                    log(textStatus);

                    loadMyAd();
                },
                error: function(jqXHR, textStatus, errorThrown)
                {
                    // TODO: handle script loading failure...
                }
            });
        });