var vLoc=location.href
var vArr=vLoc.split("/")
var vPrefix="/"+vArr[3]

// To make menu links work on CMS    Pages - remove "//" from the beginning of the line below
// To make menu links work on Staged Pages - put    "//" at   the beginning of the line below
// var vPrefix=""

// To hide "Switch to Edit Site" - remove "//" from the beginning of the lines below
// To show "Switch to Edit Site" - put    "//" at   the beginning of the lines below
//var vTo   = document.getElementById("cmsMainTable")
//if (vTo != null) {vTo.style.display = "none"}


function MT(one,two)
	{
		s = "m" + "a" + "i" + "l" + "t" + "o" + ":" + one + "@" + two
		location.href = s
	}

function MT2(one,two,subj,body)
	{	location.href = "mai"+"lto"+":"+one+"@"+two+"?sub"+"ject="+subj+"&bo"+"dy="+body
	}

// development only - show mouse position
if (vPrefix == "") {x()}
function x () {
		if (! document.all) {document.captureEvents(Event.MOUSEMOVE)}
		document.onmousemove = y
	}
function y (evt) {
	if (document.all) {
		window.status="x="+window.event.clientX+",y="+window.event.clientY }
	else {
		window.status="x="+evt.pageX+",y="+evt.pageY }
}


//##### NAVs #######################################################
sfHover = function() {
	oNav = document.getElementById("nav")
	if (oNav != null) {
//		var sfEls = oNav.children ;
		for (var i=0; i<oNav.childNodes.length; i++) {
			oNav.childNodes[i].onmouseover=function() {
				var xx = document.getElementById("nav") ;
				for (var j=0; j<xx.childNodes.length; j++) {
					if (xx.childNodes[j].className != null) {	
						xx.childNodes[j].className=xx.childNodes[j].className.replace(new RegExp("sfhover\\b"), "");
					}
				}
				this.className+=" sfhover";
			} // function
			oNav.childNodes[i].onmouseout=function() {
				if (this.className.indexOf(" sfhover") == -1) {
					this.className=this.className.replace(new RegExp("sfhover\\b"), "");
				} else {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				} // if
			} // function
		} // for
	} // if
} // function

if (window.attachEvent) {
	window.attachEvent("onload", sfHover);
}
else {
	if (window.addEventListener) {
		window.addEventListener("load", sfHover, false);
	}
}
//##### NAVs #######################################################

function toggleLayer( whichLayer )
{
  var elem, vis;  
  if( document.getElementById ) // this is the way the standards work
      elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
	  elem = document.all[whichLayer];  
  else if( document.layers ) // this is the way nn4 works
      elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	  vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

