function init()
{
	var W3CDOM = (document.createElement && document.getElementsByTagName);
	if (!W3CDOM) return;
	var test = new Image();
	var tmp = new Date();
	var suffix = tmp.getTime();
	test.src = 'images/text/fir_test.gif?'+suffix;
	test.onload = imageReplacement;
}

function imageReplacement()
{
	replaceThem(document.getElementsByTagName('h1'));
}

function replaceThem(x)
{
	var replace = document.createElement('img');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id)
		{
			var y = replace.cloneNode(true);
			y.src = 'images/text/' + x[i].id + '.gif';
			y.alt = x[i].firstChild.nodeValue;
			x[i].replaceChild(y,x[i].firstChild);
		}
	}
}


function replacehr()
{
	var thebody = document.getElementById("content-home");
	
	var hrs = document.getElementsByTagName("hr");

	thislen = hrs.length;
	for(var i=0; i<thislen; i++)
	{
		var hr = hrs[0]
		var newtag = document.createElement("div");
		var replaced = thebody.replaceChild(newtag,hr);
		  
		if (hr.className!='')
		{
			newtag.className=hr.className;
		}
	}

}

function openWindow(filename,wide,high)
{
	popupWin = window.open(filename, 'remote', 'scrollbars=yes,resizable=no,width='+wide+',height='+high+'')
}

if (window.attachEvent) {
	if(location.pathname=='/' || location.pathname=='/index.php' || location.pathname=='/archives.php') {
		window.onload = replacehr; 
	}
}
