/**
 * @requires jQuery
 * Inserts a print button
 */
netr.printButton = function () {
	var options = {
		printText: 'Skriv ut sidan…', // Text for the print button
		position: 'append', // Where to insert the button. Can be 'append' or 'prepend'.
		targetElement: '#nav-sub' // jQuery selector matching the element to insert the button into.
	};
	function init(opts) {
		for (var key in opts) {
			if (options.hasOwnProperty(key)) {
				options[key] = opts[key];
			}
		}
		var $printButton = $('<span class="print"><button type="button">' + options.printText + '</button></span>');
		$printButton.click(function (e) {
			e.preventDefault();
			window.print();
		});
		$(options.targetElement)[options.position]($printButton);
	}
	return {
		init: init
	};
} ();
