﻿function closePopUpWindow() {
    // $(".FistTimePopUp").css("display", "none");
    var date = new Date();
    window.location.href = "http://www.byreferralonly.com/dashboard/default.aspx?t=03_48_54";
}

$(document).ready(function() {
    $(".LiveUpcomingEventsWrapper .container .event .icon").click(function() {
        var parentID = $(this).parent().attr("id");


        if ($(".LiveUpcomingEventsWrapper .container #" + parentID + " .icon").attr("src") != "http://www.byreferralonly.com/assets_1/dashboard/dashboard/images/minus_icon.png") {
            $(".LiveUpcomingEventsWrapper .container .event .icon").attr("src", "http://www.byreferralonly.com/assets_1/dashboard/dashboard/images/plus_icon.png");
            $(".LiveUpcomingEventsWrapper .container  .event .hotelWrapper").hide();
            $(".LiveUpcomingEventsWrapper .container #" + parentID + " .icon").attr("src", "http://www.byreferralonly.com/assets_1/dashboard/dashboard/images/minus_icon.png");
            $(".LiveUpcomingEventsWrapper .container #" + parentID + " .hotelWrapper").fadeIn(500);
        }
        else {
            $(".LiveUpcomingEventsWrapper .container #" + parentID + " .icon").attr("src", "http://www.byreferralonly.com/assets_1/dashboard/dashboard/images/plus_icon.png");
            $(".LiveUpcomingEventsWrapper .container #" + parentID + " .hotelWrapper").hide();
        }
    });
});

var player = null;
function playerReady(obj) {
    //alert(obj['id']);
    player = document.getElementById(obj.id);
};

function SizepopWindow(height, time) {
    //        var startWidth = $("[ID$='firstLoginPopUp_fPopUpMiddleTopImage']").width();
    //        var endWidth = startWidth - width;

    //var startHeight = $("[ID$='firstLoginPopUp_fPopUpLeftSideWrapperBorder']").height();
    var endHeight = height;

    //        $("[ID$='firstLoginPopUp_fPopUpMiddleTopImage']").animate({
    //            width: endWidth + "px"
    //        }, time);

    //        $("[ID$='firstLoginPopUp_fPopUpMiddleWrapper']").animate({
    //            width: endWidth + "px"
    //        }, time);

    //        var width1 = $("[ID$='firstLoginPopUp_fPopUpWrapper']").width();
    //        var secondEndWidth = width1 - width;
    //        var newMarginLeft = (secondEndWidth / 2) * -1;
    //        $("[ID$='firstLoginPopUp_fPopUpWrapper']").animate({
    //            width: secondEndWidth + "px",
    //            marginLeft: newMarginLeft + "px"
    //        }, time);
    $("[ID$='ifPopUp']").animate({
        //width: endWidth + "px",
        height: endHeight + "px"
    }, time);

    $("[ID$='firstLoginPopUp_fPopUpContentContainer']").animate({
        //width: endWidth + "px",
        height: endHeight + "px"
    }, time);

    //        $("[ID$='firstLoginPopUp_fPopUpMiddleBottomImage']").animate({
    //            width: endWidth + "px"
    //        }, time);

    // height --------------------------------------

    $("[ID$='firstLoginPopUp_fPopUpLeftSideWrapperBorder']").animate({
        height: endHeight + "px"
    }, time);


    $("[ID$='firstLoginPopUp_fPopUpRightSideWrapperBorder']").animate({
        height: endHeight + "px"
    }, time);

    //        setTimeout("$('#playerDivpopUpPlayer').remove();", time);
    //        $(".firstTimePopUp .vidWrapper").fadeOut(time / 2);
    //        $(".firstTimePopUp .okCloseWrapper").fadeIn(time);

}

function stopPlayer() {
    //        if (player != null) {
    //            player.stop();
    //        }
    //        else {
    //            //wait a sec then try again
    //            setTimeout("stopPlayer();", 1000);
    //        }
}
