window.onload = init;

var winwin;

function viewScreenshot(url) {
  winwin=window.open('../screenshots.php?pic='+url,'poppypoppop','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=550, height=400, left=50, top=50');
  if (window.focus) {
    winwin.focus()
  }
}

function viewPage(url) {
  winwin=window.open(url,'poppypoppop','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=605, height=390, left=50, top=50');
  if (window.focus) {
    winwin.focus()
  }
}

// Image Replacement by Peter-Paul Koch - quirksmode.org
// http://www.quirksmode.org/dom/fir.html

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 = '/img/title-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 = '/img/' + x[i].id + '.gif';
			y.alt = x[i].firstChild.nodeValue;
			x[i].replaceChild(y,x[i].firstChild);
		}
	}
}