// This is the constructor function for our new NavigationItem class.

// Calling it creates a NavigationItem object and outputs the required

// <A> and <IMG> tags into the specified document at the current location. 

// Therefore, don't call it for the current document from an event handler.

// Arguments:

//	document:		The Document object the navigation list will be created in.

//	selected:		A boolean indicating the navigation button is initially selected.

//	label:			An optional string that specifies text to appear after the button.

//	onclick:		An optional function to be called when the navigation button is

//					clicked. It will be passed a boolean indicating the new

//					state of the button. You can also pass a string, which will

//					be converted to a function which is passed a boolean argument

//					named "state".

//	target_URL:		The URL for the target image.

//	target_image:	The unselected target (black) image

//	hilite_image:	The hilighted image used by mouseover event

//	here_image:		The selected 'your here' (white) image



function NavigationItem(document, selected, label, onclick, target_URL, target_image, hilite_image, here_image)

{

	

	// Save some of the arguments we were passed.

	this.document = document;

	this.selected = selected;

	this.label = label;

	this.target_URL = target_URL;

	this.target_image = target_image;

	this.hilite_image = hilite_image;

	this.here_image = here_image;



	this.document.write('<br>target_image: ' + this.target_image);



	this.imagenames = new Array(3);		// Create an array.

	this.imagenames[0] = this.target_image;	// unselected

	this.imagenames[1] = this.hilite_image;	// highlighted

	this.imagenames[2] = this.here_image;		// selected



	// First time called, document will be false. Ignore this call.

	if (document == null) return;



	// The first time we are called (and only the first time) we have

	// to do some special stuff. First, now that the prototype object

	// is created, we can set up our methods. 

	// Second, we've got to load the images that we'll be using.

	// Doing this will get the images in the cache for when we need them.

	if (!NavigationItem.prototype.over) {

		// Initialize the prototype object to create our methods.

		NavigationItem.prototype.over = _NavigationItem_over;

		NavigationItem.prototype.out = _NavigationItem_out;

		NavigationItem.prototype.click = _NavigationItem_click;



		// Now create an array of image objects, and assign URLs to them.

		// The URLs of the images are configurable, and are stored in an

		// array property of the constructor function itself. They will be

		// initialized below. Because of a bug in Navigator, we've got

		// to maintain references to these images, so we store the array

		// in a property of the constructor rather than using a local variable.

		this.images = new Array(3);

		for(var i = 0; i < 3; i++) {

			this.images[i] = new Image(NavigationItem.width,

											NavigationItem.height);

			this.images[i].src = this.imagenames[i];

		}

	}



	var url = /(\w+):\/\/([\w.]+)\/(\S*)/;

	var text = this.document.URL;

	var result = text.match(url);

	if (result != null) {

		var fullurl = result[0];	// Contains full url

		var protocol = result[1];	// Contains "http"

		var host = result[2];		// Contains url host

		var path = result[3];		// Contains document path

	}



	this.document.write('<br>path: ' + path);



	// this.document.write('<br>document.URL: ' + document.URL);

	this.document.write('<br>target_URL: ' + target_URL);

	if (path == this.target_URL) {

		this.selected = true;

	}



	// Remember that the mouse is not currently on top of us.

	this.highlighted = false;



	// Save the onclick argument to be called when the button is clicked.

	// If it is not already a function, attempt to convert it

	// to a function that is passed a single argument, named state.

	this.onclick = onclick;



	// Figure out what entry in the document.images[] array the images

	// will be stored at.

	var index = document.images.length;



	// Now output the HTML code. Use <A> and <IMG> tags.

	// The event handlers we output here are confusing, but crucial to the

	// operation of this class. The "_tb" property is defined below, as

	// are the over(), out(), and click() methods.

	document.write('&nbsp;<A HREF =""' +

	'onMouseOver="document.images[' + index + ']._tb.over();return true;" '+

	'onMouseOut="document.images[' + index + ']._tb.out()" '+

	'onClick="document.images[' + index + ']._tb.click(); return false;">');

	document.write('<IMG SRC="' + this.imagenames[this.selected*2] +'"'+

				' WIDTH=' + NavigationItem.width +

				' HEIGHT=' + NavigationItem.height +

				' ALT="' + this.label + '"' +

				' BORDER="0" HSPACE="0" VSPACE="0" >');

	document.write('</A>');

	document.write('<br>');



	// Now that we've output the <IMG> tag, save a reference to the

	// Image object that it created in the NavigationItem object.

	this.image = document.images[index];



	// And also make a link in the other direction: from the Image object

	// to this NavigationItem object. Do this by defining a "_tb" property

	// in the Image object.

	this.image._tb = this;

}



// This becomes the over() method.

function _NavigationItem_over()

{

	// Change the image, and remember that we're highlighted.

	this.image.src = this.imagenames[1];

	this.highlighted = true;

}



// This becomes the out() method.

function _NavigationItem_out()

{

	// Change the image, and remember that we're not highlighted.

	this.image.src = this.imagenames[this.selected * 2];

	this.highlighted = false;

}



// This becomes the click() method.

function _NavigationItem_click()

{

	// Toggle the state of the button, change the image, and call the

	// onclick method, if it was specified for this NavigationItem.

	this.selected=true;

	this.image.src = this.imagenames[this.selected*2];

	if (this.onclick) this.onclick(this.target_URL);

}

function _NavigationItem_onclick( target_URL ) {

	if (path != this.target_URL) {

		location=this.target_URL;

	}

}



// Initialize static class properties that describe the images. These

// are just defaults. Programs can override them by assigning new values.

// But they should only be overridden *before* any NavigationItems are created.

NavigationItem.width = 162;								// Image width 

NavigationItem.height = 25;								// Image height



function Test(document, message) {

	this.document = document;

	this.message = message;



	this.document.write('<br>' + message + '<br>');

}



//function HeaderImage(document, header_image, header_alt, header_width)

function HeaderImage(document)

{

	// Save some of the arguments we were passed.

	this.document = document;

	//this.header_image = header_image;

	//this.header_alt = header_alt;

	//this.header_width = header_width;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

		'<body bgcolor="#ffffff" marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0" border="0">' +

		'<center>' +

		'<table cellpadding="5">' +

			'<tr valign="top">' +

				'<td colspan="2">' +

					'<img src="../images/new/ltgreyletterhead.gif"' +

					' alt="Purcell International" width="600" height="117" border="0"></td>' +

			'</tr>' +

			'<tr valign=top><td width="150">' +

		' ');

}



function AllButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="../offices/index.html"><img src = ../images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../history/index.html"><img src = ../images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../financial/index.html"><img src = ../images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../products/index.html"><img src = ../images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../service/index.html"><img src = ../images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../quality/index.html"><img src = ../images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../questions/index.html"><img src = ../images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function FinancialButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="../offices/index.html"><img src = ../images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../history/index.html"><img src = ../images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><!a href="../financial/index.html"><img src = ../images/new/financial_r.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../products/index.html"><img src = ../images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../service/index.html"><img src = ../images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../quality/index.html"><img src = ../images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../questions/index.html"><img src = ../images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function HistoryButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="../offices/index.html"><img src = ../images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><!a href="../history/index.html"><img src = ../images/new/history_r.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../financial/index.html"><img src = ../images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../products/index.html"><img src = ../images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../service/index.html"><img src = ../images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../quality/index.html"><img src = ../images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../questions/index.html"><img src = ../images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function HomeButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="./offices/index.html"><img src = ./images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="./history/index.html"><img src = ./images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="./financial/index.html"><img src = ./images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="./products/index.html"><img src = ./images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="./service/index.html"><img src = ./images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="./quality/index.html"><img src = ./images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="./questions/index.html"><img src = ./images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	' ');

}



function OfficesButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><!a href="../offices/index.html"><img src = ../images/new/offices_r.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../history/index.html"><img src = ../images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../financial/index.html"><img src = ../images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../products/index.html"><img src = ../images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../service/index.html"><img src = ../images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../quality/index.html"><img src = ../images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../questions/index.html"><img src = ../images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function QuestionsButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="../offices/index.html"><img src = ../images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../history/index.html"><img src = ../images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../financial/index.html"><img src = ../images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../products/index.html"><img src = ../images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../service/index.html"><img src = ../images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../quality/index.html"><img src = ../images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><!a href="../questions/index.html"><img src = ../images/new/questions_r.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function ProductsButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="../offices/index.html"><img src = ../images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../history/index.html"><img src = ../images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../financial/index.html"><img src = ../images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><!a href="../products/index.html"><img src = ../images/new/products_r.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../service/index.html"><img src = ../images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../quality/index.html"><img src = ../images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../questions/index.html"><img src = ../images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function QualityButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="../offices/index.html"><img src = ../images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../history/index.html"><img src = ../images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../financial/index.html"><img src = ../images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../products/index.html"><img src = ../images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../service/index.html"><img src = ../images/new/service_b.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><!a href="../quality/index.html"><img src = ../images/new/quality_r.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../questions/index.html"><img src = ../images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function ServiceButtons(document)

{

	// Save some of the arguments we were passed.

	this.document = document;



	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

	'<table cellspacing="0">' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td>&nbsp;</td></tr>' +

		'<tr><td nowrap valign=top><a href="../offices/index.html"><img src = ../images/new/offices_b.gif alt="Offices" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../history/index.html"><img src = ../images/new/history_b.gif alt="Company History" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../financial/index.html"><img src = ../images/new/financial_b.gif alt="Financial" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../products/index.html"><img src = ../images/new/products_b.gif alt="Products" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><!a href="../service/index.html"><img src = ../images/new/service_r.gif alt="Service" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../quality/index.html"><img src = ../images/new/quality_b.gif alt="Quality Control" border="0"></a></td></tr>' +

		'<tr><td nowrap valign=top><a href="../questions/index.html"><img src = ../images/new/questions_b.gif alt="Questions" border="0"></a></td></tr>' +

	'</table>' +

	'</td>' +

	'<td width="450" valign="top">' +

	' ');

}



function Footer(document)

{

	// Save some of the arguments we were passed.

	this.document = document;





	// Now output the HTML code. Use <A> and <IMG> tags.

	document.write (' ' +

		'<p>' +

		'<a href="../questions/index.html">Questions</a>' +



		'</td>' +

		'</tr>' +

	'</table>' +

	'</center>' +

	'</body>' +

	' ');

}

