// ---------------------------------------------------------------------------------------------------------------
// -                                            application.js                                                   -
// ---------------------------------------------------------------------------------------------------------------

var App = {
	init: function(options) {
    this.translate_tagometer();
    this.fix_h2s();
    this.make_code_default_as_ruby();
	},
	
	translate_tagometer: function() {
		t = $('badge-yahoo-home');
		if (t) {
      Element.update($$('#tagometer .save-to-link-label').first(), 'uložte do del.icio.us'); // 'bookmark on del'
      Element.update($$('#tagometer .post-count-label-before').first(), '| '); // 'saved by'
      Element.update($$('#tagometer .post-count-label-after').first(), '&times; uloženo,'); // 'people'
      Element.update($$('#tagometer .top-tags-title').first(), 'tagy: '); // 'tags: '
		}
	},
	
	fix_h2s: function() {
	  h = $$('.body h2');
    // console.log(h);  
	  h.each( function(node) {
	    Element.update(node, '<span>'+node.firstChild.nodeValue+'</span><div>&nbsp;</div>')
	  }
    );
	},
	
	make_code_default_as_ruby: function() {
    c = $$('#article code');
    // console.log(c);
    c.each(
      function(node) {
        if ( !Element.hasClassName(node, 'php|js') ) Element.addClassName(node, 'ruby');
      }
    );
	}
} // end App
