// JavaScript Document
// javascript for tours

var busstop = new Array(5)

function parkbus(line, title, text, nexturl, prevurl, stopnumber, place) {

busstop[stopnumber] = place;
var linename
var startend

switch(line) {
	case "O":
		linename = "the Oddment Tour"
		startend = "oddment"
		break;
	case "C":
		linename = "the Classical Tour"
		startend = "classical"
		break;
	case "G":
		linename = "the Gazetteer Tour"
		startend = "gazetteer"
}
switch (place) {
	case "in":
		var bustalk="bustalkin"+stopnumber
		var knightbus="knightbusin"+stopnumber
		var infobox="infoboxin"+stopnumber
		break;
	case "left":
		var bustalk="bustalkleft"+stopnumber
		var knightbus="knightbusleft"+stopnumber
		var infobox="infoboxleft"+stopnumber
		break;
	case "right":
		var bustalk="bustalkright"+stopnumber
		var knightbus="knightbusright"+stopnumber
		var infobox="infoboxright"+stopnumber
		break;	
}

var parkit = '<div id="'+bustalk+'"><span class="talktitle">'+title+'</span><br />'+text+'</div><div id="'+knightbus+'"><span class="busline">'+line+' Line</span><br />'

if (nexturl) {
	parkit += '<a href="'+nexturl+'"><img src="http://www.hplex.info/images/tour/bus-icon50tall.gif" border=0 onMouseOver="commentary('+stopnumber+')" onMouseOut="commentary('+stopnumber+')"/></a><br />' 
}else {
	parkit += '<img src="http://www.hplex.info/images/tour/bus-icon50tall.gif" border=0 onMouseOver="commentary('+stopnumber+')" onMouseOut="commentary('+stopnumber+')"/><br />'
}
parkit += '<a href="http://www.hplex.info/help/tours/tour-main#'+startend+'.html"><img src="http://www.hplex.info/images/tour/tostart.gif" title="To the start of the line" border="0"></a>&nbsp;'

if (prevurl) {
	parkit += '<a href="'+prevurl+'"><img src="http://www.hplex.info/images/tour/previous.gif" title="Previous stop" border="0"></a>&nbsp;' 
}else{
	parkit += '<img src="http://www.hplex.info/images/tour/spacer.gif" border="0">&nbsp;'
}
if (nexturl) { 
	parkit += '<a href="'+nexturl+'"><img src="http://www.hplex.info/images/tour/next.gif" title="Next stop" border="0"></a>&nbsp;'
}else{
	parkit += '<img src="http://www.hplex.info/images/tour/spacer.gif" border="0">&nbsp;'
}
parkit += '<a href="http://www.hplex.info/help/tours/tour-'+startend+'-end.html"><img src="http://www.hplex.info/images/tour/toend.gif" title="To the end of the line" border="0"></a>&nbsp;<div id="'+infobox+'"><span class="talktitle">What&#39;s this?</span><br />This entry is a stop on a Knight Bus&#39; '+line+' Line - '+linename+' of the Lexicon. Move your cursor over the bus to read about this stop. You can use the controls to navigate the tour, or click on the bus to go to the next stop.</div><img src="http://www.hplex.info/images/tour/info.gif" border="0" onMouseOver="moreinfo('+stopnumber+')" onMouseOut="moreinfo('+stopnumber+')"></div>'

document.write(parkit)

}
var flag = Array(true,true,true,true,true,true);

function commentary(stop) {
	elid = 'bustalk'+busstop[stop]+stop;
if (flag[stop]) {
  document.getElementById(elid).style.visibility="visible";
  flag[stop]=false;
}
else {
  document.getElementById(elid).style.visibility="hidden";
  flag[stop]=true;
}
}

var flag2 = Array(true,true,true,true,true,true);
function moreinfo(stop) {
	elid = 'infobox'+busstop[stop]+stop;
if (flag2[stop]) {
  document.getElementById(elid).style.visibility="visible";
  flag2[stop]=false;
}
else {
  document.getElementById(elid).style.visibility="hidden";
  flag2[stop]=true;
}
}


// end javascript for tour

// No rightclick script v.2.5

// (c) 1998 barts1000

// barts1000@aol.com

// Don't delete this header!



var message="© 2001 The Harry Potter Lexicon"; 



// Don't edit below!



function click(e) {

if (document.all) {

if (event.button == 2) {

alert(message);

return false;

}

}

if (document.layers) {

if (e.which == 3) {

alert(message);

return false;

}

}

}

if (document.layers) {

document.captureEvents(Event.MOUSEDOWN);

}

document.onmousedown=click;


