/* Javascript for:  Japan Ship Centre brochure site */
/* Based on code developed for YLA project          */
/* Author:          Kevin Tester                    */
/* First created:   31 07 2003                      */
/* Last updated:    05/07/2004 14:46                */


/* ***************************************************** */
/* CAUTION: COMMA MUST NOT BE ADDED AFTER FINAL ENTRY    */
/* CAUTION: DON'T FORGET TO UPDATE: nojavascript.htm     */
  nav = new Array (
    "index.htm", "Home",
    "about.htm", "About JSC",
    "news.htm", "News",
    "publications.htm", "Publications",
    "statistics.htm", "Industry data",
    "regional.htm", "Regional offices",
    "soshiki.htm", "Affiliate organisations",
    "contactus.htm", "Contact us",
    "directory.htm", "Directory"
    );

  var footer = "&copy; 2009 Japan Ship Centre (JETRO). All rights reserved.";



/* ***************************************************** */
/* DO NOT ALTER ANY CODE FROM THIS POINT ONWARDS         */

  function printNav(current) {
    document.write("<ul>");
    var ix = 0;

    while (nav[ix]) {
      printMe = (nav[ix]==current) ? "<li><a class=\"current\" href=\"" : "<li><a href=\"";
      printMe = printMe+nav[ix]+"\">"+nav[ix+1]+"</a></li>";
      document.write(printMe);
      ix = ix + 2;
      }

    document.write("</ul>");
    }

  function printFooter() {
    printMe = "<p id=\"footer\">"+footer+"</p>";
    document.write(printMe);
}


function hideThese(printMe) {

// Display toggle only works for modern browsers that recognise the DOM hook: document.getElementById
// Therefore profile divs should only be hidden (display: none) if this DOM hook exists.
// In a similar way, the display toggle only works when JavaScript enabled. If disabled, the profile divs will not be hidden onload.
if (document.getElementById) {
	// Switch everything off. printMe is predefined from this functions parameter.
  	document.write(printMe);

  	// But, if page is called with an anchor to a specific div, this has to be switched on.
   	if (location.hash) {
   		printMe    = "<style type=\"text/css\"><!-- "+location.hash+" { display: block; } --></style>";
   		document.write(printMe);
   	}
}

return true;
}

function toggleDisplay(a) {
	if (document.getElementById) {
 		ix = 0;
  		while (dispToggDivs[ix]) {
  			document.getElementById(dispToggDivs[ix]).style.display = (dispToggDivs[ix]==a) ? "block" : "none";
  			ix++ ;
  		}
  		return false;
	}
	else return true;
}
