var pages = {

'about':[
  'about.html',
  'whatwedo.html',
  'our-people.html',
	'our-directors.html',
	'our-team.html',
	'our-shareholders.html',
	'regional-supporters.html',
	'contactus.html',
	'thanks.html'
  ],

'region':[
  'theregion.html',
  'tnq-businessclimate.html',
	'tnq-businessresources.html',
	'cairns-lifestyle.html'
  ],

'publications':[
  'publications.html',
	'media-releases.html',
  'business-plan.html',
  'annual-report.html',
	'other-publications.html',
	'publications'								
	],

'news-keyprojects':[
  'news-keyprojects.html',
	'advance-cairns-news.html',
	'key-projects.html',
	'news',
	'news.php',
	'key_projects'
  ]            
};

for(var i in pages) {
  if(in_array(page(document.location.href), pages[i]))
    ID(i).style.display = '';
  else
    ID(i).style.display = 'none';
} 
function in_array(needle,haystack) {
  for(var i in haystack)
    if(haystack[i] == needle)
      return true;
  return false;
}        
function ID(id) {
  return document.getElementById(id);
}   
function page(url) {
  apage = url.substring(url.lastIndexOf('/')+1);
  if(apage.indexOf('#') > 0)
    apage = apage.substring(0, apage.indexOf('#'));
  return apage;
}
