﻿function Bootstrap_Popout() {
    var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
    if (!is_chrome) {
        $("[id*=popout_enabled]").each(function () {
            $("#medialikebuttons").animate({ width: 'toggle' }, 1200);
        });
        $("[id*=popout_enabled]").each(function () {
            $("#POPOUT2").animate({ width: 'toggle' }, 1200);
        });
    }
    else {
        $("#medialikebuttons").each(function () {
            this.style.display = "block";
        });
        $("#POPOUT2").each(function () {
            this.style.display = "block";
        });
    }
    //POPOUT_Check_Scroll_Position();
}
var POPOUT_interval = 800;
var is_popped_out = false;
function POPOUT_Check_Scroll_Position(){
    var scrolled = $((document)).scrollTop();
    if (scrolled > 150 && scrolled < 500) {
        if (!is_popped_out) {
            is_popped_out = true;
            $("#POPOUT2").animate({ width: 'toggle' }, 800);
        }
    }
    else {
        if (is_popped_out) {
            is_popped_out = false;
            Close_Diary();
            $("#POPOUT2").animate({ width: 'toggle' }, 400);
        }
    }
    setTimeout(function () { POPOUT_Check_Scroll_Position(); }, POPOUT_interval);
}
