// open a window to hold prospectus version for printing
var w;

function goPrint()
  {
/*
		if (w != null)
			{
				w.close();
			}
*/
		

		w=window.open("brochure/printPages.html","printout");
		
		w.moveTo(0,0);
		
		w.resizeTo(800,600);
		
		w.focus();
		
	}

// print the prospectus
function printOut()
  		{
  			alert("For best print results please use your browser's \"Page Setup\" menu to \nset the page to A4 portrait and the page margins to 13mm (0.5 inch)");
  			print();
  			close();
  		}
	
var pageNo;
  		
//go to start of document

function start()
	{
		pageNo=1;
		setPage();
		atStart();	
	}  		
  		
  		
//go to end of document

function end()
	{
		pageNo=25;
		setPage();
		atEnd();	
	}
	
	
//disable buttons that increment page no	
function atEnd()
	{
		document.getElementById("end1").disabled=true;
		document.getElementById("end2").disabled=true;
		document.getElementById("next1").disabled=true;
		document.getElementById("next2").disabled=true;
		document.getElementById("start1").disabled=false;
		document.getElementById("start2").disabled=false;
		document.getElementById("prev1").disabled=false;
		document.getElementById("prev2").disabled=false;
	}
	
//disable buttons that decrement page no	
function atStart()
	{
		document.getElementById("start1").disabled=true;
		document.getElementById("start2").disabled=true;
		document.getElementById("prev1").disabled=true;
		document.getElementById("prev2").disabled=true;
		document.getElementById("end1").disabled=false;
		document.getElementById("end2").disabled=false;
		document.getElementById("next1").disabled=false;
		document.getElementById("next2").disabled=false;
	}
	
// activate all navigation buttons
function allActive()
	{
		document.getElementById("start1").disabled=false;
		document.getElementById("start2").disabled=false;
		document.getElementById("prev1").disabled=false;
		document.getElementById("prev2").disabled=false;
		document.getElementById("end1").disabled=false;
		document.getElementById("end2").disabled=false;
		document.getElementById("next1").disabled=false;
		document.getElementById("next2").disabled=false;
	}
	
// increment page no	
function inc()
	{
		pageNo++;
		setPage();
		if (pageNo == 25)
			{
				atEnd();
			}
		else
			{
				allActive();
			}
	}	
	
	
// decrement page no
function dec()
	{
		pageNo--;
		setPage();
		if (pageNo == 1)
			{
				atStart();
			}
		else
			{
				allActive();
			}
	}	

//set page viewed and counter to page no
function setPage()
	{
		document.getElementById("pageCount1").innerHTML="Page "+pageNo+" of 25";
		document.getElementById("pageCount2").innerHTML="Page "+pageNo+" of 25";
		document.getElementById("pFrame").src="brochure/"+pageNo+".html";
		window.location="#top";
	}