// Break out of frames
if (parent.frames.length > 0) {
    parent.location.href = self.document.location
}

// Work out which browser we're using
ns4=document.layers
ie4=document.all
ns6=document.getElementById&&!document.all

// Offsets for the start position of the menu
x_offset=-95;
y_offset=0;

// Set up window regeneration for Netscape 4
function regenerate() {
	window.location.reload();
}
if (ns4) setTimeout("window.onresize=regenerate", 400);


function pull() {
	if (window.elmove)		clearInterval(elmove);
	if (window.drawMenu)	clearInterval(drawMenu);
	pullMenu = setInterval("pullEngine()", 50);
}
function draw() {
	clearInterval(pullMenu);
	drawMenu = setInterval("drawEngine()", 50);
}
function pullEngine() {
	if (ie4 && slideMenu.pixelLeft < boundryR + document.body.scrollLeft)		slideMenu.pixelLeft += 5 + (boundryR + document.body.scrollLeft) % 5;
	else if(ns4 && slideMenu.left < boundryR + window.pageXOffset) 				slideMenu.left += 5;
	else if (window.pullMenu)													clearInterval(pullMenu);
}
function drawEngine() {
	if (ie4 && slideMenu.pixelLeft > boundryL + document.body.scrollLeft)   	slideMenu.pixelLeft -= 5;
	else if(document.layers && slideMenu.left > boundryL + window.pageXOffset) 	slideMenu.left -= 5;
	else if (window.drawMenu)   {			clearInterval(drawMenu);			elmove = setInterval("el_move()",10);}

}
function el_move() {
	if(ns4){document.layers.tray.top=window.pageYOffset+y_offset;document.layers.tray.left=window.pageXOffset+x_offset}
	if(ie4){document.all.tray.style.pixelTop=document.body.scrollTop+y_offset;document.all.tray.style.pixelLeft=document.body.scrollLeft+x_offset}
	if(ns6){document.getElementById("tray").style.top=document.body.scrollTop+y_offset;document.getElementById("tray").style.left=document.body.scrollLeft+x_offset}
}

// Output the menu
if (ns4) {
	document.write('<layer id="tray" onMouseover="pull()" onMouseout="draw()">')
	boundryR = 0-x_offset;
	boundryL = 0;
}
else if (ie4||ns6)	{
	document.write('<div id="tray" onMouseover="pull()" onMouseout="draw()">')
	boundryR = 0;
	boundryL = x_offset;
}

document.write("<table cellspacing='0' cellpadding='0'><tr><td id='menu' valign='top'>")
document.write("<a href='http://www.allen-williams.com/addresses.htm'>address book</a><hr>")
document.write("<a href='http://dave.allen-williams.com'>dave</a><br>")
document.write("<a href='http://www.allen-williams.com/lizzie'>lizzie</a><br>")
document.write("<a href='http://www.maircrosoft.com' target='_top'>mair</a><br>")
document.write("<a href='http://www.fluffles.com' target='_top'>catrin</a><br>")
document.write("<a href='http://peterandruth.allen-williams.com'>peter and ruth</a><br>")
document.write("<a href='http://www.allen-williams.com/djf'>david j f</a><br>")
document.write("&nbsp;<br>")
document.write("</td><td><img src='http://www.allen-williams.com/images/menu_aw.gif'></td></tr></table>")

if (ns4) {
	document.write('</layer>')
	slideMenu = document.layers.tray;
}
else if (ie4||ns6)	{
	document.write('</div>')
	if (ie4) 
		slideMenu = document.all.tray.style;
	else
		slideMenu = document.getElementByID("tray").style;
}
elmove=setInterval("el_move()",10);
