function MFXremoveFocus(e){var d=document,a=0,n=d.layers,m=window.sidebar;if((m||n)&&d.forms.length>0){return}
while(a<d.links.length){d.links[a].blur();++a}}document.onmouseup=MFXremoveFocus; 	 

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function CB_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
/* ***********************************************************
	nextprev.js

	Handles a Chris Bate style next-page / previous-page
	site navigation. This involves a series of web pages
	with a naming convention involving some prefix text
	followed by a number.

	Example:
	  mypage01.html <-> mypage02.html <-> mypage03.html
*********************************************************** */

/************************************************************
  <script type="text/javascript" src="nextprev.js"></script> 
  
  This must be inserted into the head of the Document ...
  anywhere after the title.
  
  ***********************************************************/

/* ***********************************************************
	findNewPage()

	This should be treated as a private, internal function
	to be called only by the public functions found later
	in this file.

	This function determines the name of the current page
	and attempts to determine the name of either a previous
	page or the next page in a series of similarly named
	and numbered filenames.

	The decrementFlag should be set to 1 if you want the
	previous page, else you will get the next page.
*********************************************************** */

function findNewPage( decrementFlag )
{
	/* *******************************************************
		For all page name substring operations, the following
		extension is assumed...
	******************************************************* */

	extension = ".htm";

	/* *******************************************************
		Find the URL of the current page. The window.location
		value is read only so we can't just use references
		to it or we'll get all sorts of javascript errors.
		Instead, append it's value to an empty string to get
		a new string.
	******************************************************* */

	pageName = "" + window.location;

	/* *******************************************************
		Seek out the extension...
	******************************************************* */

	offset = pageName.lastIndexOf( extension );

	if ( offset == -1 )
	{
		alert( "nextprev.js findNewPage()\ncouldn't find the " + extension + " extension" );
		return( null );
	}

	if ( offset == 0 )
	{
		alert( "nextprev.js findNewPage()\nthe filename is nothing more than an extension" );
		return( null );
	}

	/* *******************************************************
		Destroy the extension, if there is one.
	******************************************************* */

	temp = pageName.substring( 0, offset );

	/* *******************************************************
		Collect the numeric suffix. Chris says it will
		always be 2 digits big.
	******************************************************* */

	newPage = temp.substring( 0, temp.length - 2 );
	oldNum = temp.substring( temp.length - 2, temp.length );

	/* *******************************************************
		Increment or decrement the suffix and pad with
		a leading zero, if needed. Again, Chris says
		he just needs 2 digits so padding just depends on
		if the value is less than 10 or not...
	******************************************************* */

	num = parseInt( oldNum );

	if ( decrementFlag == 1 )
	{
		num--;
	}
	else
	{
		num++;
	}

	if ( num < 10 )
	{
		newNum = "0" + num;
	}
	else
	{
		newNum = "" + num;
	}

	/* *******************************************************
		Append the new suffix...
	******************************************************* */

	newPage = newPage + newNum + extension;

	/* *******************************************************
		Send back the new filename...
	******************************************************* */

	return( newPage );
}



/* ***********************************************************
	PUBLIC INTERFACE

	These functions are the ones you should call from
	within an HTML document that has chosen to include
	this js file.

	goNextPage()
	goPrevPage()
		These will instantly redirect the browser to the
		next or previous page in the series.

	printNextPage()
	printPrevPage()
		These will just print out the URL of the next
		or previous page in the series.
*********************************************************** */

function goNextPage()
{
	window.location = findNewPage( 0 );
}

function goPrevPage()
{
	window.location = findNewPage( 1 );
}

function printNextPage()
{
	document.write( findNewPage( 0 ) );
}

function printPrevPage()
{
	document.write( findNewPage( 1 ) );
}



