2 * utils.js - utility functions
4 * author: hackbard@hackdaworld.org
12 function objdbg(obj) {
13 var msg="debug object:\n";
15 msg=msg+"--> "+k+": "+obj[k]+"\n";
20 function anddbg(obj) {
21 var msg="debug object:\n";
23 msg=msg+"--> "+k+": "+obj[k]+"\n";
28 function vert_align_text(trg) {
29 $(trg).each(function() {
30 var lh=$(this).height();
31 $(this).css('line-height',lh+'px');
32 $(this).css('vertical-align','middle');
36 function html2ascii(str) {
37 str=str.replace(/\Ä\;/g,"Ä");
38 str=str.replace(/\Ö\;/g,"Ö");
39 str=str.replace(/\Ü\;/g,"Ü");
40 str=str.replace(/\ä\;/g,"ä");
41 str=str.replace(/\ö\;/g,"ö");
42 str=str.replace(/\ü\;/g,"ü");
43 str=str.replace(/\ß\;/g,"ß");
44 str=str.replace(/\&\;/g,"&");
48 function ascii2html(str) {
49 str=str.replace(/&/g,"&");
50 str=str.replace(/Ä/g,"Ä");
51 str=str.replace(/Ö/g,"Ö");
52 str=str.replace(/Ü/g,"Ü");
53 str=str.replace(/ä/g,"ä");
54 str=str.replace(/ö/g,"ö");
55 str=str.replace(/ü/g,"ü");
56 str=str.replace(/ß/g,"ß");