﻿// contains general functions used throughout site

//this makes sure the current page is highlighted in the nav
function GetCurrentPage() {
if (!document.getElementsByTagName) return;
var nav=document.getElementById("nav");
var anchors = nav.getElementsByTagName("a");
var thisPage = location.href;

thisPage=thisPage.substring(thisPage.lastIndexOf("/")+1)

for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
thisHREF = anchor.getAttribute("href");
thisHREF=thisHREF.substring(thisHREF.lastIndexOf("/")+1);
if ((thisHREF == thisPage)||(location.protocol + "//" + location.hostname + thisHREF == thisPage)) {
anchor.className="current";
if(thisPage == "default.aspx")
{
anchor.className="currentHome";
}
return;
}
}
}

function getMessage(name,address,loca,person)
{
symbol="@";
instr="mailto:";
fullMessage=instr+name+symbol+address+"."+loca;
add=name+"<img src='images/add_16.gif' />"+address+"<img src='images/add_18.gif' />"+loca;
document.write("<a href='"+fullMessage+"'>"+add+"</a>");
}
