var tmpl_header = AJS.join('', [
    '<div id="top"> <span style="font-weight: normal; color: #000; float: right; margin-top:20px;  font-size:11px; background-color:#333; padding-left:5px; padding-right:5px;" ><a href="tintones.html">de</a> | <a href="index.html">en</a></span>',
    '<a href="tintones.html"><img src="static_files/logo-m-russ.gif" alt="" style="margin-top:3px"/> </a><br />',
	    '<span style="font-weight: bold; color: #929191">Michael Andreas Russ</span>',
    '</div>'
]);

function insertHeader() {
    AJS.DI(tmpl_header);
}

var LINKS = {
    'tintones': 'index.html',
        'wall-to-wall': 'en-wall-to-wall.html',
	'publications': 'en-publications.html',
    'motion': 'en-motion.html',
	'press': 'en-press.html',
    'about': 'en-about.html',
    'contact': 'en-contact.html',
    'links': 'en-links.html'
}

function insertMenu(current_page) {
    var menu = AJS.UL({id: 'menu'});
    var create_item = function(cls, name) {
        var item = AJS.LI({'class': cls});
        AJS.ACN(item, AJS.A({href: LINKS[cls]}, name));
        return item;
    }
    var items = [
        create_item('tintones', 'TinTones'),
				create_item('publications', 'publications'),
                create_item('wall-to-wall', 'wall to wall'),
		create_item('press', 'press'),
        create_item('motion', 'motion'),

		create_item('about', 'about'),
        create_item('contact', 'contact'),
        create_item('links', 'links')
    ];

    AJS.map(items, function(item) {
        if(item.className == current_page) {
            AJS.addClass(AJS.$bytc('a', null, item)[0], 'current');
        }
        AJS.ACN(menu, item);
    });
    AJS.DI(menu);
}

function insertCode() {
    var code = AJS.join('\n', arguments);
    var result = '<pre><code>';
    code = code.replace(/</g, '&lt;').replace(/>/g, '&gt;');
    result += code;
    result += '</code></pre>';
    document.write(result);
}

