function initNav() {
	var menuDiv = document.getElementById("nav_cont");
	var containedDivElements = menuDiv.getElementsByTagName("div");
	
	// run through all contained elements:
	for (var i = 0; i < containedDivElements.length; i++) {
		var elem = containedDivElements[i];
		
		var menu_cont_prefix = "menu_level_";
		if (elem.className.substr(0,menu_cont_prefix.length) == menu_cont_prefix) {
			continue;
		}
		
		var prefix="";
		if (elem.className.substr(0,2)=="t_") {prefix="t_";}
		else if (elem.className.substr(0,2)=="b_") {prefix="b_";}
		elem.on_class = prefix + "on menuitem";
		elem.off_class = prefix + "off menuitem";
		
		elem.onmouseover = function() {
			this.className = this.on_class;
		}
		elem.onmouseout = function() {
			this.className = this.off_class;
		}
		
		var elem_link = elem.getElementsByTagName("a");
		elem.href=elem_link[0].href;
		
		elem.onclick = function() {
			document.location.href = this.href;
		}
		
	}
}

function simplePreload(){ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}


/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=80

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height, scrollbars) {
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }

	// center window
	w = screen.availWidth;
	h = screen.availHeight;

	var popW = width, popH = height;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	// end center window
  
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollbars+',resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+leftPos+', top='+topPos+',screenX='+leftPos+',screenY='+topPos+'');
}




// Text Size Toggle Script
	
	function toggleTextSize() {
		if (getActiveStyleSheet()=="smalltext") {
			setActiveStyleSheet('bigtext');
		} else {
			setActiveStyleSheet('smalltext');
		}
		
	}
	
	function setActiveStyleSheet(title) {
	  var i, a, main;
	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
	      a.disabled = true;
	      if(a.getAttribute("title") == title) a.disabled = false;
	    }
	  }
	}
	
	function getActiveStyleSheet() {
	  var i, a;
	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
	  }
	  return null;
	}
	
	function getPreferredStyleSheet() {
	  var i, a;
	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	    if(a.getAttribute("rel").indexOf("style") != -1
	       && a.getAttribute("rel").indexOf("alt") == -1
	       && a.getAttribute("title")
	       ) return a.getAttribute("title");
	  }
	  return null;
	}
	
	function createCookie(name,value,days) {
	  if (days) {
	    var date = new Date();
	    date.setTime(date.getTime()+(days*24*60*60*1000));
	    var expires = "; expires="+date.toGMTString();
	  }
	  else expires = "";
	  document.cookie = name+"="+value+expires+"; path=/";
	}
	
	function readCookie(name) {
	  var nameEQ = name + "=";
	  var ca = document.cookie.split(';');
	  for(var i=0;i < ca.length;i++) {
	    var c = ca[i];
	    while (c.charAt(0)==' ') c = c.substring(1,c.length);
	    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	  }
	  return null;
	}
	
	window.onload = function(e) {
	  var cookie = readCookie("style");
	  var title = cookie ? cookie : getPreferredStyleSheet();
	  setActiveStyleSheet(title);
	}
	
	window.onunload = function(e) {
		saveFontSize();
	}
	
	function saveFontSize() {
	  var title = getActiveStyleSheet();
	  createCookie("style", title, 365);
	}
	
	var cookie = readCookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
	
	
	
	function switchImage(imgName, imgSrc) 

{

  if (document.images)

  {

    if (imgSrc != "none")

    {

      document.images[imgName].src = "http://5381.fuzion.com.au/images_site/" + imgSrc;

    }

  }

}
	