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 newSep(vSep)
{	document.write("<td class=M"+vSUF+">"+vSep+"</td>")
}
function newI(text,action,url)
{	Mnr = Mnr + 1
	document.write("<td class=M"+vSUF+">")
	document.write("<div class=I"+vSUF+" onMouseOut=\"settmr()\" onMouseOver=\"onI('M"+Mnr+"')\" id=M"+Mnr+" onClick=\""+action+"('"+url+"')\">")
	document.write("<img border=0 src='"+icon+"'>")
	document.write(text)
	document.write("</div></td>")
}
function newM(text)
{	Mnr = Mnr + 1
	document.write("<td class=M"+vSUF+">")
	document.write("<div class=I"+vSUF+" onMouseOut=\"settmr()\" onMouseOver=\"onM(\'M"+Mnr+"\',\'S"+Mnr+"\')\" id=M"+Mnr+">")
	document.write("<img border=0 src='"+icon+"'>")
	document.write(text)
	document.write("</div><div class=SM"+vSUF+" id=S"+Mnr+">")
}
function newMI(text,action,url)
{	Mnr = Mnr + 1
	document.write("<div class=MI"+vSUF+" onMouseOut=\"settmr()\"  onMouseOver=\"onMI('M"+Mnr+"')\" id=M"+Mnr+" onClick=\""+action+"('"+url+"')\"><p>")
	document.write(text)
	document.write("</p></div>")
}
function newSM(text)
{	Mnr = Mnr + 1
	document.write("<table cellspacing=0 cellpadding=0 border=0><tr><td>")
	document.write("<div class=MI"+vSUF+" onMouseOut=\"settmr()\" onMouseOver=\"onSM('M"+Mnr+"','S"+Mnr+"')\" id=M"+Mnr+">")
	document.write(text)
	document.write("</div></td><td>&shy;<div class=SSM"+vSUF+" id=S"+Mnr+">")
}
function newSMI(text,action,url)
{	Mnr = Mnr + 1
	document.write("<div class=SMI"+vSUF+" onMouseOut=\"settmr()\" onMouseOver=\"onSMI('S"+Mnr+"')\" id=S"+Mnr+" onClick=\""+action+"('"+url+"')\"><p>")
	document.write(text)
	document.write("</p></div>")
}
function endSM()
{	document.write("</div></td></tr></table>")
}
function endM()
{	document.write("</div></td>")
}

Mnr = 0
timeoutid = 0
delay = 1000
var g1 = "dummy"
var g2 = "dummy"
var g3 = "dummy"
var g4 = "dummy"
var g5 = "dummy"
var w1 = "dummy"
var w2 = "dummy"
var w3 = "dummy"
var w4 = "dummy"
var w5 = "dummy"
var vOW = "ow"
var vCLK = "clk"

function onI(I)
{	if (timeoutid != 0) {clearTimeout(timeoutid);timeoutid = 0}
	w1 = I
	w2 = "dummy"
	w3 = "dummy"
	w4 = "dummy"
	w5 = "dummy"
	MakeItSo()
}
function onMI(MI)
{	if (timeoutid != 0) {clearTimeout(timeoutid);timeoutid = 0}
//	w1 = g1
//	w2 = g2
	w3 = MI
	w4 = "dummy"
	w5 = "dummy"
	MakeItSo()
}
function onSMI(SMI)
{	if (timeoutid != 0) {clearTimeout(timeoutid);timeoutid = 0}
//	w1 = g1
//	w2 = g2
//	w3 = g3
//	w4 = g4
	w5 = SMI
	MakeItSo()
}
function onM(M,SM)
{	if (timeoutid != 0) {clearTimeout(timeoutid);timeoutid = 0}
	w1 = M
	w2 = SM
	w3 = "dummy"
	w4 = "dummy"
	w5 = "dummy"
	MakeItSo()
}
function onSM(SM,SSM)
{	if (timeoutid != 0) {clearTimeout(timeoutid);timeoutid = 0}
//	w1 = g1
//	w2 = g2
	w3 = SM
	w4 = SSM
	w5 = "dummy"
	MakeItSo()
}
function settmr()
{	timeoutid=setTimeout("tmr()",delay) 
}
function tmr()
{	w1 = "dummy"
	w2 = "dummy"
	w3 = "dummy"
	w4 = "dummy"
	w5 = "dummy"
	MakeItSo()
}
function MakeItSo()
{
	if (g5 != w5) { document.getElementById(g5).className = document.getElementById(g5).className.substr(1) }
	if (g4 != w4) {	document.getElementById(g4).style.display = "none" }
	if (g3 != w3) { document.getElementById(g3).className = document.getElementById(g3).className.substr(1) }
	if (g2 != w2) { document.getElementById(g2).style.display = "none" }
	if (g1 != w1) { document.getElementById(g1).className = document.getElementById(g1).className.substr(1) }

	if (g1 != w1) { document.getElementById(w1).className = "X"+document.getElementById(w1).className }
	if (g2 != w2) { document.getElementById(w2).style.display = "block" }
	if (g3 != w3) { document.getElementById(w3).className = "X"+document.getElementById(w3).className }
	if (g4 != w4) { document.getElementById(w4).style.display = "block" }
	if (g5 != w5) { document.getElementById(w5).className = "X"+document.getElementById(w5).className }

	g1 = w1
	g2 = w2
	g3 = w3
	g4 = w4
	g5 = w5
}
function clk(vUrl)
{	if (vUrl.substr(0,1) == "/") {vLoc=vPrefix+vUrl;} else {vLoc=vUrl;};
	window.location = vLoc;
}
function ow(vUrl)
{	if (vUrl.substr(0,1) == "/") {vLoc=vPrefix+vUrl;} else {vLoc=vUrl;};
window.status = vLoc
	x=window.open(vLoc,owname,owparm);
	x.focus()
}
function jw(vUrl)
{	if (vUrl.substr(0,1) == "/") {vLoc=vPrefix+vUrl;} else {vLoc=vUrl;};
	x=window.open(vLoc,owname,owparm);
	x.focus()
}

