new function(){

var d = document;

if (!d.getElementById || !d.createElement) return;

window.onload = function()
{
	ins_deco();
	img_repl();
}

function ins_deco()
{
	var di = d.createElement('div');
	di.id = 'deco1';
	d.getElementById('navigation-container').appendChild(di);
	var di = d.createElement('div');
	di.id = 'deco2';
	d.body.appendChild(di);
	var di = d.createElement('div');
	di.id = 'deco3';
	d.body.appendChild(di);
	var di = d.createElement('div');
	di.id = 'slogan';
	d.body.appendChild(di);
}

function img_repl()
{
	var at = [];
	if (d.body.className.split(' ')[1] != 'index') at.length = 2;
	var ai = ['sitemap', 'mailto', 'home'];
	var a = d.links;
	var t, img;

	for (var i=0; ai[i]; i++)
	{
		if (t = d.getElementById(ai[i]))
		{
			replace(t, ai[i] +'.gif');
		}
	}

	for (var i=0; a[i]; i++)
	{
		if (a[i].className == 'more' || a[i].className == 'order')
		{
			replace(a[i], d.body.className.split(' ')[0] +'-'+ a[i].className +'.gif');
		}
		if (/item-/.test(a[i].parentNode.className))
		{
			replace(a[i], d.body.className.split(' ')[0] +'-'+ a[i].parentNode.className +'.gif');
		}
	}

	if (!d.getElementsByTagName) return;
	for (var i=0; at[i]; i++)
	{
		var t = at[i].split('/'), e = t[1], t = t[0];
		if ((t = d.getElementById(t)) && (e = t.getElementsByTagName(e)[0]))
		{
			replace(e, d.body.className.split(' ')[0] +'-'+ t.id +'.gif');
		}
	}

	function replace(element, src)
	{
		img = d.createElement('img');
		img.src = '/images/'+ src;
		img.style.position = 'absolute';
		img.style.top = '0';
		img.style.visibility = 'hidden';
		img.alt = img.title = element.firstChild.nodeValue;
		img.e = element;
		d.body.appendChild(img);
		img.onload = function()
		{
			if (window.addEventListener) this.onload = null;
			var o = this, t = element.firstChild.nodeValue;
			this.style.visibility = '';
			this.style.position = '';
			this.style.top = '';
			var s = d.createElement('span'), e = this.e;
			s.className = 'textonly';
			s.appendChild(e.firstChild);
			e.appendChild(s);
			e.appendChild(this);
		}
		if (img.width > 0 && img.width != 28) {
			img.onload();
		}
	}

}

}();