var tmpl_header = AJS.join('', [
    '<div id="top"> <img src="static_files/logo2.gif" alt="" /> <br />',
    '</div>'
]);

function insertHeader() {
    AJS.DI(tmpl_header);
}

var LINKS = {
    'introduction': 'introduction.html',
	'gallery': 'gallery.html',
    'prices': 'prices.html',
    'send_your_photos': 'send_your_photos.html',
	'services': 'services.html',
    'artistic': 'artistic.html',
	'restoration': 'restoration.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('introduction', 'Introduction'),
		create_item('gallery', 'Image Gallery'),
        create_item('prices', 'Prices'),
        create_item('send_your_photos', 'Send your photos'),
        create_item('artistic', 'Artistic Editing'),
		create_item('services', 'services'),
		create_item('restoration', 'Restoration')
    ];

    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);
}
