var iMilliSeconds = 7000;	// Time to display before forwarding (milliseconds)
// List of URLs - ["URL from", "URL to"]
var aURLlist = new Array
(
	["http://www.stmarys-bideford.org.uk/", "http://www.bidefordstmarys.co.uk/"],
	["http://easyweb.easynet.co.uk/~st.marys/", "http://www.bidefordstmarys.co.uk/"],
	["http://www.st.marys.easynet.co.uk/", "http://www.bidefordstmarys.co.uk/"],
	["http://www.stmarysbideford.f9.co.uk/bidefordparish/", "http://www.bidefordstmarys.co.uk/"],
	["http://www.stmarysbideford.force9.co.uk/bidefordparish/", "http://www.bidefordstmarys.co.uk/"],
	["http://www.bidefordparish.co.uk/", "http://www.bidefordstmarys.co.uk/"],
	["D:/_Web%20Site/_1%20Username%20(Webfolder%20Server)/", "D:/_Web%20Site/_0%20F9%20Sites/bidefordparish/"],
	["D:/_Web%20Site/_2%20Username%20(Linux%20Server)/", "D:/_Web%20Site/_0%20F9%20Sites/bidefordparish/"]
);

for (var i = 0; i < aURLlist.length; ++i)
{
	if (top.location.href.indexOf(aURLlist[i][0]) > -1)
	{
		var sOldURL = aURLlist[i][0];	// Where from?
		var sSiteURL = aURLlist[i][1];	// Where to?
		bOffLine = i>5? true : false;	// Off line?
		i = aURLlist.length;
	}
}

var sSlash = bOffLine? "/" : "";	// Precede with a forward slash?
/*
These two vars replaced to force home page
var sThisPage = top.location.href.split(sOldURL)[1];	// Current page path
var sPageName = document.title.split("Anglican Parish of Bideford - ")[1].split(" (This Page Has Moved)")[0]
*/
var sThisPage = "index.html";
var sPageName = "Home Page"

function fGoHome()
{
	top.location.href = sSlash + sSiteURL + sThisPage;
}

function fWriteNewLink()
{
	doc = document;
	var aHaiku = new Array
	(
		["Seeing our great fault","What was it you sought","Everything is gone","Your browser has failed","Pages come and go","Chaos reigns within","With searching comes loss","A page sought and lost","You click much too hard","Yesterday it worked","You step in the stream","Mind, screen, both are blank","You see a blue link","It was here before"],
		["Our memory of it fades","Pages, like sheep, change their pastures","No trace of code can be found","The chips were down, the code weak","No pain, no gain. That is life","Reflect, repent, and reload","Yet the absence leads us on","Let not your heart be troubled","Of little worth is your ire","Today it is not working","But the water has moved on","There is nothing for you here","Not all steps back are backward","Do not get lost in darkness"],
		["We begin again.","Shall we take you on?","Shall we rebuild it?","No one hears your screams.","You must click again.","Order shall return.","The link leads to light.","Seek new horizons?","New page to be found.","The Web is like that.","This page is not here.","Surf to new waters.","Step forward with us.","Will you find your way?"],
		["move to a new begining","go there with us","have us build new page for you","scream again, your page will hear you","prove that 'a click in time saves nine'","restore order to the internet","enter the light and see your new page","go beyond the horizon to your new page","find yourself - and your new page","net yourself a new page","take you to where your page has gone","surf where the waves are higher","step out in faith in our company","find your way out of the maze"]
	);
	var iBase = aHaiku[0].length; // for random number base
	var iRnd0 = Math.floor(Math.random() * 1000) % iBase;
	var iRnd1 = Math.floor(Math.random() * 1000) % iBase;
	var iRnd2 = Math.floor(Math.random() * 1000) % iBase;
	doc.write("<a href=\"" + sSlash + sSiteURL + sThisPage + "\" target=\"_top\" title=\"A link to the '" + sPageName + "' page on the new site.\">");
	doc.write("<img src=\"" + sSlash + sSiteURL + "images/bideford_parish_logo_col.gif\" width=\"195\" height=\"192\" border=\"0\"  alt=\"A link to the '" + sPageName + "' page on the new site.\" style=\"padding-right:25px\"></a>");
	doc.write("<h5><i>" + aHaiku[0][iRnd0] + "<br>" + aHaiku[1][iRnd1] + "<br>" + aHaiku[2][iRnd2] + "</i><br><br>");
	doc.write("Click the link to <a href=\"" + sSlash + sSiteURL + sThisPage + "\"");
	doc.write(" target=\"_top\" title=\"A link to the '" + sPageName + "' page on the new site.\">");
	doc.write(aHaiku[3][iRnd2] + "</a>.<small><br>(The link leads to the '" + sPageName + "' page)</small></h5>");
}


function fLoadTop()
{
	if (window != top)
	{
		top.location.href = location.href;
	}

}