// Copyright © 2007 Jeffrey Bazinet, http://www.vwd-cms.com/

var __isIE = (document.all != null);
var __isMoz = __isIE ? false : (document.createRange() != null);
var __editLinkElement = null;

function onMasterLoad()
{
	// detemine if analytics should be turned on
	// note: __analyticsOn and __analyticsId is set by VwdCms.MasterPage
    
    if (__analyticsOn)
    {
		if (__analyticsId == null || __analyticsId == "")
		{
			__analyticsOn = false;
		}
		else if (window.location.protocol == "https:")
		{
			__analyticsOn = false;
		}
		else if ( window.location.hostname.toLowerCase() == "localhost" )
		{
			__analyticsOn = false;
		}
	}
	// call the analytics function even if __analyticsOn == false because
	// it will indicate on the page that analytics is off by coloring 
	// the analytics text red
    try{ analytics(); }catch(ex){}
}

function analytics()
{
    var spn = document.getElementById("spnAnalytics");
    if ( __analyticsOn )
    {
        spn.style.color = "green";
        _uacct = __analyticsId;
        urchinTracker();
    }
    else
    {
        spn.style.color = "red";
    }
}

function si(a,i)
{
    // si (send inquiry) a=anchor/link element, i=index
    // e n c o d e d   c o n t a c t   a d d r e s s e s
    var u1 = String.fromCharCode(109,97,105,108,116,111,58);
    var u2 = new Array(3);
    u2[0] = String.fromCharCode(83,97,108,101,115);
    u2[1] = String.fromCharCode(83,117,112,112,111,114,116);
    u2[2] = String.fromCharCode(80,97,114,116,110,101,114,115);
    var u3 = String.fromCharCode(64,118,119,100,45,99,109,115,46,99,111,109);
    var u4 = String.fromCharCode(63,115,117,98,106,101,99,116,61);
    var u5 = String.fromCharCode(37,50,48,73,110,113,117,105,114,121);

    a.href = u1 + u2[i] + u3 + u4 + u2[i] + u5;
}
