﻿/*
 * DSCert javascript file
 * created: 2010 03 01
 */
var newhref = location.href;
if (newhref.indexOf("#print") != -1) {
    $("html").addClass("printing");
}

function log(s){
    if(window.console){
	    console.log(s);	
    }
};
// This functions sorts numbers descending.
function sortNumber(a,b){return b - a;};
var App = {
    Print: {
        clickFunction: function() {
            $("#printPage").click(function(e) {
                e.preventDefault();
                var newhref = window.location + "#print";
                window.open(newhref,"","scrollbars=yes,height=600,width=500");
            });
        },
        printPrintPage: function() {
            var newhref = location.href;
            if (newhref.indexOf("#print") != -1) {
                window.print();
            }
        },
        init: function() {
            App.Print.clickFunction();
            App.Print.printPrintPage();
        }
    },
    Frontpage: {
        removeEmpties: function() {
            $(".ds-row:not(:has(table))").hide();
        },
        init: function() {
            App.Frontpage.removeEmpties();
        }
    },
    init: function() {
        App.Print.init();
    }
}
$("document").ready(function() {
    App.init();
});
