﻿$(document).ready(function () {
    $(".ticker-booty-homepage-ab").hide();
    $(".ticker-ff-homepage-ab").hide();
    $(".ticker-bb-homepage-ab").hide();
    $(".ticker-s7-homepage-ab").hide();
    $("#offer-prog-btn").click(function () {
        $(".ticker-poc-homepage-ab").hide();
        $(".ticker-sob-homepage-ab").hide();
        $(".ticker-booty-homepage-ab").hide();
        $(".ticker-ff-homepage-ab").hide();
        $(".ticker-bb-homepage-ab").hide();
        $(".ticker-s7-homepage-ab").hide();
        var p = $("#offer-progressive-ab").css('background-position');
        if (typeof (p) === 'undefined') {
            p = $("#offer-progressive-ab").css('background-position-x') + ' ' + $("#offer-progressive-ab").css('background-position-y');
        }
        if (p == "0% 0%" || p == "0px 0px") {
            $("#offer-progressive-ab").animate({ backgroundPosition: "0% -280px" }, 250, function () { $(".ticker-booty-homepage-ab").show(); $(".ticker-ff-homepage-ab").show(); });
        }
        else if (p == "0% -280px" || p == "0px -280px") {
            $("#offer-progressive-ab").animate({ backgroundPosition: "0% -560px" }, 250, function () { $(".ticker-bb-homepage-ab").show(); $(".ticker-s7-homepage-ab").show(); });
        }
        else if (p == "0% -560px" || p == "0px -560px") {
            $("#offer-progressive-ab").animate({ backgroundPosition: "0% 0%" }, 250, function () { $(".ticker-poc-homepage-ab").show(); $(".ticker-sob-homepage-ab").show(); });
        }
    });

    $("#offer-prog-btn").mouseover(function () {
        $("#ab2-ticker-1-playnow").hide();
        $("#ab2-ticker-2-playnow").hide();
    });

    $(".offer-testimon-btn").click(function () {
        var p = $("#offer-testimon-scroll2").css('background-position');
        if (typeof (p) === 'undefined') {
            p = $("#offer-testimon-scroll2").css('background-position-x') + ' ' + $("#offer-testimon-scroll2").css('background-position-y');
        }
        if (p == "0% 0%" || p == "0px 0px") {
            $("#ab2-testimon-you").hide();
            $("#offer-testimon-scroll2").animate({ backgroundPosition: "-713px 0px" }, 250);
        }
        else if (p == "-713px 0%" || p == "-713px 0px") {
            $("#ab2-testimon-you").show();
            $("#offer-testimon-scroll2").animate({ backgroundPosition: "0px 0px" }, 250);
        }
    });

    $("#ab2-ticker-1").hover(function () {
        $("#ab2-ticker-1-playnow").show();
        $("#ab2-ticker-2-playnow").hide();
    }, function () {
        $("#ab2-ticker-1-playnow").hide();
    });

    $("#ab2-ticker-2").hover(function () {
        $("#ab2-ticker-2-playnow").show();
        $("#ab2-ticker-1-playnow").hide();
    }, function () {
        $("#ab2-ticker-2-playnow").hide();
    });

    $("#ab2-ticker-2-playnow").mouseover(function () {
        $("#ab2-ticker-1-playnow").hide();
        $("#ab2-ticker-2-playnow").show();
    });

    $("#ab2-ticker-1-playnow").mouseover(function () {
        $("#ab2-ticker-1-playnow").show();
        $("#ab2-ticker-2-playnow").hide();
    });

    $("#ab2-testimon-you").hover(function () {
        $("#ab2-testimon-playnow").show();
    }, function () {
        $("#ab2-testimon-playnow").hide();
    });

    $("#ab2-testimon-playnow").mouseover(function () {
        $("#ab2-testimon-playnow").show();
    });

    if (isFlashEnabled()) {
        if (window.location.href.indexOf("10.aspx") > -1 || window.location.href.indexOf("20.aspx") > -1 || window.location.href.indexOf("referafriend.aspx") > -1 || window.location.href.indexOf("superfreebingo.aspx") > -1 || window.location.href.indexOf("superfreeslotgames.aspx") > -1 || window.location.href.indexOf("totallybritian.aspx") > -1 )
            $(".offer-default").hide();
        if (window.location.href.indexOf("10.aspx") > -1 || window.location.href.indexOf("20.aspx") > -1 || window.location.href.indexOf("referafriend.aspx") > -1 || window.location.href.indexOf("superfreebingo.aspx") > -1 || window.location.href.indexOf("superfreeslotgames.aspx") > -1 || window.location.href.indexOf("totallybritian.aspx") > -1) {
            $("#play-offer").hide();
        }
        if (typeof (headerFlash) != "undefined")
            $("#header-flash").html(headerFlash.toString());
        if (typeof (headerOfferFlash) != "undefined")
            $("#play-offer-flash").html(headerOfferFlash.toString()); ;
        if (typeof (offerFlash) != "undefined")
            $("#div-offer-flash").html(offerFlash);
    }
    else {
        $("#play-offer-flash").hide();
        $("#div-offer-flash").hide();
    }
});
