﻿var sHeading = "doc_heading_";
var sSection = "doc_section_";

function checkSubmit(e, d, f) {
    if (d) document.forms[0].submit();
}

$(document).ready(function() {
    /*** AUTOCOMPLETE ON SEARCH **********************************************/
    $("#query").autocomplete('/getkeywords.aspx', { selectFirst: false, width: 223 });
    $("#query").result(checkSubmit);

    $("span.doc_image").parent().css("text-decoration", "none");

    /*** EXTERNAL ICON *******************************************************/
    $('a.external').each(function () {
        if ($(this).parent().find('img').length == 0)
            $(this).after('&nbsp;<img src="/image/external.gif" alt="ekstern link" />');
    });

    /*** FLASHPLAYER *******************************************************/
    if ($("#player").html() != null) {
        flowplayer("player", "/swf/flowplayer.commercial-3.2.7.swf", {
            key: '#$810327d7b35a05dcf04',

            // text localization
            play: {
                replayLabel: 'Afspil igen' 
            },

            // do not start automatically
            clip: {
                autoPlay: true,
                autoBuffering: true
            },

            // controlbar settings
            plugins: {
                controls: {

                    // setup a background image
                    // background: 'url(/img/player/skin_leather.png) repeat',

                    /* you may want to remove the gradient */
                    //backgroundGradient: 'none',

                    // these buttons are visible
                    buttonColor: '#3f81d9',
                    bufferGradient: 'none',
                    tooltipTextColor: '#ffffff',
                    backgroundGradient: 'medium',
                    borderRadius: '5',
                    volumeSliderColor: '#000000',
                    volumeSliderGradient: 'none',
                    backgroundColor: '#0a0a0a',
                    progressColor: '#3f81d9',
                    bufferColor: '#94b8ea',
                    tooltipColor: '#5F747C',
                    timeBgColor: '#555555',
                    sliderColor: '#000000',
                    sliderGradient: 'none',
                    buttonOverColor: '#6b9de1',
                    timeColor: '#94bdf5',
                    progressGradient: 'medium',
                    durationColor: '#ffffff',
                    height: 24,
                    opacity: 1.0,
                    autoHide: 'always',
                    hideDelay: 2000
                }
            }
        });
    }
});

