﻿<!--
function wopen(url, name, w, h)
{
// Fudge factors for window decoration space.
 // In my tests these work well on all platforms & browsers.
w += 32;
h += 96;
 var win = window.open(url,
  name, 
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=no, scrollbars=no, resizable=no');
 win.resizeTo(w, h);
 win.focus();
}
// -->
function ShareQuizGuide(type, socialType) {
    var title = encodeURIComponent((type == "quiz" ? "Quiz på det nye folkeskolen.dk" : "Oplev det nye folkeskolen.dk"));
    var summary = encodeURI((type == "quiz" ? "Prøv quizzen på det nye folkeskolen.dk og bliv overrasket." : "Det nye folkeskolen.dk - opgraderet med mere debat, viden og nyheder. Prøv selv"));
    var url = encodeURI("http://www.folkeskolen.dk");
    var image = encodeURI("http://www.folkeskolen.dk/Content/images/f.png");

    var link;
    if (socialType == "facebook") {
        link = "https://www.facebook.com/sharer.php?s=100&p[title]=" + title + "&p[summary]=" + summary + "&p[url]=" + url + "&p[images][0]=" + image;
    }
    else {
        link = "http://www.linkedin.com/shareArticle?mini=true&url=" + url + "&title=" + title +"&summary=" + summary + "&source=folkeskolen.dk";
    }
    
    window.open(link, 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}
function fbs_click_page() {
    u = location.href;
    t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}
function share_to_friend() {
    window.open('/Share?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title), 'share', 'toolbar=0,status=0,width=490,height=290');
    return false;
}
$(function() {
    $('.facebook-link').click(function() {
        fbs_click_page();
    });
    $('.print-link').click(function () {
        print();
    });
    $('.mail-link').click(function() {
        share_to_friend();
    });
});


