<!--
/*----thisfile, droplist, endlinks, toplinks--------------*/
/*var gnetstr="http:\/\/homepage.ntlworld.com\/scrumpy\/5pp\/";*/
var gnetstr="";
var numpages=9;
var mainpage=new Array(numpages);
mainpage[0]="index";
mainpage[1]="5ppdisco";
mainpage[2]="5ppchron";
mainpage[3]="5ppfaq";
mainpage[4]="5ppgigs";
mainpage[5]="5ppontv";
mainpage[6]="5ppsongs";
mainpage[7]="5pplinks";
mainpage[8]="5ppshop";
var optdesc=new Array(numpages);
optdesc[0]="Fivepenny Piece Main Page";
optdesc[1]="Fivepenny Piece Discography";
optdesc[2]="Fivepenny Piece Chronology";
optdesc[3]="Fivepenny Piece FAQ Page";
optdesc[4]="Fivepenny Piece Gigs Page";
optdesc[5]="Fivepenny Piece On TV";
optdesc[6]="Fivepenny Piece Songs";
optdesc[7]="5PP Gradely Links Page";
optdesc[8]="The Gradely Corner Shop";
var shortdes=new Array(numpages);
shortdes[0]="Fivepenny Piece Main Page";
shortdes[1]="5PP Discography";
shortdes[2]="5PP Chronology";
shortdes[3]="5PP FAQ";
shortdes[4]="5PP Gigs";
shortdes[5]="5PP On TV";
shortdes[6]="5PP Songs";
shortdes[7]="Gradely Links";
shortdes[8]="The Gradely Corner Shop";
var imgname=new Array(numpages);
imgname[0]="home";
imgname[1]="disc";
imgname[2]="hist";
imgname[3]="faqs";
imgname[4]="gigs";
imgname[5]="ontv";
imgname[6]="song";
imgname[7]="link";
imgname[8]="shop";
var imgwid=new Array(numpages);
imgwid[0]=88;
imgwid[1]=90;
imgwid[2]=120;
imgwid[3]=68;
imgwid[4]=76;
imgwid[5]=50;
imgwid[6]=102;
imgwid[7]=85;
imgwid[8]=85;
/*-------get name of this file--------*/
function thisfile(){//get name of this file
fileurl=document.URL; //get filename url
//fileurl="http://www.5pp.co.uk/";//debug
urlength=fileurl.length; //no. of chars in URL
//document.write("<br \/>url="+fileurl+"<br \/>length="+urlength+"<br \/><br \/>"); //debug
var slashch="/"; //slash character
//var bslashch=String.fromCharCode(92); //backslash character
var bslashch="\\"; //backslash character
var dotch="."; //dot character
var slashpos=-1; //init last slash position
//scan url string to find last slash or backslash
i=0; //init loop counter to first char of url string
while (i < urlength){//loop to end of string
	nextchar=fileurl.substr(i,1); //get next char
//	document.write(nextchar); // debug
	if ((nextchar==slashch)||(nextchar==bslashch)){// look for slash or backslash
		slashpos=i; //note position of last slash or backslash
	};//endif
	i++; // inc loop counter
};//endloop
//document.write("<br \/>slashpos="+slashpos+"<br \/>"); //debug
filename=fileurl.substring(slashpos+1,urlength); // extract filename.type
filength=filename.length; // length of filename.type
//document.write("<br \/>filename="+filename+"<br \/>"); //debug
//document.write("<br \/>filength="+filength+"<br \/>"); //debug
//find dot
var dotpos=-1; //init dot position
i = 0;//init loop counter to first char of filename.type
while (i < filength){//loop to end of filename.type
	nextchar=filename.substr(i,1); //get next char
	if (nextchar==dotch){//look for dot
		dotpos=i; //note position of dot
		break; //dot found, stop looking (assumes only 1 dot)
	};//endif
	i++; //inc loop counter
};//endloop
//document.write("<br \/>dotpos="+dotpos+"<br \/>"); //debug
if (dotpos<0){//if no dot found
	filename="index.html";//assume index file
	dotpos=5;
};
filename=filename.substring(0,dotpos); // extract filename
filength=filename.length;//filename length
//document.write("<br \/>filename="+filename+"<br \/>"); //debug
//document.write("filength="+filength+"<br \/>"); //debug
mpagefl=-1; //init not a main page
for (i=0; i<numpages; i++){//for each main page
	if (filename==mainpage[i]){//if this file is a main page
		mpagefl=i;//note which one
	};//endif
//document.write(i+"<br \/>"); //debug
}//endfor
if (mpagefl<0){//if not a main page
//document.write("<br \/>filename="+filename+"<br \/>"); //debug
//document.write("filength="+filength+"<br \/>"); //debug
	if (filength==8){//if it could be a song file
//		document.write(filename.substring(0,7)+"<br \/>");//debug
		if (filename.substring(0,7)=="5ppsong"){//if a song file
			filename="5ppsong";//song file
		}
		else{//not a song file
			filename="5ppxxx";//assume record
		};//endif
	}
	else{//not a song file (name too short/long)
		filename="5ppxxx";//assume record
	};//endif
};//endif
//document.write("filename="+filename+"<br \/><br \/>"); //debug
return filename;
}//endfn
/*-------------droplist---------*/
function droplist(choice){// select a page from drop down list
var pageurl, urlvalue;
urlvalue = choice.options[choice.selectedIndex].value;
if(urlvalue){
   if(choice.form.target)pageurl = parent[choice.form.target];
   else pageurl = window;
   if (! pageurl) return true;
   pageurl.location = urlvalue;
};//endif
return false;
}//endfn
/*--------write end links-------------------------*/
function endlinks(p1){
for (i=1; i<numpages; i++){//for each main page
barflag=1;//init bar separator flag to "yes"
if ((p1!=mainpage[i])&&(!((p1=="5ppxxx")&&(i==1)))&&(!((p1=="5ppsong")&&(i==6)))){//if this isn't the page then write the link
	document.write("<a href=\""+gnetstr+mainpage[i]+".html\">"+shortdes[i]+"<\/a>");
	}
else{
	barflag=0; //no bar separator
};
if ((p1==mainpage[i])||(i==numpages-1)){//if this page or last, no bar
	barflag=0; //no bar separator
};

if ((barflag>0)&&((i!=numpages-2)||(p1!=mainpage[numpages-1]))){
	document.write(" &nbsp;<b>&#124;</b>&nbsp; ");//write bar separator
};
//document.write(i+"<br \/>"); //debug
}//endfor
}
/*--------write all top links and dropdown list-----*/
function toplinks(p1){
document.write("<b><i>Links To Other Pages<\/i><\/b><br \/>");
if (p1==mainpage[0]){
	document.write("<span class=\"herefont\">"+shortdes[0]+"<\/span>");
	}
else{
	document.write("<a href=\""+gnetstr+mainpage[0]+".html\">Back To "+shortdes[0]+"<\/a>");
};
document.write("<br \/>");
for (i=1; i<numpages; i++){ //loop for each link
desctext=shortdes[i];
if ((p1=="5ppxxx")&&(i==1)){
	desctext="Back To "+desctext+"<br \/>";
};
if (p1==mainpage[i]){
	document.write("<span class=\"herefont\">"+desctext+"<\/span>");
	}
else{
	document.write("<a href=\""+gnetstr+mainpage[i]+".html\">"+desctext+"<\/a>");
};
if ((i==3)||(i==5)){
	document.write(" &nbsp;<b>&#124;</b>&nbsp; ");
	}
else{
	document.write("<br \/>");
};
//document.write(i+"<br \/>"); //debug
}//endfor
document.write("<br \/><form action=\"\" method=\"post\" onSubmit=\"return droplist(this.selurl)\">");
document.write("<select class=\"selstyle\" name=\"selurl\" size=\"1\"");
document.write(" onSubmit=\"if(options[selectedIndex].value)");
document.write("window.location.href= (options[selectedIndex].value)\">");
document.write("<option class=\"dropfrst\" value=\"\">Site Index: choose a page... &amp; go!<\/option>");
for (i=0; i<numpages; i++)
{
	document.write("<option class=\"");
	if (p1==mainpage[i])
		{
		document.write("curropt\" value=\"");
		}
	else
		{
		document.write("droption\" value=\""+gnetstr+mainpage[i]+".html");
	}
	document.write("\">"+optdesc[i]+"<\/option>");
//document.write(i+"<br \/>"); //debug
}//endfor
document.write("<\/select><input type=\"submit\" value=\"Go!\" \/><\/form>");
}//endfunc
/*-----------imgchg-----------------*/
function imgchg(pname,pimage,pimtype) {
document[pname].src='images/hmenu/'+pimage+'.'+pimtype;
}//eofn
/*------------write horizontal menu------------------*/
function hmenu(p1) {
document.write("<table columns=\""+numpages+4+"\" align=\"center\" border=\"0\" ");
document.write("cellpadding=\"0\" cellspacing=\"0\"><tr>");
document.write("<td width=\"56\"><img src=\"images\/hmenu\/5ppzleft.gif\" width=\"56\" height=\"40\"></td>");
document.write("<td width=\"50%\"><img src=\"images\/hmenu\/5ppzmidd.gif\" width=\"100%\" height=\"40\"></td>");
for (i=0; i<numpages; i++){ //loop for each link
document.write("<td width=\""+imgwid[i]+"\">");
if (p1==mainpage[i]){
document.write("<a name=\"\" onmouseover=\"imgchg(\'");
document.write("img"+imgname[i]+"\',\'5pp"+imgname[i]+"t\',\'gif\')\" onmouseout=\"imgchg(\'");
document.write("img"+imgname[i]+"\',\'5pp"+imgname[i]+"t\',\'gif\')\">");
document.write("<img name=\"img"+imgname[i]+"\" src=\"images\/hmenu\/5pp"+imgname[i]+"t.gif\" ");
document.write("width=\""+imgwid[i]+"\" height=\"40\" border=\"0\" hspace =\"0\" vspace=\"0\" alt=\""+optdesc[i]+" - you\'re already on this page!"+"\" \/>");
document.write("<\/a>");
}
else {
document.write("<a href=\""+mainpage[i]+".html\" onmouseover=\"imgchg(\'");
document.write("img"+imgname[i]+"\',\'5pp"+imgname[i]+"s\',\'gif\')\" onmouseout=\"imgchg(\'");
document.write("img"+imgname[i]+"\',\'5pp"+imgname[i]+"u\',\'gif\')\">");
document.write("<img name=\"img"+imgname[i]+"\" src=\"images\/hmenu\/5pp"+imgname[i]+"u.gif\" ");
document.write("width=\""+imgwid[i]+"\" height=\"40\" border=\"0\" hspace =\"0\" vspace=\"0\" alt=\""+optdesc[i]+"\" \/>");
document.write("<\/a>");
};
document.write("</td>");
}//endfor
document.write("<td width=\"50%\"><img src=\"images\/hmenu\/5ppzmidd.gif\" width=\"100%\" height=\"40\"></td>");
document.write("<td width=\"56\"><img src=\"images\/hmenu\/5ppzrigh.gif\" width=\"56\" height=\"40\"></td>");
document.write("</tr></table>");
}//eofn
//-->