1jQuery(function() {
2	var $img = jQuery("#dokuwiki__header img").clone();
3	var $h1 = jQuery("#dokuwiki__content h1:first");
4	if ($h1.length > 0) {
5		var h1 = $h1.text();
6	} else {
7		var h1 = '';
8	}
9	var $table = jQuery("<table>")
10					.addClass("print-only")
11					.css({
12						'border-collapse': 'collapse',
13						'border': '0',//eliminate default border
14						'width':'100%',
15						'margin-bottom': '10px'
16	});
17
18	var $tr = jQuery("<tr>").appendTo($table);
19
20	var cells = [];
21
22	cells.push(jQuery("<td>").append($img));
23	if (h1 !== '')
24	{
25		$new_h1 = $h1.clone();
26		$h1.addClass("no-print");
27		cells.push(jQuery("<td>").append($new_h1));
28	}
29
30	$publish = jQuery(".approval");
31	if ($publish.length > 0) {
32
33		var status = JSINFO['status'];
34		var date = JSINFO['date'];
35		var author = JSINFO['author'];
36
37		var loc_status = jQuery('.approval_'+status).find("em").text();
38
39		var $main_div = jQuery(".approval");
40
41		if(status == 'approved')
42			var cont = LANG.plugins.prettyprint.approve+'&nbsp;<strong>'+author+'</strong>';
43		else
44			var cont = LANG.plugins.prettyprint.created+'&nbsp;<strong>'+author+'</strong>';
45
46		cells.push(jQuery("<td>").html('<p style="text-align:left">'+LANG.plugins.prettyprint.state+'&nbsp;<strong>'+loc_status+'</strong><br>'+
47					LANG.plugins.prettyprint.date+'&nbsp;'+date.replace(' ', '&nbsp;')+'<br>'+cont+'</p>'));
48	}
49	for (cell in cells) {
50		var $td = cells[cell];
51		$td.css({
52			'border':'2px solid #000',
53			'border-top':'0',
54			'text-align': 'center',
55			'vertical-align': 'middle'
56		});
57		$tr.append($td);
58	}
59
60	$tr.children().first().css('border-left', '0');
61	$tr.children().last().css('border-right', '0');
62
63	$table.prependTo("body");
64});
65