function localInit() {
poststart();
try {pageInit()} catch (e) {;}
}
//----------------------------------------

function poststart() {
message = getElementsByClassName(document,"div","colap");
document.getElementById("howmany").innerHTML = textNum(message.length);
// if the URL has a ?number then that message counted from the bottom is opened and the page scrolls to show it.
if (document.location.href.indexOf("?")>0 || document.location.href.indexOf("index")>0) { 
	passnum = document.location.search;
	passnum = 1 * passnum.substring(1,passnum.length);
	if (passnum == 0) {
		shownum = 0;
		} else {
		shownum = message.length - passnum;
		}
	message[shownum].style.display = "block";
	Ypos = message[shownum].offsetTop;
	if (passnum >0) scroll(0,Ypos);
	}
}	// end of local functions after loading
//----------------------------------------

function collapseall() {
state="block";
witch = false;
for (var x=20;x<document.all.length;x++) {
	if (document.all[x].className == "colap" && document.all[x].style.display == "block") witch = true;
	}
if (witch) state="none"; 
for (var x=20;x<document.all.length;x++) {
	if (document.all[x].className == "colap") document.all[x].style.display = state;
	}
if (state=="block") {
	document.getElementById("toggle").value = "Hide All Messages";
	} else {
	document.getElementById("toggle").value = "Show All Messages";
	} 
}	// end of show/hide all messages
//----------------------------------------

function showbelow(obj) {

posn=0;
while (obj != document.all[posn]) {posn++};

while (document.all[posn].className != "colap") {posn++;};
if (document.all[posn].style.display == "block") {
	document.all[posn].style.display = "none";
	} else {
	document.all[posn].style.display = "block";
	}
}	// end of show/hide individual message
//----------------------------------------

function hide(divobj) {divobj.style.display = "none";}

//----------------------------------------
function numbermessages() {
messender = getElementsByClassName(document,"span","nam");
for (var x=0; x < messender.length; x++) {
	n = messender.length-x;
	messender[x].innerHTML = prezero(n,3) + " " + messender[x].innerHTML
	}
}
//----------------------------------------
var picID = 0;

function writepostpicHTML(caption) {
picID++;
var al = arguments.length;
if (caption == "") {
	caption = "Click the curly corner to see " + (al-2) + " more photos";
	if (al == 3) caption = "Click the curly corner to see another photo";
	}
var imNum = prezero(picID,2);
document.writeln("<div style=position:relative;width:480px;height:360px; id=frmref" + imNum + ">");
var recall_1st_num = imNum;
document.writeln("<img class=swipe id=picref" + imNum + " src=graphics/" + arguments[1]+ ".jpg width=480 alt=\'" + caption + "\'>");
var msg = "<img class=curl src=../home/graphics/turn.gif onClick=\"swap(picref" + imNum ;
for (var x = 1;x < al;x++) {
	msg+=",\'" + arguments[x] + "\'";
	}
msg+=")\" alt=\'Click to change picture\'>";
document.write(msg);
document.writeln("</div>");
if (al>2) { // preload the hidden images
	for (var x=2;x<al;x++) {document.writeln("<img class=pre width=0 height=0 src=graphics/" + arguments[x] + ".jpg alt=hidden>");}
	}
}
//=========================================
// Post section replaced by Motorbike section 1/11/2008. These lines make Post accessible after change.

var post_menu_db = ["1|<img src=../home/gifs/post.gif align=left><u>P</u>ost|post/post_index.htm|Connected directly to the Leicester Phoenix MCC Forum||3,4,5|1|30/12/2006|||||||",
	"2|2006|post/post_2006.htm|All the post from 2006||5|2|23/12/2006|||||||",
	"2|2005|post/post_2005.htm|2005 messages in date order|||2|31/12/2005|||||||",
	"2|2004|post/post_2004.htm|The messages sent in 2004|||2|23/12/2004||||||||",
	"2|2003|post/post_2003.htm|Read the mesages from your old pals||5|2|29/12/2003|||||||",
	"2|2002|post/post_2002.htm|See who discovered the website soon after if began|||2|31/12/2002|||||||"];

for (var m = 0; m < menu_db.length; m++) {
	if (menu_db[m].split("|")[2] == "news/news_index.htm") {
		for (var n = 0; n < post_menu_db.length;n++) {
			menu_db.splice(m+n,0,post_menu_db[n]);
			}
		m = menu_db.length;
		}
	}










