/*************************************************************
 * Copyright 2006 Avallo Multimedia and Creative Services Inc.
 * 
 * Code Edited by: Weston Shaw
 * 
 *************************************************************/

/* =Load Functions
-----------------------------------------------------------------------------*/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(startList);
addLoadEvent(doNewWin);



/* =IE Menu dropdown support
-----------------------------------------------------------------------------*/
function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav").firstChild;
		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", "");
				}
			}
		}
	}
}

/* =Open a new window
-----------------------------------------------------------------------------*/
function doNewWin() {
  if (!document.getElementsByTagName) return false;
  var links=document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("newwin")) {
      links[i].onclick=function() {window.open(this.href);return false;
      }
    }
  }
}

/* =PopUp
-----------------------------------------------------------------------------*/
function popup(url, name, width, height) {
    settings = "toolbar=no,location=no,directories=no," + "status=no,menubar=no,scrollbars=no," + "resizable=no,width=" + width + ",height=" + height;
    MyNewWindow = window.open(url, name, settings);
}
