// JavaScript Document

var strBookmarkPage = "bookmark page"
var strPrintPage = "print page"

var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function changeCol(txtarea, col) {
	if (!DHTML) return;
	var x = new getObj(txtarea);
	x.style.color = col;
}


//TNSW : Implementing common javascript start function for all pages
function initPage() {
        // Start the menu script
        startList();
};



/* This is the SuckerFish menu fix applied to the main menu -  see: http://alistapart.com/articles/dropdowns/  */
var startList = function()
{
    if (document.all&&document.getElementById)
    {
        navRoot = document.getElementById("navMenu");
        if (navRoot)
        {
            for (i=0; i<navRoot.childNodes.length; i++)
            {
                node = navRoot.childNodes[i];

                if (node.nodeName=="LI")
                {
                    node.onmouseover=function()
                    {   
                        this.className+=" over";
                    }
    
                    node.onmouseout=function()
                    {
                        this.className=this.className.replace(" over", "");
                    }
                }
            }
        }
                else
                {
            //alert("The main menu on this page has not been enabled. Please pulll the main menu from the Home page:\n\n    a1_home_page.html\n\nor the destination page:\n\n    b2_regional_landing_page.html\n\nwhich shows the sub menu visible on page load.");
                }
    }

    // If the page has a map then the javascript for the rollovers will need to be included - eg nsw_map.js 
    if ( window.loadRollovers )
    {
        loadRollovers();
                pickRandom(ic);
    }
        else
        {
            // since there's no map define the rollover functions becuase the menu will call them anyway
                showRollover = new Function("x", "y","z", "return true")
                hideRollover = new Function("x", "y","z", "return true")
        }
    if ( window.getNextPhoto )
    {
        slide_node = document.getElementById("img_slide_div");
                if(slide_node)
                {
            getNextPhoto(1,global_total_results_available);
                }
                else
                {
                //alert("ERROR: The script file \"slideshow.js\" has been included without the element with id \"slide-div-img\" being present on the page.");
                }
        }
}


window.onload=initPage;