function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// JavaScript Document
// get mouse location
function Point(x,y) {  this.x = x; this.y = y; }
mLoc = new Point(-500,-500);

function getMouseLoc(e)
{
	if(document.layers)  //NS old
  {
    mLoc.x = e.pageX;
    mLoc.y = e.pageY;
  }
  else               //IE 
  {
    mLoc.x = e.clientX + document.body.scrollLeft;
    mLoc.y = e.clientY + document.body.scrollTop;		
  }
		
  return true;
}
//NS init:
if(document.layers){ document.captureEvents(Event.MOUSEMOVE); document.onMouseMove = getMouseLoc; }

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// * Dependencies * 
// this function requires the following snippets:
//  - replaced with MM_findObj, MM_showHideLayers MVW
// JavaScript/events/getMouseLoc
// Want to fix y? pass offsetV > 500. Want to fix x? pass offsetH > 1000 
function moveLayerToMouseLoc(evt, theLayer, offsetH, offsetV)
{
  var obj;
  if ((MM_findObj(theLayer))!=null)
  {
    if (document.layers)  //Old NS
    {
      document.onMouseMove = getMouseLoc;
      obj = document.layers[theLayer];
      obj.left = mLoc.x +offsetH;			
      if (offsetV < 500) obj.top  = mLoc.y +offsetV;
    }
    else  // if (document.all) // IE NS 7
    {  
      getMouseLoc(evt);
      obj = document.getElementById(theLayer).style;
      //obj.pixelLeft = mLoc.x +offsetH;
      //if (offsetV < 500) obj.pixelTop  = mLoc.y +offsetV;
			if (offsetH < 1000) obj.left = mLoc.x +offsetH; else obj.left = (offsetH-1000);
      if (offsetV < 500) obj.top  = mLoc.y +offsetV;
    }
    MM_showHideLayers(theLayer,'','show');
  }
}
// PREVIOUS ITEMS OR ALL TO DO WITH ARROR THING - SEPERATE MODULE???


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideBlock() { //v6.0
	var i,p,v,obj,args=MM_showHideBlock.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'':(v=='hide')?'none':(v=='tog' && obj.display=='')?'none':''; }
    obj.display=v; }
}

// Used for toggling image
function mvwToggleImg() { // imgTag, img1, img2 
   var oImg,args=mvwToggleImg.arguments; 
	 if ((oImg=MM_findObj(args[0]))!=null) { 
	   if (!oImg.osrc) oImg.osrc = args[1];
		 oImg.src = oImg.osrc = (oImg.osrc==args[1])? args[2] : args[1];	
	 }
}

function mvwGet_rad_idx(rsRad_nam) {
	var nIdx = -1;
	var oObj = MM_findObj(rsRad_nam);
		
	if (oObj && oObj.length > 0) for (var i = 0; i < oObj.length; i++) if (oObj[i].checked) nIdx = i;

	return nIdx;
}

var go_menu = new Object();
var gbcont = false;
var gitimer = null;
go_menu.mitem = null; 
go_menu.mlayer = null;

// menu move mouse in / out
function mmi(t, slay_id) { 
  if (!slay_id || slay_id != go_menu.mlayer) { gbcont = false; mout(); }
	else gbcont = true; 
  if (t.className != 't-mnuc') { t.className='t-mnus'; t.firstChild.className='t-anms'; }
}
function mmo(t) { 
  if (t.className != 't-mnuc') { t.className='t-mnu'; 	t.firstChild.className='t-anm'; }
	gbcont = false; 
}

// menu move mouse in / out & expand
function mmix(t, slay_id) {   
  gbcont = false;
	mout();
	mmi(t);
	MM_showHideLayers(slay_id,'','show');
}

function mmox(t, slay_id) { 
  gbcont = false;
	go_menu.mitem = t; 
	go_menu.mlayer = slay_id;
	gitimer = window.setTimeout("mout()", 800);
}

function mout () {
	if (gitimer) { window.clearTimeout(gitimer); gitimer = null; }	
  if (gbcont == true) gitimer = window.setTimeout("mout()", 800);
	else if (go_menu.mitem) {	 
    mmo(go_menu.mitem);
    MM_showHideLayers(go_menu.mlayer,'','hide');
		go_menu.mitem = null;
	}
}

// menu mouse click...
function mc(t) { window.open(t.firstChild.href, "_self"); }

// Expand a section, simply by changing class of header, and next sibling block!
function mvw_expd(t) { 
  if (t.className == "e2") { t.className = "e1"; mvw_nextSibling(t).className = "t-ebox1"; }
	else { t.className = "e2"; mvw_nextSibling(t).className = "t-ebox2"; }
}	

// Rewrite of function that works for NS and IE... NS counts innertext as new node, IE does not.
function mvw_nextSibling(t) {
  if (t.nextSibling.nodeName == "#text") return (t.nextSibling.nextSibling);
	else return (t.nextSibling);
}	

// Quick image swap rollover
function mvwRol(t, simg) { 
	document.MM_sr=new Array(t); 
	if (!t.oSrc) t.oSrc = t.src; 
	t.src = simg; 
}

function mvwgetCookie(sName) {
  var aCookie = document.cookie.split("; ");
	for (var i=0; i<aCookie.length; i++) {
	  var aCrumb = aCookie[i].split("="); 
		if (sName == aCrumb[0]) return aCrumb[1]; 
	}
	return null;
}

function onunloadSave() { }