﻿
// AddThis.com
var addthis_config;
var addthis_url;
//var strUrl;
var intIndex;

var minHeight = 590;

function showAddThis(videoId) 
{
    $.getJSON("Services/Share/GetTitle.ashx", { "vid": videoId }, function(e) { realAdd(videoId, e) });
}

function realAdd(videoId, e) 
{
    // igoogle ... får addthis script til at fejle
    addthis_config = {
        ui_language: "da",
        services_expanded: "arto, ask, bebo, blogger, delicious, digg, email, facebook, favorites, gmail, google, hotmail, live, myspace, pdfonline, readitlater, technorati, twitter, wordpress, yahoobkm, yahoomail"
    };

    addthis_url = strUrl + "?vid=" + videoId;

    addthis_open(document.body, 'more', addthis_url, e.title);
}

function setHeight(newMinHeight)
{
    minHeight = newMinHeight;

    doResize();    
}

function doResize()
{
    var b = document.getElementById('body');
    var f = document.getElementById('Danmarksindsamling');

    h = getHeight();

    b.style.height = h;
    f.style.height = h;

    w = getWidth();

    b.style.width = w;
    f.style.width = w;
}

function getHeight()
{
    h = minHeight;   

    if (document.documentElement.clientHeight > h)
        h = document.documentElement.clientHeight;

    return h + 'px';
}

function getWidth()
{
    w = 890;

    if (document.documentElement.clientWidth > w)
        w = document.documentElement.clientWidth;

    return w + 'px';
}
