//
// head.js
//

// Common code


//#####################################################################################
//				Menu definitions
//#####################################################################################

//-------------------
// Top menu
//-------------------

	// Gifs:
	//   Need images "b_<name>o.gif" & "b_<name>r.gif"
	// URLs: Corresponding URLs for main menu items
	//   If empty, no URL will be invoked
	//   If not, image "b_<name>s.gif" will be required
	// Main menu URLs to remain active when selected
	//   If 1, then rollover uses "b_<name>s.gif"
	//   If 2, then need image "a_<name>sr.gif"

// Must first define submenu items
var	empmenu = new Array();
	empmenu[0] = new Menu("c_vacancies",	"http://www.odpp.nsw.gov.au/scripts/display.idc",	1, "Vacancies",		null);
	empmenu[1] = new Menu("c_apply",		"/employment/employment.html#apply",	1, "How to Apply",	null);
	empmenu[2] = new Menu("c_selection",	"/employment/employment.html#selection",	1, "Selection Process",	null);
	empmenu[3] = new Menu("c_info",		"/employment/employment.html#others",	1, "Other Information",	null);

// Top main menu
var	tmenu = new Array();
	tmenu[0] = new Menu("b_home",		"/home.html",		   2,	"Home",		null);
	tmenu[1] = new Menu("b_over",		"/overview/overview.html", 2,	"DPP Overview",	null);
	tmenu[2] = new Menu("b_employ",	"",				   0,	"Employment",	empmenu);
	tmenu[3] = new Menu("b_contact",	"/location/location.html", 2,	"Contact Us",	null);
	tmenu[4] = new Menu("b_links",	"/links.html",		   2,	"Links",		null);

// Pre-load button images
function tLoadImages()
{
	// need to do this smarter
	MM_preloadImages('/images/b_homer.gif','/images/b_homes.gif',
			 '/images/b_overr.gif','/images/b_overs.gif',
			 '/images/b_employr.gif','/images/b_employs.gif',
			 '/images/b_contactr.gif','/images/b_contacts.gif',
			 '/images/b_linksr.gif','/images/b_linkss.gif',
			 '/images/c_vacanciesa.gif','/images/c_vacanciesr.gif','/images/c_vacanciess.gif',
			 '/images/c_applya.gif','/images/c_applyr.gif','/images/c_applys.gif',
			 '/images/c_selectiona.gif','/images/c_selectionr.gif','/images/c_selections.gif',
			 '/images/c_infoa.gif','/images/c_infor.gif','/images/c_infos.gif');
} // tLoadImages()

//-------------------
// Left menu
//-------------------

// Sub menu items -- one submenu list per main menu item
				// Basename of gifs used
				//   If none, then no submenu will be invoked
				//   Else need images "as_<subname>o.gif" and
				//	"as_<subname>r.gif"
				//	where <subname> is asitems<n> entry.
var	witmenu = new Array();
	witmenu[0] = new Menu("as_assist",		"/was/was.html",					2,	"Witness Assistance Service",	null);
	witmenu[1] = new Menu("as_beingwit",	"/was/bawitn/default.html",			2,	"Being A Witness",		null);
	witmenu[2] = new Menu("as_rightsvic",	"/was/victims-rights/default.html",		2,	"Your Rights As A Victim",	null);
	witmenu[3] = new Menu("as_state",		"http://www.lawlink.nsw.gov.au/lawlink/victimsservices/ll_vs.nsf/vwFiles/VIS%20Info%20Pack%202006.pdf/$file/VIS%20Info%20Pack%202006.pdf", 2, "Victim Impact Statements", null);
	witmenu[4] = new Menu("as_feedback",	"/scripts/wvsfeed.html",					2,	"Witness & Victim Feedback",	null);



	// Basename of main menu gifs
	//   Need images "a_<name>o.gif" & "a_<name>r.gif"
	// Corresponding URLs for main menu items
	//   If empty, no URL will be invoked
	//   If not, need image "a_<name>s.gif"
	// Main menu URLs to remain active when selected
	//   If 1, then rollover uses "a_<name>s.gif"
	//   If 2, then need image "a_<name>sr.gif"

var	lmenu = new Array();
	lmenu[0] = new Menu("a_witness",	"",							0,	"Witness & Victim Services",	witmenu);
	lmenu[1] = new Menu("a_freque",	"/faq/faq.html",					2,	"Frequently Asked Questions",	null);
	lmenu[2] = new Menu("a_prosec",	"/guidelines/guidelines.html",							0,	"Prosecution & Policy Guidelines", null);
	lmenu[3] = new Menu("a_annual",	"/annual reports/reports.html",			2,	"Annual Reports",			null);
	lmenu[4] = new Menu("a_public",	"/publications/library.html",			2,	"Publications",			null);
	lmenu[5] = new Menu("a_code",	"/publications/Code of conduct.pdf",			2,	"Code of Conduct",			null);
	lmenu[6] = new Menu("a_speech",	"/speeches/speeches.html",			2,	"Speeches & Papers",		null);
	lmenu[7] = new Menu("a_media",	"/MediaRelease/MediaReleaseIndependence.html",	2, "Media Releases",		null);
	lmenu[8] = new Menu("a_freedom",	"/foi/foitoc.html",					2,	"Freedom Of Information",	null);

// Specify all images to be pre-loaded
function lLoadImages()
{
  MM_preloadImages( '/images/arrow.gif','/images/arrowdk.gif','/images/arrows.gif',

	 '/images/a_witnessr.gif',
	 '/images/a_frequer.gif','/images/a_freques.gif',
	 '/images/a_prosecr.gif',
	 '/images/a_annualr.gif','/images/a_annuals.gif','/images/a_annualsr.gif',
	 '/images/a_publicr.gif','/images/a_publics.gif',
	 '/images/a_coder.gif','/images/a_codes.gif',
	 '/images/a_speechr.gif','/images/a_speechs.gif','/images/a_speechsr.gif',
	 '/images/a_mediar.gif','/images/a_medias.gif','/images/a_mediasr.gif',
	 '/images/a_freedomr.gif','/images/a_freedoms.gif',',/images/a_freedomsr.gif',

	 '/images/as_appendo.gif','/images/as_appendr.gif','/images/as_appends.gif',
	 '/images/as_assisto.gif','/images/as_assistr.gif','/images/as_assists.gif',
	 '/images/as_beingwito.gif','/images/as_beingwitr.gif','/images/as_beingwits.gif',
	 '/images/as_feedbacko.gif','/images/as_feedbackr.gif','/images/as_feedbacks.gif',
	 '/images/as_guideo.gif','/images/as_guider.gif','/images/as_guides.gif',
	 '/images/as_introo.gif','/images/as_intror.gif','/images/as_intros.gif',
	 '/images/as_libraryo.gif','/images/as_libraryr.gif','/images/as_librarys.gif',
	 '/images/as_noteso.gif','/images/as_notesr.gif','/images/as_notess.gif',
	 '/images/as_policyo.gif','/images/as_policyr.gif','/images/as_policys.gif',
	 '/images/as_rightsvico.gif','/images/as_rightsvicr.gif','/images/as_rightsvics.gif',
	   '/images/as_rightsvicsr.gif',
	 '/images/as_stateo.gif','/images/as_stater.gif','/images/as_states.gif'

	);
} // lLoadImages()

//#####################################################################################
//					Common functions
//#####################################################################################

// Menu object constructor
function Menu(gif, url, actvroll, title, submenu)
{
	this.gif = gif;				// Basename of gifs used
	this.url = url;
	this.actvroll = actvroll;		// URLs to remain active when selected
	this.title = title;
	this.submenu = submenu;
} // Menu()

acurr = 99;
bcurr = 99;
ccurr = 99;

function getMstat()
{
	var	mstat, idx;
	
	mstat = getCookie("_odcms");
	if ( mstat )
	  {
	  mstata = mstat.split(',');
	  acurr = mstata[0];
	  bcurr = mstata[1];
	  ccurr = mstata[2];
	  for ( idx=0; lmenu[idx]; idx++ )
	    lmenu[idx].subexp = mstata[idx+3];
	  }
} // getMstat()

function putMstat()
{
	var	cs, idx;

	mstat = acurr + ',' + bcurr + ',' + ccurr;
	for ( idx=0; lmenu[idx]; idx++ )
	  if ( lmenu[idx].submenu == null )
	    mstat += ",0";
	  else if ( eval("Asub"+idx+".style.display") == "none" )
	    mstat += ",0";
	  else
	    mstat += ",1";
	setCookie("_odcms", mstat);
} // putMstat()

//#####################################################################################
//					Top Menu Mechanics
//#####################################################################################

// Output top menu
function DispTopMenu()
{
	var	img, url, roll, subs;

	document.writeln('<TABLE ID="TopTab" BORDER="1" CELLSPACING="0" CELLPADDING="0" BORDERCOLOR="#000000">');
	document.writeln('  <TR>');
	for ( mnuidx=0; tmenu[mnuidx] != null; mnuidx++ )
	  {
	  mnuitem = tmenu[mnuidx];
	  img = mnuitem.gif;
	  url = mnuitem.url;
	  title = mnuitem.title;
	  roll = mnuitem.actvroll;
	  //subs = mnuitem.submenu;

	  if ( !ns )
	    {
	    document.write  ('    <TD ID="Bmenu' + mnuidx + '">');
	    document.write  ('<A HREF="javascript:SelTopMenu(' + mnuidx + ');"');
	    document.write  (' onMouseOut="MM_swapImgRestore()"');
	    document.write  (' onMouseOver="MM_swapImage(\'BImage'+mnuidx+'\',\'\',\'/images/'+img+'r.gif\',1)">');
	    document.write  ('<IMG NAME="BImage' + mnuidx + '" BORDER="0" SRC="/images/' + img + 'o.gif"');
	    document.write  (' HEIGHT="17" TITLE="' + title + '"></A>');
	    document.writeln('</TD>');
	    }
	  }
	document.writeln('  </TR>');

	// Output submenus
	document.writeln('  <TR>');
	document.writeln('    <TD COLSPAN="' + mnuidx + '" HEIGHT="17">');

	document.writeln('      <TABLE ID="BotTab" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="17">');
	document.writeln('	  <TR ID="Csub">');
	if ( !ns )
	  {
	  for ( idx=0; idx <= 5; idx++ )			// Blank line
	    document.writeln('        <TD></TD>');
	  }
	document.writeln('	  </TR>');
	for ( mnuidx=0; tmenu[mnuidx] != null; mnuidx++ )
	  if ( subs=tmenu[mnuidx].submenu )
	    {
	    document.writeln('	  <TR ID="Csub' + mnuidx + '" STYLE="display:none">');
	    for ( idx=0; subs[idx] != null; idx++ )
	      {
	      document.write  ('<TD ID="Cmenu' + mnuidx + '_' + idx + '">');
	      document.write  ('<A');
	      document.write  (' HREF="javascript:SelTopSub(' + idx + ')"');
	      document.write  (' onMouseOut="MM_swapImgRestore()"');
	      document.write  (' onMouseOver="MM_swapImage(\'CImage' + mnuidx + '_' + idx + '\',\'\',' +
	      			'\'/images/' + subs[idx].gif + 'r.gif\',1)"');
	      document.write  ('>');
	      document.write  ('<IMG NAME="CImage' + mnuidx + '_' + idx + '" BORDER=0 ' +
	      			'SRC="/images/' + subs[idx].gif + 'o.gif" TITLE="' + subs[idx].title + '"></A>');
	      document.writeln('</TD>');
	      }
	    document.writeln('	  </TR>');
	    }

	document.writeln('	  </TR>');
	document.writeln('      </TABLE>');

	document.writeln('    </TD>');
	document.writeln('  </TR>');

	document.writeln('</TABLE>');

} // DispTopMenu()

// Highlight relevant entry on top menu
function HiTopMenu(mno)
{
	var	mnuidx, subs, o;

	// Turn off/on filler for submenu as required
	if ( mno >= 0 && mno < 99 )
	  Csub.style.display = ( tmenu[mno].submenu ? "none" : "inline" );
	// Turn off/on submenu(s) as required
	for ( mnuidx=0; tmenu[mnuidx] != null; mnuidx++ )
	  if ( subs = tmenu[mnuidx].submenu )
	    {
	    if ( mnuidx == mno )
	      eval('Csub'+mnuidx+'.style.display = "inline"');
	    else
	      eval('Csub'+mnuidx+'.style.display = "none"');
	    }

	// Unhighlight previous cmenu item
	if ( ccurr != 99 )
	  {
	  o = eval('CImage' + bcurr + '_' + ccurr);
	  o.src = '/images/' + tmenu[bcurr].submenu[ccurr].gif + 'o.gif';
	  if ( o.oSrc ) o.oSrc = o.src;
	  }
	// Unhighlight previous bmenu item
	if ( bcurr != 99 )
	  {
	  o = eval('BImage' + bcurr);
	  o.src = '/images/' + tmenu[bcurr].gif + 'o.gif';
	  if ( o.oSrc ) o.oSrc = o.src;
	  }
	ccurr = 99;
	bcurr = 99;

	// Highlight new bmenu item
	if ( mno >= 0 && mno < 99 )
	  {
	  var o = eval('BImage' + mno);
	  o.src = '/images/' + tmenu[mno].gif + 's.gif';
	  if ( o.oSrc ) o.oSrc = o.src;			// Handle if currently rolled over
	  bcurr = mno;
	  }
} // HiTopMenu()

// Highlight top submenu item
function HiTopSub(mns)
{
	// Unhighlight previous cmenu item
	if ( ccurr != 99 )
	  {
	  o = eval('CImage' + bcurr + '_' + ccurr);
	  o.src = '/images/' + tmenu[bcurr].submenu[ccurr].gif + 'o.gif';
	  if ( o.oSrc ) o.oSrc = o.src;
	  }
	ccurr = 99;

	// Highlight new cmenu item
	if ( mns >= 0 && mns < 99 )
	  {
	  var o = eval('CImage' + bcurr + '_' + mns);
	  o.src = '/images/' + tmenu[bcurr].submenu[mns].gif + 's.gif';
	  if ( o.oSrc ) o.oSrc = o.src;			// Handle if currently rolled over
	  ccurr = mns;
	  }
} // HiTopSub()

// Select top menu item (IE only)
function SelTopMenu(mno)
{
	HiTopMenu(mno);
	if ( mno >= 0 && mno < 99 )
	  {
	  // Turn off left menu item
	  HiLeftMenu(99);

	  // Save state
	  putMstat();

	  // Go to linked page
	  if ( (url=tmenu[mno].url) != "" )
	    window.location.href = url;
	  }
} // SelTopMenu()

// Select top submenu item (IE only)
function SelTopSub(mns)
{
	HiTopSub(mns);
	if ( mns >= 0 && mns < 99 )
	  {
	  // Turn off left menu item
	  HiLeftMenu(99);

	  // Save state
	  putMstat();

	  // Go to linked page
	  if ( (url=tmenu[bcurr].submenu[mns].url) != "" )
	    window.location.href = url;
	  }
} // SelTopSub()

//#####################################################################################
//					Left Menu Mechanics
//#####################################################################################

function DispLeftMenu()
{
	document.writeln('<TABLE ID="Atable" WIDTH="1%" BORDER="0" CELLSPACING="0" CELLPADDING="0" VSPACE="0" ' +
		'HSPACE="0">');

	for ( mnuidx=0; lmenu[mnuidx]; mnuidx++ )
	  {
	  mnuitem = lmenu[mnuidx];
	  img = mnuitem.gif;
	  url = mnuitem.url;
	  roll = mnuitem.actvroll;
	  title = mnuitem.title;
	  subs = mnuitem.submenu;

	  document.writeln('  <TR ID="Arow'+mnuidx+'">');

	  document.write  ('    <TD ALIGN="RIGHT" WIDTH="99%">');
	  document.write  ('<IMG SRC="/images/ablankbox.gif" NAME="Abox'+mnuidx+'" WIDTH="17" HEIGHT="25" BORDER="0">');
	  document.writeln('</TD>');

	  document.write  ('    <TD ALIGN="RIGHT" WIDTH="1%" ID="Amenu'+mnuidx+'">');

	  document.write  ('<A HREF="JavaScript:SelLeftMenu('+mnuidx+');" ');
	  document.write  ('onMouseOut="MM_swapImgRestore()" ' +
			   'onMouseOver="MM_swapImage(\'Abox'+mnuidx+'\',\'\',\'/images/arrow.gif\',' +
			   			     '\'AImage'+mnuidx+'\',\'\',\'/images/'+img+'r.gif\',1)">');
	  document.write  ('<IMG BORDER="0" NAME="AImage'+mnuidx+'" SRC="/images/'+img+'o.gif" ' +
	  		   'WIDTH="195" HEIGHT="25" TITLE="'+title+'">');
	  document.writeln('</A></TD>');
	  document.writeln('  </TR>');

	  if ( subs )
	    {
	    // Display submenu
	    document.writeln('  <TR ID="Asub'+mnuidx+'" STYLE="display:none">');
	    document.writeln('    <TD ALIGN="RIGHT" WIDTH="99%"><IMG SRC="/images/oxo.gif" WIDTH="1" HEIGHT="1">');
	    document.writeln('    </TD>');
	    document.writeln('    <TD ALIGN="RIGHT" WIDTH="1%">');
	    document.writeln('      <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">');

	    for ( asmidx=0; subs[asmidx]; asmidx++ )
	      {
	      document.writeln('	<TR>');

	      document.write  ('	  <TD ALIGN="RIGHT" WIDTH="99%">');
	      document.write  ('<IMG NAME="ASBox'+mnuidx+'_'+asmidx+'" SRC="/images/asblankbox.gif" ' +
	      		       'WIDTH="17" HEIGHT="25">');
	      document.writeln('</TD>');

	      document.write  ('	  <TD ALIGN="RIGHT" WIDTH="1%">');
	      document.write  ('<A HREF="JavaScript:SelLeftMenu(' + ((asmidx+1)*10+mnuidx) + ')"' +
			       ' onMouseOut="MM_swapImgRestore()"' +
			       ' onMouseOver="MM_swapImage(\'ASBox'+mnuidx+'_'+asmidx+'\',\'\',\'/images/arrows.gif\',' +
			       '\'ASImage'+mnuidx+'_'+asmidx+'\',\'\',\'/images/' + subs[asmidx].gif + 'r.gif\',1)">');
	      document.write  ('<IMG NAME="ASImage'+mnuidx+'_'+asmidx+'" BORDER="0" ' +
			       'SRC="/images/' + subs[asmidx].gif + 'o.gif" WIDTH="178" HEIGHT="25" ' +
				 'TITLE="' + subs[asmidx].title + '">');
	      document.writeln('</A></TD>');

	      document.writeln('	</TR>');
	      }

	    document.writeln('      </TABLE>');
	    document.writeln('    </TD>');
	    document.writeln('  </TR>');
	    }
	  }

	document.writeln('  <TR>');
	document.writeln('    <TD ALIGN="RIGHT" WIDTH="99%" VALIGN="TOP" HEIGHT="1">');
	document.writeln('<IMG SRC="/images/oxo.gif" WIDTH="1" HEIGHT="1"></TD>');
	document.writeln('    <TD WIDTH="1%" HEIGHT="1" VALIGN="TOP" ALIGN="RIGHT">');
	document.writeln('<IMG SRC="/images/abasebar.gif" WIDTH="195" HEIGHT="10" BORDER="0"></TD>');
	document.writeln('  </TR>');
	document.writeln('</TABLE>');
} // DispLeftMenu()

// Highlight relevant item on left menu
function HiLeftMenu(mno)
{
	var	mnuidx, subs, o, amaj, amin;

	// Toggle submenu as required
	if ( mno >= 0 && mno < 10 )
	  {
	  if ( lmenu[mno].submenu )
	    {
	    o = eval('Asub'+mno);
	    if ( o.style.display == "inline" )
	      o.style.display = "none";
	    else
	      o.style.display = "inline";
	    return;
	    }
	  }

	// Unhighlight previous lmenu item
	if ( acurr < 10 )		// Top level menu item
	  {
	  o = eval('AImage' + acurr);
	  o.src = '/images/' + lmenu[acurr].gif + 'o.gif';
	  if ( o.oSrc ) o.oSrc = o.src;
	  }
	else if ( acurr < 99 )		// Submenu item
	  {
	  amaj = acurr % 10;
	  amin = Math.round(acurr / 10 - 1);
	  o = eval('ASImage' + amaj + '_' + amin);
	  o.src = '/images/' + lmenu[amaj].submenu[amin].gif + 'o.gif';
	  if ( o.oSrc ) o.oSrc = o.src;
	  }
	acurr = 99;

	// Highlight new lmenu item
	if ( mno >= 0 )
	  {
	  if ( mno < 10 )		// Top level menu item
	    {
	    o = eval('AImage' + mno);
	    o.src = '/images/' + lmenu[mno].gif + 's.gif';
	    if ( o.oSrc ) o.oSrc = o.src;			// Handle if currently rolled over
	    acurr = mno;
	    }
	  else if ( mno < 99 )		// Submenu item
	    {
	    amaj = mno % 10;
	    amin = Math.round(mno / 10 - 1);
	    o = eval('ASImage' + amaj + '_' + amin);
	    o.src = '/images/' + lmenu[amaj].submenu[amin].gif + 's.gif';
	    if ( o.oSrc ) o.oSrc = o.src;			// Handle if currently rolled over
	    acurr = mno;
	    }
	  }
} // HiLeftMenu()

// Select left menu item (IE only)
function SelLeftMenu(mno)
{
	var	url, amaj, amin;

	HiLeftMenu(mno);
	if ( mno >= 0 && mno < 99 )
	  {
	  HiTopMenu(99);

	  // Save state
	  putMstat();

	  // Go to linked page
	  if ( mno < 10 )
	    {
	    if ( (url=lmenu[mno].url) != "" )
	      window.location.href = url;
	    }
	  else
	    {
	    amaj = mno % 10;
	    amin = Math.round(mno / 10 - 1);
	    if ( (url=lmenu[amaj].submenu[amin].url) != "" )
	      window.location.href = url;
	    }
	  }
} // SelLeftMenu()

//#####################################################################################
//					Cell mechanics
//#####################################################################################

function tlcell()
{
	document.writeln('    <TD BGCOLOR="#3A5A78" WIDTH="1">');
	document.writeln('<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" VSPACE="0" HSPACE="0">');
	document.writeln('  <TR ALIGN="RIGHT">');
	document.writeln('    <TD HEIGHT="91" VALIGN="BOTTOM">');
	document.write  ('      <A HREF="JavaScript:SelTopMenu(0)">');
	document.writeln('<IMG SRC="/images/dpplogo.gif" WIDTH="74" HEIGHT="79" BORDER="0" TITLE="Home"></A></TD>');
	document.writeln('  </TR>');
	document.writeln('  <TR>');
	document.write  ('    <TD ALIGN="RIGHT" VALIGN="TOP" HEIGHT="19">');
	document.writeln('<IMG SRC="/images/alines.gif" WIDTH="212" HEIGHT="19" BORDER="0"></TD>');
	document.writeln('  </TR>');
	document.writeln('</TABLE>');
	document.writeln('</TD>');
} // tlcell()

function tmcell()
{
	document.writeln('    <TD WIDTH="99%" BGCOLOR="#3A5A78">');
	document.writeln('<STYLE TYPE="TEXT/CSS">');
	document.writeln('<!--');
	document.writeln('.titlebg { background-repeat: repeat-x }');
	document.writeln('-->');
	document.writeln('</STYLE>');

	document.writeln('<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" VSPACE="0" HSPACE="0">');
	document.writeln('  <TR VALIGN="BOTTOM">');
	document.writeln('    <TD HEIGHT="34">');
	document.writeln('      <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" VSPACE="0" HSPACE="0">');
	document.writeln('	<TR>');
	document.write  ('	  <TD WIDTH="1" HEIGHT="1%"><IMG SRC="/images/heading.gif" WIDTH="370" HEIGHT="22" ');
	document.writeln('BORDER="0" VSPACE="0" HSPACE="0"></TD>');
	document.write  ('	  <TD WIDTH="100%" HEIGHT="1%" BACKGROUND="/images/clines.gif" ');
	document.writeln('CLASS="titlebg">&nbsp;</TD>');
	document.writeln('	</TR>');
	document.writeln('      </TABLE>');
	document.writeln('    </TD>');
	document.writeln('  </TR>');
	document.writeln('  <TR>');
	document.writeln('    <TD>');
	document.writeln('      <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">');
	document.writeln('	<TR>');
	document.writeln('	  <TD HEIGHT="76" WIDTH="30"><IMG SRC="/images/b45.gif" WIDTH="45" HEIGHT="1"></TD>');
	document.writeln('	  <TD HEIGHT="76" WIDTH="99%" VALIGN="BOTTOM">');

	DispTopMenu();

	document.writeln('	  </TD>');
	document.writeln('	</TR>');
	document.writeln('      </TABLE>');
	document.writeln('    </TD>');
	document.writeln('  </TR>');
	document.writeln('</TABLE>');
	document.writeln('</TD>');

	document.writeln('    </TD>');
} // tmcell()

function lcell()
{
	document.writeln('    <TD VALIGN="TOP" BGCOLOR="#3A5A78">');

	document.writeln('<STYLE TYPE="TEXT/CSS">');
	document.writeln('<!--');
	document.writeln('.bgcell {  background-image: url(images/bluebkgnd.gif); background-repeat: repeat-y; ' +
			 'background-position: right}');
	document.writeln('.btn {  height: 23px; width: 23px; font-size: 9pt; background-color: #3399CC}');
	document.writeln('-->');
	document.writeln('</STYLE>');

	document.writeln('<TABLE WIDTH="100%" HEIGHT="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" VSPACE="0" ' +
			 'HSPACE="0" ALIGN="RIGHT">');
	document.writeln('  <TR>');
	document.writeln('    <TD ALIGN="RIGHT">');

	// Display the left menu
	DispLeftMenu();

	document.writeln('    </TD>');
	document.writeln('  </TR>');
	document.writeln('  <TR>');
	document.writeln('    <TD HEIGHT="99%" VALIGN="TOP">');
	document.writeln('      <TABLE WIDTH="100%" HEIGHT="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" ' +
			 'VSPACE="0" HSPACE="0" ALIGN="RIGHT" VALIGN="TOP">');
	document.writeln('	<TR VALIGN="TOP">');
	document.writeln('          <TD WIDTH="223" HEIGHT="100%"><a href="http://www.nsw.gov.au">' +
			 '<IMG SRC="/images/nswcrest.gif" WIDTH="75" HEIGHT="52" border=0 ALIGN="RIGHT"></a>');
	document.writeln('            <BR><BR>&nbsp;&nbsp;&nbsp;<A HREF="/sitemap.htm">' +
			 '<FONT FACE="Arial, Helvetica, sans-serif" SIZE="-1" COLOR="#33FFFF">DPP Site Map</FONT></A>');
	document.writeln('	<FORM ACTION="/query.idq" METHOD="GET">');
	document.writeln('	  &nbsp;&nbsp;&nbsp;<FONT FACE="Arial, Helvetica, sans-serif" COLOR="#CCCCCC">' +
			 'Search this website</FONT><BR>');
	document.writeln('	  &nbsp;&nbsp;&nbsp;<INPUT TYPE="TEXT" NAME="CiRestriction" SIZE="20" ' +
			 'MAXLENGTH="100" VALUE="">');
	document.writeln('	    <INPUT TYPE="SUBMIT" VALUE="Go" CLASS="btn">');
	document.writeln('	    <BR>');
	document.writeln('	    &nbsp;&nbsp;&nbsp;<INPUT NAME="FreeText" TYPE=CHECKBOX>');
	document.writeln('	    <FONT COLOR="#CCCCCC" FACE="Arial, Helvetica, sans-serif" SIZE="-1">Use</FONT>');
	document.writeln('	    <A HREF="/oop/ixtiphlp.htm#FreeTextQueries">' +
			 '<FONT FACE="Arial, Helvetica, sans-serif" COLOR="#33FFFF" SIZE="-1">Free-Text ' +
			 'Query</FONT></a>.<BR>');
	document.writeln('	    &nbsp;&nbsp;&nbsp;<A HREF="/oop/ixtiphlp.htm">' +
			 '<FONT COLOR="#33FFFF" FACE="Arial, Helvetica, sans-serif" SIZE="-1">Tips for searching' +
			 '</FONT></A>');
	document.writeln('	  <INPUT TYPE="HIDDEN" NAME="CiScope" VALUE="/">');
	document.writeln('	  <INPUT TYPE="HIDDEN" NAME="CiMaxRecordsPerPage" VALUE="10">');
	document.writeln('	  <INPUT TYPE="HIDDEN" NAME="TemplateName" VALUE="query">');
	document.writeln('	  <INPUT TYPE="HIDDEN" NAME="CiSort" VALUE="rank[d]">');
	document.writeln('        <INPUT TYPE="HIDDEN" NAME="HTMLQueryForm" VALUE="/query.htm">');
	document.writeln('	</FORM>');
	document.writeln('	  </TD>');
	document.writeln('          <TD WIDTH="1" HEIGHT="1000"><IMG SRC="/images/oxo.gif" WIDTH="1" HEIGHT="1"></TD>');
	document.writeln('          <TD ALIGN="RIGHT" WIDTH="1" HEIGHT="100%" CLASS="bgcell">' +
			 '<IMG SRC="/images/oxo.gif" BORDER=0 WIDTH=1 HEIGHT=1></TD>');
	document.writeln('	</TR>');
	document.writeln('      </TABLE>');
	document.writeln('    </TD>');
	document.writeln('  </TR>');
	document.writeln('</TABLE>');

	document.writeln('    </TD>');
} // lcell()

//#####################################################################################
//					Mainline
//#####################################################################################

	who();
	getMstat();
	tLoadImages();
	lLoadImages();
	document.writeln('<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" WIDTH="100%">');
	document.writeln('  <TR>');
	tlcell();
	tmcell();
	scc = ccurr;
	HiTopMenu(bcurr);
	ccurr = scc;
	HiTopSub(ccurr);
	document.writeln('  </TR>');
	document.writeln('  <TR>');
	lcell();
	for ( idx=0; lmenu[idx]; idx++ )
	  if ( lmenu[idx].subexp == 1 )
	    eval("Asub"+idx+".style.display = 'inline'");
	HiLeftMenu(acurr);
	if ( typeof(mainpad) != "undefined" )
	  document.writeln('    <TD VALIGN="TOP" STYLE="padding=' + mainpad + '">');
	else
	  document.writeln('    <TD VALIGN="TOP" STYLE="padding=10">');
