function hideDescription(){
    $("#objectversion-description-button-icon").attr("src","img/arrow-down.png");
    $("#box-frame-description-title").hide();
    $("#box-frame-description-versiondescription").hide();
}

function showDescription(){
    $("#objectversion-description-button-icon").attr("src","img/arrow-up.png");
    $("#box-frame-description-title").show();
    $("#box-frame-description-versiondescription").show();
}

function buildDescription(){
    if (typeof _GTPollObjectVersionUrl !== "undefined" && _GTPollObjectVersionUrl !== null && !$("#box-frame-objectversion").length ){
        $.get( _GTPollObjectVersionUrl, function( data ) {
            $("body").prepend(data);
            $("#box-frame-objectversion").hide();
            $("#objectversion-description-button-icon").click(function() {
                var deschide = $.cookie('cookie.objectversiondescription.show');
                if (typeof deschide !== "undefined" && deschide !== null && deschide){
                    $.cookie('cookie.objectversiondescription.show', null);
                    showDescription();
                } else {
                    $.cookie('cookie.objectversiondescription.show', true);
                    hideDescription();
                }
            });
    
            // render current state
            var deschide = $.cookie('cookie.objectversiondescription.show');
            if (typeof deschide !== "undefined" && deschide !== null && deschide){
                hideDescription();
            } else {
                showDescription();
            }
            $("#box-frame-objectversion").show();
            //59339
            $("#reportcontainer").css("height",$("#reportcontainer").height() - $("#box-frame-objectversion").height() + "px").css("min-height","");
            $("#reportcontainer").css("height","");
            $(".objectversion-float-right").show();
            $('body').css('visibility','visible');//72524
            $(window).scroll();

            $( window ).resize(function() {
                $("#reportcontainer").css("height","");
            });
        });
    }
}