/*******************************************************************************
*                                                                              *
*  Web Site  :  Code adapted from http://www.eps.com.au/                                         *
*  Author    :  EPS                                                    *
*  Modified  :  16-Jan-2006                                                 *
*                                                                              *
*******************************************************************************/
var d = document, dE = d.documentElement;
var fixIEwidth = 0;


/* Hover support for drop downs in IE (Opera 7.23 also seems to need this too?!)
*******************************************************************************/

function menuHover() {
	var menuItems = d.getElementById("nav").getElementsByTagName("LI");

	for (var i = 0, miL = menuItems.length; i < miL; i++) {
		menuItems[i].onmouseover = function() {
			this.className = "mnhover";
		}
		menuItems[i].onmouseout = function() {
			this.className = "";
		}

		// Add alpha transparencey in IE 5.5+
		var hasSub = menuItems[i].getElementsByTagName("UL")[0];
		if (hasSub && (typeof hasSub.filters == "object")) {
			hasSub.style.filter = "alpha(opacity=90)";
		}
	}
}

/* Make external links pop (ken 2005-03-11)
*******************************************************************************/
function popExLinks() {
var aTags = d.getElementsByTagName("a");

for( var i=0; i<aTags.length; i++ ) {
	// all non-javascript/mailto href attributes pointing to external locations
                // or if it's a pdf document (ken 2005-03-23)
		if( (aTags[i].href.indexOf("http://") == 0 && aTags[i].href.indexOf("http://"+d.domain) != 0) || (aTags[i].href.indexOf("https://") == 0 && aTags[i].href.indexOf("https://"+d.domain) != 0) ||
                    aTags[i].href.indexOf("http://") == 0 && aTags[i].href.indexOf(".pdf") > 5 || aTags[i].href.indexOf("http://") == 0 && aTags[i].href.indexOf(".html") > 5) {
			aTags[i].target = "_blank";
		}
	}
}

/* Perform on page load/unload
*******************************************************************************/

function init() {
	
}

window.onload = function(e) {
	if (d.getElementById) {
		if (d.all) {
			menuHover();
		}
		// Opera wont switch css sometimes unless we do it onload! POS!
		if (navigator.userAgent.indexOf('Opera') != -1) {
			init();
			//alert("Your browser sucks!!");
		}
		
	}
};

if (d.all && !window.opera && fixIEwidth == 0) {
window.onresize = function() {
	checkMinWidth();
	};
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
};
/* Perform as soon as we can!
*******************************************************************************/

init();

