// JavaScript Document

var xmlHttp;

function showPage(myfile, npages)
{
var ctext = ""

if (npages<2) {document.getElementById("pagepart").innerHTML="";return true}
else 
{
	for (var k = 1;k<=npages;k++)
		{
		ctext = ctext + '<a href="#" onClick="showContent(' + "'" + myfile + k + ".htm','',true" + 
					')">Page&nbsp;' + k + "</a>&nbsp;&nbsp;&nbsp;" 
		document.getElementById("pagepart").innerHTML = ctext 
		}
}
/*	document.getElementById("pagepart").style.border = "thin solid" ;
	document.getElementById("pagepart").style.width = "auto" ;
	document.getElementById("pagepart").style.padding = "20px" ;
*/		
}
	
function showContent(cfile,cpicfile,lpages,lnoborder)	 
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
if (cpicfile>"")
   {document.getElementById("showpic").innerHTML = '<img src="' + cpicfile + '" width="175" />'};

if (lnoborder==true) {document.getElementById("mainpart").style.border = "thin none"} 
else {document.getElementById("mainpart").style.border = "thin solid" } 

document.getElementById("mainpart").style.width = "auto" ;
document.getElementById("mainpart").style.padding = "20px" ;

if (lpages==true){}
else {document.getElementById("pagepart").innerHTML=""}

var url=cfile;
xmlHttp.onreadystatechange=stateIsChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateIsChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { document.getElementById("mainpart").innerHTML=xmlHttp.responseText}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}